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_
HFSimpleTimeCheck::soiPhase
unsigned soiPhase() const
Definition: HFSimpleTimeCheck.h:80
HFSimpleTimeCheck::determineAnodeStatus
virtual unsigned determineAnodeStatus(unsigned anodeNumber, const HFQIE10Info &anode, bool *isTimingReliable) const
Definition: HFSimpleTimeCheck.cc:57
HFQIE10Info
Definition: HFQIE10Info.h:15
HFSimpleTimeCheck::tfallIfNoTDC_
float tfallIfNoTDC_
Definition: HFSimpleTimeCheck.h:101
HFSimpleTimeCheck::triseIfNoTDC
float triseIfNoTDC() const
Definition: HFSimpleTimeCheck.h:82
HLT_FULL_cff.energyWeights
energyWeights
Definition: HLT_FULL_cff.py:8542
HFRecHit
Definition: HFRecHit.h:11
HFSimpleTimeCheck::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, float minChargeForUndershoot, float minChargeForOvershoot, bool rejectAllFailures=true, bool alwaysCalculateChargeAsymmetry=true)
Definition: HFSimpleTimeCheck.cc:32
HFAnodeStatus::N_POSSIBLE_STATES
Definition: HFAnodeStatus.h:14
HFSimpleTimeCheck::minChargeForOvershoot_
float minChargeForOvershoot_
Definition: HFSimpleTimeCheck.h:103
HFSimpleTimeCheck::alwaysCalculatingQAsym
bool alwaysCalculatingQAsym() const
Definition: HFSimpleTimeCheck.h:87
HFSimpleTimeCheck::mapStatusIntoIndex
unsigned mapStatusIntoIndex(const unsigned states[2]) const
Definition: HFSimpleTimeCheck.cc:72
HFSimpleTimeCheck::timeShift
float timeShift() const
Definition: HFSimpleTimeCheck.h:81
HFSimpleTimeCheck::~HFSimpleTimeCheck
~HFSimpleTimeCheck() override
Definition: HFSimpleTimeCheck.h:71
HcalCalibrations
Definition: HcalCalibrations.h:9
HFSimpleTimeCheck::energyWeights_
float energyWeights_[2 *HFAnodeStatus::N_POSSIBLE_STATES - 1][2]
Definition: HFSimpleTimeCheck.h:97
HFSimpleTimeCheck::alwaysQAsym_
bool alwaysQAsym_
Definition: HFSimpleTimeCheck.h:105
HFSimpleTimeCheck::rejectAllFailures_
bool rejectAllFailures_
Definition: HFSimpleTimeCheck.h:104
HLT_FULL_cff.rejectAllFailures
rejectAllFailures
Definition: HLT_FULL_cff.py:8541
HFAnodeStatus.h
HFSimpleTimeCheck::soiPhase_
unsigned soiPhase_
Definition: HFSimpleTimeCheck.h:98
HFSimpleTimeCheck::minChargeForUndershoot
float minChargeForUndershoot() const
Definition: HFSimpleTimeCheck.h:84
AbsHFPhase1Algo
Definition: AbsHFPhase1Algo.h:25
HFSimpleTimeCheck::timeShift_
float timeShift_
Definition: HFSimpleTimeCheck.h:99
HFSimpleTimeCheck::isConfigurable
bool isConfigurable() const override
Definition: HFSimpleTimeCheck.h:73
HFSimpleTimeCheck::tlimits_
std::pair< float, float > tlimits_[2]
Definition: HFSimpleTimeCheck.h:96
HFSimpleTimeCheck
Definition: HFSimpleTimeCheck.h:9
HFSimpleTimeCheck::minChargeForOvershoot
float minChargeForOvershoot() const
Definition: HFSimpleTimeCheck.h:85
HFSimpleTimeCheck::minChargeForUndershoot_
float minChargeForUndershoot_
Definition: HFSimpleTimeCheck.h:102
HFSimpleTimeCheck::tfallIfNoTDC
float tfallIfNoTDC() const
Definition: HFSimpleTimeCheck.h:83
AbsHFPhase1Algo.h
HFPreRecHit
Definition: HFPreRecHit.h:14
HFSimpleTimeCheck::reconstruct
HFRecHit reconstruct(const HFPreRecHit &prehit, const HcalCalibrations &calibs, const bool flaggedBadInDB[2], bool expectSingleAnodePMT) override
Definition: HFSimpleTimeCheck.cc:88
HFSimpleTimeCheck::triseIfNoTDC_
float triseIfNoTDC_
Definition: HFSimpleTimeCheck.h:100
HFSimpleTimeCheck::rejectingAllFailures
bool rejectingAllFailures() const
Definition: HFSimpleTimeCheck.h:86
HLT_FULL_cff.tlimits
tlimits
Definition: HLT_FULL_cff.py:8545