CMS 3D CMS Logo

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

Public Member Functions

template<class Digi >
void analyze (const Digi &digi)
 
 HcalDigiStatistics (std::string name, int maxBin, float amplitudeThreshold, float expectedPedestal, float binPrevToBinMax, float binNextToBinMax, CaloHitAnalyzer &amplitudeAnalyzer)
 

Private Attributes

CaloHitAnalyzeramplitudeAnalyzer_
 
float amplitudeThreshold_
 
CaloValidationStatistics binNextToBinMax_
 
CaloValidationStatistics binPrevToBinMax_
 
int maxBin_
 
CaloValidationStatistics pedestal_
 

Detailed Description

Studies Hcal digis

Rick Wilkinson, Caltech

Definition at line 23 of file HcalDigiAnalyzer.cc.

Constructor & Destructor Documentation

◆ HcalDigiStatistics()

HcalDigiStatistics::HcalDigiStatistics ( std::string  name,
int  maxBin,
float  amplitudeThreshold,
float  expectedPedestal,
float  binPrevToBinMax,
float  binNextToBinMax,
CaloHitAnalyzer amplitudeAnalyzer 
)
inline

Definition at line 25 of file HcalDigiAnalyzer.cc.

32  : maxBin_(maxBin),
34  pedestal_(name + " pedestal", expectedPedestal, 0.),
35  binPrevToBinMax_(name + " binPrevToBinMax", binPrevToBinMax, 0.),
36  binNextToBinMax_(name + " binNextToBinMax", binNextToBinMax, 0.),
37  amplitudeAnalyzer_(amplitudeAnalyzer) {}
CaloValidationStatistics pedestal_
CaloValidationStatistics binPrevToBinMax_
constexpr unsigned int maxBin
CaloValidationStatistics binNextToBinMax_
CaloHitAnalyzer & amplitudeAnalyzer_

Member Function Documentation

◆ analyze()

template<class Digi >
void HcalDigiStatistics::analyze ( const Digi &  digi)

Definition at line 52 of file HcalDigiAnalyzer.cc.

References gpuClustering::adc, CaloValidationStatistics::addEntry(), CustomPhysics_cfi::amplitude, amplitudeAnalyzer_, amplitudeThreshold_, CaloHitAnalyzer::analyze(), binNextToBinMax_, binPrevToBinMax_, maxBin_, and pedestal_.

52  {
53  pedestal_.addEntry(digi[0].adc());
54  pedestal_.addEntry(digi[1].adc());
55 
56  double pedestal_fC = 0.5 * (digi[0].nominal_fC() + digi[1].nominal_fC());
57 
58  double maxAmplitude = digi[maxBin_].nominal_fC() - pedestal_fC;
59 
60  if (maxAmplitude > amplitudeThreshold_) {
61  double binPrevToBinMax = (digi[maxBin_ - 1].nominal_fC() - pedestal_fC) / maxAmplitude;
62  binPrevToBinMax_.addEntry(binPrevToBinMax);
63 
64  double binNextToBinMax = (digi[maxBin_ + 1].nominal_fC() - pedestal_fC) / maxAmplitude;
65  binNextToBinMax_.addEntry(binNextToBinMax);
66 
67  double amplitude = digi[maxBin_].nominal_fC() + digi[maxBin_ + 1].nominal_fC() - 2 * pedestal_fC;
68 
69  amplitudeAnalyzer_.analyze(digi.id().rawId(), amplitude);
70  }
71 }
void analyze(int detId, double recEnergy)
to be called for each RecHit
CaloValidationStatistics pedestal_
CaloValidationStatistics binPrevToBinMax_
CaloValidationStatistics binNextToBinMax_
void addEntry(float value, float weight=1.)
CaloHitAnalyzer & amplitudeAnalyzer_
uint16_t *__restrict__ uint16_t const *__restrict__ adc

Member Data Documentation

◆ amplitudeAnalyzer_

CaloHitAnalyzer& HcalDigiStatistics::amplitudeAnalyzer_
private

Definition at line 48 of file HcalDigiAnalyzer.cc.

Referenced by analyze().

◆ amplitudeThreshold_

float HcalDigiStatistics::amplitudeThreshold_
private

Definition at line 44 of file HcalDigiAnalyzer.cc.

Referenced by analyze().

◆ binNextToBinMax_

CaloValidationStatistics HcalDigiStatistics::binNextToBinMax_
private

Definition at line 47 of file HcalDigiAnalyzer.cc.

Referenced by analyze().

◆ binPrevToBinMax_

CaloValidationStatistics HcalDigiStatistics::binPrevToBinMax_
private

Definition at line 46 of file HcalDigiAnalyzer.cc.

Referenced by analyze().

◆ maxBin_

int HcalDigiStatistics::maxBin_
private

Definition at line 43 of file HcalDigiAnalyzer.cc.

Referenced by analyze().

◆ pedestal_

CaloValidationStatistics HcalDigiStatistics::pedestal_
private

Definition at line 45 of file HcalDigiAnalyzer.cc.

Referenced by analyze().