CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
HFFlexibleTimeCheck Class Reference

#include <HFFlexibleTimeCheck.h>

Inheritance diagram for HFFlexibleTimeCheck:
HFSimpleTimeCheck AbsHFPhase1Algo

Public Member Functions

bool configure (const AbsHcalAlgoData *config) override
 
bool isConfigurable () const override
 
HFRecHit reconstruct (const HFPreRecHit &prehit, const HcalCalibrations &calibs, const bool flaggedBadInDB[2], bool expectSingleAnodePMT) override
 
 ~HFFlexibleTimeCheck () override
 
- Public Member Functions inherited from HFSimpleTimeCheck
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)
 
bool isConfigurable () const override
 
float minChargeForOvershoot () const
 
float minChargeForUndershoot () const
 
HFRecHit reconstruct (const HFPreRecHit &prehit, const HcalCalibrations &calibs, const bool flaggedBadInDB[2], bool expectSingleAnodePMT) override
 
bool rejectingAllFailures () const
 
unsigned soiPhase () const
 
float tfallIfNoTDC () const
 
float timeShift () const
 
float triseIfNoTDC () const
 
 ~HFSimpleTimeCheck () override
 
- Public Member Functions inherited from AbsHFPhase1Algo
virtual ~AbsHFPhase1Algo ()
 

Protected Member Functions

unsigned determineAnodeStatus (unsigned anodeNumber, const HFQIE10Info &anode, bool *isTimingReliable) const override
 

Private Attributes

const HFPhase1PMTParamsalgoConf_ = 0
 
const HFPhase1PMTDatapmtInfo_ = 0
 

Detailed Description

Definition at line 7 of file HFFlexibleTimeCheck.h.

Constructor & Destructor Documentation

HFFlexibleTimeCheck::~HFFlexibleTimeCheck ( )
inlineoverride

Definition at line 12 of file HFFlexibleTimeCheck.h.

12 {}

Member Function Documentation

bool HFFlexibleTimeCheck::configure ( const AbsHcalAlgoData config)
inlineoverridevirtual

Reimplemented from AbsHFPhase1Algo.

Definition at line 16 of file HFFlexibleTimeCheck.h.

References algoConf_, looper::config, determineAnodeStatus(), and reconstruct().

17  {
18  algoConf_ = dynamic_cast<const HFPhase1PMTParams*>(config);
19  return algoConf_;
20  }
const HFPhase1PMTParams * algoConf_
config
Definition: looper.py:291
unsigned HFFlexibleTimeCheck::determineAnodeStatus ( unsigned  anodeNumber,
const HFQIE10Info anode,
bool *  isTimingReliable 
) const
overrideprotectedvirtual

Reimplemented from HFSimpleTimeCheck.

Definition at line 12 of file HFFlexibleTimeCheck.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, HFQIE10Info::charge(), HFPhase1PMTData::cut(), HFAnodeStatus::FAILED_TIMING, HFAnodeStatus::HARDWARE_ERROR, HFQIE10Info::isDataframeOK(), HcalSpecialTimes::isSpecial(), HFPhase1PMTData::minCharge0(), HFPhase1PMTData::minCharge1(), HFSimpleTimeCheck::minChargeForOvershoot(), HFSimpleTimeCheck::minChargeForUndershoot(), HFAnodeStatus::OK, pmtInfo_, HFPhase1PMTData::T_0_MAX, HFPhase1PMTData::T_0_MIN, HFPhase1PMTData::T_1_MAX, HFPhase1PMTData::T_1_MIN, HFQIE10Info::timeRising(), HFSimpleTimeCheck::timeShift(), HcalSpecialTimes::UNKNOWN_T_DLL_FAILURE, HcalSpecialTimes::UNKNOWN_T_OVERSHOOT, and HcalSpecialTimes::UNKNOWN_T_UNDERSHOOT.

Referenced by configure().

