15 #include "CLHEP/Random/RandPoissonQ.h" 16 #include "CLHEP/Units/GlobalPhysicalConstants.h" 17 #include "CLHEP/Units/GlobalSystemOfUnits.h" 25 : theAnalogSignalMap(),
26 theParameterMap(parametersMap),
29 theHitCorrection(nullptr),
30 thePECorrection(nullptr),
31 theHitFilter(nullptr),
36 storePrecise(HighFidelity),
38 highFidelityPreMix(HighFidelity),
45 : theAnalogSignalMap(),
46 theParameterMap(parametersMap),
49 theHitCorrection(nullptr),
50 thePECorrection(nullptr),
51 theHitFilter(nullptr),
56 storePrecise(HighFidelity),
58 highFidelityPreMix(HighFidelity),
99 const unsigned int size(signal.
size());
101 for (
unsigned int i(0);
i !=
size; ++
i) {
115 if (oldSignal ==
nullptr) {
119 (*oldSignal) += signal;
135 double jitter =
time - tof;
144 double binTime =
tzero;
154 double pulseBit = (*shape)(binTime)*signal *
dt;
155 result[sampleBin] += pulseBit;
171 CLHEP::HepRandomEngine *engine)
const {
178 npe = CLHEP::RandPoissonQ::shoot(engine, npe);
191 result = &(signalItr->second);
213 result.setPreciseSize(preciseSize);
224 edm::LogWarning(
"CaloHitResponse") <<
"No Calo Geometry set, so no time of flight correction";
227 if (cellGeometry ==
nullptr) {
229 <<
" so no time-of-flight subtraction will be done";
231 double distance = cellGeometry->getPosition().mag();
CaloHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape, bool PreMix1=false, bool HighFidelity=false)
int size() const
get the size
virtual ~CaloHitResponse()
doesn't delete the pointers passed in
constexpr bool isNotFinite(T x)
Electronic response of the preamp.
static constexpr int invdt
virtual void run(const MixCollection< PCaloHit > &hits, CLHEP::HepRandomEngine *)
Complete cell digitization.
Main class for Parameters in different subdetectors.
const CaloGeometry * theGeometry
virtual double correctPE(const DetId &detId, double npe, CLHEP::HepRandomEngine *) const =0
double analogSignalAmplitude(const DetId &id, float energy, const CaloSimParameters ¶meters, CLHEP::HepRandomEngine *) const
const CaloVPECorrection * thePECorrection
DetId id() const
get the (generic) id
virtual const CaloVShape * shape(const DetId &detId, bool precise=false) const
int getReadoutFrameSize(const DetId &id) const
virtual bool keepBlank() const
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
virtual bool accepts(const PCaloHit &hit) const =0
const CaloVHitCorrection * theHitCorrection
bool withinBunchRange(int bunchCrossing) const
check if crossing is within bunch range:
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
virtual double delay(const PCaloHit &hit, CLHEP::HepRandomEngine *) const =0
AnalogSignalMap theAnalogSignalMap
const CaloShapes * theShapes
const CaloVSimParameterMap * theParameterMap
virtual CaloSamples makeAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *) const
creates the signal corresponding to this hit
void setBunchRange(int minBunch, int maxBunch)
tells it which pileup bunches to do
double timeOfFlight(const DetId &detId) const
CaloSamples * findSignal(const DetId &detId)
users can look for the signal for a given cell
virtual void finalizeHits(CLHEP::HepRandomEngine *)
Finalize hits.
virtual void add(const PCaloHit &hit, CLHEP::HepRandomEngine *)
process a single SimHit
static constexpr double dt
static const double tzero[3]
const CaloVHitFilter * theHitFilter
const CaloVShape * theShape
Log< level::Warning, false > LogWarning
CaloSamples makeBlankSignal(const DetId &detId) const
creates an empty signal for this DetId
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly