CMS 3D CMS Logo

CastorDigiStatistics Class Reference

#include <SimCalorimetry/CastorSim/plugins/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.

00019 :  maxBin_(maxBin),
00020    amplitudeThreshold_(amplitudeThreshold),
00021    pedestal_(name+" pedestal", expectedPedestal, 0.),
00022    binPrevToBinMax_(name+" binPrevToBinMax", binPrevToBinMax, 0.),
00023    binNextToBinMax_(name+" binNextToBinMax", binNextToBinMax, 0.),
00024    amplitudeAnalyzer_(amplitudeAnalyzer)
00025 {
00026 }


Member Function Documentation

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

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().

00042                                                     {
00043    pedestal_.addEntry(digi[0].adc());
00044    pedestal_.addEntry(digi[1].adc());
00045                                                                                
00046                                                                                
00047    double pedestal_fC = 0.5*(digi[0].nominal_fC() + digi[1].nominal_fC());
00048                                                                                
00049                                                                               
00050   double maxAmplitude = digi[maxBin_].nominal_fC()   - pedestal_fC;
00051                                                                               
00052   if(maxAmplitude > amplitudeThreshold_) {
00053                                                                               
00054     double binPrevToBinMax = (digi[maxBin_-1].nominal_fC() - pedestal_fC)
00055                            / maxAmplitude;
00056     binPrevToBinMax_.addEntry(binPrevToBinMax);
00057                                                                               
00058                                                                               
00059     double binNextToBinMax = (digi[maxBin_+1].nominal_fC() - pedestal_fC)
00060                            / maxAmplitude;
00061     binNextToBinMax_.addEntry(binNextToBinMax);
00062                                                                               
00063     double amplitude = digi[maxBin_].nominal_fC()
00064                    + digi[maxBin_+1].nominal_fC()
00065                    - 2*pedestal_fC;
00066                                                                                 
00067                                                                                 
00068     amplitudeAnalyzer_.analyze(digi.id().rawId(), amplitude);
00069                                                                                 
00070   }
00071 }


Member Data Documentation

CaloHitAnalyzer& CastorDigiStatistics::amplitudeAnalyzer_ [private]

Definition at line 37 of file CastorDigiStatistics.h.

Referenced by analyze().

float CastorDigiStatistics::amplitudeThreshold_ [private]

Definition at line 33 of file CastorDigiStatistics.h.

Referenced by analyze().

CaloValidationStatistics CastorDigiStatistics::binNextToBinMax_ [private]

Definition at line 36 of file CastorDigiStatistics.h.

Referenced by analyze().

CaloValidationStatistics CastorDigiStatistics::binPrevToBinMax_ [private]

Definition at line 35 of file CastorDigiStatistics.h.

Referenced by analyze().

int CastorDigiStatistics::maxBin_ [private]

Definition at line 32 of file CastorDigiStatistics.h.

Referenced by analyze().

CaloValidationStatistics CastorDigiStatistics::pedestal_ [private]

Definition at line 34 of file CastorDigiStatistics.h.

Referenced by analyze().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:16:09 2009 for CMSSW by  doxygen 1.5.4