CMS 3D CMS Logo

HFSimpleTimeCheck.h
Go to the documentation of this file.
1 #ifndef RecoLocalCalo_HcalRecAlgos_HFSimpleTimeCheck_h_
2 #define RecoLocalCalo_HcalRecAlgos_HFSimpleTimeCheck_h_
3 
4 #include <utility>
5 
8 
10 public:
11  // "tlimits" are the rise time limits for the anode pair.
12  // The first element of the pair is the min rise time and the
13  // second element is the max rise time. tlimits[0] is for the
14  // first anode and tlimits[1] is for the second one.
15  //
16  // "energyWeights" is the lookup table for the energy weights
17  // based on the multi-state decision about anode quality.
18  // The first index of this array corresponds to the decision
19  // about the status of the anodes, and the second index corresponds
20  // to the anode number. Possible status values are given in the
21  // HFAnodeStatus enum. Mapping of the first index to the possible
22  // status values is as follows:
23  //
24  // Indices 0 to HFAnodeStatus::N_POSSIBLE_STATES-1 correspond to
25  // the situations in which the first anode has the status "OK"
26  // and the second anode has the status given by the index.
27  //
28  // HFAnodeStatus::N_POSSIBLE_STATES to HFAnodeStatus::N_POSSIBLE_STATES-2
29  // correspond to the situations in which the second anode has
30  // the status "OK" and the first anode has the status given
31  // by index - HFAnodeStatus::N_POSSIBLE_STATES + 1. This excludes
32  // the state {OK, OK} already covered.
33  //
34  // "soiPhase" argument specifies the desired position of the
35  // sample of interest ADC in the ADC bytes written out into the
36  // aux words of the HFRecHit. For more detail, see comments
37  // inside the HFRecHitAuxSetter.h header.
38  //
39  // "timeShift" value (in ns) will be added to all valid times
40  // returned by QIE10 TDCs. This shift is used both for applying
41  // the timing cuts and for rechit construction.
42  //
43  // "triseIfNoTDC" and "tfallIfNoTDC": the rechit rise and
44  // fall times will be set to these values in case meaningful
45  // TDC information is not available for any of the PMT anodes
46  // (time shift is not added to these numbers).
47  //
48  // For monitoring purposes, "rejectAllFailures" can be set to
49  // "false". In this case, for the energy reconstruction purposes,
50  // all status values indicating that the anode is not passing
51  // algorithm cuts will be mapped to "OK". However, HFRecHit
52  // will still be made using proper status flags.
53  //
54  // If "alwaysCalculateChargeAsymmetry" is true, charge asymmetry
55  // status bit will be set whenever the data is available for both
56  // anodes. If "alwaysCalculateChargeAsymmetry" is false, the bit
57  // will be set only if the status of both anodes is "OK" (or mapped
58  // into "OK").
59  //
60  HFSimpleTimeCheck(const std::pair<float, float> tlimits[2],
61  const float energyWeights[2 * HFAnodeStatus::N_POSSIBLE_STATES - 1][2],
62  unsigned soiPhase,
63  float timeShift,
64  float triseIfNoTDC,
65  float tfallIfNoTDC,
68  bool rejectAllFailures = true,
69  bool alwaysCalculateChargeAsymmetry = true);
70 
71  inline ~HFSimpleTimeCheck() override {}
72 
73  inline bool isConfigurable() const override { return false; }
74 
75  HFRecHit reconstruct(const HFPreRecHit& prehit,
76  const HcalCalibrations& calibs,
77  const bool flaggedBadInDB[2],
78  bool expectSingleAnodePMT) override;
79 
80  inline unsigned soiPhase() const { return soiPhase_; }
81  inline float timeShift() const { return timeShift_; }
82  inline float triseIfNoTDC() const { return triseIfNoTDC_; }
83  inline float tfallIfNoTDC() const { return tfallIfNoTDC_; }
84  inline float minChargeForUndershoot() const { return minChargeForUndershoot_; }
85  inline float minChargeForOvershoot() const { return minChargeForOvershoot_; }
86  inline bool rejectingAllFailures() const { return rejectAllFailures_; }
87  inline bool alwaysCalculatingQAsym() const { return alwaysQAsym_; }
88 
89 protected:
90  virtual unsigned determineAnodeStatus(unsigned anodeNumber, const HFQIE10Info& anode, bool* isTimingReliable) const;
91 
92 private:
93  // Map possible status values into the first index of "energyWeights_"
94  unsigned mapStatusIntoIndex(const unsigned states[2]) const;
95 
96  std::pair<float, float> tlimits_[2];
98  unsigned soiPhase_;
99  float timeShift_;
106 };
107 
108 #endif // RecoLocalCalo_HcalRecAlgos_HFSimpleTimeCheck_h_
float minChargeForOvershoot() const
~HFSimpleTimeCheck() override
virtual unsigned determineAnodeStatus(unsigned anodeNumber, const HFQIE10Info &anode, bool *isTimingReliable) const
bool alwaysCalculatingQAsym() const
HFSimpleTimeCheck(const std::pair< float, float > tlimits[2], const float energyWeights[2 *HFAnodeStatus::N_POSSIBLE_STATES-1][2], unsigned soiPhase, float timeShift, float triseIfNoTDC, float tfallIfNoTDC, float minChargeForUndershoot, float minChargeForOvershoot, bool rejectAllFailures=true, bool alwaysCalculateChargeAsymmetry=true)
float tfallIfNoTDC() const
unsigned mapStatusIntoIndex(const unsigned states[2]) const
float triseIfNoTDC() const
bool isConfigurable() const override
std::pair< float, float > tlimits_[2]
HFRecHit reconstruct(const HFPreRecHit &prehit, const HcalCalibrations &calibs, const bool flaggedBadInDB[2], bool expectSingleAnodePMT) override
float energyWeights_[2 *HFAnodeStatus::N_POSSIBLE_STATES-1][2]
unsigned soiPhase() const
float timeShift() const
bool rejectingAllFailures() const
float minChargeForUndershoot() const