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 ()
 
virtual HGCRecHit makeRecHit (const HGCUncalibratedRecHit &uncalibRH, const uint32_t &flags=0) const override
 Compute parameters. More...
 
virtual void setADCToGeVConstant (const float value) override
 
virtual void setLayerWeights (const std::vector< float > &weights) override
 make rechits from dataframes More...
 
virtual ~HGCalRecHitSimpleAlgo ()
 
- 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 18 of file HGCalRecHitSimpleAlgo.h.

Constructor & Destructor Documentation

HGCalRecHitSimpleAlgo::HGCalRecHitSimpleAlgo ( )
inline

Definition at line 21 of file HGCalRecHitSimpleAlgo.h.

References adcToGeVConstant_, and adcToGeVConstantIsSet_.

virtual HGCalRecHitSimpleAlgo::~HGCalRecHitSimpleAlgo ( )
inlinevirtual

Definition at line 37 of file HGCalRecHitSimpleAlgo.h.

37 { };

Member Function Documentation

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

Compute parameters.

Implements HGCalRecHitAbsAlgo.

Definition at line 40 of file HGCalRecHitSimpleAlgo.h.

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

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

make rechits from dataframes

Reimplemented from HGCalRecHitAbsAlgo.

Definition at line 26 of file HGCalRecHitSimpleAlgo.h.

References create_public_lumi_plots::weights, and weights_.

Member Data Documentation

float HGCalRecHitSimpleAlgo::adcToGeVConstant_
private

Definition at line 80 of file HGCalRecHitSimpleAlgo.h.

Referenced by HGCalRecHitSimpleAlgo(), and setADCToGeVConstant().

bool HGCalRecHitSimpleAlgo::adcToGeVConstantIsSet_
private

Definition at line 81 of file HGCalRecHitSimpleAlgo.h.

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

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

Definition at line 82 of file HGCalRecHitSimpleAlgo.h.

Referenced by makeRecHit(), and setLayerWeights().