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") )
85 agc_eb = float(agc->getEBValue());
86 agc_ee = float(agc->getEEValue());
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;
125 lasercalib = pLaser->getLaserCorrection(
EBDetId(it->id()), evt.
time() );
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 );
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;
163 lasercalib = pLaser->getLaserCorrection(
EEDetId(it->id()), evt.
time() );
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();
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_
virtual void produce(edm::StreamID sid, edm::Event &evt, const edm::EventSetup &es) const override
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
const bool doEnergyScaleInverse_
const bool doLaserCorrectionsInverse_
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
const std::string EBRecalibRecHitCollection_
edm::Timestamp time() const
float EcalIntercalibConstant