CMS 3D CMS Logo

HcalHitReconstructor.cc
Go to the documentation of this file.
1 #include "HcalHitReconstructor.h"
21 #include <iostream>
22 #include <fstream>
23 
24 /* Hcal Hit reconstructor allows for CaloRecHits with status words */
25 
27  : reco_(conf.getParameter<bool>("correctForTimeslew"),
28  conf.getParameter<bool>("correctForPhaseContainment"),
29  conf.getParameter<double>("correctionPhaseNS")),
30  det_(DetId::Hcal),
31  inputLabel_(conf.getParameter<edm::InputTag>("digiLabel")),
32  correctTiming_(conf.getParameter<bool>("correctTiming")),
33  setNoiseFlags_(conf.getParameter<bool>("setNoiseFlags")),
34  setHSCPFlags_(conf.getParameter<bool>("setHSCPFlags")),
35  setSaturationFlags_(conf.getParameter<bool>("setSaturationFlags")),
36  setTimingTrustFlags_(conf.getParameter<bool>("setTimingTrustFlags")),
37  setPulseShapeFlags_(conf.getParameter<bool>("setPulseShapeFlags")),
38  setNegativeFlags_(false),
39  dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed")),
40  firstAuxTS_(conf.getParameter<int>("firstAuxTS")),
41  firstSample_(conf.getParameter<int>("firstSample")),
42  samplesToAdd_(conf.getParameter<int>("samplesToAdd")),
43  tsFromDB_(conf.getParameter<bool>("tsFromDB")),
44  useLeakCorrection_(conf.getParameter<bool>("useLeakCorrection")),
45  dataOOTCorrectionName_(""),
46  dataOOTCorrectionCategory_("Data"),
47  mcOOTCorrectionName_(""),
48  mcOOTCorrectionCategory_("MC"),
49  setPileupCorrection_(nullptr),
50  paramTS(nullptr)
51 
52 {
53  // register for data access
54  tok_ho_ = consumes<HODigiCollection>(inputLabel_);
55  tok_hf_ = consumes<HFDigiCollection>(inputLabel_);
56  tok_calib_ = consumes<HcalCalibDigiCollection>(inputLabel_);
57 
58  std::string subd = conf.getParameter<std::string>("Subdetector");
59  //Set all FlagSetters to 0
60  /* Important to do this! Otherwise, if the setters are turned off,
61  the "if (XSetter_) delete XSetter_;" commands can crash
62  */
63 
64  recoParamsFromDB_ = conf.getParameter<bool>("recoParamsFromDB");
65  // recoParamsFromDB_ = false ; // trun off for now.
66 
67  // std::cout<<" HcalHitReconstructor recoParamsFromDB_ "<<recoParamsFromDB_<<std::endl;
68 
69  if (conf.existsAs<bool>("setNegativeFlags"))
70  setNegativeFlags_ = conf.getParameter<bool>("setNegativeFlags");
71 
72  hfdigibit_ = nullptr;
73 
74  hfS9S1_ = nullptr;
75  hfS8S1_ = nullptr;
76  hfPET_ = nullptr;
77  saturationFlagSetter_ = nullptr;
78  HFTimingTrustFlagSetter_ = nullptr;
79  digiTimeFromDB_ = false; // only need for HF
80 
81  if (setSaturationFlags_) {
82  const edm::ParameterSet& pssat = conf.getParameter<edm::ParameterSet>("saturationParameters");
83  saturationFlagSetter_ = new HcalADCSaturationFlag(pssat.getParameter<int>("maxADCvalue"));
84  }
85 
86  if (!strcasecmp(subd.c_str(), "HO")) {
88  // setPileupCorrection_ = &HcalSimpleRecAlgo::setHOPileupCorrection;
89  setPileupCorrection_ = nullptr;
90  produces<HORecHitCollection>();
91  } else if (!strcasecmp(subd.c_str(), "HF")) {
93  // setPileupCorrection_ = &HcalSimpleRecAlgo::setHFPileupCorrection;
94  setPileupCorrection_ = nullptr;
95  digiTimeFromDB_ = conf.getParameter<bool>("digiTimeFromDB");
96 
98  const edm::ParameterSet& pstrust = conf.getParameter<edm::ParameterSet>("hfTimingTrustParameters");
99  HFTimingTrustFlagSetter_ = new HFTimingTrustFlag(pstrust.getParameter<int>("hfTimingTrustLevel1"),
100  pstrust.getParameter<int>("hfTimingTrustLevel2"));
101  }
102 
103  if (setNoiseFlags_) {
104  const edm::ParameterSet& psdigi = conf.getParameter<edm::ParameterSet>("digistat");
105  const edm::ParameterSet& psTimeWin = conf.getParameter<edm::ParameterSet>("HFInWindowStat");
106  hfdigibit_ = new HcalHFStatusBitFromDigis(psdigi, psTimeWin);
107 
108  const edm::ParameterSet& psS9S1 = conf.getParameter<edm::ParameterSet>("S9S1stat");
109  hfS9S1_ = new HcalHF_S9S1algorithm(psS9S1.getParameter<std::vector<double> >("short_optimumSlope"),
110  psS9S1.getParameter<std::vector<double> >("shortEnergyParams"),
111  psS9S1.getParameter<std::vector<double> >("shortETParams"),
112  psS9S1.getParameter<std::vector<double> >("long_optimumSlope"),
113  psS9S1.getParameter<std::vector<double> >("longEnergyParams"),
114  psS9S1.getParameter<std::vector<double> >("longETParams"),
115  psS9S1.getParameter<int>("HcalAcceptSeverityLevel"),
116  psS9S1.getParameter<bool>("isS8S1"));
117 
118  const edm::ParameterSet& psS8S1 = conf.getParameter<edm::ParameterSet>("S8S1stat");
119  hfS8S1_ = new HcalHF_S9S1algorithm(psS8S1.getParameter<std::vector<double> >("short_optimumSlope"),
120  psS8S1.getParameter<std::vector<double> >("shortEnergyParams"),
121  psS8S1.getParameter<std::vector<double> >("shortETParams"),
122  psS8S1.getParameter<std::vector<double> >("long_optimumSlope"),
123  psS8S1.getParameter<std::vector<double> >("longEnergyParams"),
124  psS8S1.getParameter<std::vector<double> >("longETParams"),
125  psS8S1.getParameter<int>("HcalAcceptSeverityLevel"),
126  psS8S1.getParameter<bool>("isS8S1"));
127 
128  const edm::ParameterSet& psPET = conf.getParameter<edm::ParameterSet>("PETstat");
129  hfPET_ = new HcalHF_PETalgorithm(psPET.getParameter<std::vector<double> >("short_R"),
130  psPET.getParameter<std::vector<double> >("shortEnergyParams"),
131  psPET.getParameter<std::vector<double> >("shortETParams"),
132  psPET.getParameter<std::vector<double> >("long_R"),
133  psPET.getParameter<std::vector<double> >("longEnergyParams"),
134  psPET.getParameter<std::vector<double> >("longETParams"),
135  psPET.getParameter<int>("HcalAcceptSeverityLevel"),
136  psPET.getParameter<std::vector<double> >("short_R_29"),
137  psPET.getParameter<std::vector<double> >("long_R_29"));
138  }
139  produces<HFRecHitCollection>();
140  } else if (!strcasecmp(subd.c_str(), "ZDC")) {
141  det_ = DetId::Calo;
143  produces<ZDCRecHitCollection>();
144  } else if (!strcasecmp(subd.c_str(), "CALIB")) {
145  subdet_ = HcalOther;
147  produces<HcalCalibRecHitCollection>();
148  } else {
149  edm::LogWarning("Configuration") << "HcalHitReconstructor is not associated with a specific subdetector!"
150  << std::endl;
151  }
152 
153  // If no valid OOT pileup correction name specified,
154  // disable the correction
155  if (conf.existsAs<std::string>("dataOOTCorrectionName"))
156  dataOOTCorrectionName_ = conf.getParameter<std::string>("dataOOTCorrectionName");
157  if (conf.existsAs<std::string>("dataOOTCorrectionCategory"))
158  dataOOTCorrectionCategory_ = conf.getParameter<std::string>("dataOOTCorrectionCategory");
159  if (conf.existsAs<std::string>("mcOOTCorrectionName"))
160  mcOOTCorrectionName_ = conf.getParameter<std::string>("mcOOTCorrectionName");
161  if (conf.existsAs<std::string>("mcOOTCorrectionCategory"))
162  mcOOTCorrectionCategory_ = conf.getParameter<std::string>("mcOOTCorrectionCategory");
163  if (dataOOTCorrectionName_.empty() && mcOOTCorrectionName_.empty())
164  setPileupCorrection_ = nullptr;
165 }
166 
168  delete hfdigibit_;
169 
170  delete hfS9S1_;
171  delete hfS8S1_;
172  delete hfPET_;
173  delete saturationFlagSetter_;
175 
176  delete paramTS;
177 }
178 
181  es.get<HcalRecNumberingRecord>().get(htopo);
182 
183  if (tsFromDB_ == true || recoParamsFromDB_ == true) {
185  es.get<HcalRecoParamsRcd>().get(p);
186  paramTS = new HcalRecoParams(*p.product());
187  paramTS->setTopo(htopo.product());
188 
189  // std::cout<<" skdump in HcalHitReconstructor::beginRun dupm RecoParams "<<std::endl;
190  // std::ofstream skfile("skdumpRecoParamsNewFormat.txt");
191  // HcalDbASCIIIO::dumpObject(skfile, (*paramTS) );
192  }
193 
194  if (digiTimeFromDB_ == true) {
196  es.get<HcalFlagHFDigiTimeParamsRcd>().get(p);
198  HFDigiTimeParams->setTopo(htopo.product());
199  }
200 
201  reco_.beginRun(es);
202 }
203 
205  if (tsFromDB_ == true) {
206  delete paramTS;
207  paramTS = nullptr;
208  }
209  if (digiTimeFromDB_ == true) {
210  //DL delete HFDigiTimeParams; HFDigiTimeParams = 0;
211  }
212  reco_.endRun();
213 }
214 
216  // get conditions
218  eventSetup.get<HcalRecNumberingRecord>().get(topo);
219 
220  edm::ESHandle<HcalDbService> conditions;
221  eventSetup.get<HcalDbRecord>().get(conditions);
222 
223  if (useLeakCorrection_)
225 
227  eventSetup.get<HcalChannelQualityRcd>().get("withTopo", p);
228  const HcalChannelQuality* myqual = p.product();
229 
231  eventSetup.get<HcalSeverityLevelComputerRcd>().get(mycomputer);
232  const HcalSeverityLevelComputer* mySeverity = mycomputer.product();
233 
234  // GET THE BEAM CROSSING INFO HERE, WHEN WE UNDERSTAND HOW THINGS WORK.
235  // Then, call "setBXInfo" method of the reco_ object.
236  // Also remember to call SetBXInfo in the negative energy flag setter.
237 
238  if (det_ == DetId::Hcal) {
239  // HO ------------------------------------------------------------------
240  if (subdet_ == HcalOuter) {
242  e.getByToken(tok_ho_, digi);
243 
244  // create empty output
245  auto rec = std::make_unique<HORecHitCollection>();
246  rec->reserve(digi->size());
247  // run the algorithm
249 
250  // Vote on majority TS0 CapId
251  int favorite_capid = 0;
252  if (correctTiming_) {
253  long capid_votes[4] = {0, 0, 0, 0};
254  for (i = digi->begin(); i != digi->end(); i++) {
255  capid_votes[(*i)[0].capid()]++;
256  }
257  for (int k = 0; k < 4; k++)
258  if (capid_votes[k] > capid_votes[favorite_capid])
259  favorite_capid = k;
260  }
261 
262  for (i = digi->begin(); i != digi->end(); i++) {
263  HcalDetId cell = i->id();
264  DetId detcell = (DetId)cell;
265  // firstSample & samplesToAdd
266  if (tsFromDB_ || recoParamsFromDB_) {
267  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
268  if (tsFromDB_) {
269  firstSample_ = param_ts->firstSample();
270  samplesToAdd_ = param_ts->samplesToAdd();
271  }
272  if (recoParamsFromDB_) {
273  bool correctForTimeslew = param_ts->correctForTimeslew();
275  float phaseNS = param_ts->correctionPhaseNS();
277  correctTiming_ = param_ts->correctTiming();
278  firstAuxTS_ = param_ts->firstAuxTS();
279  int pileupCleaningID = param_ts->pileupCleaningID();
281  correctForTimeslew, correctForPhaseContainment, useLeakCorrection_, pileupCleaningID, phaseNS);
282  }
283  }
284 
285  int first = firstSample_;
286  int toadd = samplesToAdd_;
287 
288  if (first >= i->size() || first < 0)
289  edm::LogWarning("Configuration")
290  << "HcalHitReconstructor: illegal firstSample" << first << " in subdet " << subdet_ << std::endl;
291 
292  // check on cells to be ignored and dropped: (rof,20.Feb.09)
293  const HcalChannelStatus* mydigistatus = myqual->getValues(detcell.rawId());
294  if (mySeverity->dropChannel(mydigistatus->getValue()))
295  continue;
297  if (i->zsMarkAndPass())
298  continue;
299 
300  const HcalCalibrations& calibrations = conditions->getHcalCalibrations(cell);
301  const HcalQIECoder* channelCoder = conditions->getHcalCoder(cell);
302  const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
303  HcalCoderDb coder(*channelCoder, *shape);
304 
305  rec->push_back(reco_.reconstruct(*i, first, toadd, coder, calibrations));
306 
307  // Set auxiliary flag
308  int auxflag = 0;
309  int fTS = firstAuxTS_;
310  if (fTS < 0)
311  fTS = 0; //silly protection against negative time slice values
312  for (int xx = fTS; xx < fTS + 4 && xx < i->size(); ++xx)
313  auxflag += (i->sample(xx).adc())
314  << (7 *
315  (xx - fTS)); // store the time slices in the first 28 bits of aux, a set of 4 7-bit adc values
316  // bits 28 and 29 are reserved for capid of the first time slice saved in aux
317  auxflag += ((i->sample(fTS).capid()) << 28);
318  (rec->back()).setAux(auxflag);
319  // (rec->back()).setFlags(0); Don't want to do this because the algorithm
320  // can already set some flags
321  // Fill Presample ADC flag
322  if (fTS > 0)
323  (rec->back()).setFlagField((i->sample(fTS - 1).adc()), HcalCaloFlagLabels::PresampleADC, 7);
324 
326  saturationFlagSetter_->setSaturationFlag(rec->back(), *i);
327  if (correctTiming_)
328  HcalTimingCorrector::Correct(rec->back(), *i, favorite_capid);
329  }
330  // return result
331  e.put(std::move(rec));
332 
333  // HF -------------------------------------------------------------------
334  } else if (subdet_ == HcalForward) {
336  e.getByToken(tok_hf_, digi);
337 
339  // create empty output
340  auto rec = std::make_unique<HFRecHitCollection>();
341  rec->reserve(digi->size());
342  // run the algorithm
344 
345  // Vote on majority TS0 CapId
346  int favorite_capid = 0;
347  if (correctTiming_) {
348  long capid_votes[4] = {0, 0, 0, 0};
349  for (i = digi->begin(); i != digi->end(); i++) {
350  capid_votes[(*i)[0].capid()]++;
351  }
352  for (int k = 0; k < 4; k++)
353  if (capid_votes[k] > capid_votes[favorite_capid])
354  favorite_capid = k;
355  }
356 
357  for (i = digi->begin(); i != digi->end(); i++) {
358  HcalDetId cell = i->id();
359  DetId detcell = (DetId)cell;
360 
361  if (tsFromDB_ || recoParamsFromDB_) {
362  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
363  if (tsFromDB_) {
364  firstSample_ = param_ts->firstSample();
365  samplesToAdd_ = param_ts->samplesToAdd();
366  }
367  if (recoParamsFromDB_) {
368  bool correctForTimeslew = param_ts->correctForTimeslew();
370  float phaseNS = param_ts->correctionPhaseNS();
372  correctTiming_ = param_ts->correctTiming();
373  firstAuxTS_ = param_ts->firstAuxTS();
374  int pileupCleaningID = param_ts->pileupCleaningID();
376  correctForTimeslew, correctForPhaseContainment, useLeakCorrection_, pileupCleaningID, phaseNS);
377  }
378  }
379 
380  int first = firstSample_;
381  int toadd = samplesToAdd_;
382 
383  if (first >= i->size() || first < 0)
384  edm::LogWarning("Configuration")
385  << "HcalHitReconstructor: illegal firstSample" << first << " in subdet " << subdet_ << std::endl;
386 
387  // check on cells to be ignored and dropped: (rof,20.Feb.09)
388  const HcalChannelStatus* mydigistatus = myqual->getValues(detcell.rawId());
389  if (mySeverity->dropChannel(mydigistatus->getValue()))
390  continue;
392  if (i->zsMarkAndPass())
393  continue;
394 
395  const HcalCalibrations& calibrations = conditions->getHcalCalibrations(cell);
396  const HcalQIECoder* channelCoder = conditions->getHcalCoder(cell);
397  const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
398  HcalCoderDb coder(*channelCoder, *shape);
399 
400  // Set HFDigiTime flag values from digiTimeFromDB_
401  if (digiTimeFromDB_ == true && hfdigibit_ != nullptr) {
402  const HcalFlagHFDigiTimeParam* hfDTparam = HFDigiTimeParams->getValues(detcell.rawId());
404  hfDTparam->HFdigiflagSamplesToAdd(),
405  hfDTparam->HFdigiflagExpectedPeak(),
406  hfDTparam->HFdigiflagMinEThreshold(),
407  hfDTparam->HFdigiflagCoefficients());
408  }
409 
410  //std::cout << "TOADDHF " << toadd << " " << first << " " << std::endl;
411  rec->push_back(reco_.reconstruct(*i, first, toadd, coder, calibrations));
412 
413  // Set auxiliary flag
414  int auxflag = 0;
415  int fTS = firstAuxTS_;
416  if (fTS < 0)
417  fTS = 0; // silly protection against negative time slice values
418  for (int xx = fTS; xx < fTS + 4 && xx < i->size(); ++xx)
419  auxflag += (i->sample(xx).adc())
420  << (7 *
421  (xx - fTS)); // store the time slices in the first 28 bits of aux, a set of 4 7-bit adc values
422  // bits 28 and 29 are reserved for capid of the first time slice saved in aux
423  auxflag += ((i->sample(fTS).capid()) << 28);
424  (rec->back()).setAux(auxflag);
425 
426  // (rec->back()).setFlags(0); Don't want to do this because the algorithm
427  // can already set some flags
428 
429  // Fill Presample ADC flag
430  if (fTS > 0)
431  (rec->back()).setFlagField((i->sample(fTS - 1).adc()), HcalCaloFlagLabels::PresampleADC, 7);
432 
433  // This calls the code for setting the HF noise bit determined from digi shape
434  if (setNoiseFlags_)
435  hfdigibit_->hfSetFlagFromDigi(rec->back(), *i, coder, calibrations);
437  saturationFlagSetter_->setSaturationFlag(rec->back(), *i);
440  if (correctTiming_)
441  HcalTimingCorrector::Correct(rec->back(), *i, favorite_capid);
442  } // for (i=digi->begin(); i!=digi->end(); i++) -- loop on all HF digis
443 
444  // The following flags require the full set of rechits
445  // These need to be set consecutively, so an energy check should be the first
446  // test performed on these hits (to minimize the loop time)
447  if (setNoiseFlags_) {
448  // Step 1: Set PET flag (short fibers of |ieta|==29)
449  // Neighbor/partner channels that are flagged by Pulse Shape algorithm (HFDigiTime)
450  // won't be considered in these calculations
451  for (HFRecHitCollection::iterator i = rec->begin(); i != rec->end(); ++i) {
452  int depth = i->id().depth();
453  int ieta = i->id().ieta();
454  // Short fibers and all channels at |ieta|=29 use PET settings in Algo 3
455  if (depth == 2 || abs(ieta) == 29)
456  hfPET_->HFSetFlagFromPET(*i, *rec, myqual, mySeverity);
457  }
458 
459  // Step 2: Set S8S1 flag (short fibers or |ieta|==29)
460  for (HFRecHitCollection::iterator i = rec->begin(); i != rec->end(); ++i) {
461  int depth = i->id().depth();
462  int ieta = i->id().ieta();
463  // Short fibers and all channels at |ieta|=29 use PET settings in Algo 3
464  if (depth == 2 || abs(ieta) == 29)
465  hfS8S1_->HFSetFlagFromS9S1(*i, *rec, myqual, mySeverity);
466  }
467 
468  // Set 3: Set S9S1 flag (long fibers)
469  for (HFRecHitCollection::iterator i = rec->begin(); i != rec->end(); ++i) {
470  int depth = i->id().depth();
471  int ieta = i->id().ieta();
472  // Short fibers and all channels at |ieta|=29 use PET settings in Algo 3
473  if (depth == 1 && abs(ieta) != 29)
474  hfS9S1_->HFSetFlagFromS9S1(*i, *rec, myqual, mySeverity);
475  }
476  }
477 
478  // return result
479  e.put(std::move(rec));
480  } else if (subdet_ == HcalOther && subdetOther_ == HcalCalibration) {
482  e.getByToken(tok_calib_, digi);
483 
484  // create empty output
485  auto rec = std::make_unique<HcalCalibRecHitCollection>();
486  rec->reserve(digi->size());
487  // run the algorithm
488  int first = firstSample_;
489  int toadd = samplesToAdd_;
490 
492  for (i = digi->begin(); i != digi->end(); i++) {
493  HcalCalibDetId cell = i->id();
494  // HcalDetId cellh = i->id();
495  DetId detcell = (DetId)cell;
496  // check on cells to be ignored and dropped: (rof,20.Feb.09)
497  const HcalChannelStatus* mydigistatus = myqual->getValues(detcell.rawId());
498  if (mySeverity->dropChannel(mydigistatus->getValue()))
499  continue;
501  if (i->zsMarkAndPass())
502  continue;
503 
504  const HcalCalibrations& calibrations = conditions->getHcalCalibrations(cell);
505  const HcalQIECoder* channelCoder = conditions->getHcalCoder(cell);
506  const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
507  HcalCoderDb coder(*channelCoder, *shape);
508 
509  // firstSample & samplesToAdd
510  if (tsFromDB_) {
511  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
512  first = param_ts->firstSample();
513  toadd = param_ts->samplesToAdd();
514  }
515  rec->push_back(reco_.reconstruct(*i, first, toadd, coder, calibrations));
516 
517  /*
518  // Flag setting not available for calibration rechits
519  // Set auxiliary flag
520  int auxflag=0;
521  int fTS = firstAuxTS_;
522  for (int xx=fTS; xx<fTS+4 && xx<i->size();++xx)
523  auxflag+=(i->sample(xx).adc())<<(7*(xx-fTS)); // store the time slices in the first 28 bits of aux, a set of 4 7-bit adc values
524  // bits 28 and 29 are reserved for capid of the first time slice saved in aux
525  auxflag+=((i->sample(fTS).capid())<<28);
526  (rec->back()).setAux(auxflag);
527 
528  (rec->back()).setFlags(0); // Not yet implemented for HcalCalibRecHit
529  */
530  }
531  // return result
532  e.put(std::move(rec));
533  }
534  }
535  //DL delete myqual;
536 } // void HcalHitReconstructor::produce(...)
T getParameter(std::string const &) const
void HFSetFlagFromS9S1(HFRecHit &hf, HFRecHitCollection &rec, const HcalChannelQuality *myqual, const HcalSeverityLevelComputer *mySeverity)
HcalRecoParams * paramTS
constexpr unsigned int samplesToAdd() const
Definition: HcalRecoParam.h:32
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
void beginRun(edm::Run const &r, edm::EventSetup const &es) final
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
constexpr unsigned int pileupCleaningID() const
Definition: HcalRecoParam.h:43
void setHFTimingTrustFlag(HFRecHit &rechit, const HFDataFrame &digi)
HcalADCSaturationFlag * saturationFlagSetter_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void produce(edm::Event &e, const edm::EventSetup &c) override
uint32_t HFdigiflagSamplesToAdd() const
void beginRun(edm::EventSetup const &es)
void hfSetFlagFromDigi(HFRecHit &hf, const HFDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calib)
#define nullptr
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::vector< T >::const_iterator const_iterator
const Item * getValues(DetId fId, bool throwOnFail=true) const
void resetParamsFromDB(int firstSample, int samplesToAdd, int expectedPeak, double minthreshold, const std::vector< double > &coef)
SetCorrectionFcn setPileupCorrection_
void HFSetFlagFromPET(HFRecHit &hf, HFRecHitCollection &rec, const HcalChannelQuality *myqual, const HcalSeverityLevelComputer *mySeverity)
std::string dataOOTCorrectionCategory_
constexpr float correctionPhaseNS() const
Definition: HcalRecoParam.h:30
std::unique_ptr< HcalFlagHFDigiTimeParams > HFDigiTimeParams
edm::EDGetTokenT< HcalCalibDigiCollection > tok_calib_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HcalHFStatusBitFromDigis * hfdigibit_
constexpr unsigned int firstAuxTS() const
Definition: HcalRecoParam.h:40
bool dropChannel(const uint32_t &mystatus) const
uint32_t HFdigiflagExpectedPeak() const
constexpr bool correctTiming() const
Definition: HcalRecoParam.h:39
HFRecHit reconstruct(const HFDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
void setSaturationFlag(HBHERecHit &rechit, const HBHEDataFrame &digi)
constexpr bool useLeakCorrection() const
Definition: HcalRecoParam.h:35
edm::EDGetTokenT< HODigiCollection > tok_ho_
HcalHitReconstructor(const edm::ParameterSet &ps)
std::vector< T >::iterator iterator
const_iterator end() const
std::vector< double > HFdigiflagCoefficients() const
HcalHF_PETalgorithm * hfPET_
Definition: DetId.h:17
constexpr bool correctForPhaseContainment() const
Definition: HcalRecoParam.h:28
constexpr bool correctForTimeslew() const
Definition: HcalRecoParam.h:37
HcalHF_S9S1algorithm * hfS9S1_
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
void setRecoParams(bool correctForTimeslew, bool correctForPulse, bool setLeakCorrection, int pileupCleaningID, float phaseNS)
uint32_t HFdigiflagFirstSample() const
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
std::string dataOOTCorrectionName_
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
HcalHF_S9S1algorithm * hfS8S1_
HLT enums.
size_type size() const
HcalOtherSubdetector subdetOther_
T get() const
Definition: EventSetup.h:73
static void Correct(HBHERecHit &rechit, const HBHEDataFrame &digi, int favorite_capid)
void endRun(edm::Run const &r, edm::EventSetup const &es) final
HFTimingTrustFlag * HFTimingTrustFlagSetter_
uint32_t getValue() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
std::string mcOOTCorrectionCategory_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511
void setTopo(const HcalTopology *topo)
constexpr unsigned int firstSample() const
Definition: HcalRecoParam.h:31
const_iterator begin() const
Definition: Run.h:45
HcalSimpleRecAlgo reco_
double HFdigiflagMinEThreshold() const