CMS 3D CMS Logo

Public Member Functions | Private Attributes

CastorDigiStatistics Class Reference

#include <CastorDigiStatistics.h>

List of all members.

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

Definition at line 9 of file CastorDigiStatistics.h.


Constructor & Destructor Documentation

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

Definition at line 12 of file CastorDigiStatistics.h.

:  maxBin_(maxBin),
   amplitudeThreshold_(amplitudeThreshold),
   pedestal_(name+" pedestal", expectedPedestal, 0.),
   binPrevToBinMax_(name+" binPrevToBinMax", binPrevToBinMax, 0.),
   binNextToBinMax_(name+" binNextToBinMax", binNextToBinMax, 0.),
   amplitudeAnalyzer_(amplitudeAnalyzer)
{
}

Member Function Documentation

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

Definition at line 42 of file CastorDigiStatistics.h.

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

Referenced by CastorDigiAnalyzerImpl::analyze().

                                                    {
   pedestal_.addEntry(digi[0].adc());
   pedestal_.addEntry(digi[1].adc());
                                                                               
                                                                               
   double pedestal_fC = 0.5*(digi[0].nominal_fC() + digi[1].nominal_fC());
                                                                               
                                                                              
  double maxAmplitude = digi[maxBin_].nominal_fC()   - pedestal_fC;
                                                                              
  if(maxAmplitude > amplitudeThreshold_) {
                                                                              
    double binPrevToBinMax = (digi[maxBin_-1].nominal_fC() - pedestal_fC)
                           / maxAmplitude;
    binPrevToBinMax_.addEntry(binPrevToBinMax);
                                                                              
                                                                              
    double binNextToBinMax = (digi[maxBin_+1].nominal_fC() - pedestal_fC)
                           / maxAmplitude;
    binNextToBinMax_.addEntry(binNextToBinMax);
                                                                              
    double amplitude = digi[maxBin_].nominal_fC()
                   + digi[maxBin_+1].nominal_fC()
                   - 2*pedestal_fC;
                                                                                
                                                                                
    amplitudeAnalyzer_.analyze(digi.id().rawId(), amplitude);
                                                                                
  }
}

Member Data Documentation

Definition at line 37 of file CastorDigiStatistics.h.

Referenced by analyze().

Definition at line 33 of file CastorDigiStatistics.h.

Referenced by analyze().

Definition at line 36 of file CastorDigiStatistics.h.

Referenced by analyze().

Definition at line 35 of file CastorDigiStatistics.h.

Referenced by analyze().

Definition at line 32 of file CastorDigiStatistics.h.

Referenced by analyze().

Definition at line 34 of file CastorDigiStatistics.h.

Referenced by analyze().