CMS 3D CMS Logo

ESRecHitSimAlgo Class Reference

#include <RecoLocalCalo/EcalRecAlgos/interface/ESRecHitSimAlgo.h>

List of all members.

Public Member Functions

 ESRecHitSimAlgo (int gain, int pedestal, double MIPADC, double MIPkeV)
double EvalAmplitude (const ESDataFrame &digi) const
EcalRecHit reconstruct (const ESDataFrame &digi) const
 ~ESRecHitSimAlgo ()

Private Attributes

int gain_
double MIPADC_
double MIPkeV_
double ped_
float pw [3]


Detailed Description

Definition at line 9 of file ESRecHitSimAlgo.h.


Constructor & Destructor Documentation

ESRecHitSimAlgo::ESRecHitSimAlgo ( int  gain,
int  pedestal,
double  MIPADC,
double  MIPkeV 
)

Definition at line 6 of file ESRecHitSimAlgo.cc.

References gain_, LogDebug, and pw.

00006                                                                                      :
00007   gain_(gain), ped_(pedestal), MIPADC_(MIPADC), MIPkeV_(MIPkeV) 
00008 {
00009 
00010   // pulse height parametrization
00011   // 0 : old gain in ORCA
00012   // 1 : low gain for data taking
00013   // 2 : high gain for calibration
00014   if (gain_ == 0) {
00015     pw[0] = -1.12521;
00016     pw[1] =  0.877968;
00017     pw[2] =  0.247238;
00018   }
00019   else if (gain_ == 1) {
00020     pw[0] = -0.0772417;
00021     pw[1] =  0.8168024;
00022     pw[2] =  0.3857636;
00023   }
00024   else if (gain_ == 2) {
00025     pw[0] = -0.01687177;
00026     pw[1] =  0.77676196;
00027     pw[2] =  0.416363;
00028   }
00029 
00030   LogDebug("ESRecHitSimAlgo") << "ESRecHitSimAlgo : Gain "<<gain_<<" Weights : "<<pw[0]<<" "<<pw[1]<<" "<<pw[2];
00031 }

ESRecHitSimAlgo::~ESRecHitSimAlgo (  )  [inline]

Definition at line 14 of file ESRecHitSimAlgo.h.

00014 {}


Member Function Documentation

double ESRecHitSimAlgo::EvalAmplitude ( const ESDataFrame digi  )  const

Definition at line 33 of file ESRecHitSimAlgo.cc.

References ecalMGPA::adc(), ESSample::adc(), relval_parameters_module::energy, gain_, i, LogDebug, MIPADC_, MIPkeV_, ped_, pw, ESDataFrame::sample(), and ESDataFrame::size().

Referenced by ESZeroSuppressionProducer::produce(), and reconstruct().

00033                                                                    {
00034   
00035   float energy = 0;
00036   float adc[3];  
00037 
00038   for (int i=0; i<digi.size(); i++) {
00039     energy += pw[i]*(digi.sample(i).adc()-ped_);
00040     LogDebug("ESRecHitSimAlgo") << "ESRecHitSimAlgo : Digi "<<i<<" ADC counts "<<digi.sample(i).adc()<<" Ped "<<ped_;
00041     adc[i] = digi.sample(i).adc();
00042   }
00043   if (gain_>0) energy *= MIPkeV_/MIPADC_;
00044 
00045   // convert to GeV
00046   energy /= 1000000.;
00047   
00048   return energy;
00049 }

EcalRecHit ESRecHitSimAlgo::reconstruct ( const ESDataFrame digi  )  const

Definition at line 51 of file ESRecHitSimAlgo.cc.

References detId, relval_parameters_module::energy, EvalAmplitude(), ESDataFrame::id(), and LogDebug.

Referenced by ESRecHitProducer::produce().

00051                                                                      {
00052 
00053   float energy = 0;
00054 
00055   energy = EvalAmplitude(digi);
00056 
00057   DetId detId = digi.id();
00058 
00059   LogDebug("ESRecHitSimAlgo") << "ESRecHitSimAlgo : reconstructed energy "<<energy;
00060 
00061   return EcalRecHit(digi.id(), energy, 0); 
00062 }


Member Data Documentation

int ESRecHitSimAlgo::gain_ [private]

Definition at line 20 of file ESRecHitSimAlgo.h.

Referenced by ESRecHitSimAlgo(), and EvalAmplitude().

double ESRecHitSimAlgo::MIPADC_ [private]

Definition at line 23 of file ESRecHitSimAlgo.h.

Referenced by EvalAmplitude().

double ESRecHitSimAlgo::MIPkeV_ [private]

Definition at line 24 of file ESRecHitSimAlgo.h.

Referenced by EvalAmplitude().

double ESRecHitSimAlgo::ped_ [private]

Definition at line 21 of file ESRecHitSimAlgo.h.

Referenced by EvalAmplitude().

float ESRecHitSimAlgo::pw[3] [private]

Definition at line 22 of file ESRecHitSimAlgo.h.

Referenced by ESRecHitSimAlgo(), and EvalAmplitude().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:25 2009 for CMSSW by  doxygen 1.5.4