#include <CaloTDigitizer.h>
Public Types | |
typedef Traits::Digi | Digi |
typedef Traits::DigiCollection | DigiCollection |
typedef Traits::ElectronicsSim | ElectronicsSim |
Public Member Functions | |
void | addNoiseHits () |
void | addNoiseSignals () |
CaloTDigitizer (CaloHitResponse *hitResponse, ElectronicsSim *electronicsSim, bool addNoise) | |
const std::vector< DetId > & | detIds () const |
tell the digitizer which cells exist | |
void | run (MixCollection< PCaloHit > &input, DigiCollection &output) |
turns hits into digis | |
void | setDetIds (const std::vector< DetId > &detIds) |
void | setNoiseHitGenerator (CaloVNoiseHitGenerator *generator) |
void | setNoiseSignalGenerator (CaloVNoiseSignalGenerator *generator) |
void | setRandomEngine (CLHEP::HepRandomEngine &engine) |
~CaloTDigitizer () | |
doesn't delete the pointers passed in | |
Private Attributes | |
bool | addNoise_ |
const std::vector< DetId > * | theDetIds |
ElectronicsSim * | theElectronicsSim |
CaloHitResponse * | theHitResponse |
CaloVNoiseHitGenerator * | theNoiseHitGenerator |
CaloVNoiseSignalGenerator * | theNoiseSignalGenerator |
Turns hits into digis. Assumes that there's an ElectroncsSim class with the interface analogToDigital(const CaloSamples &, Digi &);
Definition at line 17 of file CaloTDigitizer.h.
typedef Traits::Digi CaloTDigitizer< Traits >::Digi |
Definition at line 24 of file CaloTDigitizer.h.
typedef Traits::DigiCollection CaloTDigitizer< Traits >::DigiCollection |
Definition at line 25 of file CaloTDigitizer.h.
typedef Traits::ElectronicsSim CaloTDigitizer< Traits >::ElectronicsSim |
these are the types that need to be defined in the Traits class. The ElectronicsSim needs to have an interface that you'll see in the run() method
Definition at line 23 of file CaloTDigitizer.h.
CaloTDigitizer< Traits >::CaloTDigitizer | ( | CaloHitResponse * | hitResponse, |
ElectronicsSim * | electronicsSim, | ||
bool | addNoise | ||
) | [inline] |
Definition at line 27 of file CaloTDigitizer.h.
: theHitResponse(hitResponse), theNoiseHitGenerator(0), theNoiseSignalGenerator(0), theElectronicsSim(electronicsSim), theDetIds(0), addNoise_(addNoise) { }
CaloTDigitizer< Traits >::~CaloTDigitizer | ( | ) | [inline] |
void CaloTDigitizer< Traits >::addNoiseHits | ( | ) | [inline] |
Definition at line 101 of file CaloTDigitizer.h.
References CaloHitResponse::add(), CaloVNoiseHitGenerator::getNoiseHits(), CaloTDigitizer< Traits >::theHitResponse, and CaloTDigitizer< Traits >::theNoiseHitGenerator.
Referenced by CaloTDigitizer< Traits >::run().
{ std::vector<PCaloHit> noiseHits; theNoiseHitGenerator->getNoiseHits(noiseHits); for(std::vector<PCaloHit>::const_iterator hitItr = noiseHits.begin(), hitEnd = noiseHits.end(); hitItr != hitEnd; ++hitItr) { theHitResponse->add(*hitItr); } }
void CaloTDigitizer< Traits >::addNoiseSignals | ( | ) | [inline] |
Definition at line 112 of file CaloTDigitizer.h.
References CaloHitResponse::add(), CaloVNoiseSignalGenerator::fillEvent(), CaloVNoiseSignalGenerator::getNoiseSignals(), CaloTDigitizer< Traits >::theHitResponse, and CaloTDigitizer< Traits >::theNoiseSignalGenerator.
Referenced by CaloTDigitizer< Traits >::run().
{ std::vector<CaloSamples> noiseSignals; // noise signals need to be in units of photoelectrons. Fractional is OK theNoiseSignalGenerator->fillEvent(); theNoiseSignalGenerator->getNoiseSignals(noiseSignals); for(std::vector<CaloSamples>::const_iterator signalItr = noiseSignals.begin(), signalEnd = noiseSignals.end(); signalItr != signalEnd; ++signalItr) { theHitResponse->add(*signalItr); } }
const std::vector<DetId>& CaloTDigitizer< Traits >::detIds | ( | ) | const [inline] |
tell the digitizer which cells exist
Definition at line 42 of file CaloTDigitizer.h.
References CaloTDigitizer< Traits >::theDetIds.
Referenced by CaloTDigitizer< Traits >::setDetIds().
void CaloTDigitizer< Traits >::run | ( | MixCollection< PCaloHit > & | input, |
DigiCollection & | output | ||
) | [inline] |
turns hits into digis
Definition at line 62 of file CaloTDigitizer.h.
References CaloTDigitizer< Traits >::addNoise_, CaloTDigitizer< Traits >::addNoiseHits(), CaloTDigitizer< Traits >::addNoiseSignals(), CaloHitResponse::clear(), CaloHitResponse::findSignal(), CaloHitResponse::makeBlankSignal(), CaloHitResponse::nSignals(), CaloHitResponse::run(), CaloTDigitizer< Traits >::theDetIds, CaloTDigitizer< Traits >::theElectronicsSim, CaloTDigitizer< Traits >::theHitResponse, CaloTDigitizer< Traits >::theNoiseHitGenerator, and CaloTDigitizer< Traits >::theNoiseSignalGenerator.
Referenced by EcalDigiProducer::produce(), HcalDigitizer::produce(), HcalTBDigiProducer::produce(), and CastorDigiProducer::produce().
{ assert(theDetIds->size() != 0); if(theNoiseHitGenerator != 0) addNoiseHits(); if(theNoiseSignalGenerator != 0) addNoiseSignals(); theHitResponse->run(input); theElectronicsSim->newEvent(); // reserve space for how many digis we expect int nDigisExpected = addNoise_ ? theDetIds->size() : theHitResponse->nSignals(); output.reserve(nDigisExpected); // make a raw digi for evey cell for(std::vector<DetId>::const_iterator idItr = theDetIds->begin(); idItr != theDetIds->end(); ++idItr) { Digi digi(*idItr); CaloSamples * analogSignal = theHitResponse->findSignal(*idItr); bool needToDeleteSignal = false; // don't bother digitizing if no signal and no noise if(analogSignal == 0 && addNoise_) { // I guess we need to make a blank signal for this cell. // Don't bother storing it anywhere. analogSignal = new CaloSamples(theHitResponse->makeBlankSignal(*idItr)); needToDeleteSignal = true; } if(analogSignal != 0) { theElectronicsSim->analogToDigital(*analogSignal , digi); output.push_back(digi); if(needToDeleteSignal) delete analogSignal; } } // free up some memory theHitResponse->clear(); }
void CaloTDigitizer< Traits >::setDetIds | ( | const std::vector< DetId > & | detIds | ) | [inline] |
Definition at line 43 of file CaloTDigitizer.h.
References CaloTDigitizer< Traits >::detIds(), and CaloTDigitizer< Traits >::theDetIds.
Referenced by HcalDigitizer::buildHOSiPMCells(), CastorDigiProducer::checkGeometry(), HcalTBDigiProducer::updateGeometry(), HcalDigitizer::updateGeometry(), and EcalDigiProducer::updateGeometry().
void CaloTDigitizer< Traits >::setNoiseHitGenerator | ( | CaloVNoiseHitGenerator * | generator | ) | [inline] |
Definition at line 45 of file CaloTDigitizer.h.
References python::IdGenerator::generator, and CaloTDigitizer< Traits >::theNoiseHitGenerator.
Referenced by HcalDigitizer::HcalDigitizer().
{ theNoiseHitGenerator = generator; }
void CaloTDigitizer< Traits >::setNoiseSignalGenerator | ( | CaloVNoiseSignalGenerator * | generator | ) | [inline] |
Definition at line 50 of file CaloTDigitizer.h.
References python::IdGenerator::generator, and CaloTDigitizer< Traits >::theNoiseSignalGenerator.
Referenced by HcalDigitizer::HcalDigitizer(), HcalDigitizer::setHBHENoiseSignalGenerator(), HcalDigitizer::setHFNoiseSignalGenerator(), HcalDigitizer::setHONoiseSignalGenerator(), and HcalDigitizer::setZDCNoiseSignalGenerator().
{ theNoiseSignalGenerator = generator; }
void CaloTDigitizer< Traits >::setRandomEngine | ( | CLHEP::HepRandomEngine & | engine | ) | [inline] |
Definition at line 55 of file CaloTDigitizer.h.
References CaloHitResponse::setRandomEngine(), CaloTDigitizer< Traits >::theElectronicsSim, and CaloTDigitizer< Traits >::theHitResponse.
Referenced by HcalDigitizer::HcalDigitizer().
{ theHitResponse->setRandomEngine(engine); theElectronicsSim->setRandomEngine(engine); }
bool CaloTDigitizer< Traits >::addNoise_ [private] |
Definition at line 131 of file CaloTDigitizer.h.
Referenced by CaloTDigitizer< Traits >::run().
const std::vector<DetId>* CaloTDigitizer< Traits >::theDetIds [private] |
Definition at line 130 of file CaloTDigitizer.h.
Referenced by CaloTDigitizer< Traits >::detIds(), CaloTDigitizer< Traits >::run(), and CaloTDigitizer< Traits >::setDetIds().
ElectronicsSim* CaloTDigitizer< Traits >::theElectronicsSim [private] |
Definition at line 129 of file CaloTDigitizer.h.
Referenced by CaloTDigitizer< Traits >::run(), and CaloTDigitizer< Traits >::setRandomEngine().
CaloHitResponse* CaloTDigitizer< Traits >::theHitResponse [private] |
Definition at line 126 of file CaloTDigitizer.h.
Referenced by CaloTDigitizer< Traits >::addNoiseHits(), CaloTDigitizer< Traits >::addNoiseSignals(), CaloTDigitizer< Traits >::run(), and CaloTDigitizer< Traits >::setRandomEngine().
CaloVNoiseHitGenerator* CaloTDigitizer< Traits >::theNoiseHitGenerator [private] |
Definition at line 127 of file CaloTDigitizer.h.
Referenced by CaloTDigitizer< Traits >::addNoiseHits(), CaloTDigitizer< Traits >::run(), and CaloTDigitizer< Traits >::setNoiseHitGenerator().
CaloVNoiseSignalGenerator* CaloTDigitizer< Traits >::theNoiseSignalGenerator [private] |
Definition at line 128 of file CaloTDigitizer.h.
Referenced by CaloTDigitizer< Traits >::addNoiseSignals(), CaloTDigitizer< Traits >::run(), and CaloTDigitizer< Traits >::setNoiseSignalGenerator().