8 #include "CLHEP/Random/RandPoissonQ.h" 9 #include "CLHEP/Random/RandGaussQ.h" 24 m_apdOnly ( apdOnly ) ,
25 m_apdPars ( apdPars ) ,
26 m_apdShape ( apdShape ) ,
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)
43 const unsigned int rSize (
parameters.readoutFrameSize() ) ;
44 const unsigned int nPre (
parameters.binOfMaximum() - 1 ) ;
50 for(
unsigned int i ( 0 ) ;
i !=
size ; ++
i )
68 CLHEP::RandGaussQ::shoot(engine, 0,
apdParameters()->timeOffWidth() ) ;
99 const double signal ( npe*
nonlFunc( npe*energyFac ) ) ;
105 <<
"EBHitResponse::putAPDSignal called without initializing\n";
114 double binTime ( tzero ) ;
129 assert( 1 == iddepth || 2 == iddepth ) ;
131 double npe ( hit.
energy()*( 2 == iddepth ?
139 CLHEP::RandPoissonQ randPoissonQ(*engine, npe);
140 npe = randPoissonQ.fire();
165 double& icalconst )
const 172 "No intercal constant defined for EBHitResponse" ;
178 if( icalit != icalMap.end() )
180 thisconst = *icalit ;
181 if ( thisconst == 0. ) thisconst = 1. ;
185 edm::LogError(
"EBHitResponse") <<
"No intercalib const found for xtal " 187 <<
"! something wrong with EcalIntercalibConstants in your DB? ";
190 icalconst = thisconst ;
201 m_apdNpeVec = std::vector<double>( bSize, (double)0.0 ) ;
202 m_apdTimeVec = std::vector<double>( bSize, (double)0.0 ) ;
212 for(
unsigned int i ( 0 ) ;
i != bSize ; ++
i )
242 const unsigned int icell (
EBDetId( hit.
id() ).denseIndex() ) ;
259 m_apdNpeVec = std::vector<double>( bSize, (double)0.0 ) ;
260 m_apdTimeVec = std::vector<double>( bSize, (double)0.0 ) ;
264 hitItr != hits.
end() ; ++hitItr )
267 const int bunch ( hitItr.bunch() ) ;
284 const unsigned int icell (
EBDetId( hit.
id() ).denseIndex() ) ;
295 for(
unsigned int i ( 0 ) ;
i != bSize ; ++
i )
double simToPEHigh() const
const self & getMap() const
std::vector< EBSamples > m_vSam
EcalSamples * operator[](unsigned int i) override
const CaloVShape * m_apdShape
void putAPDSignal(const DetId &detId, double npe, double time)
unsigned int samplesSize() const override
virtual void putAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *)
Electronic response of the preamp.
double timeOfFlight(const DetId &detId) const
const APDSimParameters * apdParameters() const
const APDSimParameters * m_apdPars
Main class for Parameters in different subdetectors.
const CaloSimParameters * params(const DetId &detId) const
static EBDetId detIdFromDenseIndex(uint32_t di)
uint32_t rawId() const
get the raw id
void findIntercalibConstant(const DetId &detId, double &icalconst) const
virtual bool accepts(const PCaloHit &hit) const =0
unsigned int samplesSizeAll() const override
double phaseShift() const
~EBHitResponse() override
void setIntercal(const EcalIntercalibConstantsMC *ical)
const CaloVHitFilter * hitFilter() const
const VecD & offsets() const
void initializeHits() override
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
void blankOutUsedSamples()
double apdSignalAmplitude(const PCaloHit &hit, CLHEP::HepRandomEngine *) const
double simHitToPhotoelectrons() const
const EcalIntercalibConstantsMC * m_intercal
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::vector< double > m_timeOffVec
EcalSamples * vSamAll(unsigned int i) override
bin
set the eta bin as selection string.
EBHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape, bool apdOnly, const APDSimParameters *apdPars, const CaloVShape *apdShape)
EcalSamples * vSam(unsigned int i) override
std::vector< Item >::const_iterator const_iterator
const double nonlFunc(double enr) const
void initialize(CLHEP::HepRandomEngine *)
static const double tzero[3]
EcalSamples * findSignal(const DetId &detId)
float EcalIntercalibConstantMC
Detector det() const
get the detector field from this detid
void run(MixCollection< PCaloHit > &hits, CLHEP::HepRandomEngine *) override
double simToPELow() const
void finalizeHits() override
std::vector< double > m_apdTimeVec
std::vector< double > m_apdNpeVec
const CaloVShape * apdShape() const
void add(const PCaloHit &hit, CLHEP::HepRandomEngine *) override
static const int kEcalDepthIdMask