13 #include "CLHEP/Random/RandPoissonQ.h"
16 #include "CLHEP/Units/GlobalPhysicalConstants.h"
17 #include "CLHEP/Units/GlobalSystemOfUnits.h"
24 m_parameterMap ( parameterMap ) ,
26 m_hitCorrection ( 0 ) ,
27 m_PECorrection ( 0 ) ,
35 m_useLCcorrection ( 0 )
126 for(
unsigned int i ( 0 ) ;
i !=
size ; ++
i )
145 const DetId detId ( hit.
id() ) ;
149 const int rsize ( result.size() ) ;
151 if(rsize != hit.
size()) {
153 <<
"CaloSamples and EcalSamples have different sizes. Type Mismatach";
156 for(
int bin ( 0 ) ;
bin != rsize ; ++
bin )
158 result[
bin ] += hit[
bin ] ;
167 return(m_minBunch <= bunchCrossing && m_maxBunch >= bunchCrossing);
187 hitItr != hits.
end() ; ++hitItr )
190 const int bunch ( hitItr.bunch() ) ;
201 const DetId detId ( hit.
id() ) ;
207 double time = hit.
time();
216 + parameters->timePhase()
220 double binTime ( tzero ) ;
224 const unsigned int rsize ( result.
size() ) ;
226 for(
unsigned int bin ( 0 ) ;
bin != rsize ; ++
bin )
228 result[
bin ] += (*
shape())( binTime )*signal ;
257 float lasercalib = 1.;
266 CLHEP::RandPoissonQ randPoissonQ(*engine, npe);
267 npe = randPoissonQ.fire();
278 assert( 0 != cellGeometry ) ;
const CaloVShape * m_shape
virtual void run(MixCollection< PCaloHit > &hits, CLHEP::HepRandomEngine *)
const CaloVShape * shape() const
double findLaserConstant(const DetId &detId) const
std::vector< unsigned int > VecInd
double analogSignalAmplitude(const DetId &id, float energy, CLHEP::HepRandomEngine *) const
void setEventTime(const edm::TimeValue_t &iTime)
virtual ~EcalHitResponse()
float getLaserCorrection(DetId const &xid, edm::Timestamp const &iTime) const
virtual void initializeHits()
virtual void putAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *)
bool doPhotostatistics() const
whether or not to apply Poisson statistics to photoelectrons
Electronic response of the preamp.
double timeOfFlight(const DetId &detId) const
CaloGeometry const * getGeometry()
Main class for Parameters in different subdetectors.
void setHitFilter(const CaloVHitFilter *filter)
const CaloSimParameters * params(const DetId &detId) const
virtual double correctPE(const DetId &detId, double npe, CLHEP::HepRandomEngine *) const =0
void setHitCorrection(const CaloVHitCorrection *hitCorrection)
void setBunchRange(int minBunch, int maxBunch)
void setLaserConstants(const EcalLaserDbService *laser, bool &useLCcorrection)
const EcalSamples * findDetId(const DetId &detId) const
double phaseShift() const
const CaloVHitFilter * hitFilter() const
EcalHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
void setPhaseShift(double phaseShift)
void blankOutUsedSamples()
const CaloVHitCorrection * m_hitCorrection
double simHitToPhotoelectrons() const
virtual double timeToRise() const =0
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
virtual bool accepts(const PCaloHit &hit) const =0
const EcalLaserDbService * m_lasercals
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
unsigned long long TimeValue_t
virtual double delay(const PCaloHit &hit, CLHEP::HepRandomEngine *) const =0
void setGeometry(const CaloSubdetectorGeometry *geometry)
const CaloSubdetectorGeometry * m_geometry
const CaloSubdetectorGeometry * geometry() const
int size() const
get the size
const CaloVSimParameterMap * m_parameterMap
void setPECorrection(const CaloVPECorrection *peCorrection)
const CaloVPECorrection * m_PECorrection
ESHandle< TrackerGeometry > geometry
static const double tzero[3]
EcalSamples * findSignal(const DetId &detId)
DetId id() const
get the (generic) id
virtual EcalSamples * vSamAll(unsigned int i)=0
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
void add(const EcalSamples *pSam)
const CaloVHitFilter * m_hitFilter
bool withinBunchRange(int bunchCrossing) const
tuple size
Write out results.
virtual void finalizeHits()