1 #ifndef CaloSimAlgos_CaloTDigitizer_h
2 #define CaloSimAlgos_CaloTDigitizer_h
17 template<
class Traits>
25 typedef typename Traits::Digi
Digi;
62 void add(
const std::vector<PCaloHit> & hits,
int bunchCrossing) {
64 for(std::vector<PCaloHit>::const_iterator it = hits.begin(), itEnd = hits.end(); it != itEnd; ++it) {
99 output.reserve(nDigisExpected);
104 for(std::vector<DetId>::const_iterator idItr =
theDetIds->begin();
109 bool needToDeleteSignal =
false;
115 needToDeleteSignal =
true;
117 if(analogSignal != 0) {
121 output.push_back(std::move(digi));
122 if(needToDeleteSignal)
delete analogSignal;
133 std::vector<PCaloHit> noiseHits;
135 for(std::vector<PCaloHit>::const_iterator hitItr = noiseHits.begin(),
136 hitEnd = noiseHits.end(); hitItr != hitEnd; ++hitItr)
144 std::vector<CaloSamples> noiseSignals;
148 for(std::vector<CaloSamples>::const_iterator signalItr = noiseSignals.begin(),
149 signalEnd = noiseSignals.end(); signalItr != signalEnd; ++signalItr)
void setNoiseHitGenerator(CaloVNoiseHitGenerator *generator)
CaloSamples makeBlankSignal(const DetId &detId) const
creates an empty signal for this DetId
CaloTDigitizer(CaloHitResponse *hitResponse, ElectronicsSim *electronicsSim, bool addNoise)
bool withinBunchRange(int bunchCrossing) const
check if crossing is within bunch range:
void add(const std::vector< PCaloHit > &hits, int bunchCrossing)
virtual void getNoiseHits(std::vector< PCaloHit > &noiseHits)=0
Traits::DigiCollection DigiCollection
Creates electronics signals from hits.
virtual void initializeHits()
Initialize hits.
virtual void add(const PCaloHit &hit)
process a single SimHit
CaloVNoiseHitGenerator * theNoiseHitGenerator
void setNoiseSignalGenerator(CaloVNoiseSignalGenerator *generator)
void run(DigiCollection &output)
Collects the digis.
CaloVNoiseSignalGenerator * theNoiseSignalGenerator
CaloHitResponse * theHitResponse
virtual void finalizeHits()
Finalize hits.
void run(MixCollection< PCaloHit > &, DigiCollection &)
turns hits into digis
ElectronicsSim * theElectronicsSim
void fillEvent()
fill theNoiseSignals with one event's worth of noise, in units of pe
Traits::ElectronicsSim ElectronicsSim
CaloSamples * findSignal(const DetId &detId)
users can look for the signal for a given cell
void clear()
frees up memory
void setDetIds(const std::vector< DetId > &detIds)
void getNoiseSignals(std::vector< CaloSamples > &noiseSignals)
const std::vector< DetId > * theDetIds
virtual void setRandomEngine(CLHEP::HepRandomEngine &engine)
void setRandomEngine(CLHEP::HepRandomEngine &engine)
int nSignals() const
number of signals in the current cache
~CaloTDigitizer()
doesn't delete the pointers passed in
const std::vector< DetId > & detIds() const
tell the digitizer which cells exist