1 #ifndef CalibratedPhotonProducer_h
2 #define CalibratedPhotonProducer_h
36 : thePhotonToken(consumes<edm::
View<
T> >(conf.getParameter<edm::
InputTag>(
"photons"))),
37 theEnCorrectorRun2(conf.getParameter<bool>(
"isMC"),
38 conf.getParameter<bool>(
"isSynchronization"),
39 conf.getParameter<std::
string>(
"correctionFile")) {
44 produces<std::vector<T> >();
55 if (theSemiDeterministicRng && !in->empty()) {
56 const auto &
first = in->front();
57 std::seed_seq seeder = {int(iEvent.
id().
event()),
59 int(iEvent.
id().
run()),
63 uint32_t
seed = 0, tries = 10;
65 seeder.generate(&seed, &seed + 1);
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());
EventNumber_t event() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
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)
CalibratedPhotonProducerRun2T(const edm::ParameterSet &)
edm::EDGetTokenT< edm::View< T > > thePhotonToken
LuminosityBlockNumber_t luminosityBlock() const
CalibratedPhotonProducerRun2T< reco::Photon > CalibratedPhotonProducerRun2
CalibratedPhotonProducerRun2T< pat::Photon > CalibratedPatPhotonProducerRun2
PhotonEnergyCalibratorRun2 theEnCorrectorRun2
void produce(edm::Event &, const edm::EventSetup &) override
T getParameter(std::string const &) const
void initPrivateRng(TRandom *rnd)
StreamID streamID() const
~CalibratedPhotonProducerRun2T() override
std::unique_ptr< TRandom > theSemiDeterministicRng