10 : ecalHitsProducer_(iConfig.getParameter<std::
string>(
"ecalRecHitsProducer")),
11 barrelHits_(iConfig.getParameter<std::
string>(
"barrelHitCollection")),
12 endcapHits_(iConfig.getParameter<std::
string>(
"endcapHitCollection")),
13 recalibBarrelHits_(iConfig.getParameter<std::
string>(
"RecalibBarrelHitCollection")),
14 recalibEndcapHits_(iConfig.getParameter<std::
string>(
"RecalibEndcapHitCollection")),
15 refactor_(iConfig.getUntrackedParameter<double>(
"Refactor", (double)1)),
16 refactor_mean_(iConfig.getUntrackedParameter<double>(
"Refactor_mean", (double)1)),
37 if (!barrelRecHitsHandle.isValid()) {
38 LogDebug(
"") <<
"EcalREcHitMiscalib: Error! can't get product!" << std::endl;
40 EBRecHits = barrelRecHitsHandle.product();
44 if (!endcapRecHitsHandle.isValid()) {
45 LogDebug(
"") <<
"EcalREcHitMiscalib: Error! can't get product!" << std::endl;
47 EERecHits = endcapRecHitsHandle.product();
51 auto RecalibEBRecHitCollection = std::make_unique<EBRecHitCollection>();
52 auto RecalibEERecHitCollection = std::make_unique<EERecHitCollection>();
65 if (icalit != ical.getMap().end()) {
66 icalconst = (*icalit);
69 edm::LogError(
"EcalRecHitRecalib") <<
"No intercalib const found for xtal " <<
EBDetId(itb->id())
70 <<
"! something wrong with EcalIntercalibConstants in your DB? ";
76 EcalRecHit aHit(itb->id(), itb->energy() * icalconst, itb->time());
78 RecalibEBRecHitCollection->push_back(aHit);
90 if (icalit != ical.getMap().end()) {
91 icalconst = (*icalit);
93 edm::LogError(
"EcalRecHitRecalib") <<
"No intercalib const found for xtal " <<
EEDetId(ite->id())
94 <<
"! something wrong with EcalIntercalibConstants in your DB? ";
101 EcalRecHit aHit(ite->id(), ite->energy() * icalconst, ite->time());
103 RecalibEERecHitCollection->push_back(aHit);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDPutTokenT< EBRecHitCollection > barrelHitsToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~EcalRecHitRecalib() override
std::vector< EcalRecHit >::const_iterator const_iterator
EcalRecHitRecalib(const edm::ParameterSet &)
Log< level::Error, false > LogError
const edm::ESGetToken< EcalIntercalibConstants, EcalIntercalibConstantsRcd > intercalibConstsToken_
bool getData(T &iHolder) const
const edm::EDPutTokenT< EERecHitCollection > endcapHitsToken_
const double refactor_mean_
std::vector< Item >::const_iterator const_iterator
const edm::EDGetTokenT< EERecHitCollection > eeRecHitToken_
const edm::EDGetTokenT< EBRecHitCollection > ebRecHitToken_
void produce(edm::Event &, const edm::EventSetup &) override
float EcalIntercalibConstant