35 EBRecHitCollection_( ps.getParameter<
edm::InputTag>(
"EBRecHitCollection") ),
36 EERecHitCollection_( ps.getParameter<
edm::InputTag>(
"EERecHitCollection") ),
39 EBRecalibRecHitCollection_( ps.getParameter<
std::
string>(
"EBRecalibRecHitCollection") ),
40 EERecalibRecHitCollection_( ps.getParameter<
std::
string>(
"EERecalibRecHitCollection") ),
41 doEnergyScale_( ps.getParameter<
bool>(
"doEnergyScale") ),
42 doIntercalib_( ps.getParameter<
bool>(
"doIntercalib") ),
43 doLaserCorrections_( ps.getParameter<
bool>(
"doLaserCorrections") ),
45 doEnergyScaleInverse_( ps.getParameter<
bool>(
"doEnergyScaleInverse") ),
46 doIntercalibInverse_( ps.getParameter<
bool>(
"doIntercalibInverse") ),
47 doLaserCorrectionsInverse_( ps.getParameter<
bool>(
"doLaserCorrectionsInverse") )
64 EBRecHits = pEBRecHits.
product();
68 EERecHits = pEERecHits.
product();
72 auto EBRecalibRecHits = std::make_unique<EBRecHitCollection>();
73 auto EERecalibRecHits = std::make_unique<EERecHitCollection>();
93 ical = pIcal.product();
115 if( icalit!=icalMap.
end() ){
116 icalconst = (*icalit);
118 edm::LogError(
"EcalRecHitError") <<
"No intercalib const found for xtal " <<
EBDetId(it->id()) <<
"! something wrong with EcalIntercalibConstants in your DB? " 123 float lasercalib = 1;
132 icalconst = 1.0/icalconst;
135 lasercalib = 1.0/lasercalib;
138 EcalRecHit aHit( (*it).id(), (*it).energy() * agc_eb * icalconst * lasercalib, (*it).time() );
139 EBRecalibRecHits->push_back( aHit );
147 it != EERecHits->
end(); ++it) {
154 if( icalit!=icalMap.
end() ) {
155 icalconst = (*icalit);
157 edm::LogError(
"EcalRecHitError") <<
"No intercalib const found for xtal " <<
EEDetId(it->id()) <<
"! something wrong with EcalIntercalibConstants in your DB? ";
161 float lasercalib = 1;
167 icalconst = 1.0/icalconst;
170 lasercalib = 1.0/lasercalib;
174 EcalRecHit aHit( (*it).id(), (*it).energy() * agc_ee * icalconst * lasercalib, (*it).time() );
175 EERecalibRecHits->push_back( aHit );
179 LogInfo(
"EcalRecalibRecHitInfo") <<
"total # EB re-calibrated rechits: " << EBRecalibRecHits->size();
180 LogInfo(
"EcalRecalibRecHitInfo") <<
"total # EE re-calibrated rechits: " << EERecalibRecHits->size();
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void produce(edm::StreamID sid, edm::Event &evt, const edm::EventSetup &es) const override
const edm::InputTag EERecHitCollection_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const self & getMap() const
#define DEFINE_FWK_MODULE(type)
float getLaserCorrection(DetId const &xid, edm::Timestamp const &iTime) const
std::vector< EcalRecHit >::const_iterator const_iterator
const bool doIntercalibInverse_
const bool doEnergyScaleInverse_
const_iterator end() const
const bool doLaserCorrectionsInverse_
EcalRecalibRecHitProducer(const edm::ParameterSet &ps)
T const * product() const
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
const std::string EBRecalibRecHitCollection_
edm::Timestamp time() const
const_iterator begin() const
float EcalIntercalibConstant