13 #include "CLHEP/Random/RandPoissonQ.h"
14 #include "CLHEP/Random/RandFlat.h"
17 #include "CLHEP/Units/GlobalPhysicalConstants.h"
18 #include "CLHEP/Units/GlobalSystemOfUnits.h"
24 : theAnalogSignalMap(),
25 theParameterMap(parametersMap),
60 hitItr != hits.
end(); ++hitItr)
85 const unsigned int size ( signal.
size() ) ;
88 for(
unsigned int i ( 0 ) ;
i !=
size ; ++
i )
90 keep = keep || signal[
i] > 1.e-7 ;
94 LogDebug(
"CaloHitResponse") << signal;
95 if( keep )
add(signal);
104 if (oldSignal == 0) {
108 int sampleSize = oldSignal->
size();
109 assert(sampleSize == signal.
size());
110 assert(signal.
presamples() == oldSignal->presamples());
112 for(
int i = 0;
i < sampleSize; ++
i) {
113 (*oldSignal)[
i] += signal[
i];
137 + parameters.timePhase()
141 double binTime =
tzero;
146 result[
bin] += (*theShape)(binTime)* signal;
160 <<
"CaloHitResponse requires the RandomNumberGeneratorService\n"
161 "which is not present in the configuration file. You must add the service\n"
162 "in the configuration file or remove the modules that require it.";
187 result = &(signalItr->second);
206 edm::LogWarning(
"CaloHitResponse") <<
"No Calo Geometry set, so no time of flight correction";
210 if(cellGeometry == 0) {
212 << detId.
rawId() <<
" so no time-of-flight subtraction will be done";
216 result = distance * cm / c_light;
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
CaloSamples makeBlankSignal(const DetId &detId) const
creates an empty signal for this DetId
virtual ~CaloHitResponse()
doesn't delete the pointers passed in
CLHEP::RandPoissonQ * theRandPoisson
virtual CaloSamples makeAnalogSignal(const PCaloHit &inputHit) const
creates the signal corresponding to this hit
int presamples() const
access presample information
bool doPhotostatistics() const
whether or not to apply Poisson statistics to photoelectrons
virtual bool keepBlank() const
Electronic response of the preamp.
CaloHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
Main class for Parameters in different subdetectors.
const CaloGeometry * theGeometry
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
uint32_t rawId() const
get the raw id
const CaloVPECorrection * thePECorrection
virtual void correct(PCaloHit &hit) const =0
virtual void add(const PCaloHit &hit)
process a single SimHit
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
double timeOfFlight(const DetId &detId) const
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
int readoutFrameSize() const
for now, the LinearFrames and trhe digis will be one-to-one.
const CaloVHitCorrection * theHitCorrection
AnalogSignalMap theAnalogSignalMap
virtual void run(MixCollection< PCaloHit > &hits)
Complete cell digitization.
double analogSignalAmplitude(const PCaloHit &hit, const CaloSimParameters ¶meters) const
const CaloVSimParameterMap * theParameterMap
int size() const
get the size
void setBunchRange(int minBunch, int maxBunch)
tells it which pileup bunches to do
CaloSamples * findSignal(const DetId &detId)
users can look for the signal for a given cell
static const double tzero[3]
const CaloVHitFilter * theHitFilter
virtual void setRandomEngine(CLHEP::HepRandomEngine &engine)
const CaloVShape * theShape
DetId id() const
get the (generic) id
virtual double correctPE(const DetId &detId, double npe) const =0
const GlobalPoint & getPosition() const
tuple size
Write out results.