CMS 3D CMS Logo

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

#include <HGCalRecHitSimpleAlgo.h>

Inheritance diagram for HGCalRecHitSimpleAlgo:
HGCalRecHitAbsAlgo

Public Member Functions

 HGCalRecHitSimpleAlgo ()
 
HGCRecHit makeRecHit (const HGCUncalibratedRecHit &uncalibRH, const uint32_t &flags=0) const override
 Compute parameters. More...
 
void setADCToGeVConstant (const float value) override
 
void setLayerWeights (const std::vector< float > &weights) override
 make rechits from dataframes More...
 
 ~HGCalRecHitSimpleAlgo () override
 
- Public Member Functions inherited from HGCalRecHitAbsAlgo
virtual ~HGCalRecHitAbsAlgo ()
 Constructor. More...
 

Private Attributes

float adcToGeVConstant_
 
bool adcToGeVConstantIsSet_
 
std::vector< float > weights_
 

Detailed Description

Simple algoritm to make HGCAL rechits from HGCAL uncalibrated rechits , following Ecal sceleton

Author
Valeri Andreev

Simple algoritm to make HGCAL rechits from HGCAL uncalibrated rechits

Author
Valeri Andreev

Definition at line 20 of file HGCalRecHitSimpleAlgo.h.

Constructor & Destructor Documentation

HGCalRecHitSimpleAlgo::HGCalRecHitSimpleAlgo ( )
inline

Definition at line 23 of file HGCalRecHitSimpleAlgo.h.

References adcToGeVConstant_, and adcToGeVConstantIsSet_.

HGCalRecHitSimpleAlgo::~HGCalRecHitSimpleAlgo ( )
inlineoverride

Definition at line 39 of file HGCalRecHitSimpleAlgo.h.

39 { };

Member Function Documentation

HGCRecHit HGCalRecHitSimpleAlgo::makeRecHit ( const HGCUncalibratedRecHit uncalibRH,
const uint32_t &  flags = 0 
) const
inlineoverridevirtual

Compute parameters.

Implements HGCalRecHitAbsAlgo.

Definition at line 42 of file HGCalRecHitSimpleAlgo.h.

References adcToGeVConstantIsSet_, HGCUncalibratedRecHit::amplitude(), HcalDetId::depth(), DetId::det(), Exception, DetId::Forward, DetId::Hcal, HcalEndcap, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, HGCEE, HGCHEF, HGCUncalibratedRecHit::id(), HGCUncalibratedRecHit::jitter(), HGCRecHit::kGood, HGCScintillatorDetId::layer(), HGCalDetId::layer(), HGCSiliconDetId::layer(), DetId::rawId(), HGCRecHit::setFlag(), DetId::subdetId(), ntuplemaker::time, and weights_.

43  {
44 
46  throw cms::Exception("HGCalRecHitSimpleAlgoBadConfig")
47  << "makeRecHit: adcToGeVConstant_ not set before calling this method!";
48  }
49 
50  DetId baseid = uncalibRH.id();
51  unsigned layer = 0;
52  if( DetId::Hcal == baseid.det() && HcalEndcap == baseid.subdetId() ) {
53  layer = HcalDetId(baseid).depth() + 40;
54  } else if ( DetId::Forward == baseid.det() && HGCEE == baseid.subdetId() ) {
55  layer = HGCalDetId(baseid).layer();
56  } else if ( DetId::Forward == baseid.det() && HGCHEF == baseid.subdetId() ) {
57  layer = HGCalDetId(baseid).layer() + 28;
58  } else if ( DetId::HGCalEE == baseid.det() ) {
59  layer = HGCSiliconDetId(baseid).layer();
60  } else if ( DetId::HGCalHSi == baseid.det() ) {
61  layer = HGCSiliconDetId(baseid).layer() + 28;
62  } else if ( DetId::HGCalHSc == baseid.det() ) {
63  layer = HGCScintillatorDetId(baseid).layer() + 28;
64  } else {
65  throw cms::Exception("InvalidRecHit")
66  << "HGCalRecHitSimpleAlgo encountered a non-HGCal det id: " << baseid.det() << ' ' << baseid.subdetId() << ' ' << baseid.rawId();
67  }
68 
69  // float clockToNsConstant = 25;
70  float energy = uncalibRH.amplitude() * weights_[layer] * 0.001f;
71  float time = uncalibRH.jitter();
72 
73  //if(time<0) time = 0; // fast-track digi conversion
74 
75  HGCRecHit rh( uncalibRH.id(), energy, time );
76 
77  // Now fill flags
78  // all rechits from the digitizer are "good" at present
80 
81  return rh;
82  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
void setFlag(int flag)
set the flags (from Flags or ESFlags)
Definition: HGCRecHit.h:95
int depth() const
get the tower depth
Definition: HcalDetId.h:162
int layer() const
get the layer #
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
Definition: DetId.h:18
int layer() const
get the layer #
std::vector< float > weights_
int layer() const
get the layer #
Definition: HGCalDetId.h:48
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
void HGCalRecHitSimpleAlgo::setADCToGeVConstant ( const float  value)
inlineoverridevirtual
void HGCalRecHitSimpleAlgo::setLayerWeights ( const std::vector< float > &  weights)
inlineoverridevirtual

make rechits from dataframes

Reimplemented from HGCalRecHitAbsAlgo.

Definition at line 28 of file HGCalRecHitSimpleAlgo.h.

References create_public_lumi_plots::weights, and weights_.

Member Data Documentation

float HGCalRecHitSimpleAlgo::adcToGeVConstant_
private

Definition at line 85 of file HGCalRecHitSimpleAlgo.h.

Referenced by HGCalRecHitSimpleAlgo(), and setADCToGeVConstant().

bool HGCalRecHitSimpleAlgo::adcToGeVConstantIsSet_
private

Definition at line 86 of file HGCalRecHitSimpleAlgo.h.

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

std::vector<float> HGCalRecHitSimpleAlgo::weights_
private

Definition at line 87 of file HGCalRecHitSimpleAlgo.h.

Referenced by makeRecHit(), and setLayerWeights().