#include <CastorElectronicsSim.h>
Public Member Functions | |
void | analogToDigital (CaloSamples &linearFrame, CastorDataFrame &result) |
CastorElectronicsSim (CastorAmplifier *amplifier, const CastorCoderFactory *coderFactory) | |
void | newEvent () |
Things that need to be initialized every event. | |
void | setRandomEngine (CLHEP::HepRandomEngine &engine) |
~CastorElectronicsSim () | |
Private Member Functions | |
template<class Digi > | |
void | convert (CaloSamples &frame, Digi &result) |
Private Attributes | |
CastorAmplifier * | theAmplifier |
const CastorCoderFactory * | theCoderFactory |
CLHEP::RandFlat * | theRandFlat |
int | theStartingCapId |
Definition at line 16 of file CastorElectronicsSim.h.
CastorElectronicsSim::CastorElectronicsSim | ( | CastorAmplifier * | amplifier, |
const CastorCoderFactory * | coderFactory | ||
) |
Definition at line 9 of file CastorElectronicsSim.cc.
: theAmplifier(amplifier), theCoderFactory(coderFactory), theRandFlat(0), theStartingCapId(0) { }
CastorElectronicsSim::~CastorElectronicsSim | ( | ) |
Definition at line 18 of file CastorElectronicsSim.cc.
References theRandFlat.
{ delete theRandFlat; }
void CastorElectronicsSim::analogToDigital | ( | CaloSamples & | linearFrame, |
CastorDataFrame & | result | ||
) |
Definition at line 37 of file CastorElectronicsSim.cc.
References query::result.
{ convert<CastorDataFrame>(lf, result); }
void CastorElectronicsSim::convert | ( | CaloSamples & | frame, |
Digi & | result | ||
) | [private] |
Definition at line 31 of file CastorElectronicsSim.cc.
References CastorAmplifier::amplify(), CastorCoderFactory::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 CastorElectronicsSim::newEvent | ( | ) |
Things that need to be initialized every event.
Definition at line 41 of file CastorElectronicsSim.cc.
References CastorAmplifier::setStartingCapId(), theAmplifier, theRandFlat, and theStartingCapId.
{ // pick a new starting Capacitor ID theStartingCapId = theRandFlat->fireInt(4); theAmplifier->setStartingCapId(theStartingCapId); }
void CastorElectronicsSim::setRandomEngine | ( | CLHEP::HepRandomEngine & | engine | ) |
Definition at line 24 of file CastorElectronicsSim.cc.
References theRandFlat.
Referenced by CastorDigiProducer::CastorDigiProducer().
{ theRandFlat = new CLHEP::RandFlat(engine); }
Definition at line 32 of file CastorElectronicsSim.h.
Referenced by convert(), and newEvent().
const CastorCoderFactory* CastorElectronicsSim::theCoderFactory [private] |
Definition at line 33 of file CastorElectronicsSim.h.
Referenced by convert().
CLHEP::RandFlat* CastorElectronicsSim::theRandFlat [private] |
Definition at line 34 of file CastorElectronicsSim.h.
Referenced by newEvent(), setRandomEngine(), and ~CastorElectronicsSim().
int CastorElectronicsSim::theStartingCapId [private] |
Definition at line 36 of file CastorElectronicsSim.h.
Referenced by convert(), and newEvent().