8 #include "CLHEP/Random/RandPoissonQ.h"
9 #include "CLHEP/Random/RandGaussQ.h"
23 m_apdOnly ( apdOnly ) ,
24 m_apdPars ( apdPars ) ,
25 m_apdShape ( apdShape ) ,
26 m_timeOffVec ( kNOffsets, apdParameters()->timeOffset() ) ,
27 pcub ( 0 == apdPars ? 0 : apdParameters()->nonlParms()[0] ) ,
28 pqua ( 0 == apdPars ? 0 : apdParameters()->nonlParms()[1] ) ,
29 plin ( 0 == apdPars ? 0 : apdParameters()->nonlParms()[2] ) ,
30 pcon ( 0 == apdPars ? 0 : apdParameters()->nonlParms()[3] ) ,
31 pelo ( 0 == apdPars ? 0 : apdParameters()->nonlParms()[4] ) ,
32 pehi ( 0 == apdPars ? 0 : apdParameters()->nonlParms()[5] ) ,
33 pasy ( 0 == apdPars ? 0 : apdParameters()->nonlParms()[6] ) ,
34 pext ( 0 == apdPars ? 0 : nonlFunc1( pelo ) ) ,
35 poff ( 0 == apdPars ? 0 : nonlFunc1( pehi ) ) ,
36 pfac ( 0 == apdPars ? 0 : ( pasy - poff )*2./
M_PI ),
37 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 )
67 CLHEP::RandGaussQ::shoot(engine, 0,
apdParameters()->timeOffWidth() ) ;
98 const double signal ( npe*
nonlFunc( npe*energyFac ) ) ;
104 <<
"EBHitResponse::putAPDSignal called without initializing\n";
113 double binTime ( tzero ) ;
138 CLHEP::RandPoissonQ randPoissonQ(*engine, npe);
139 npe = randPoissonQ.fire();
164 double& icalconst )
const
171 "No intercal constant defined for EBHitResponse" ;
177 if( icalit != icalMap.end() )
179 thisconst = *icalit ;
180 if ( thisconst == 0. ) thisconst = 1. ;
184 edm::LogError(
"EBHitResponse") <<
"No intercalib const found for xtal "
186 <<
"! something wrong with EcalIntercalibConstants in your DB? ";
189 icalconst = thisconst ;
200 m_apdNpeVec = std::vector<double>( bSize, (double)0.0 ) ;
201 m_apdTimeVec = std::vector<double>( bSize, (double)0.0 ) ;
211 for(
unsigned int i ( 0 ) ;
i != bSize ; ++
i )
231 if( 0 == hit.
depth() )
240 const unsigned int icell (
EBDetId( hit.
id() ).denseIndex() ) ;
257 m_apdNpeVec = std::vector<double>( bSize, (double)0.0 ) ;
258 m_apdTimeVec = std::vector<double>( bSize, (double)0.0 ) ;
262 hitItr != hits.
end() ; ++hitItr )
265 const int bunch ( hitItr.bunch() ) ;
272 if( 0 == hit.
depth() )
281 const unsigned int icell (
EBDetId( hit.
id() ).denseIndex() ) ;
292 for(
unsigned int i ( 0 ) ;
i != bSize ; ++
i )
double simToPEHigh() const
const self & getMap() const
std::vector< EBSamples > m_vSam
virtual EcalSamples * operator[](unsigned int i) override
const CaloVShape * m_apdShape
void putAPDSignal(const DetId &detId, double npe, double time)
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
double phaseShift() const
void setIntercal(const EcalIntercalibConstantsMC *ical)
const CaloVHitFilter * hitFilter() const
const VecD & offsets() const
virtual void initializeHits() override
void blankOutUsedSamples()
double apdSignalAmplitude(const PCaloHit &hit, CLHEP::HepRandomEngine *) const
double simHitToPhotoelectrons() const
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
virtual unsigned int samplesSize() const override
virtual bool accepts(const PCaloHit &hit) const =0
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
virtual EcalSamples * vSamAll(unsigned int i) override
EBHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape, bool apdOnly, const APDSimParameters *apdPars, const CaloVShape *apdShape)
virtual 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
virtual unsigned int samplesSizeAll() const override
volatile std::atomic< bool > shutdown_flag false
Detector det() const
get the detector field from this detid
virtual void run(MixCollection< PCaloHit > &hits, CLHEP::HepRandomEngine *) override
double simToPELow() const
tuple size
Write out results.
virtual void finalizeHits() override
std::vector< double > m_apdTimeVec
std::vector< double > m_apdNpeVec
const CaloVShape * apdShape() const
virtual void add(const PCaloHit &hit, CLHEP::HepRandomEngine *) override