1 #ifndef CaloSimAlgos_CaloTDigitizer_h
2 #define CaloSimAlgos_CaloTDigitizer_h
16 template<
class Traits>
24 typedef typename Traits::Digi
Digi;
73 output.reserve(nDigisExpected);
76 for(std::vector<DetId>::const_iterator idItr =
theDetIds->begin();
81 bool needToDeleteSignal =
false;
87 needToDeleteSignal =
true;
89 if(analogSignal != 0) {
91 output.push_back(digi);
92 if(needToDeleteSignal)
delete analogSignal;
103 std::vector<PCaloHit> noiseHits;
105 for(std::vector<PCaloHit>::const_iterator hitItr = noiseHits.begin(),
106 hitEnd = noiseHits.end(); hitItr != hitEnd; ++hitItr)
114 std::vector<CaloSamples> noiseSignals;
118 for(std::vector<CaloSamples>::const_iterator signalItr = noiseSignals.begin(),
119 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)
virtual void getNoiseHits(std::vector< PCaloHit > &noiseHits)=0
Traits::DigiCollection DigiCollection
Creates electronics signals from hits.
void run(MixCollection< PCaloHit > &input, DigiCollection &output)
turns hits into digis
virtual void add(const PCaloHit &hit)
process a single SimHit
CaloVNoiseHitGenerator * theNoiseHitGenerator
void setNoiseSignalGenerator(CaloVNoiseSignalGenerator *generator)
CaloVNoiseSignalGenerator * theNoiseSignalGenerator
CaloHitResponse * theHitResponse
virtual void run(MixCollection< PCaloHit > &hits)
Complete cell digitization.
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