26 : EBRecHitCollection_(ps.getParameter<edm::
InputTag>(
"EBRecHitCollection")),
27 EERecHitCollection_(ps.getParameter<edm::
InputTag>(
"EERecHitCollection")),
32 EBRecalibRecHitCollection_(ps.getParameter<std::
string>(
"EBRecalibRecHitCollection")),
33 EERecalibRecHitCollection_(ps.getParameter<std::
string>(
"EERecalibRecHitCollection")),
34 doEnergyScale_(ps.getParameter<bool>(
"doEnergyScale")),
35 doIntercalib_(ps.getParameter<bool>(
"doIntercalib")),
36 doLaserCorrections_(ps.getParameter<bool>(
"doLaserCorrections")),
38 doEnergyScaleInverse_(ps.getParameter<bool>(
"doEnergyScaleInverse")),
39 doIntercalibInverse_(ps.getParameter<bool>(
"doIntercalibInverse")),
40 doLaserCorrectionsInverse_(ps.getParameter<bool>(
"doLaserCorrectionsInverse")),
70 auto EBRecalibRecHits = std::make_unique<EBRecHitCollection>();
71 auto EERecalibRecHits = std::make_unique<EERecHitCollection>();
83 agc_eb = float(agc->getEBValue());
84 agc_ee = float(agc->getEEValue());
91 ical = pIcal.product();
97 agc_eb = 1.0 / agc_eb;
98 agc_ee = 1.0 / agc_ee;
109 if (icalit != icalMap.
end()) {
110 icalconst = (*icalit);
113 <<
"! something wrong with EcalIntercalibConstants in your DB? ";
117 float lasercalib = 1;
119 lasercalib = pLaser->getLaserCorrection(
EBDetId(it->id()), evt.
time());
126 icalconst = 1.0 / icalconst;
129 lasercalib = 1.0 / lasercalib;
132 EcalRecHit aHit((*it).id(), (*it).energy() * agc_eb * icalconst * lasercalib, (*it).time());
133 EBRecalibRecHits->push_back(aHit);
145 if (icalit != icalMap.
end()) {
146 icalconst = (*icalit);
149 <<
"! something wrong with EcalIntercalibConstants in your DB? ";
153 float lasercalib = 1;
155 lasercalib = pLaser->getLaserCorrection(
EEDetId(it->id()), evt.
time());
159 icalconst = 1.0 / icalconst;
162 lasercalib = 1.0 / lasercalib;
166 EcalRecHit aHit((*it).id(), (*it).energy() * agc_ee * icalconst * lasercalib, (*it).time());
167 EERecalibRecHits->push_back(aHit);
171 LogInfo(
"EcalRecalibRecHitInfo") <<
"total # EB re-calibrated rechits: " << EBRecalibRecHits->size();
172 LogInfo(
"EcalRecalibRecHitInfo") <<
"total # EE re-calibrated rechits: " << EERecalibRecHits->size();
edm::ESGetToken< EcalADCToGeVConstant, EcalADCToGeVConstantRcd > ecalADCToGeVConstantToken_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::InputTag EERecHitCollection_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const self & getMap() const
#define DEFINE_FWK_MODULE(type)
std::vector< EcalRecHit >::const_iterator const_iterator
const bool doIntercalibInverse_
edm::ESGetToken< EcalIntercalibConstants, EcalIntercalibConstantsRcd > ecalIntercalibConstantsToken_
edm::ESGetToken< EcalLaserDbService, EcalLaserDbRecord > ecalLaserDBServiceToken_
Log< level::Error, false > LogError
void produce(edm::StreamID sid, edm::Event &evt, const edm::EventSetup &es) const override
const bool doEnergyScaleInverse_
const bool doLaserCorrectionsInverse_
Log< level::Info, false > LogInfo
EcalRecalibRecHitProducer(const edm::ParameterSet &ps)
std::vector< Item >::const_iterator const_iterator
const bool doEnergyScale_
const edm::EDGetTokenT< EERecHitCollection > EERecHitToken_
const bool doLaserCorrections_
const std::string EERecalibRecHitCollection_
const edm::EDGetTokenT< EBRecHitCollection > EBRecHitToken_
const edm::InputTag EBRecHitCollection_
const_iterator find(uint32_t rawId) const
const_iterator end() const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const std::string EBRecalibRecHitCollection_
edm::Timestamp time() const
float EcalIntercalibConstant