CMS 3D CMS Logo

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

Public Member Functions

template<class Digi >
void analyze (const Digi &digi)
 
 CastorDigiStatistics (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

Castor digis Author: Panos Katsas

Definition at line 21 of file CastorDigiAnalyzer.cc.

Constructor & Destructor Documentation

◆ CastorDigiStatistics()

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

Definition at line 23 of file CastorDigiAnalyzer.cc.

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

Member Function Documentation

◆ analyze()

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

Definition at line 50 of file CastorDigiAnalyzer.cc.

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

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

Member Data Documentation

◆ amplitudeAnalyzer_

CaloHitAnalyzer& CastorDigiStatistics::amplitudeAnalyzer_
private

Definition at line 46 of file CastorDigiAnalyzer.cc.

Referenced by analyze().

◆ amplitudeThreshold_

float CastorDigiStatistics::amplitudeThreshold_
private

Definition at line 42 of file CastorDigiAnalyzer.cc.

Referenced by analyze().

◆ binNextToBinMax_

CaloValidationStatistics CastorDigiStatistics::binNextToBinMax_
private

Definition at line 45 of file CastorDigiAnalyzer.cc.

Referenced by analyze().

◆ binPrevToBinMax_

CaloValidationStatistics CastorDigiStatistics::binPrevToBinMax_
private

Definition at line 44 of file CastorDigiAnalyzer.cc.

Referenced by analyze().

◆ maxBin_

int CastorDigiStatistics::maxBin_
private

Definition at line 41 of file CastorDigiAnalyzer.cc.

Referenced by analyze().

◆ pedestal_

CaloValidationStatistics CastorDigiStatistics::pedestal_
private

Definition at line 43 of file CastorDigiAnalyzer.cc.

Referenced by analyze().