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
 
 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
 
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_ = nullptr
 
const HFPhase1PMTDatapmtInfo_ = nullptr
 

Detailed Description

Definition at line 7 of file HFFlexibleTimeCheck.h.

Constructor & Destructor Documentation

◆ ~HFFlexibleTimeCheck()

HFFlexibleTimeCheck::~HFFlexibleTimeCheck ( )
inlineoverride

Definition at line 11 of file HFFlexibleTimeCheck.h.

11 {}

Member Function Documentation

◆ configure()

bool HFFlexibleTimeCheck::configure ( const AbsHcalAlgoData config)
inlineoverridevirtual

Reimplemented from AbsHFPhase1Algo.

Definition at line 15 of file HFFlexibleTimeCheck.h.

15  {
16  algoConf_ = dynamic_cast<const HFPhase1PMTParams*>(config);
17  return algoConf_;
18  }

References algoConf_.

◆ determineAnodeStatus()

unsigned HFFlexibleTimeCheck::determineAnodeStatus ( unsigned  anodeNumber,
const HFQIE10Info anode,
bool *  isTimingReliable 
) const
overrideprotectedvirtual

Reimplemented from HFSimpleTimeCheck.

Definition at line 12 of file HFFlexibleTimeCheck.cc.

14  {
15  // Return quickly if this anode has a dataframe error
16  if (!anode.isDataframeOK())
18 
19  // Require minimum charge for reliable timing measurement
20  const float charge = anode.charge();
21  const float minCharge = ianode ? pmtInfo_->minCharge1() : pmtInfo_->minCharge0();
22  if (charge < minCharge) {
23  *isTimingReliable = false;
24  return HFAnodeStatus::OK;
25  }
26 
27  // Special handling of under/overshoot TDC values, as well
28  // as of DLL failures
29  float trise = anode.timeRising();
33  *isTimingReliable = false;
34  return HFAnodeStatus::OK;
35  }
36 
37  // Check if the rise time information is meaningful
38  if (HcalSpecialTimes::isSpecial(trise))
40 
41  // Figure out the timing cuts for this PMT
44 
45  // Apply the timing cuts
46  trise += timeShift();
47  if (minTimeShape(charge) <= trise && trise <= maxTimeShape(charge))
48  return HFAnodeStatus::OK;
49  else
51 }

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.

◆ HFSimpleTimeCheck()

HFSimpleTimeCheck::HFSimpleTimeCheck

Definition at line 32 of file HFSimpleTimeCheck.cc.

42  : soiPhase_(i_soiPhase),
43  timeShift_(i_timeShift),
44  triseIfNoTDC_(i_triseIfNoTDC),
45  tfallIfNoTDC_(i_tfallIfNoTDC),
46  minChargeForUndershoot_(i_minChargeForUndershoot),
47  minChargeForOvershoot_(i_minChargeForOvershoot),
50  tlimits_[0] = tlimits[0];
51  tlimits_[1] = tlimits[1];
52  float* to = &energyWeights_[0][0];
53  const float* from = &energyWeights[0][0];
54  memcpy(to, from, sizeof(energyWeights_));
55 }

◆ isConfigurable()

bool HFFlexibleTimeCheck::isConfigurable ( ) const
inlineoverridevirtual

Implements AbsHFPhase1Algo.

Definition at line 14 of file HFFlexibleTimeCheck.h.

14 { return true; }

◆ reconstruct()

HFRecHit HFFlexibleTimeCheck::reconstruct ( const HFPreRecHit prehit,
const HcalCalibrations calibs,
const bool  flaggedBadInDB[2],
bool  expectSingleAnodePMT 
)
overridevirtual

Implements AbsHFPhase1Algo.

Definition at line 53 of file HFFlexibleTimeCheck.cc.