15 {
16  // Return quickly if this anode has a dataframe error
17  if (!anode.isDataframeOK())
19 
20  // Require minimum charge for reliable timing measurement
21  const float charge = anode.charge();
22  const float minCharge = ianode ? pmtInfo_->minCharge1() :
24  if (charge < minCharge)
25  {
26  *isTimingReliable = false;
27  return HFAnodeStatus::OK;
28  }
29 
30  // Special handling of under/overshoot TDC values, as well
31  // as of DLL failures
32  float trise = anode.timeRising();
34  charge < minChargeForUndershoot()) ||
36  charge < minChargeForOvershoot()) ||
38  {
39  *isTimingReliable = false;
40  return HFAnodeStatus::OK;
41  }
42 
43  // Check if the rise time information is meaningful
44  if (HcalSpecialTimes::isSpecial(trise))
46 
47  // Figure out the timing cuts for this PMT
48  const AbsHcalFunctor& minTimeShape = pmtInfo_->cut(
50  const AbsHcalFunctor& maxTimeShape = pmtInfo_->cut(
52 
53  // Apply the timing cuts
54  trise += timeShift();
55  if (minTimeShape(charge) <= trise && trise <= maxTimeShape(charge))
56  return HFAnodeStatus::OK;
57  else
59 }
float minChargeForOvershoot() const
float timeRising() const
Definition: HFQIE10Info.h:72
constexpr float UNKNOWN_T_DLL_FAILURE
bool isDataframeOK(bool checkAllTimeSlices=false) const
Definition: HFQIE10Info.h:86
constexpr float UNKNOWN_T_UNDERSHOOT
constexpr float UNKNOWN_T_OVERSHOOT
const AbsHcalFunctor & cut(const unsigned which) const
float minCharge0() const
constexpr bool isSpecial(const float t)
float minCharge1() const
float timeShift() const
const HFPhase1PMTData * pmtInfo_
float charge() const
Definition: HFQIE10Info.h:70
float minChargeForUndershoot() const
bool HFFlexibleTimeCheck::isConfigurable ( ) const
inlineoverridevirtual

Implements AbsHFPhase1Algo.

Definition at line 15 of file HFFlexibleTimeCheck.h.

15 {return true;}
HFRecHit HFFlexibleTimeCheck::reconstruct ( const HFPreRecHit prehit,
const HcalCalibrations calibs,
const bool  flaggedBadInDB[2],
bool  expectSingleAnodePMT 
)
overridevirtual

Implements AbsHFPhase1Algo.

Definition at line 61 of file HFFlexibleTimeCheck.cc.

References algoConf_, HFSimpleTimeCheck::alwaysCalculatingQAsym(), HFPhase1PMTData::ASYMM_MAX, HFPhase1PMTData::ASYMM_MIN, HcalItemCollById< Item >::at(), CaloRecHit::aux(), HFPreRecHit::charge(), HFPreRecHit::chargeAsymmetry(), HFPhase1PMTData::cut(), Exception, HFRecHit::getAuxHF(), CaloRecHitAuxSetter::getField(), HcalPhase1FlagLabels::HFSignalAsymmetry, HFRecHit::id(), HFPreRecHit::id(), HFRecHitAuxSetter::MASK_STATUS, HFPhase1PMTData::minChargeAsymm(), HFRecHitAuxSetter::OFF_STATUS, HFAnodeStatus::OK, pmtInfo_, lumiQueryAPI::q, DetId::rawId(), HFSimpleTimeCheck::reconstruct(), CaloRecHit::setFlagField(), and mitigatedMETSequence_cff::U.

Referenced by configure().

65 {
66  // The algorithm must be configured by now
67  if (!algoConf_)
68  throw cms::Exception("HFPhase1BadConfig")
69  << "In HFFlexibleTimeCheck::reconstruct: algorithm is not configured";
70 
71  // Fetch the algorithm configuration data for this PMT
72  pmtInfo_ = &algoConf_->at(prehit.id());
73 
74  // Run the reconstruction algorithm from the base class
76  prehit, calibs, flaggedBadInDB, expectSingleAnodePMT);
77 
78  if (rh.id().rawId())
79  {
80  // Check the charge asymmetry between the two anodes
81  bool setAsymmetryFlag = true;
83  {
84  using namespace CaloRecHitAuxSetter;
85 
86  const unsigned st0 = getField(rh.aux(), HFRecHitAuxSetter::MASK_STATUS,
88  const unsigned st1 = getField(rh.getAuxHF(), HFRecHitAuxSetter::MASK_STATUS,
90  setAsymmetryFlag = st0 == HFAnodeStatus::OK && st1 == HFAnodeStatus::OK;
91  }
92 
93  if (setAsymmetryFlag)
94  {
95  bool passesAsymmetryCut = true;
96  const std::pair<float,bool> qAsymm =
98  if (qAsymm.second)
99  {
100  const float q = prehit.charge();
101  const float minAsymm = (pmtInfo_->cut(HFPhase1PMTData::ASYMM_MIN))(q);
102  const float maxAsymm = (pmtInfo_->cut(HFPhase1PMTData::ASYMM_MAX))(q);
103  passesAsymmetryCut = minAsymm <= qAsymm.first && qAsymm.first <= maxAsymm;
104  }
105  if (!passesAsymmetryCut)
107  }
108  }
109 
110  return rh;
111 }
float minChargeAsymm() const
const HFPhase1PMTParams * algoConf_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
bool alwaysCalculatingQAsym() const
constexpr void setFlagField(uint32_t value, int base, int width=1)
Definition: CaloRecHit.h:38
static const unsigned OFF_STATUS
const Item & at(const HcalDetId &id) const
HcalDetId id() const
Definition: HFPreRecHit.h:38
static const unsigned MASK_STATUS
const AbsHcalFunctor & cut(const unsigned which) const
constexpr unsigned getField(const uint32_t u, const unsigned mask, const unsigned offset)
HFRecHit reconstruct(const HFPreRecHit &prehit, const HcalCalibrations &calibs, const bool flaggedBadInDB[2], bool expectSingleAnodePMT) override
float charge() const
Definition: HFPreRecHit.h:51
uint32_t getAuxHF() const
Definition: HFRecHit.h:34
constexpr uint32_t aux() const
Definition: CaloRecHit.h:52
std::pair< float, bool > chargeAsymmetry(float chargeThreshold) const
Definition: HFPreRecHit.cc:3
HcalDetId id() const
Definition: HFRecHit.h:31
const HFPhase1PMTData * pmtInfo_

Member Data Documentation

const HFPhase1PMTParams* HFFlexibleTimeCheck::algoConf_ = 0
private

Definition at line 32 of file HFFlexibleTimeCheck.h.

Referenced by configure(), and reconstruct().

const HFPhase1PMTData* HFFlexibleTimeCheck::pmtInfo_ = 0
private

Definition at line 33 of file HFFlexibleTimeCheck.h.

Referenced by determineAnodeStatus(), and reconstruct().