CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

EcalElectronicsSim Class Reference

#include <EcalElectronicsSim.h>

List of all members.

Public Types

typedef CaloTSamples< float, 10 > EcalSamples

Public Member Functions

void analogToDigital (EcalSamples &clf, EcalDataFrame &df) const
 from EcalSamples to EcalDataFrame
 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

Private Attributes

CLHEP::RandGaussQ * m_gaussQDistribution
const EcalSimParameterMapm_simMap
 map of parameters
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 Exception, edm::Service< T >::isAvailable(), and m_gaussQDistribution.

                                                                                         :
   m_simMap             ( parameterMap ) ,
   m_theCoder           ( coder        ) ,
   m_gaussQDistribution ( 0            )
{
   edm::Service<edm::RandomNumberGenerator> rng;
 
   if( applyConstantTerm )
   {
      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 ;
      m_gaussQDistribution = new CLHEP::RandGaussQ( rng->getEngine(), 1.0, thisCT ) ;
   }
}
EcalElectronicsSim::~EcalElectronicsSim ( )

Definition at line 40 of file EcalElectronicsSim.cc.

References m_gaussQDistribution.

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

{
   const double fac ( m_simMap->simParameters( clf.id() ).photoelectronsToAnalog() ) ;
   if( 0 != m_gaussQDistribution ) 
   {
      clf *= fac*m_gaussQDistribution->fire() ;
   }
   else
   {
      clf *= fac ;
   }
}
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.

{
   //PG input signal is in pe.  Converted in GeV
   amplify( clf ) ;

   m_theCoder->analogToDigital( clf, df ) ;
}
void EcalElectronicsSim::newEvent ( ) [inline]

Definition at line 36 of file EcalElectronicsSim.h.

{}

Member Data Documentation

CLHEP::RandGaussQ* EcalElectronicsSim::m_gaussQDistribution [private]

Definition at line 49 of file EcalElectronicsSim.h.

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

map of parameters

Definition at line 45 of file EcalElectronicsSim.h.

Referenced by amplify().

Definition at line 47 of file EcalElectronicsSim.h.

Referenced by analogToDigital().