56  {
57  // The algorithm must be configured by now
58  if (!algoConf_)
59  throw cms::Exception("HFPhase1BadConfig") << "In HFFlexibleTimeCheck::reconstruct: algorithm is not configured";
60 
61  // Fetch the algorithm configuration data for this PMT
62  pmtInfo_ = &algoConf_->at(prehit.id());
63 
64  // Run the reconstruction algorithm from the base class
65  HFRecHit rh = HFSimpleTimeCheck::reconstruct(prehit, calibs, flaggedBadInDB, expectSingleAnodePMT);
66 
67  if (rh.id().rawId()) {
68  // Check the charge asymmetry between the two anodes
69  bool setAsymmetryFlag = true;
70  if (!alwaysCalculatingQAsym()) {
71  using namespace CaloRecHitAuxSetter;
72 
75  setAsymmetryFlag = st0 == HFAnodeStatus::OK && st1 == HFAnodeStatus::OK;
76  }
77 
78  if (setAsymmetryFlag) {
79  bool passesAsymmetryCut = true;
80  const std::pair<float, bool> qAsymm = prehit.chargeAsymmetry(pmtInfo_->minChargeAsymm());
81  if (qAsymm.second) {
82  const float q = prehit.charge();
83  const float minAsymm = (pmtInfo_->cut(HFPhase1PMTData::ASYMM_MIN))(q);
84  const float maxAsymm = (pmtInfo_->cut(HFPhase1PMTData::ASYMM_MAX))(q);
85  passesAsymmetryCut = minAsymm <= qAsymm.first && qAsymm.first <= maxAsymm;
86  }
87  if (!passesAsymmetryCut)
89  }
90  }
91 
92  return rh;
93 }

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_, submitPVResolutionJobs::q, DetId::rawId(), HFSimpleTimeCheck::reconstruct(), CaloRecHit::setFlagField(), and mitigatedMETSequence_cff::U.

Member Data Documentation

◆ algoConf_

const HFPhase1PMTParams* HFFlexibleTimeCheck::algoConf_ = nullptr
private

Definition at line 30 of file HFFlexibleTimeCheck.h.

Referenced by configure(), and reconstruct().

◆ pmtInfo_

const HFPhase1PMTData* HFFlexibleTimeCheck::pmtInfo_ = nullptr
private

Definition at line 31 of file HFFlexibleTimeCheck.h.

Referenced by determineAnodeStatus(), and reconstruct().

