1 #ifndef CalibratedElectronProducerRun2_h
2 #define CalibratedElectronProducerRun2_h
45 : theElectronToken(consumes<edm::
View<
T> >(conf.getParameter<edm::
InputTag>(
"electrons"))),
46 theGBRForestName(conf.getParameter<std::
string>(
"gbrForestName")),
47 theEpCombinationTool(),
48 theEnCorrectorRun2(theEpCombinationTool,
49 conf.getParameter<bool>(
"isMC"),
50 conf.getParameter<bool>(
"isSynchronization"),
51 conf.getParameter<std::
string>(
"correctionFile")) {
57 produces<std::vector<T> >();
66 theEpCombinationTool.init(theGBRForest);
71 std::unique_ptr<std::vector<T> >
out(
new std::vector<T>());
72 out->reserve(in->size());
74 if (theSemiDeterministicRng && !in->empty()) {
75 const auto &
first = in->front();
76 std::seed_seq seeder = {int(iEvent.
id().
event()),
78 int(iEvent.
id().
run()),
82 uint32_t
seed = 0, tries = 10;
84 seeder.generate(&seed, &seed + 1);
86 }
while (seed == 0 && tries < 10);
87 theSemiDeterministicRng->SetSeed(seed ? seed : iEvent.
id().
event());
90 for (
const T &ele : *in) {
92 theEnCorrectorRun2.calibrate(out->back(), iEvent.
id().
run(), iEvent.
streamID());
EventNumber_t event() const
CalibratedElectronProducerRun2T< reco::GsfElectron > CalibratedElectronProducerRun2
edm::EDGetTokenT< edm::View< T > > theElectronToken
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
CalibratedElectronProducerRun2T(const edm::ParameterSet &)
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void produce(edm::Event &, const edm::EventSetup &) override
LuminosityBlockNumber_t luminosityBlock() const
edm::ESGetToken< GBRForest, GBRWrapperRcd > gbrforestToken_
void initPrivateRng(TRandom *rnd)
bool getData(T &iHolder) const
EpCombinationTool theEpCombinationTool
CalibratedElectronProducerRun2T< pat::Electron > CalibratedPatElectronProducerRun2
T getParameter(std::string const &) const
std::unique_ptr< TRandom > theSemiDeterministicRng
StreamID streamID() const
std::string theGBRForestName
~CalibratedElectronProducerRun2T() override
ElectronEnergyCalibratorRun2 theEnCorrectorRun2