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