#include <SimCalorimetry/EcalSimAlgos/interface/EcalElectronicsSim.h>
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_ |
EcalCoder * | theCoder |
Converts CaloDataFrame in CaloTimeSample and vice versa. | |
const EcalSimParameterMap * | theParameterMap |
map of parameters |
Definition at line 18 of file EcalElectronicsSim.h.
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 }
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] |
const bool EcalElectronicsSim::applyConstantTerm_ [private] |
const double EcalElectronicsSim::rmsConstantTerm_ [private] |
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] |