15 #include "CLHEP/Random/RandPoissonQ.h"
16 #include "CLHEP/Random/RandGaussQ.h"
19 #include "CLHEP/Units/GlobalPhysicalConstants.h"
20 #include "CLHEP/Units/GlobalSystemOfUnits.h"
27 m_parameterMap ( parameterMap ) ,
29 m_hitCorrection ( 0 ) ,
30 m_PECorrection ( 0 ) ,
40 m_useLCcorrection ( 0 )
46 <<
"EcalHitResponse requires the RandomNumberGeneratorService\n"
47 "which is not present in the configuration file. You must add the service\n"
48 "in the configuration file or remove the modules that require it.";
155 for(
unsigned int i ( 0 ) ;
i !=
size ; ++
i )
169 hitItr != hits.
end() ; ++hitItr )
172 const int bunch ( hitItr.bunch() ) ;
188 const DetId detId ( hit.
id() ) ;
197 + parameters->timePhase()
201 double binTime ( tzero ) ;
205 const unsigned int rsize ( result.
size() ) ;
207 for(
unsigned int bin ( 0 ) ;
bin != rsize ; ++
bin )
209 result[
bin ] += (*
shape())( binTime )*signal ;
234 const DetId& detId ( hit.
id() ) ;
241 float lasercalib = 1.;
246 double npe ( hit.
energy()/lasercalib*parameters.simHitToPhotoelectrons( detId ) ) ;
249 if( parameters.doPhotostatistics() ) npe =
ranPois()->fire( npe ) ;
260 assert( 0 != cellGeometry ) ;
const CaloVShape * m_shape
const CaloVShape * shape() const
double findLaserConstant(const DetId &detId) const
CLHEP::RandGaussQ * ranGauss() const
std::vector< unsigned int > VecInd
CLHEP::RandGaussQ * m_RandGauss
void setEventTime(const edm::TimeValue_t &iTime)
virtual ~EcalHitResponse()
float getLaserCorrection(DetId const &xid, edm::Timestamp const &iTime) const
Electronic response of the preamp.
double timeOfFlight(const DetId &detId) const
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Main class for Parameters in different subdetectors.
void setHitFilter(const CaloVHitFilter *filter)
const CaloSimParameters * params(const DetId &detId) const
double analogSignalAmplitude(const PCaloHit &hit) const
void setHitCorrection(const CaloVHitCorrection *hitCorrection)
virtual void run(MixCollection< PCaloHit > &hits)
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)
virtual void correct(PCaloHit &hit) const =0
void setPhaseShift(double phaseShift)
void blankOutUsedSamples()
const CaloVHitCorrection * m_hitCorrection
virtual double timeToRise() const =0
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
virtual bool accepts(const PCaloHit &hit) const =0
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
virtual void putAnalogSignal(const PCaloHit &inputHit)
const EcalLaserDbService * m_lasercals
unsigned long long TimeValue_t
void setGeometry(const CaloSubdetectorGeometry *geometry)
const CaloSubdetectorGeometry * m_geometry
const CaloSubdetectorGeometry * geometry() const
const CaloVSimParameterMap * m_parameterMap
void setPECorrection(const CaloVPECorrection *peCorrection)
const CaloVPECorrection * m_PECorrection
ESHandle< TrackerGeometry > geometry
CLHEP::RandPoissonQ * ranPois() const
static const double tzero[3]
CLHEP::RandPoissonQ * m_RandPoisson
EcalSamples * findSignal(const DetId &detId)
virtual double correctPE(const DetId &detId, double npe) const =0
virtual EcalSamples * vSamAll(unsigned int i)=0
void add(const EcalSamples *pSam)
const CaloVHitFilter * m_hitFilter
tuple size
Write out results.