CMS 3D CMS Logo

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

#include <HcalDigiStatistics.h>

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

Definition at line 9 of file HcalDigiStatistics.h.

Constructor & Destructor Documentation

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

Definition at line 12 of file HcalDigiStatistics.h.

References analyze().

19 : maxBin_(maxBin),
20  amplitudeThreshold_(amplitudeThreshold),
21  pedestal_(name+" pedestal", expectedPedestal, 0.),
22  binPrevToBinMax_(name+" binPrevToBinMax", binPrevToBinMax, 0.),
23  binNextToBinMax_(name+" binNextToBinMax", binNextToBinMax, 0.),
24  amplitudeAnalyzer_(amplitudeAnalyzer)
25 {
26 }
CaloValidationStatistics pedestal_
CaloValidationStatistics binPrevToBinMax_
CaloValidationStatistics binNextToBinMax_
CaloHitAnalyzer & amplitudeAnalyzer_

Member Function Documentation

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

Definition at line 42 of file HcalDigiStatistics.h.

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

Referenced by HcalDigiAnalyzerImpl::analyze(), and HcalDigiStatistics().

42  {
43  pedestal_.addEntry(digi[0].adc());
44  pedestal_.addEntry(digi[1].adc());
45 
46 
47  double pedestal_fC = 0.5*(digi[0].nominal_fC() + digi[1].nominal_fC());
48 
49 
50  double maxAmplitude = digi[maxBin_].nominal_fC() - pedestal_fC;
51 
52  if(maxAmplitude > amplitudeThreshold_) {
53 
54  double binPrevToBinMax = (digi[maxBin_-1].nominal_fC() - pedestal_fC)
55  / maxAmplitude;
56  binPrevToBinMax_.addEntry(binPrevToBinMax);
57 
58 
59  double binNextToBinMax = (digi[maxBin_+1].nominal_fC() - pedestal_fC)
60  / maxAmplitude;
61  binNextToBinMax_.addEntry(binNextToBinMax);
62 
63  double amplitude = digi[maxBin_].nominal_fC()
64  + digi[maxBin_+1].nominal_fC()
65  - 2*pedestal_fC;
66 
67 
68  amplitudeAnalyzer_.analyze(digi.id().rawId(), amplitude);
69 
70  }
71 }
int adc(sample_type sample)
get the ADC sample (12 bits)
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_

Member Data Documentation

CaloHitAnalyzer& HcalDigiStatistics::amplitudeAnalyzer_
private

Definition at line 37 of file HcalDigiStatistics.h.

Referenced by analyze().

float HcalDigiStatistics::amplitudeThreshold_
private

Definition at line 33 of file HcalDigiStatistics.h.

Referenced by analyze().

CaloValidationStatistics HcalDigiStatistics::binNextToBinMax_
private

Definition at line 36 of file HcalDigiStatistics.h.

Referenced by analyze().

CaloValidationStatistics HcalDigiStatistics::binPrevToBinMax_
private

Definition at line 35 of file HcalDigiStatistics.h.

Referenced by analyze().

int HcalDigiStatistics::maxBin_
private

Definition at line 32 of file HcalDigiStatistics.h.

Referenced by analyze().

CaloValidationStatistics HcalDigiStatistics::pedestal_
private

Definition at line 34 of file HcalDigiStatistics.h.

Referenced by analyze().