CMS 3D CMS Logo

EcalElectronicsSim Class Reference

#include <SimCalorimetry/EcalSimAlgos/interface/EcalElectronicsSim.h>

List of all members.

Public Member Functions

void amplify (CaloSamples &clf) const
 input signal is in pe. Converted in GeV
void analogToDigital (CaloSamples &clf, EcalDataFrame &df) const
 from CaloSamples to EcalDataFrame
double constantTerm () const
 compute the event random constant term
 EcalElectronicsSim (const EcalSimParameterMap *parameterMap, EcalCoder *coder, bool applyConstantTerm, double rmsConstantTerm)
 ctor
void newEvent ()
 anything that needs to be done once per event

Private Attributes

const bool applyConstantTerm_
const double rmsConstantTerm_
EcalCodertheCoder
 Converts CaloDataFrame in CaloTimeSample and vice versa.
const EcalSimParameterMaptheParameterMap
 map of parameters


Detailed Description

Definition at line 18 of file EcalElectronicsSim.h.


Constructor & Destructor Documentation

EcalElectronicsSim::EcalElectronicsSim ( const EcalSimParameterMap parameterMap,
EcalCoder coder,
bool  applyConstantTerm,
double  rmsConstantTerm 
)

ctor

Definition at line 16 of file EcalElectronicsSim.cc.

00020 : theParameterMap(parameterMap),
00021   theCoder(coder),
00022   applyConstantTerm_(applyConstantTerm), 
00023   rmsConstantTerm_(rmsConstantTerm)
00024 {
00025 }


Member Function Documentation

void EcalElectronicsSim::amplify ( CaloSamples clf  )  const

input signal is in pe. Converted in GeV

Definition at line 28 of file EcalElectronicsSim.cc.

References applyConstantTerm_, constantTerm(), CaloSamples::id(), EcalSimParameterMap::simParameters(), and theParameterMap.

Referenced by analogToDigital().

00029 {
00030   clf *= theParameterMap->simParameters(clf.id()).photoelectronsToAnalog();
00031   if (applyConstantTerm_) {
00032     clf *= (1.+constantTerm());
00033   }
00034 }

void EcalElectronicsSim::analogToDigital ( CaloSamples clf,
EcalDataFrame df 
) const

from CaloSamples to EcalDataFrame

Definition at line 51 of file EcalElectronicsSim.cc.

References amplify(), EcalCoder::analogToDigital(), and theCoder.

00052 {
00053   //PG input signal is in pe.  Converted in GeV
00054   amplify(clf);
00055   theCoder->analogToDigital(clf, df);
00056 }

double EcalElectronicsSim::constantTerm (  )  const

compute the event random constant term

Definition at line 36 of file EcalElectronicsSim.cc.

References Exception, edm::Service< T >::isAvailable(), and rmsConstantTerm_.

Referenced by amplify().

00037 {
00038   edm::Service<edm::RandomNumberGenerator> rng;
00039   if ( ! rng.isAvailable()) {
00040     throw cms::Exception("Configuration")
00041       << "EcalElectroncSim requires the RandomNumberGeneratorService\n"
00042       "which is not present in the configuration file.  You must add the service\n"
00043       "in the configuration file or remove the modules that require it.";
00044   }
00045 
00046   double thisCT = rmsConstantTerm_;
00047   CLHEP::RandGaussQ gaussQDistribution(rng->getEngine(), 0.0, thisCT);
00048   return gaussQDistribution.fire();
00049 }

void EcalElectronicsSim::newEvent (  )  [inline]

anything that needs to be done once per event

Definition at line 33 of file EcalElectronicsSim.h.

00033 {}


Member Data Documentation

const bool EcalElectronicsSim::applyConstantTerm_ [private]

Definition at line 41 of file EcalElectronicsSim.h.

Referenced by amplify().

const double EcalElectronicsSim::rmsConstantTerm_ [private]

Definition at line 42 of file EcalElectronicsSim.h.

Referenced by constantTerm().

EcalCoder* EcalElectronicsSim::theCoder [private]

Converts CaloDataFrame in CaloTimeSample and vice versa.

Definition at line 40 of file EcalElectronicsSim.h.

Referenced by analogToDigital().

const EcalSimParameterMap* EcalElectronicsSim::theParameterMap [private]

map of parameters

Definition at line 38 of file EcalElectronicsSim.h.

Referenced by amplify().


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