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::HcalDigiStatistics ( std::string  name,
int  maxBin,
float  amplitudeThreshold,
float  expectedPedestal,
float  binPrevToBinMax,
float  binNextToBinMax,
CaloHitAnalyzer amplitudeAnalyzer 
)
inline

Definition at line 11 of file HcalDigiStatistics.h.

18  : maxBin_(maxBin),
20  pedestal_(name + " pedestal", expectedPedestal, 0.),
21  binPrevToBinMax_(name + " binPrevToBinMax", binPrevToBinMax, 0.),
22  binNextToBinMax_(name + " binNextToBinMax", binNextToBinMax, 0.),
23  amplitudeAnalyzer_(amplitudeAnalyzer) {}

Member Function Documentation

◆ analyze()

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

Definition at line 38 of file HcalDigiStatistics.h.

38  {
39  pedestal_.addEntry(digi[0].adc());
40  pedestal_.addEntry(digi[1].adc());
41 
42  double pedestal_fC = 0.5 * (digi[0].nominal_fC() + digi[1].nominal_fC());
43 
44  double maxAmplitude = digi[maxBin_].nominal_fC() - pedestal_fC;
45 
46  if (maxAmplitude > amplitudeThreshold_) {
47  double binPrevToBinMax = (digi[maxBin_ - 1].nominal_fC() - pedestal_fC) / maxAmplitude;
48  binPrevToBinMax_.addEntry(binPrevToBinMax);
49 
50  double binNextToBinMax = (digi[maxBin_ + 1].nominal_fC() - pedestal_fC) / maxAmplitude;
51  binNextToBinMax_.addEntry(binNextToBinMax);
52 
53  double amplitude = digi[maxBin_].nominal_fC() + digi[maxBin_ + 1].nominal_fC() - 2 * pedestal_fC;
54 
55  amplitudeAnalyzer_.analyze(digi.id().rawId(), amplitude);
56  }
57 }

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

Member Data Documentation

◆ amplitudeAnalyzer_

CaloHitAnalyzer& HcalDigiStatistics::amplitudeAnalyzer_
private

Definition at line 34 of file HcalDigiStatistics.h.

Referenced by analyze().

◆ amplitudeThreshold_

float HcalDigiStatistics::amplitudeThreshold_
private

Definition at line 30 of file HcalDigiStatistics.h.

Referenced by analyze().

◆ binNextToBinMax_

CaloValidationStatistics HcalDigiStatistics::binNextToBinMax_
private

Definition at line 33 of file HcalDigiStatistics.h.

Referenced by analyze().

◆ binPrevToBinMax_

CaloValidationStatistics HcalDigiStatistics::binPrevToBinMax_
private

Definition at line 32 of file HcalDigiStatistics.h.

Referenced by analyze().

◆ maxBin_

int HcalDigiStatistics::maxBin_
private

Definition at line 29 of file HcalDigiStatistics.h.

Referenced by analyze().

◆ pedestal_

CaloValidationStatistics HcalDigiStatistics::pedestal_
private

Definition at line 31 of file HcalDigiStatistics.h.

Referenced by analyze().

CustomPhysics_cfi.amplitude
amplitude
Definition: CustomPhysics_cfi.py:12
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
HcalDigiStatistics::binNextToBinMax_
CaloValidationStatistics binNextToBinMax_
Definition: HcalDigiStatistics.h:33
HcalDigiStatistics::binPrevToBinMax_
CaloValidationStatistics binPrevToBinMax_
Definition: HcalDigiStatistics.h:32
HcalDigiStatistics::maxBin_
int maxBin_
Definition: HcalDigiStatistics.h:29
TestPulseClient_cfi.amplitudeThreshold
amplitudeThreshold
Definition: TestPulseClient_cfi.py:8
cms::cuda::allocator::maxBin
constexpr unsigned int maxBin
Definition: getCachingDeviceAllocator.h:20
CaloHitAnalyzer::analyze
void analyze(int detId, double recEnergy)
to be called for each RecHit
Definition: CaloHitAnalyzer.cc:47
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
HcalDigiStatistics::pedestal_
CaloValidationStatistics pedestal_
Definition: HcalDigiStatistics.h:31
HcalDigiStatistics::amplitudeThreshold_
float amplitudeThreshold_
Definition: HcalDigiStatistics.h:30
CaloValidationStatistics::addEntry
void addEntry(float value, float weight=1.)
Definition: CaloValidationStatistics.cc:18
HcalDigiStatistics::amplitudeAnalyzer_
CaloHitAnalyzer & amplitudeAnalyzer_
Definition: HcalDigiStatistics.h:34