CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EcalElectronicsSim Class Reference

#include <EcalElectronicsSim.h>

Public Member Functions

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

Private Attributes

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

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.

20 : theParameterMap(parameterMap),
21  theCoder(coder),
22  applyConstantTerm_(applyConstantTerm),
23  rmsConstantTerm_(rmsConstantTerm)
24 {
25 }
EcalCoder * theCoder
Converts CaloDataFrame in CaloTimeSample and vice versa.
const bool applyConstantTerm_
const EcalSimParameterMap * theParameterMap
map of parameters
const double rmsConstantTerm_

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

29 {
30  clf *= theParameterMap->simParameters(clf.id()).photoelectronsToAnalog();
31  if (applyConstantTerm_) {
32  clf *= (1.+constantTerm());
33  }
34 }
virtual const CaloSimParameters & simParameters(const DetId &id) const
return the sim parameters relative to the right subdet
double constantTerm() const
compute the event random constant term
const bool applyConstantTerm_
const EcalSimParameterMap * theParameterMap
map of parameters
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
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.

52 {
53  //PG input signal is in pe. Converted in GeV
54  amplify(clf);
55  theCoder->analogToDigital(clf, df);
56 }
EcalCoder * theCoder
Converts CaloDataFrame in CaloTimeSample and vice versa.
virtual void analogToDigital(const CaloSamples &clf, EcalDataFrame &df) const
from CaloSamples to EcalDataFrame
Definition: EcalCoder.cc:70
void amplify(CaloSamples &clf) const
input signal is in pe. Converted in GeV
double EcalElectronicsSim::constantTerm ( ) const

compute the event random constant term

Definition at line 36 of file EcalElectronicsSim.cc.

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

Referenced by amplify().

37 {
39  if ( ! rng.isAvailable()) {
40  throw cms::Exception("Configuration")
41  << "EcalElectroncSim requires the RandomNumberGeneratorService\n"
42  "which is not present in the configuration file. You must add the service\n"
43  "in the configuration file or remove the modules that require it.";
44  }
45 
46  double thisCT = rmsConstantTerm_;
47  CLHEP::RandGaussQ gaussQDistribution(rng->getEngine(), 0.0, thisCT);
48  return gaussQDistribution.fire();
49 }
bool isAvailable() const
Definition: Service.h:47
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
const double rmsConstantTerm_
void EcalElectronicsSim::newEvent ( )
inline

anything that needs to be done once per event

Definition at line 33 of file EcalElectronicsSim.h.

33 {}

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