HcalSpecialTimes::UNKNOWN_T_DLL_FAILURE
constexpr float UNKNOWN_T_DLL_FAILURE
Definition: HcalSpecialTimes.h:38
AbsHcalFunctor
Definition: AbsHcalFunctor.h:19
HcalSpecialTimes::isSpecial
constexpr bool isSpecial(const float t)
Definition: HcalSpecialTimes.h:53
HFPreRecHit::chargeAsymmetry
std::pair< float, bool > chargeAsymmetry(float chargeThreshold) const
Definition: HFPreRecHit.cc:3
HFSimpleTimeCheck::tfallIfNoTDC_
float tfallIfNoTDC_
Definition: HFSimpleTimeCheck.h:101
HLT_FULL_cff.energyWeights
energyWeights
Definition: HLT_FULL_cff.py:8542
HcalSpecialTimes::UNKNOWN_T_UNDERSHOOT
constexpr float UNKNOWN_T_UNDERSHOOT
Definition: HcalSpecialTimes.h:28
to
HFRecHitAuxSetter::OFF_STATUS
static const unsigned OFF_STATUS
Definition: HFRecHitAuxSetter.h:32
HFRecHit::id
constexpr HcalDetId id() const
Definition: HFRecHit.h:26
HFQIE10Info::charge
constexpr float charge() const
Definition: HFQIE10Info.h:79
config
Definition: config.py:1
HFFlexibleTimeCheck::algoConf_
const HFPhase1PMTParams * algoConf_
Definition: HFFlexibleTimeCheck.h:30
HFPhase1PMTData::minChargeAsymm
float minChargeAsymm() const
Definition: HFPhase1PMTData.h:49
HFPhase1PMTData::T_0_MAX
Definition: HFPhase1PMTData.h:21
HFQIE10Info::timeRising
constexpr float timeRising() const
Definition: HFQIE10Info.h:81
HFRecHit
Definition: HFRecHit.h:11
HFAnodeStatus::HARDWARE_ERROR
Definition: HFAnodeStatus.h:10
HFSimpleTimeCheck::minChargeForOvershoot_
float minChargeForOvershoot_
Definition: HFSimpleTimeCheck.h:103
HFRecHitAuxSetter::MASK_STATUS
static const unsigned MASK_STATUS
Definition: HFRecHitAuxSetter.h:31
HFSimpleTimeCheck::alwaysCalculatingQAsym
bool alwaysCalculatingQAsym() const
Definition: HFSimpleTimeCheck.h:87
HFSimpleTimeCheck::timeShift
float timeShift() const
Definition: HFSimpleTimeCheck.h:81
HFSimpleTimeCheck::energyWeights_
float energyWeights_[2 *HFAnodeStatus::N_POSSIBLE_STATES - 1][2]
Definition: HFSimpleTimeCheck.h:97
CaloRecHitAuxSetter::getField
constexpr unsigned getField(const uint32_t u, const unsigned mask, const unsigned offset)
Definition: CaloRecHitAuxSetter.h:13
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
HFSimpleTimeCheck::alwaysQAsym_
bool alwaysQAsym_
Definition: HFSimpleTimeCheck.h:105
HFSimpleTimeCheck::rejectAllFailures_
bool rejectAllFailures_
Definition: HFSimpleTimeCheck.h:104
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
HFAnodeStatus::OK
Definition: HFAnodeStatus.h:7
HcalPhase1FlagLabels::HFSignalAsymmetry
Definition: HcalPhase1FlagLabels.h:22
HLT_FULL_cff.rejectAllFailures
rejectAllFailures
Definition: HLT_FULL_cff.py:8541
HFSimpleTimeCheck::soiPhase_
unsigned soiPhase_
Definition: HFSimpleTimeCheck.h:98
HFPreRecHit::charge
constexpr float charge() const
Definition: HFPreRecHit.h:47
HFPhase1PMTData::T_0_MIN
Definition: HFPhase1PMTData.h:19
HFPhase1PMTData::T_1_MIN
Definition: HFPhase1PMTData.h:22
HFPhase1PMTData::minCharge0
float minCharge0() const
Definition: HFPhase1PMTData.h:45
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
HcalSpecialTimes::UNKNOWN_T_OVERSHOOT
constexpr float UNKNOWN_T_OVERSHOOT
Definition: HcalSpecialTimes.h:35
HFSimpleTimeCheck::minChargeForUndershoot
float minChargeForUndershoot() const
Definition: HFSimpleTimeCheck.h:84
HFFlexibleTimeCheck::pmtInfo_
const HFPhase1PMTData * pmtInfo_
Definition: HFFlexibleTimeCheck.h:31
HFSimpleTimeCheck::timeShift_
float timeShift_
Definition: HFSimpleTimeCheck.h:99
HFRecHit::getAuxHF
constexpr uint32_t getAuxHF() const
Definition: HFRecHit.h:29
HFPhase1PMTData::T_1_MAX
Definition: HFPhase1PMTData.h:23
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HFPreRecHit::id
constexpr HcalDetId id() const
Definition: HFPreRecHit.h:34
HFPhase1PMTData::cut
const AbsHcalFunctor & cut(const unsigned which) const
Definition: HFPhase1PMTData.h:39
HFSimpleTimeCheck::tlimits_
std::pair< float, float > tlimits_[2]
Definition: HFSimpleTimeCheck.h:96
Exception
Definition: hltDiff.cc:246
HFPhase1PMTData::ASYMM_MAX
Definition: HFPhase1PMTData.h:26
HcalItemCollById::at
const Item & at(const HcalDetId &id) const
Definition: HcalItemCollById.h:90
HFSimpleTimeCheck::minChargeForOvershoot
float minChargeForOvershoot() const
Definition: HFSimpleTimeCheck.h:85
HFPhase1Reconstructor_cfi.alwaysCalculateQAsymmetry
alwaysCalculateQAsymmetry
Definition: HFPhase1Reconstructor_cfi.py:78
HFQIE10Info::isDataframeOK
bool isDataframeOK(bool checkAllTimeSlices=false) const
Definition: HFQIE10Info.h:94
HFSimpleTimeCheck::minChargeForUndershoot_
float minChargeForUndershoot_
Definition: HFSimpleTimeCheck.h:102
CaloRecHit::setFlagField
constexpr void setFlagField(uint32_t value, int base, int width=1)
Definition: CaloRecHit.h:36
CaloRecHit::aux
constexpr uint32_t aux() const
Definition: CaloRecHit.h:50
HFPhase1PMTData::ASYMM_MIN
Definition: HFPhase1PMTData.h:24
HFAnodeStatus::FAILED_TIMING
Definition: HFAnodeStatus.h:12
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
CaloRecHitAuxSetter
Definition: CaloRecHitAuxSetter.h:7
HFPhase1PMTData::minCharge1
float minCharge1() const
Definition: HFPhase1PMTData.h:46
HLT_FULL_cff.tlimits
tlimits
Definition: HLT_FULL_cff.py:8545