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 ()
 
void setNoiseSignalGenerator (const CaloVNoiseSignalGenerator *noiseSignalGenerator)
 
 ~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
 
const CaloVNoiseSignalGeneratortheNoiseSignalGenerator
 

Detailed Description

Definition at line 21 of file EcalElectronicsSim.h.

Member Typedef Documentation

Definition at line 25 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 57 of file EcalElectronicsSim.cc.

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

Referenced by analogToDigital().

58 {
59  const double fac ( m_simMap->simParameters( clf.id() ).photoelectronsToAnalog() ) ;
60  if( 0 != m_gaussQDistribution )
61  {
62  clf *= fac*m_gaussQDistribution->fire() ;
63  }
64  else
65  {
66  clf *= fac ;
67  }
68 }
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 
50  //PG input signal is in pe. Converted in GeV
51  amplify( clf ) ;
52 
53  m_theCoder->analogToDigital( clf, df ) ;
54 }
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:75
void EcalElectronicsSim::newEvent ( )
inline

Definition at line 37 of file EcalElectronicsSim.h.

37 {}
void EcalElectronicsSim::setNoiseSignalGenerator ( const CaloVNoiseSignalGenerator noiseSignalGenerator)
inline

Definition at line 39 of file EcalElectronicsSim.h.

References theNoiseSignalGenerator.

39  {
40  theNoiseSignalGenerator = noiseSignalGenerator;
41  }
const CaloVNoiseSignalGenerator * theNoiseSignalGenerator

Member Data Documentation

CLHEP::RandGaussQ* EcalElectronicsSim::m_gaussQDistribution
private

Definition at line 56 of file EcalElectronicsSim.h.

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

const EcalSimParameterMap* EcalElectronicsSim::m_simMap
private

map of parameters

Definition at line 50 of file EcalElectronicsSim.h.

Referenced by amplify().

EcalCoder* EcalElectronicsSim::m_theCoder
private

Definition at line 54 of file EcalElectronicsSim.h.

Referenced by analogToDigital().

const CaloVNoiseSignalGenerator* EcalElectronicsSim::theNoiseSignalGenerator
private

Definition at line 52 of file EcalElectronicsSim.h.

Referenced by setNoiseSignalGenerator().