|
|
Go to the documentation of this file.
8 #include "CLHEP/Random/RandPoissonQ.h"
9 #include "CLHEP/Random/RandGaussQ.h"
27 m_timeOffVec(kNOffsets, apdParameters()->
timeOffset()),
28 pcub(nullptr == apdPars ? 0 : apdParameters()->nonlParms()[0]),
29 pqua(nullptr == apdPars ? 0 : apdParameters()->nonlParms()[1]),
30 plin(nullptr == apdPars ? 0 : apdParameters()->nonlParms()[2]),
31 pcon(nullptr == apdPars ? 0 : apdParameters()->nonlParms()[3]),
32 pelo(nullptr == apdPars ? 0 : apdParameters()->nonlParms()[4]),
33 pehi(nullptr == apdPars ? 0 : apdParameters()->nonlParms()[5]),
34 pasy(nullptr == apdPars ? 0 : apdParameters()->nonlParms()[6]),
35 pext(nullptr == apdPars ? 0 : nonlFunc1(pelo)),
36 poff(nullptr == apdPars ? 0 : nonlFunc1(pehi)),
37 pfac(nullptr == apdPars ? 0 : (pasy - poff) * 2. /
M_PI),
38 m_isInitialized(
false) {
42 const unsigned int rSize(
parameters.readoutFrameSize());
43 const unsigned int nPre(
parameters.binOfMaximum() - 1);
49 for (
unsigned int i(0);
i !=
size; ++
i) {
76 const double energyFac(1. /
parameters.simHitToPhotoelectrons(detId));
82 const double signal(npe *
nonlFunc(npe * energyFac));
87 throw cms::Exception(
"LogicError") <<
"EBHitResponse::putAPDSignal called without initializing\n";
93 double binTime(
tzero);
105 assert(1 == iddepth || 2 == iddepth);
111 CLHEP::RandPoissonQ randPoissonQ(*engine, npe);
112 npe = randPoissonQ.fire();
135 edm::LogError(
"EBHitResponse") <<
"No intercal constant defined for EBHitResponse";
139 if (icalit != icalMap.end()) {
144 edm::LogError(
"EBHitResponse") <<
"No intercalib const found for xtal " << detId.
rawId()
145 <<
"! something wrong with EcalIntercalibConstants in your DB? ";
148 icalconst = thisconst;
158 m_apdNpeVec = std::vector<double>(bSize, (
double)0.0);
166 for (
unsigned int i(0);
i != bSize; ++
i) {
188 const unsigned int icell(
EBDetId(
hit.
id()).denseIndex());
204 m_apdNpeVec = std::vector<double>(bSize, (
double)0.0);
210 const int bunch(hitItr.bunch());
221 const unsigned int icell(
EBDetId(
hit.
id()).denseIndex());
231 for (
unsigned int i(0);
i != bSize; ++
i) {
const self & getMap() const
void run(MixCollection< PCaloHit > &hits, CLHEP::HepRandomEngine *) override
std::vector< double > m_apdNpeVec
double simToPEHigh() const
void add(const PCaloHit &hit, CLHEP::HepRandomEngine *) override
std::vector< double > m_timeOffVec
void blankOutUsedSamples()
constexpr bool isNotFinite(T x)
constexpr Detector det() const
get the detector field from this detid
double apdSignalAmplitude(const PCaloHit &hit, CLHEP::HepRandomEngine *) const
double timeOfFlight(const DetId &detId) const
void initializeHits() override
virtual void putAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *)
const CaloVShape * apdShape() const
double phaseShift() const
const EcalIntercalibConstantsMC * m_intercal
const CaloVShape * m_apdShape
void setIntercal(const EcalIntercalibConstantsMC *ical)
void putAPDSignal(const DetId &detId, double npe, double time)
const double nonlFunc(double enr) const
EBHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape, bool apdOnly, const APDSimParameters *apdPars, const CaloVShape *apdShape)
const APDSimParameters * m_apdPars
virtual bool accepts(const PCaloHit &hit) const =0
Main class for Parameters in different subdetectors.
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
unsigned int samplesSize() const override
static const double tzero[3]
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
const CaloSimParameters * params(const DetId &detId) const
static EBDetId detIdFromDenseIndex(uint32_t di)
EcalSamples * vSamAll(unsigned int i) override
Electronic response of the preamp.
std::vector< EBSamples > m_vSam
EcalSamples * findSignal(const DetId &detId)
const VecD & offsets() const
void finalizeHits() override
constexpr uint32_t rawId() const
get the raw id
float EcalIntercalibConstantMC
const CaloVHitFilter * hitFilter() const
const APDSimParameters * apdParameters() const
void findIntercalibConstant(const DetId &detId, double &icalconst) const
std::vector< Item >::const_iterator const_iterator
std::vector< double > m_apdTimeVec
EcalSamples * operator[](unsigned int i) override
~EBHitResponse() override
void initialize(CLHEP::HepRandomEngine *)
double simToPELow() const
EcalSamples * vSam(unsigned int i) override
unsigned int samplesSizeAll() const override
static const int kEcalDepthIdMask