CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

HcalElectronicsSim Class Reference

#include <HcalElectronicsSim.h>

List of all members.

Public Member Functions

void analogToDigital (CaloSamples &linearFrame, HBHEDataFrame &result)
void analogToDigital (CaloSamples &linearFrame, HODataFrame &result)
void analogToDigital (CaloSamples &linearFrame, HFDataFrame &result)
void analogToDigital (CaloSamples &linearFrame, ZDCDataFrame &result)
 HcalElectronicsSim (HcalAmplifier *amplifier, const HcalCoderFactory *coderFactory)
void newEvent ()
void setRandomEngine (CLHEP::HepRandomEngine &engine)
void setStartingCapId (int startingCapId)
 ~HcalElectronicsSim ()

Private Member Functions

template<class Digi >
void convert (CaloSamples &frame, Digi &result)

Private Attributes

HcalAmplifiertheAmplifier
const HcalCoderFactorytheCoderFactory
CLHEP::RandFlat * theRandFlat
int theStartingCapId
bool theStartingCapIdIsRandom

Detailed Description

Definition at line 19 of file HcalElectronicsSim.h.


Constructor & Destructor Documentation

HcalElectronicsSim::HcalElectronicsSim ( HcalAmplifier amplifier,
const HcalCoderFactory coderFactory 
)

Definition at line 12 of file HcalElectronicsSim.cc.

  : theAmplifier(amplifier),
    theCoderFactory(coderFactory),
    theRandFlat(0),
    theStartingCapId(0),
    theStartingCapIdIsRandom(true)
{
}
HcalElectronicsSim::~HcalElectronicsSim ( )

Definition at line 22 of file HcalElectronicsSim.cc.

References theRandFlat.

{
  delete theRandFlat;
}

Member Function Documentation

void HcalElectronicsSim::analogToDigital ( CaloSamples linearFrame,
HBHEDataFrame result 
)

Definition at line 43 of file HcalElectronicsSim.cc.

References query::result.

                                                                                 {
  convert<HBHEDataFrame>(lf, result);
}
void HcalElectronicsSim::analogToDigital ( CaloSamples linearFrame,
HFDataFrame result 
)

Definition at line 53 of file HcalElectronicsSim.cc.

References query::result.

                                                                               {
  convert<HFDataFrame>(lf, result);
}
void HcalElectronicsSim::analogToDigital ( CaloSamples linearFrame,
ZDCDataFrame result 
)

Definition at line 57 of file HcalElectronicsSim.cc.

References query::result.

                                                                                {
  convert<ZDCDataFrame>(lf, result);
}
void HcalElectronicsSim::analogToDigital ( CaloSamples linearFrame,
HODataFrame result 
)

Definition at line 48 of file HcalElectronicsSim.cc.

References query::result.

                                                                               {
  convert<HODataFrame>(lf, result);
}
template<class Digi >
void HcalElectronicsSim::convert ( CaloSamples frame,
Digi &  result 
) [private]
void HcalElectronicsSim::newEvent ( )

Things that need to be initialized every event sets starting CapID randomly

Definition at line 62 of file HcalElectronicsSim.cc.

References HcalAmplifier::setStartingCapId(), theAmplifier, theRandFlat, theStartingCapId, and theStartingCapIdIsRandom.

                                  {
  // pick a new starting Capacitor ID
  if(theStartingCapIdIsRandom)
  {
    theStartingCapId = theRandFlat->fireInt(4);
    theAmplifier->setStartingCapId(theStartingCapId);
  }
}
void HcalElectronicsSim::setRandomEngine ( CLHEP::HepRandomEngine &  engine)

Definition at line 28 of file HcalElectronicsSim.cc.

References HcalAmplifier::setRandomEngine(), theAmplifier, and theRandFlat.

{
  theRandFlat = new CLHEP::RandFlat(engine);
  theAmplifier->setRandomEngine(engine);
}
void HcalElectronicsSim::setStartingCapId ( int  startingCapId)

Member Data Documentation

Definition at line 40 of file HcalElectronicsSim.h.

Referenced by convert(), newEvent(), setRandomEngine(), and setStartingCapId().

Definition at line 41 of file HcalElectronicsSim.h.

Referenced by convert().

CLHEP::RandFlat* HcalElectronicsSim::theRandFlat [private]

Definition at line 42 of file HcalElectronicsSim.h.

Referenced by newEvent(), setRandomEngine(), and ~HcalElectronicsSim().

Definition at line 44 of file HcalElectronicsSim.h.

Referenced by convert(), newEvent(), and setStartingCapId().

Definition at line 45 of file HcalElectronicsSim.h.

Referenced by newEvent(), and setStartingCapId().