CMS 3D CMS Logo

HFFlexibleTimeCheck.cc
Go to the documentation of this file.
1 #include <cmath>
2 
6 
7 // Phase 1 rechit status bit assignments
9 
11  const unsigned ianode, const HFQIE10Info& anode,
12  bool* isTimingReliable) const
13 {
14  // Return quickly if this anode has a dataframe error
15  if (!anode.isDataframeOK())
17 
18  // Require minimum charge for reliable timing measurement
19  const float charge = anode.charge();
20  const float minCharge = ianode ? pmtInfo_->minCharge1() :
22  if (charge < minCharge)
23  {
24  *isTimingReliable = false;
25  return HFAnodeStatus::OK;
26  }
27 
28  // Special handling of under/overshoot TDC values, as well
29  // as of DLL failures
30  float trise = anode.timeRising();
32  charge < minChargeForUndershoot()) ||
34  charge < minChargeForOvershoot()) ||
36  {
37  *isTimingReliable = false;
38  return HFAnodeStatus::OK;
39  }
40 
41  // Check if the rise time information is meaningful
42  if (HcalSpecialTimes::isSpecial(trise))
44 
45  // Figure out the timing cuts for this PMT
46  const AbsHcalFunctor& minTimeShape = pmtInfo_->cut(
48  const AbsHcalFunctor& maxTimeShape = pmtInfo_->cut(
50 
51  // Apply the timing cuts
52  trise += timeShift();
53  if (minTimeShape(charge) <= trise && trise <= maxTimeShape(charge))
54  return HFAnodeStatus::OK;
55  else
57 }
58 
60  const HcalCalibrations& calibs,
61  const bool flaggedBadInDB[2],
62  const bool expectSingleAnodePMT)
63 {
64  // The algorithm must be configured by now
65  if (!algoConf_)
66  throw cms::Exception("HFPhase1BadConfig")
67  << "In HFFlexibleTimeCheck::reconstruct: algorithm is not configured";
68 
69  // Fetch the algorithm configuration data for this PMT
70  pmtInfo_ = &algoConf_->at(prehit.id());
71 
72  // Run the reconstruction algorithm from the base class
74  prehit, calibs, flaggedBadInDB, expectSingleAnodePMT);
75 
76  if (rh.id().rawId())
77  {
78  // Check the charge asymmetry between the two anodes
79  bool passesAsymmetryCut = true;
80  const std::pair<float,bool> qAsymm =
82  if (qAsymm.second)
83  {
84  const float q = prehit.charge();
85  const float minAsymm = (pmtInfo_->cut(HFPhase1PMTData::ASYMM_MIN))(q);
86  const float maxAsymm = (pmtInfo_->cut(HFPhase1PMTData::ASYMM_MAX))(q);
87  passesAsymmetryCut = minAsymm <= qAsymm.first && qAsymm.first <= maxAsymm;
88  }
89  if (!passesAsymmetryCut)
91  }
92 
93  return rh;
94 }
float minChargeForOvershoot() const
unsigned determineAnodeStatus(unsigned anodeNumber, const HFQIE10Info &anode, bool *isTimingReliable) const override
float minChargeAsymm() const
float timeRising() const
Definition: HFQIE10Info.h:72
constexpr float UNKNOWN_T_DLL_FAILURE
const HFPhase1PMTParams * algoConf_
bool isDataframeOK(bool checkAllTimeSlices=false) const
Definition: HFQIE10Info.h:86
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
constexpr void setFlagField(uint32_t value, int base, int width=1)
Definition: CaloRecHit.h:38
constexpr float UNKNOWN_T_UNDERSHOOT
const Item & at(const HcalDetId &id) const
constexpr float UNKNOWN_T_OVERSHOOT
HcalDetId id() const
Definition: HFPreRecHit.h:38
HFRecHit reconstruct(const HFPreRecHit &prehit, const HcalCalibrations &calibs, const bool flaggedBadInDB[2], bool expectSingleAnodePMT) override
const AbsHcalFunctor & cut(const unsigned which) const
float minCharge0() const
constexpr bool isSpecial(const float t)
float minCharge1() const
HFRecHit reconstruct(const HFPreRecHit &prehit, const HcalCalibrations &calibs, const bool flaggedBadInDB[2], bool expectSingleAnodePMT) override
float charge() const
Definition: HFPreRecHit.h:51
float timeShift() const
std::pair< float, bool > chargeAsymmetry(float chargeThreshold) const
Definition: HFPreRecHit.cc:3
HcalDetId id() const
Definition: HFRecHit.h:31
const HFPhase1PMTData * pmtInfo_
float charge() const
Definition: HFQIE10Info.h:70
float minChargeForUndershoot() const