CMS 3D CMS Logo

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

#include <EcalRecHitSimpleAlgo.h>

Inheritance diagram for EcalRecHitSimpleAlgo:
EcalRecHitAbsAlgo

Public Member Functions

 EcalRecHitSimpleAlgo ()
 
EcalRecHit makeRecHit (const EcalUncalibratedRecHit &uncalibRH, const float &intercalibConstant, const float &timeIntercalib=0, const uint32_t &flags=0) const override
 Compute parameters. More...
 
void setADCToGeVConstant (const float &value) override
 make rechits from dataframes More...
 
 ~EcalRecHitSimpleAlgo () override
 
- Public Member Functions inherited from EcalRecHitAbsAlgo
virtual ~EcalRecHitAbsAlgo ()
 Constructor. More...
 

Private Attributes

float adcToGeVConstant_
 
bool adcToGeVConstantIsSet_
 

Detailed Description

Simple algoritm to make rechits from uncalibrated rechits

Author
Shahram Rahatlou, University of Rome & INFN, March 2006

Definition at line 15 of file EcalRecHitSimpleAlgo.h.

Constructor & Destructor Documentation

◆ EcalRecHitSimpleAlgo()

EcalRecHitSimpleAlgo::EcalRecHitSimpleAlgo ( )
inline

Definition at line 18 of file EcalRecHitSimpleAlgo.h.

18  {
19  adcToGeVConstant_ = -1;
20  adcToGeVConstantIsSet_ = false;
21  }

References adcToGeVConstant_, and adcToGeVConstantIsSet_.

◆ ~EcalRecHitSimpleAlgo()

EcalRecHitSimpleAlgo::~EcalRecHitSimpleAlgo ( )
inlineoverride

Definition at line 29 of file EcalRecHitSimpleAlgo.h.

29 {};

Member Function Documentation

◆ makeRecHit()

EcalRecHit EcalRecHitSimpleAlgo::makeRecHit ( const EcalUncalibratedRecHit uncalibRH,
const float &  intercalibConstant,
const float &  timeIntercalib = 0,
const uint32_t &  flags = 0 
) const
inlineoverridevirtual

Compute parameters.

Implements EcalRecHitAbsAlgo.

Definition at line 32 of file EcalRecHitSimpleAlgo.h.

35  {
37  std::cout << "EcalRecHitSimpleAlgo::makeRecHit: adcToGeVConstant_ not set before calling this method!"
38  << " will use -1 and produce bogus rechits!" << std::endl;
39  }
40 
41  float clockToNsConstant = 25;
42  float energy = uncalibRH.amplitude() * adcToGeVConstant_ * intercalibConstant;
43  float time = uncalibRH.jitter() * clockToNsConstant + timeIntercalib;
44 
45  EcalRecHit rh(uncalibRH.id(), energy, time);
46  rh.setChi2(uncalibRH.chi2());
47  rh.setEnergyError(uncalibRH.amplitudeError() * adcToGeVConstant_ * intercalibConstant);
48  /* rh.setOutOfTimeEnergy( uncalibRH.outOfTimeEnergy() * adcToGeVConstant_ * intercalibConstant ); */
49  /* rh.setOutOfTimeChi2( uncalibRH.outOfTimeChi2() ); */
50  rh.setTimeError(uncalibRH.jitterErrorBits());
51 
52  // Now fill flags
53 
54  bool good = true;
55 
58  good = false;
59  }
61  // leading edge recovery failed - still keep the information
62  // about the saturation and do not flag as dead
63  rh.setFlag(EcalRecHit::kSaturated);
64  good = false;
65  }
66  if (uncalibRH.isSaturated()) {
67  rh.setFlag(EcalRecHit::kSaturated);
68  good = false;
69  }
71  rh.setFlag(EcalRecHit::kOutOfTime);
72  good = false;
73  }
75  rh.setFlag(EcalRecHit::kPoorReco);
76  good = false;
77  }
80  }
83  }
84 
85  if (good)
86  rh.setFlag(EcalRecHit::kGood);
87  return rh;
88  }

References adcToGeVConstant_, adcToGeVConstantIsSet_, EcalUncalibratedRecHit::amplitude(), EcalUncalibratedRecHit::amplitudeError(), EcalUncalibratedRecHit::checkFlag(), EcalUncalibratedRecHit::chi2(), gather_cfg::cout, HCALHighEnergyHPDFilter_cfi::energy, EcalUncalibratedRecHit::id(), EcalUncalibratedRecHit::isSaturated(), EcalUncalibratedRecHit::jitter(), EcalUncalibratedRecHit::jitterErrorBits(), EcalRecHit::kGood, EcalUncalibratedRecHit::kHasSwitchToGain1, EcalRecHit::kHasSwitchToGain1, EcalUncalibratedRecHit::kHasSwitchToGain6, EcalRecHit::kHasSwitchToGain6, EcalUncalibratedRecHit::kLeadingEdgeRecovered, EcalRecHit::kLeadingEdgeRecovered, EcalUncalibratedRecHit::kOutOfTime, EcalRecHit::kOutOfTime, EcalUncalibratedRecHit::kPoorReco, EcalRecHit::kPoorReco, EcalUncalibratedRecHit::kSaturated, EcalRecHit::kSaturated, EcalRecHit::setChi2(), and ntuplemaker::time.

