|
|
Go to the documentation of this file. 1 #ifndef CaloSimAlgos_CaloTDigitizer_h
2 #define CaloSimAlgos_CaloTDigitizer_h
18 class HepRandomEngine;
21 template <
class Traits>
29 CLHEP::HepRandomEngine *engine,
31 std::vector<DetId>::const_iterator idItr,
34 theElectronicsSim->analogToDigital(engine, *analogSignal, digi);
63 const std::vector<DetId> &
detIds()
const {
75 void add(
const std::vector<PCaloHit> &
hits,
int bunchCrossing, CLHEP::HepRandomEngine *engine) {
77 for (std::vector<PCaloHit>::const_iterator it =
hits.begin(), itEnd =
hits.end(); it != itEnd; ++it) {
103 output.reserve(nDigisExpected);
106 csColl_.reserve(nDigisExpected);
111 for (std::vector<DetId>::const_iterator idItr =
theDetIds->begin(); idItr !=
theDetIds->end(); ++idItr) {
114 csColl_.push_back(*analogSignal);
115 bool needToDeleteSignal =
false;
117 if (analogSignal ==
nullptr &&
addNoise_) {
121 needToDeleteSignal =
true;
123 if (analogSignal !=
nullptr) {
125 if (needToDeleteSignal)
135 std::vector<CaloSamples> noiseSignals;
139 for (std::vector<CaloSamples>::const_iterator signalItr = noiseSignals.begin(), signalEnd = noiseSignals.end();
140 signalItr != signalEnd;
void add(const std::vector< PCaloHit > &hits, int bunchCrossing, CLHEP::HepRandomEngine *engine)
Traits::DigiCollection DigiCollection
CaloSamplesCollection csColl_
ElectronicsSim * theElectronicsSim
void operator()(DigiCollection &output, CLHEP::HepRandomEngine *engine, CaloSamples *analogSignal, std::vector< DetId >::const_iterator idItr, ElectronicsSim *theElectronicsSim)
void run(DigiCollection &output, CLHEP::HepRandomEngine *engine)
Collects the digis.
void setDetIds(const std::vector< DetId > &detIds)
CaloHitResponse * theHitResponse
bool withinBunchRange(int bunchCrossing) const
check if crossing is within bunch range:
const std::vector< DetId > & detIds() const
tell the digitizer which cells exist
CaloTDigitizer(CaloHitResponse *hitResponse, ElectronicsSim *electronicsSim, bool addNoise)
int nSignals() const
number of signals in the current cache
virtual void initializeHits()
Initialize hits.
void addNoiseSignals(CLHEP::HepRandomEngine *engine)
virtual void add(const PCaloHit &hit, CLHEP::HepRandomEngine *)
process a single SimHit
virtual void finalizeHits(CLHEP::HepRandomEngine *)
Finalize hits.
void setNoiseSignalGenerator(CaloVNoiseSignalGenerator *generator)
Traits::DigiCollection DigiCollection
Creates electronics signals from hits.
~CaloTDigitizer()
doesn't delete the pointers passed in
CaloSamples makeBlankSignal(const DetId &detId) const
creates an empty signal for this DetId
CaloVNoiseSignalGenerator * theNoiseSignalGenerator
void getNoiseSignals(std::vector< CaloSamples > &noiseSignals)
runHelper< Traits > runAnalogToDigital
const CaloSamplesCollection & getCaloSamples() const
void run(MixCollection< PCaloHit > &, DigiCollection &)
turns hits into digis
Traits::ElectronicsSim ElectronicsSim
CaloSamples * findSignal(const DetId &detId)
users can look for the signal for a given cell
void fillEvent(CLHEP::HepRandomEngine *)
fill theNoiseSignals with one event's worth of noise, in units of pe
void setDebugCaloSamples(bool debug)
const std::vector< DetId > * theDetIds
std::vector< CaloSamples > CaloSamplesCollection
void clear()
frees up memory
void setStorePrecise(bool sp)
Traits::ElectronicsSim ElectronicsSim