1 #ifndef CalibratedElectronProducerRun2_h 2 #define CalibratedElectronProducerRun2_h 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);
69 iEvent.getByToken(theElectronToken,
in);
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()),
77 int(
iEvent.id().luminosityBlock()),
82 uint32_t
seed = 0, tries = 10;
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());
T getParameter(std::string const &) const
CalibratedElectronProducerRun2T< reco::GsfElectron > CalibratedElectronProducerRun2
edm::EDGetTokenT< edm::View< T > > theElectronToken
CalibratedElectronProducerRun2T(const edm::ParameterSet &)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
void produce(edm::Event &, const edm::EventSetup &) override
edm::ESGetToken< GBRForest, GBRWrapperRcd > gbrforestToken_
void initPrivateRng(TRandom *rnd)
EpCombinationTool theEpCombinationTool
#define DEFINE_FWK_MODULE(type)
CalibratedElectronProducerRun2T< pat::Electron > CalibratedPatElectronProducerRun2
std::unique_ptr< TRandom > theSemiDeterministicRng
std::string theGBRForestName
~CalibratedElectronProducerRun2T() override
ElectronEnergyCalibratorRun2 theEnCorrectorRun2