#include <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.
: theParameterMap(parameterMap), theCoder(coder), applyConstantTerm_(applyConstantTerm), rmsConstantTerm_(rmsConstantTerm) { }
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().
{ clf *= theParameterMap->simParameters(clf.id()).photoelectronsToAnalog(); if (applyConstantTerm_) { clf *= (1.+constantTerm()); } }
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.
{ //PG input signal is in pe. Converted in GeV amplify(clf); theCoder->analogToDigital(clf, df); }
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().
{ edm::Service<edm::RandomNumberGenerator> rng; if ( ! rng.isAvailable()) { throw cms::Exception("Configuration") << "EcalElectroncSim requires the RandomNumberGeneratorService\n" "which is not present in the configuration file. You must add the service\n" "in the configuration file or remove the modules that require it."; } double thisCT = rmsConstantTerm_; CLHEP::RandGaussQ gaussQDistribution(rng->getEngine(), 0.0, thisCT); return gaussQDistribution.fire(); }
void EcalElectronicsSim::newEvent | ( | ) | [inline] |
anything that needs to be done once per event
Definition at line 33 of file EcalElectronicsSim.h.
{}
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] |