Referenced by EcalRecHitWorkerSimple::run().

◆ setADCToGeVConstant()

void EcalRecHitSimpleAlgo::setADCToGeVConstant ( const float &  value)
inlineoverridevirtual

make rechits from dataframes

Implements EcalRecHitAbsAlgo.

Definition at line 23 of file EcalRecHitSimpleAlgo.h.

23  {
26  }

References adcToGeVConstant_, adcToGeVConstantIsSet_, and relativeConstraints::value.

Referenced by EcalRecHitWorkerSimple::run().

Member Data Documentation

◆ adcToGeVConstant_

float EcalRecHitSimpleAlgo::adcToGeVConstant_
private

Definition at line 91 of file EcalRecHitSimpleAlgo.h.

Referenced by EcalRecHitSimpleAlgo(), makeRecHit(), and setADCToGeVConstant().

◆ adcToGeVConstantIsSet_

bool EcalRecHitSimpleAlgo::adcToGeVConstantIsSet_
private

Definition at line 92 of file EcalRecHitSimpleAlgo.h.

Referenced by EcalRecHitSimpleAlgo(), makeRecHit(), and setADCToGeVConstant().

EcalUncalibratedRecHit::kHasSwitchToGain6
Definition: EcalUncalibratedRecHit.h:18
EcalRecHit
Definition: EcalRecHit.h:15
EcalRecHit::kHasSwitchToGain6
Definition: EcalRecHit.h:37
EcalUncalibratedRecHit::amplitude
float amplitude() const
Definition: EcalUncalibratedRecHit.h:28
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EcalRecHit::kSaturated
Definition: EcalRecHit.h:27
EcalUncalibratedRecHit::jitterErrorBits
uint8_t jitterErrorBits() const
Definition: EcalUncalibratedRecHit.cc:94
EcalRecHitSimpleAlgo::adcToGeVConstant_
float adcToGeVConstant_
Definition: EcalRecHitSimpleAlgo.h:91
EcalRecHit::setChi2
void setChi2(float chi2)
Definition: EcalRecHit.h:125
EcalUncalibratedRecHit::kPoorReco
Definition: EcalUncalibratedRecHit.h:14
EcalUncalibratedRecHit::kLeadingEdgeRecovered
Definition: EcalUncalibratedRecHit.h:17
EcalUncalibratedRecHit::kOutOfTime
Definition: EcalUncalibratedRecHit.h:16
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
EcalRecHit::kGood
Definition: EcalRecHit.h:21
EcalRecHitSimpleAlgo::adcToGeVConstantIsSet_
bool adcToGeVConstantIsSet_
Definition: EcalRecHitSimpleAlgo.h:92
EcalRecHit::kPoorReco
Definition: EcalRecHit.h:22
EcalRecHit::kLeadingEdgeRecovered
Definition: EcalRecHit.h:28
EcalRecHit::kOutOfTime
Definition: EcalRecHit.h:23
EcalUncalibratedRecHit::id
DetId id() const
Definition: EcalUncalibratedRecHit.h:38
EcalUncalibratedRecHit::checkFlag
bool checkFlag(Flags flag) const
Definition: EcalUncalibratedRecHit.cc:109
EcalUncalibratedRecHit::chi2
float chi2() const
Definition: EcalUncalibratedRecHit.h:32
EcalUncalibratedRecHit::amplitudeError
float amplitudeError() const
Definition: EcalUncalibratedRecHit.h:29
EcalRecHit::kHasSwitchToGain1
Definition: EcalRecHit.h:38
relativeConstraints.value
value
Definition: relativeConstraints.py:53
EcalUncalibratedRecHit::isSaturated
bool isSaturated() const
Definition: EcalUncalibratedRecHit.cc:27
EcalUncalibratedRecHit::kSaturated
Definition: EcalUncalibratedRecHit.h:15
EcalUncalibratedRecHit::jitter
float jitter() const
Definition: EcalUncalibratedRecHit.h:31
EcalUncalibratedRecHit::kHasSwitchToGain1
Definition: EcalUncalibratedRecHit.h:19
ntuplemaker.time
time
Definition: ntuplemaker.py:310