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