Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to New Random Service Interface #2753

Merged
merged 1 commit into from Mar 11, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -14,6 +14,10 @@ using std::ifstream;
using std::istringstream;
using std::cout;

namespace edm {
class StreamID;
}

struct correctionValues
{
double nRunMin;
Expand Down Expand Up @@ -68,7 +72,7 @@ class ElectronEnergyCalibrator
init();
}

void calibrate(SimpleElectron &electron);
void calibrate(SimpleElectron &electron, edm::StreamID const&);
void correctLinearity(SimpleElectron &electron);

private:
Expand Down
Expand Up @@ -289,7 +289,7 @@ void CalibratedElectronProducer::produce( edm::Event & event, const edm::EventSe
// energy calibration for ecalDriven electrons
if ( ele.core()->ecalDrivenSeed() || correctionsType==2 || combinationType==3 )
{
theEnCorrector->calibrate(mySimpleElectron);
theEnCorrector->calibrate(mySimpleElectron, event.streamID());

// E-p combination

Expand Down
Expand Up @@ -244,7 +244,7 @@ void CalibratedPatElectronProducer::produce( edm::Event & event, const edm::Even
// energy calibration for ecalDriven electrons
if ( ele->core()->ecalDrivenSeed() || correctionsType==2 || combinationType==3 )
{
theEnCorrector->calibrate(mySimpleElectron);
theEnCorrector->calibrate(mySimpleElectron, event.streamID());

// E-p combination

Expand Down
6 changes: 3 additions & 3 deletions EgammaAnalysis/ElectronTools/src/ElectronEnergyCalibrator.cc
Expand Up @@ -167,7 +167,7 @@ double ElectronEnergyCalibrator::stringToDouble(const string &str)
return val;
}

void ElectronEnergyCalibrator::calibrate(SimpleElectron &electron)
void ElectronEnergyCalibrator::calibrate(SimpleElectron &electron, edm::StreamID const& streamID)
{
double scale = 1.0;
double dsigMC=0.;
Expand Down Expand Up @@ -299,7 +299,7 @@ void ElectronEnergyCalibrator::calibrate(SimpleElectron &electron)
}
} else
{
CLHEP::RandFlat flatRandom(rng->getEngine());
CLHEP::RandFlat flatRandom(rng->getEngine(streamID));
double rn = flatRandom.fire();
if ( rn > lumiRatio_ )
{
Expand Down Expand Up @@ -411,7 +411,7 @@ void ElectronEnergyCalibrator::calibrate(SimpleElectron &electron)

if ( isMC_ )
{
CLHEP::RandGaussQ gaussDistribution(rng->getEngine(), 1.,dsigMC);
CLHEP::RandGaussQ gaussDistribution(rng->getEngine(streamID), 1.,dsigMC);
corrMC = gaussDistribution.fire();
if ( verbose_ )
{
Expand Down