CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HGCalUncalibRecHitRecWeightsAlgo< C > Class Template Reference

#include <HGCalUncalibRecHitRecWeightsAlgo.h>

Public Member Functions

bool isSiFESim () const
 
virtual HGCUncalibratedRecHit makeRecHit (const C &dataFrame)
 Compute HGCUncalibratedRecHit from DataFrame. More...
 
void set_ADCLSB (const double adclsb)
 
void set_fCPerMIP (const std::vector< double > &fCPerMIP)
 
void set_isSiFESim (const bool isSiFE)
 
void set_TDCLSB (const double tdclsb)
 
void set_tdcOnsetfC (const double tdcOnset)
 
void set_toaLSBToNS (const double lsb2ns)
 
void setGeometry (const HGCalGeometry *geom)
 
virtual ~HGCalUncalibRecHitRecWeightsAlgo ()
 

Private Attributes

double adcLSB_
 
const HGCalDDDConstantsddd_
 
std::vector< double > fCPerMIP_
 
bool isSiFESim_
 
double tdcLSB_
 
double tdcOnsetfC_
 
double toaLSBToNS_
 

Detailed Description

template<class C>
class HGCalUncalibRecHitRecWeightsAlgo< C >

Template used to produce fast-track HGCAL Reco, weight=1

Author
Valeri Andreev

Definition at line 21 of file HGCalUncalibRecHitRecWeightsAlgo.h.

Constructor & Destructor Documentation

◆ ~HGCalUncalibRecHitRecWeightsAlgo()

template<class C>
virtual HGCalUncalibRecHitRecWeightsAlgo< C >::~HGCalUncalibRecHitRecWeightsAlgo ( )
inlinevirtual

Definition at line 24 of file HGCalUncalibRecHitRecWeightsAlgo.h.

24 {};

Member Function Documentation

◆ isSiFESim()

template<class C>
bool HGCalUncalibRecHitRecWeightsAlgo< C >::isSiFESim ( ) const
inline

◆ makeRecHit()

template<class C>
virtual HGCUncalibratedRecHit HGCalUncalibRecHitRecWeightsAlgo< C >::makeRecHit ( const C &  dataFrame)
inlinevirtual

Compute HGCUncalibratedRecHit from DataFrame.

Definition at line 51 of file HGCalUncalibRecHitRecWeightsAlgo.h.

51  {
52  double amplitude_(-1.), pedestal_(-1.), jitter_(-1.), chi2_(-1.);
53  uint32_t flag = 0;
54 
55  constexpr int iSample = 2; //only in-time sample
56  const auto& sample = dataFrame.sample(iSample);
57 
58  // Were digis done w/ the complete digitization and using signal shape?
59  // (originally done only for the silicon, while for scitillator it was trivial. Fomr 11_ also scinti uses shape)
60  if (isSiFESim_) {
61  // mode == true: TDC readout was activated and amplitude comes from TimeOverThreshold
62  if (sample.mode()) {
63  flag = !sample.threshold(); // raise flag if busy cell
64  // LG (23/06/2015):
65  // to get a continuous energy spectrum we must add here the maximum value in fC ever
66  // reported by the ADC. Namely: floor(tdcOnset/adcLSB_) * adcLSB_
67  // need to increment by one so TDC doesn't overlap with ADC last bin
68  // LG (11/04/2016):
69  // offset the TDC upwards to reflect the bin center
70  amplitude_ = (std::floor(tdcOnsetfC_ / adcLSB_) + 1.0) * adcLSB_ + (double(sample.data()) + 0.5) * tdcLSB_;
71 
72  if (sample.getToAValid()) {
73  jitter_ = double(sample.toa()) * toaLSBToNS_;
74  }
75  } else {
76  amplitude_ = double(sample.data()) * adcLSB_; // why do we not have +0.5 here ?
77  if (sample.getToAValid()) {
78  jitter_ = double(sample.toa()) * toaLSBToNS_;
79  }
80  } //isSiFESim_
81  } //mode()
82 
83  // trivial digitization, i.e. no signal shape
84  else {
85  amplitude_ = double(sample.data()) * adcLSB_;
86  }
87 
88  int thickness = (ddd_ != nullptr) ? ddd_->waferType(dataFrame.id()) : 0;
89  amplitude_ = amplitude_ / fCPerMIP_[thickness];
90 
91  LogDebug("HGCUncalibratedRecHit") << "isSiFESim_: " << isSiFESim_ << " ADC+: set the charge to: " << amplitude_
92  << ' ' << sample.data() << ' ' << adcLSB_ << ' '
93  << " TDC+: set the ToA to: " << jitter_ << ' ' << sample.toa()
94  << ' ' << toaLSBToNS_ << ' ' << tdcLSB_
95  << " getToAValid(): " << sample.getToAValid()
96  << " mode(): " << sample.mode() << std::endl;
97  LogDebug("HGCUncalibratedRecHit") << "Final uncalibrated amplitude : " << amplitude_ << std::endl;
98 
99  return HGCUncalibratedRecHit(dataFrame.id(), amplitude_, pedestal_, jitter_, chi2_, flag);
100  }
int waferType(DetId const &id, bool fromFile=false) const
#define LogDebug(id)

◆ set_ADCLSB()

template<class C>
void HGCalUncalibRecHitRecWeightsAlgo< C >::set_ADCLSB ( const double  adclsb)
inline

Definition at line 29 of file HGCalUncalibRecHitRecWeightsAlgo.h.

Referenced by configureIt().

◆ set_fCPerMIP()

template<class C>
void HGCalUncalibRecHitRecWeightsAlgo< C >::set_fCPerMIP ( const std::vector< double > &  fCPerMIP)
inline

Definition at line 36 of file HGCalUncalibRecHitRecWeightsAlgo.h.

Referenced by configureIt().

36  {
37  if (std::any_of(fCPerMIP.cbegin(), fCPerMIP.cend(), [](double conv) { return conv <= 0.0; })) {
38  throw cms::Exception("BadConversionFactor") << "At least one of fCPerMIP is zero!" << std::endl;
39  }
41  }
EPOS::IO_EPOS conv

◆ set_isSiFESim()

template<class C>
void HGCalUncalibRecHitRecWeightsAlgo< C >::set_isSiFESim ( const bool  isSiFE)
inline

◆ set_TDCLSB()

template<class C>
void HGCalUncalibRecHitRecWeightsAlgo< C >::set_TDCLSB ( const double  tdclsb)
inline

Definition at line 30 of file HGCalUncalibRecHitRecWeightsAlgo.h.

Referenced by configureIt().

◆ set_tdcOnsetfC()

template<class C>
void HGCalUncalibRecHitRecWeightsAlgo< C >::set_tdcOnsetfC ( const double  tdcOnset)
inline

◆ set_toaLSBToNS()

template<class C>
void HGCalUncalibRecHitRecWeightsAlgo< C >::set_toaLSBToNS ( const double  lsb2ns)
inline

Definition at line 32 of file HGCalUncalibRecHitRecWeightsAlgo.h.

Referenced by configureIt().

◆ setGeometry()

template<class C>
void HGCalUncalibRecHitRecWeightsAlgo< C >::setGeometry ( const HGCalGeometry geom)
inline

Definition at line 43 of file HGCalUncalibRecHitRecWeightsAlgo.h.

43  {
44  if (geom)
45  ddd_ = &(geom->topology().dddConstants());
46  else
47  ddd_ = nullptr;
48  }

Member Data Documentation

◆ adcLSB_

template<class C>
double HGCalUncalibRecHitRecWeightsAlgo< C >::adcLSB_
private

◆ ddd_

template<class C>
const HGCalDDDConstants* HGCalUncalibRecHitRecWeightsAlgo< C >::ddd_
private

◆ fCPerMIP_

template<class C>
std::vector<double> HGCalUncalibRecHitRecWeightsAlgo< C >::fCPerMIP_
private

◆ isSiFESim_

template<class C>
bool HGCalUncalibRecHitRecWeightsAlgo< C >::isSiFESim_
private

◆ tdcLSB_

template<class C>
double HGCalUncalibRecHitRecWeightsAlgo< C >::tdcLSB_
private

◆ tdcOnsetfC_

template<class C>
double HGCalUncalibRecHitRecWeightsAlgo< C >::tdcOnsetfC_
private

◆ toaLSBToNS_

template<class C>
double HGCalUncalibRecHitRecWeightsAlgo< C >::toaLSBToNS_
private