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  HFSimpleTimeCheck(const std::pair<float,float> tlimits[2],
57  unsigned soiPhase, float timeShift,
58  float triseIfNoTDC, float tfallIfNoTDC,
60  bool rejectAllFailures = true);
61 
62  inline virtual ~HFSimpleTimeCheck() {}
63 
64  inline virtual bool isConfigurable() const override {return false;}
65 
66  virtual HFRecHit reconstruct(const HFPreRecHit& prehit,
67  const HcalCalibrations& calibs,
68  const bool flaggedBadInDB[2],
69  bool expectSingleAnodePMT) override;
70 
71  inline unsigned soiPhase() const {return soiPhase_;}
72  inline float timeShift() const {return timeShift_;}
73  inline float triseIfNoTDC() const {return triseIfNoTDC_;}
74  inline float tfallIfNoTDC() const {return tfallIfNoTDC_;}
75  inline float minChargeForUndershoot() const {return minChargeForUndershoot_;}
76  inline float minChargeForOvershoot() const {return minChargeForOvershoot_;}
77  inline bool rejectingAllFailures() const {return rejectAllFailures_;}
78 
79 protected:
80  virtual unsigned determineAnodeStatus(unsigned anodeNumber,
81  const HFQIE10Info& anode,
82  bool* isTimingReliable) const;
83 private:
84  // Map possible status values into the first index of "energyWeights_"
85  unsigned mapStatusIntoIndex(const unsigned states[2]) const;
86 
87  std::pair<float,float> tlimits_[2];
89  unsigned soiPhase_;
90  float timeShift_;
96 };
97 
98 #endif // RecoLocalCalo_HcalRecAlgos_HFSimpleTimeCheck_h_
float minChargeForOvershoot() const
std::pair< float, float > tlimits_[2]
virtual unsigned determineAnodeStatus(unsigned anodeNumber, const HFQIE10Info &anode, bool *isTimingReliable) const
virtual bool isConfigurable() const override
float tfallIfNoTDC() const
unsigned mapStatusIntoIndex(const unsigned states[2]) const
float triseIfNoTDC() const
virtual ~HFSimpleTimeCheck()
virtual 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
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 rejectingAllFailures() const
float minChargeForUndershoot() const