15 recalibHBHEHits_(iConfig.getParameter<std::
string>(
"RecalibHBHEHitCollection")),
16 recalibHFHits_(iConfig.getParameter<std::
string>(
"RecalibHFHitCollection")),
17 recalibHOHits_(iConfig.getParameter<std::
string>(
"RecalibHOHitCollection")),
18 hcalfileinpath_(iConfig.getUntrackedParameter<std::
string>(
"fileNameHcal",
"")),
19 refactor_(iConfig.getUntrackedParameter<double>(
"Refactor", (double)1)),
20 refactor_mean_(iConfig.getUntrackedParameter<double>(
"Refactor_mean", (double)1)) {
58 if (!HBHERecHitsHandle.isValid()) {
59 LogDebug(
"") <<
"HcalREcHitRecalib: Error! can't get product!" << std::endl;
65 if (!HORecHitsHandle.isValid()) {
66 LogDebug(
"") <<
"HcalREcHitRecalib: Error! can't get product!" << std::endl;
68 HORecHits = HORecHitsHandle.product();
72 if (!HFRecHitsHandle.isValid()) {
73 LogDebug(
"") <<
"HcalREcHitRecalib: Error! can't get product!" << std::endl;
79 auto RecalibHBHERecHitCollection = std::make_unique<HBHERecHitCollection>();
80 auto RecalibHFRecHitCollection = std::make_unique<HFRecHitCollection>();
81 auto RecalibHORecHitCollection = std::make_unique<HORecHitCollection>();
87 float icalconst = (
mapHcal_.
get().find(itHBHE->id().rawId()))->second;
90 HBHERecHit aHit(itHBHE->id(), itHBHE->energy() * icalconst, itHBHE->time());
92 RecalibHBHERecHitCollection->push_back(aHit);
100 float icalconst = (
mapHcal_.
get().find(itHF->id().rawId()))->second;
103 HFRecHit aHit(itHF->id(), itHF->energy() * icalconst, itHF->time());
105 RecalibHFRecHitCollection->push_back(aHit);
111 for (itHO = HORecHits->begin(); itHO != HORecHits->end(); ++itHO) {
113 float icalconst = (
mapHcal_.
get().find(itHO->id().rawId()))->second;
116 HORecHit aHit(itHO->id(), itHO->energy() * icalconst, itHO->time());
118 RecalibHORecHitCollection->push_back(aHit);
const std::map< uint32_t, float > & get()
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
~HcalRecHitRecalib() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< T >::const_iterator const_iterator
bool parseXMLMiscalibFile(std::string configFile)
HcalRecHitRecalib(const edm::ParameterSet &)
const std::string recalibHOHits_
const edm::EDGetTokenT< HFRecHitCollection > tok_hf_
const std::string hcalfileinpath_
const edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topologyToken_
void beginRun(const edm::Run &, const edm::EventSetup &) override
bool getData(T &iHolder) const
const std::string recalibHFHits_
const edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
void produce(edm::Event &, const edm::EventSetup &) override
const std::string recalibHBHEHits_
CaloMiscalibMapHcal mapHcal_
void prefillMap(const HcalTopology &topology)
const edm::EDGetTokenT< HORecHitCollection > tok_ho_
const double refactor_mean_