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, ZDCDataFrame &result)
void analogToDigital (CaloSamples &linearFrame, HcalUpgradeDataFrame &result)
void analogToDigital (CaloSamples &linearFrame, HODataFrame &result)
void analogToDigital (CaloSamples &linearFrame, HFDataFrame &result)
 HcalElectronicsSim (HcalAmplifier *amplifier, const HcalCoderFactory *coderFactory)
void newEvent ()
void setDbService (const HcalDbService *service)
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
HcalTDC theTDC

Detailed Description

Definition at line 21 of file HcalElectronicsSim.h.


Constructor & Destructor Documentation

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

Definition at line 13 of file HcalElectronicsSim.cc.

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

Definition at line 23 of file HcalElectronicsSim.cc.

References theRandFlat.

                                        {
  if (theRandFlat) delete theRandFlat;
}

Member Function Documentation

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

Definition at line 48 of file HcalElectronicsSim.cc.

References query::result.

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

Definition at line 53 of file HcalElectronicsSim.cc.

References query::result.

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

Definition at line 58 of file HcalElectronicsSim.cc.

References query::result.

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

Definition at line 62 of file HcalElectronicsSim.cc.

References query::result.

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

Definition at line 67 of file HcalElectronicsSim.cc.

References query::result, theTDC, and HcalTDC::timing().

                                                                        {
  convert<HcalUpgradeDataFrame>(lf, result);
  theTDC.timing(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 73 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::setDbService ( const HcalDbService service)

Definition at line 35 of file HcalElectronicsSim.cc.

References HcalTDC::setDbService(), and theTDC.

Referenced by HcalDigitizer::initializeEvent().

                                                                   {
  //  theAmplifier->setDbService(service);
  theTDC.setDbService(service);
}
void HcalElectronicsSim::setRandomEngine ( CLHEP::HepRandomEngine &  engine)

Definition at line 28 of file HcalElectronicsSim.cc.

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

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

Member Data Documentation

Definition at line 43 of file HcalElectronicsSim.h.

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

Definition at line 44 of file HcalElectronicsSim.h.

Referenced by convert().

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

Definition at line 46 of file HcalElectronicsSim.h.

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

Definition at line 48 of file HcalElectronicsSim.h.

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

Definition at line 49 of file HcalElectronicsSim.h.

Referenced by newEvent(), and setStartingCapId().

Definition at line 45 of file HcalElectronicsSim.h.

Referenced by analogToDigital(), setDbService(), and setRandomEngine().