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

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

Protected Member Functions

virtual 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

virtual HFFlexibleTimeCheck::~HFFlexibleTimeCheck ( )
inlinevirtual

Definition at line 12 of file HFFlexibleTimeCheck.h.

12 {}

Member Function Documentation

virtual bool HFFlexibleTimeCheck::configure ( const AbsHcalAlgoData config)
inlineoverridevirtual

Reimplemented from AbsHFPhase1Algo.

Definition at line 16 of file HFFlexibleTimeCheck.h.

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

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

Reimplemented from HFSimpleTimeCheck.

Definition at line 10 of file HFFlexibleTimeCheck.cc.

References HFQIE10Info::charge(), ALCARECOTkAlJpsiMuMu_cff::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().

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

Reimplemented from HFSimpleTimeCheck.

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

Reimplemented from HFSimpleTimeCheck.

Definition at line 59 of file HFFlexibleTimeCheck.cc.

References algoConf_, HFPhase1PMTData::ASYMM_MAX, HFPhase1PMTData::ASYMM_MIN, HcalItemCollById< Item >::at(), HFPreRecHit::charge(), HFPreRecHit::chargeAsymmetry(), HFPhase1PMTData::cut(), Exception, HcalPhase1FlagLabels::HFSignalAsymmetry, HFRecHit::id(), HFPreRecHit::id(), HFPhase1PMTData::minChargeAsymm(), pmtInfo_, lumiQueryAPI::q, DetId::rawId(), HFSimpleTimeCheck::reconstruct(), CaloRecHit::setFlagField(), and mitigatedMETSequence_cff::U.

Referenced by configure().

63 {
64  // The algorithm must be configured by now
65  if (!algoConf_)
66  throw cms::Exception("HFPhase1BadConfig")
67  << "In HFFlexibleTimeCheck::reconstruct: algorithm is not configured";
68 
69  // Fetch the algorithm configuration data for this PMT
70  pmtInfo_ = &algoConf_->at(prehit.id());
71 
72  // Run the reconstruction algorithm from the base class
74  prehit, calibs, flaggedBadInDB, expectSingleAnodePMT);
75 
76  if (rh.id().rawId())
77  {
78  // Check the charge asymmetry between the two anodes
79  bool passesAsymmetryCut = true;
80  const std::pair<float,bool> qAsymm =
82  if (qAsymm.second)
83  {
84  const float q = prehit.charge();
85  const float minAsymm = (pmtInfo_->cut(HFPhase1PMTData::ASYMM_MIN))(q);
86  const float maxAsymm = (pmtInfo_->cut(HFPhase1PMTData::ASYMM_MAX))(q);
87  passesAsymmetryCut = minAsymm <= qAsymm.first && qAsymm.first <= maxAsymm;
88  }
89  if (!passesAsymmetryCut)
91  }
92 
93  return rh;
94 }
float minChargeAsymm() const
const HFPhase1PMTParams * algoConf_
void setFlagField(uint32_t value, int base, int width=1)
Definition: CaloRecHit.cc:20
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const Item & at(const HcalDetId &id) const
HcalDetId id() const
Definition: HFPreRecHit.h:26
const AbsHcalFunctor & cut(const unsigned which) const
virtual HFRecHit reconstruct(const HFPreRecHit &prehit, const HcalCalibrations &calibs, const bool flaggedBadInDB[2], bool expectSingleAnodePMT) override
float charge() const
Definition: HFPreRecHit.cc:24
std::pair< float, bool > chargeAsymmetry(float chargeThreshold) const
Definition: HFPreRecHit.cc:50
HcalDetId id() const
Definition: HFRecHit.h:23
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().