#include <HcalElectronicsSim.h>
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 | |
HcalAmplifier * | theAmplifier |
const HcalCoderFactory * | theCoderFactory |
CLHEP::RandFlat * | theRandFlat |
int | theStartingCapId |
bool | theStartingCapIdIsRandom |
Definition at line 19 of file HcalElectronicsSim.h.
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; }
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); }
void HcalElectronicsSim::convert | ( | CaloSamples & | frame, |
Digi & | result | ||
) | [private] |
Definition at line 36 of file HcalElectronicsSim.cc.
References HcalAmplifier::amplify(), HcalCoderFactory::coder(), CaloSamples::id(), CaloSamples::size(), theAmplifier, theCoderFactory, and theStartingCapId.
{ result.setSize(frame.size()); theAmplifier->amplify(frame); theCoderFactory->coder(frame.id())->fC2adc(frame, result, theStartingCapId); }
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 | ) |
Definition at line 72 of file HcalElectronicsSim.cc.
References HcalAmplifier::setStartingCapId(), theAmplifier, theStartingCapId, and theStartingCapIdIsRandom.
Referenced by HcalSignalGenerator< HBHEDigitizerTraits >::fill().
{ theStartingCapId = startingCapId; theAmplifier->setStartingCapId(theStartingCapId); // turns off random capIDs forever for this instance theStartingCapIdIsRandom = false; }
HcalAmplifier* HcalElectronicsSim::theAmplifier [private] |
Definition at line 40 of file HcalElectronicsSim.h.
Referenced by convert(), newEvent(), setRandomEngine(), and setStartingCapId().
const HcalCoderFactory* HcalElectronicsSim::theCoderFactory [private] |
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().
int HcalElectronicsSim::theStartingCapId [private] |
Definition at line 44 of file HcalElectronicsSim.h.
Referenced by convert(), newEvent(), and setStartingCapId().
bool HcalElectronicsSim::theStartingCapIdIsRandom [private] |
Definition at line 45 of file HcalElectronicsSim.h.
Referenced by newEvent(), and setStartingCapId().