1 #ifndef CalibratedPhotonProducer_h 2 #define CalibratedPhotonProducer_h 37 theEnCorrectorRun2(conf.getParameter<
bool>(
"isMC"),
38 conf.getParameter<
bool>(
"isSynchronization"),
39 conf.getParameter<
std::
string>(
"correctionFile")) {
44 produces<std::vector<T> >();
53 iEvent.getByToken(thePhotonToken,
in);
55 if (theSemiDeterministicRng && !
in->empty()) {
56 const auto &
first =
in->front();
57 std::seed_seq seeder = {
int(
iEvent.id().event()),
58 int(
iEvent.id().luminosityBlock()),
63 uint32_t
seed = 0, tries = 10;
67 }
while (
seed == 0 && tries < 10);
68 theSemiDeterministicRng->SetSeed(
seed ?
seed :
iEvent.id().event());
71 std::unique_ptr<std::vector<T> >
out(
new std::vector<T>());
72 out->reserve(
in->size());
74 for (
const T &ele : *
in) {
76 theEnCorrectorRun2.calibrate(
out->back(),
iEvent.id().run(),
iEvent.streamID());
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
CalibratedPhotonProducerRun2T(const edm::ParameterSet &)
edm::EDGetTokenT< edm::View< T > > thePhotonToken
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
CalibratedPhotonProducerRun2T< reco::Photon > CalibratedPhotonProducerRun2
CalibratedPhotonProducerRun2T< pat::Photon > CalibratedPatPhotonProducerRun2
PhotonEnergyCalibratorRun2 theEnCorrectorRun2
void produce(edm::Event &, const edm::EventSetup &) override
void initPrivateRng(TRandom *rnd)
~CalibratedPhotonProducerRun2T() override
std::unique_ptr< TRandom > theSemiDeterministicRng