CMS 3D CMS Logo

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

#include <EcalElectronicsSim.h>

Public Types

typedef CaloTSamples< float, 10 > EcalSamples
 

Public Member Functions

void analogToDigital (EcalSamples &clf, EcalDataFrame &df) const
 from EcalSamples to EcalDataFrame More...
 
 EcalElectronicsSim (const EcalSimParameterMap *parameterMap, EcalCoder *coder, bool applyConstantTerm, double rmsConstantTerm)
 
void newEvent ()
 
 ~EcalElectronicsSim ()
 

Private Member Functions

void amplify (EcalSamples &clf) const
 input signal is in pe. Converted in GeV More...
 

Private Attributes

CLHEP::RandGaussQ * m_gaussQDistribution
 
const EcalSimParameterMapm_simMap
 map of parameters More...
 
EcalCoderm_theCoder
 

Detailed Description

Definition at line 20 of file EcalElectronicsSim.h.

Member Typedef Documentation

Definition at line 24 of file EcalElectronicsSim.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file EcalElectronicsSim.cc.

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

18  :
19  m_simMap ( parameterMap ) ,
20  m_theCoder ( coder ) ,
22 {
24 
25  if( applyConstantTerm )
26  {
27  if ( !rng.isAvailable() )
28  {
29  throw cms::Exception("Configuration")
30  << "EcalElectroncSim requires the RandomNumberGeneratorService\n"
31  "which is not present in the configuration file. You must add the service\n"
32  "in the configuration file or remove the modules that require it.";
33  }
34 
35  double thisCT = rmsConstantTerm ;
36  m_gaussQDistribution = new CLHEP::RandGaussQ( rng->getEngine(), 1.0, thisCT ) ;
37  }
38 }
CLHEP::RandGaussQ * m_gaussQDistribution
bool isAvailable() const
Definition: Service.h:46
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
const EcalSimParameterMap * m_simMap
map of parameters
EcalElectronicsSim::~EcalElectronicsSim ( )

Definition at line 40 of file EcalElectronicsSim.cc.

References m_gaussQDistribution.

41 {
42  delete m_gaussQDistribution ;
43 }
CLHEP::RandGaussQ * m_gaussQDistribution

Member Function Documentation

void EcalElectronicsSim::amplify ( EcalElectronicsSim::EcalSamples clf) const
private

input signal is in pe. Converted in GeV

Definition at line 56 of file EcalElectronicsSim.cc.

References CaloTSamplesBase< Ttype >::id(), m_gaussQDistribution, m_simMap, and EcalSimParameterMap::simParameters().

Referenced by analogToDigital().

57 {
58  const double fac ( m_simMap->simParameters( clf.id() ).photoelectronsToAnalog() ) ;
59  if( 0 != m_gaussQDistribution )
60  {
61  clf *= fac*m_gaussQDistribution->fire() ;
62  }
63  else
64  {
65  clf *= fac ;
66  }
67 }
virtual const CaloSimParameters & simParameters(const DetId &id) const
return the sim parameters relative to the right subdet
CLHEP::RandGaussQ * m_gaussQDistribution
DetId id() const
const EcalSimParameterMap * m_simMap
map of parameters
void EcalElectronicsSim::analogToDigital ( EcalElectronicsSim::EcalSamples clf,
EcalDataFrame df 
) const

from EcalSamples to EcalDataFrame

Definition at line 46 of file EcalElectronicsSim.cc.

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

48 {
49  //PG input signal is in pe. Converted in GeV
50  amplify( clf ) ;
51 
52  m_theCoder->analogToDigital( clf, df ) ;
53 }
void amplify(EcalSamples &clf) const
input signal is in pe. Converted in GeV
virtual void analogToDigital(const EcalSamples &clf, EcalDataFrame &df) const
from EcalSamples to EcalDataFrame
Definition: EcalCoder.cc:73
void EcalElectronicsSim::newEvent ( )
inline

Definition at line 36 of file EcalElectronicsSim.h.

36 {}

Member Data Documentation

CLHEP::RandGaussQ* EcalElectronicsSim::m_gaussQDistribution
private

Definition at line 49 of file EcalElectronicsSim.h.

Referenced by amplify(), EcalElectronicsSim(), and ~EcalElectronicsSim().

const EcalSimParameterMap* EcalElectronicsSim::m_simMap
private

map of parameters

Definition at line 45 of file EcalElectronicsSim.h.

Referenced by amplify().

EcalCoder* EcalElectronicsSim::m_theCoder
private

Definition at line 47 of file EcalElectronicsSim.h.

Referenced by analogToDigital().