15 #include "CLHEP/Random/RandPoissonQ.h" 16 #include "CLHEP/Units/GlobalPhysicalConstants.h" 17 #include "CLHEP/Units/GlobalSystemOfUnits.h" 22 : theAnalogSignalMap(),
23 theParameterMap(parametersMap),
78 const unsigned int size(signal.
size());
80 for (
unsigned int i(0);
i !=
size; ++
i) {
81 keep = keep || signal[
i] > 1.e-7;
94 if (oldSignal ==
nullptr) {
98 (*oldSignal) += signal;
114 double jitter = time - tof;
121 const double tzero = (shape->
timeToRise() + parameters.timePhase() - jitter -
123 double binTime =
tzero;
133 double pulseBit = (*shape)(binTime)*signal;
134 result[sampleBin] += pulseBit;
140 result[
bin] += (*shape)(binTime)*signal;
150 CLHEP::HepRandomEngine *engine)
const {
157 npe = CLHEP::RandPoissonQ::shoot(engine, npe);
170 result = &(signalItr->second);
190 edm::LogWarning(
"CaloHitResponse") <<
"No Calo Geometry set, so no time of flight correction";
193 if (cellGeometry ==
nullptr) {
195 <<
" so no time-of-flight subtraction will be done";
197 double distance = cellGeometry->getPosition().mag();
198 result = distance * cm / c_light;
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
CaloSamples makeBlankSignal(const DetId &detId) const
creates an empty signal for this DetId
virtual ~CaloHitResponse()
doesn't delete the pointers passed in
constexpr bool isNotFinite(T x)
virtual const CaloVShape * shape(const DetId &detId, bool precise=false) const
bool withinBunchRange(int bunchCrossing) const
check if crossing is within bunch range:
constexpr uint32_t rawId() const
get the raw id
bool doPhotostatistics() const
whether or not to apply Poisson statistics to photoelectrons
virtual bool keepBlank() const
virtual double delay(const PCaloHit &hit, CLHEP::HepRandomEngine *) const =0
Electronic response of the preamp.
CaloHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
virtual void run(const MixCollection< PCaloHit > &hits, CLHEP::HepRandomEngine *)
Complete cell digitization.
Main class for Parameters in different subdetectors.
const CaloGeometry * theGeometry
const CaloVPECorrection * thePECorrection
virtual bool accepts(const PCaloHit &hit) const =0
virtual double timeToRise() const =0
virtual CaloSamples makeAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *) const
creates the signal corresponding to this hit
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
double simHitToPhotoelectrons() const
double timeOfFlight(const DetId &detId) const
int readoutFrameSize() const
for now, the LinearFrames and trhe digis will be one-to-one.
const CaloVHitCorrection * theHitCorrection
bin
set the eta bin as selection string.
AnalogSignalMap theAnalogSignalMap
double analogSignalAmplitude(const DetId &id, float energy, const CaloSimParameters ¶meters, CLHEP::HepRandomEngine *) const
const CaloShapes * theShapes
const CaloVSimParameterMap * theParameterMap
int size() const
get the size
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 correctPE(const DetId &detId, double npe, CLHEP::HepRandomEngine *) const =0
void setBunchRange(int minBunch, int maxBunch)
tells it which pileup bunches to do
CaloSamples * findSignal(const DetId &detId)
users can look for the signal for a given cell
float & preciseAtMod(int i)
mutable function to access precise samples
virtual void add(const PCaloHit &hit, CLHEP::HepRandomEngine *)
process a single SimHit
static const double tzero[3]
const CaloVHitFilter * theHitFilter
const CaloVShape * theShape
DetId id() const
get the (generic) id