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 parameters. 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 20 of file HGCalUncalibRecHitRecWeightsAlgo.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file HGCalUncalibRecHitRecWeightsAlgo.h.

24 { };

Member Function Documentation

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

Compute parameters.

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  // are we using the SiFE Simulation?
59  if( isSiFESim_ ) {
60  // mode == true means TDC readout was activated
61  if( sample.mode() ) {
62  flag = !sample.threshold(); //raise flag if busy cell
63  // LG (23/06/2015):
64  //to get a continuous energy spectrum we must add here the maximum value in fC ever
65  //reported by the ADC. Namely: floor(tdcOnset/adcLSB_) * adcLSB_
66  // need to increment by one so TDC doesn't overlap with ADC last bin
67  // LG (11/04/2016):
68  // offset the TDC upwards to reflect the bin center
69  amplitude_ = ( std::floor(tdcOnsetfC_/adcLSB_) + 1.0 )* adcLSB_ + ( double(sample.data()) + 0.5) * tdcLSB_;
70  if(sample.getToAValid()) jitter_ = double(sample.toa()) * toaLSBToNS_;
71  LogDebug("HGCUncalibratedRecHit") << "TDC+: set the charge to: " << amplitude_ << ' ' << sample.data()
72  << ' ' << tdcLSB_ << std::endl
73  << "TDC+: set the ToA to: " << jitter_ << ' '
74  << sample.toa() << ' ' << toaLSBToNS_ << ' '
75  << " flag=" << flag << std::endl;
76  } else {
77  amplitude_ = double(sample.data()) * adcLSB_;
78  if(sample.getToAValid()) jitter_ = double(sample.toa()) * toaLSBToNS_;
79  LogDebug("HGCUncalibratedRecHit") << "ADC+: set the charge to: " << amplitude_ << ' ' << sample.data()
80  << ' ' << adcLSB_ << ' '
81  << "TDC+: set the ToA to: " << jitter_ << ' '
82  << sample.toa() << ' ' << toaLSBToNS_ << ' '<< std::endl;
83  }
84  } else {
85  amplitude_ = double(sample.data()) * adcLSB_;
86  LogDebug("HGCUncalibratedRecHit") << "ADC+: set the charge to: " << amplitude_ << ' ' << sample.data()
87  << ' ' << adcLSB_ << ' ' << std::endl;
88  }
89 
90  int thickness = (ddd_ != nullptr) ? ddd_->waferType(dataFrame.id()) : 1;
91  amplitude_ = amplitude_/fCPerMIP_[thickness-1];
92 
93  LogDebug("HGCUncalibratedRecHit") << "Final uncalibrated amplitude : " << amplitude_ << std::endl;
94 
95  return HGCUncalibratedRecHit( dataFrame.id(), amplitude_, pedestal_, jitter_, chi2_, flag);
96  }
#define LogDebug(id)
int waferType(DetId const &id) const
#define constexpr
template<class C>
void HGCalUncalibRecHitRecWeightsAlgo< C >::set_ADCLSB ( const double  adclsb)
inline

Definition at line 29 of file HGCalUncalibRecHitRecWeightsAlgo.h.

Referenced by configureIt().

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(),
38  fCPerMIP.cend(),
39  [](double conv){ return conv <= 0.0; }) ) {
40  throw cms::Exception("BadConversionFactor") << "At least one of fCPerMIP is zero!" << std::endl;
41  }
43  }
static HepMC::IO_HEPEVT conv
template<class C>
void HGCalUncalibRecHitRecWeightsAlgo< C >::set_isSiFESim ( const bool  isSiFE)
inline
template<class C>
void HGCalUncalibRecHitRecWeightsAlgo< C >::set_TDCLSB ( const double  tdclsb)
inline

Definition at line 30 of file HGCalUncalibRecHitRecWeightsAlgo.h.

Referenced by configureIt().

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

Definition at line 32 of file HGCalUncalibRecHitRecWeightsAlgo.h.

Referenced by configureIt().

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

Definition at line 45 of file HGCalUncalibRecHitRecWeightsAlgo.h.

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

Member Data Documentation

template<class C>
double HGCalUncalibRecHitRecWeightsAlgo< C >::adcLSB_
private
template<class C>
const HGCalDDDConstants* HGCalUncalibRecHitRecWeightsAlgo< C >::ddd_
private
template<class C>
std::vector<double> HGCalUncalibRecHitRecWeightsAlgo< C >::fCPerMIP_
private
template<class C>
bool HGCalUncalibRecHitRecWeightsAlgo< C >::isSiFESim_
private
template<class C>
double HGCalUncalibRecHitRecWeightsAlgo< C >::tdcLSB_
private
template<class C>
double HGCalUncalibRecHitRecWeightsAlgo< C >::tdcOnsetfC_
private
template<class C>
double HGCalUncalibRecHitRecWeightsAlgo< C >::toaLSBToNS_
private