1 #ifndef CaloSimAlgos_CaloTDigitizer_h
2 #define CaloSimAlgos_CaloTDigitizer_h
18 class HepRandomEngine;
21 template<
class Traits>
30 theElectronicsSim->analogToDigital(engine, *analogSignal , digi);
76 void add(
const std::vector<PCaloHit> & hits,
int bunchCrossing, CLHEP::HepRandomEngine* engine) {
78 for(std::vector<PCaloHit>::const_iterator it = hits.begin(), itEnd = hits.end(); it != itEnd; ++it) {
108 output.reserve(nDigisExpected);
111 for(std::vector<DetId>::const_iterator idItr =
theDetIds->begin();
115 bool needToDeleteSignal =
false;
121 needToDeleteSignal =
true;
123 if(analogSignal != 0) {
125 if(needToDeleteSignal)
delete analogSignal;
135 std::vector<PCaloHit> noiseHits;
137 for(std::vector<PCaloHit>::const_iterator hitItr = noiseHits.begin(),
138 hitEnd = noiseHits.end(); hitItr != hitEnd; ++hitItr)
146 std::vector<CaloSamples> noiseSignals;
150 for(std::vector<CaloSamples>::const_iterator signalItr = noiseSignals.begin(),
151 signalEnd = noiseSignals.end(); signalItr != signalEnd; ++signalItr)
void setNoiseHitGenerator(CaloVNoiseHitGenerator *generator)
CaloSamples makeBlankSignal(const DetId &detId) const
creates an empty signal for this DetId
void add(const std::vector< PCaloHit > &hits, int bunchCrossing, CLHEP::HepRandomEngine *engine)
Traits::ElectronicsSim ElectronicsSim
bool withinBunchRange(int bunchCrossing) const
check if crossing is within bunch range:
const std::vector< DetId > & detIds() const
tell the digitizer which cells exist
virtual void getNoiseHits(std::vector< PCaloHit > &noiseHits)=0
void operator()(DigiCollection &output, CLHEP::HepRandomEngine *engine, CaloSamples *analogSignal, std::vector< DetId >::const_iterator idItr, ElectronicsSim *theElectronicsSim)
std::tuple< unsigned int, int, int, DigiType, int, int, int, float > Digi
Traits::ElectronicsSim ElectronicsSim
CaloVNoiseSignalGenerator * theNoiseSignalGenerator
virtual void finalizeHits(CLHEP::HepRandomEngine *)
Finalize hits.
Creates electronics signals from hits.
CaloTDigitizer(CaloHitResponse *hitResponse, ElectronicsSim *electronicsSim, bool addNoise)
virtual void initializeHits()
Initialize hits.
void addNoiseSignals(CLHEP::HepRandomEngine *engine)
void addNoiseHits(CLHEP::HepRandomEngine *engine)
void setNoiseSignalGenerator(CaloVNoiseSignalGenerator *generator)
CaloHitResponse * theHitResponse
runHelper< Traits > runAnalogToDigital
~CaloTDigitizer()
doesn't delete the pointers passed in
CaloVNoiseHitGenerator * theNoiseHitGenerator
void run(MixCollection< PCaloHit > &, DigiCollection &)
turns hits into digis
ElectronicsSim * theElectronicsSim
CaloSamples * findSignal(const DetId &detId)
users can look for the signal for a given cell
virtual void add(const PCaloHit &hit, CLHEP::HepRandomEngine *)
process a single SimHit
void fillEvent(CLHEP::HepRandomEngine *)
fill theNoiseSignals with one event's worth of noise, in units of pe
void clear()
frees up memory
Traits::DigiCollection DigiCollection
void getNoiseSignals(std::vector< CaloSamples > &noiseSignals)
Traits::DigiCollection DigiCollection
int nSignals() const
number of signals in the current cache
void run(DigiCollection &output, CLHEP::HepRandomEngine *engine)
Collects the digis.
void setDetIds(const std::vector< DetId > &detIds)
const std::vector< DetId > * theDetIds