15 #include "CLHEP/Random/RandPoissonQ.h"
16 #include "CLHEP/Units/GlobalPhysicalConstants.h"
17 #include "CLHEP/Units/GlobalSystemOfUnits.h"
23 : theAnalogSignalMap(),
24 theParameterMap(parametersMap),
38 : theAnalogSignalMap(),
39 theParameterMap(parametersMap),
55 #ifdef ChangeHcalEnergyScale
56 for (
int ij=0; ij<100; ij++) {
57 for (
int jk=0; jk<72; jk++) {
58 for (
int kl=0; kl<4; kl++) {
68 std::ifstream
infile(fileIn.c_str());
69 LogDebug(
"CaloHitResponse") <<
"Reading from " << fileIn;
70 #ifdef ChangeHcalEnergyScale
72 edm::LogError(
"CaloHitResponse") <<
"** ERROR: Can't open '" << fileIn <<
"' for the input file";
77 infile >> eta >> phi >> depth >> cFactor;
96 hitItr != hits.
end(); ++hitItr) {
115 const unsigned int size ( signal.
size() ) ;
118 for(
unsigned int i ( 0 ) ;
i !=
size ; ++
i )
120 keep = keep || signal[
i] > 1.e-7 ;
127 if( keep )
add(signal);
136 if (oldSignal == 0) {
142 int sampleSize = oldSignal->
size();
143 assert(sampleSize == signal.
size());
144 assert(signal.
presamples() == oldSignal->presamples());
146 for(
int i = 0;
i < sampleSize; ++
i) {
147 (*oldSignal)[
i] += signal[
i];
173 + parameters.timePhase()
177 double binTime =
tzero;
182 result[
bin] += (*shape)(binTime)* signal;
194 #ifdef ChangeHcalEnergyScale
199 int ieta = dId.
ieta()+50;
200 int iphi = dId.
iphi()-1;
201 int idep = dId.
depth()-1;
203 LogDebug(
"CaloHitResponse") <<
" ID " << dId <<
" Scale " << scl;
211 CLHEP::RandPoissonQ randPoissonQ(*engine, npe);
212 npe = randPoissonQ.fire();
225 result = &(signalItr->second);
244 edm::LogWarning(
"CaloHitResponse") <<
"No Calo Geometry set, so no time of flight correction";
248 if(cellGeometry == 0) {
250 << detId.
rawId() <<
" so no time-of-flight subtraction will be done";
254 result = distance * cm / c_light;
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
float hcal_en_scale[100][72][4]
CaloSamples makeBlankSignal(const DetId &detId) const
creates an empty signal for this DetId
HcalSubdetector subdet() const
get the subdetector
virtual ~CaloHitResponse()
doesn't delete the pointers passed in
bool withinBunchRange(int bunchCrossing) const
check if crossing is within bunch range:
virtual void run(MixCollection< PCaloHit > &hits, CLHEP::HepRandomEngine *)
Complete cell digitization.
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 double correctPE(const DetId &detId, double npe, CLHEP::HepRandomEngine *) const =0
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
int depth() const
get the tower depth
virtual CaloSamples makeAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *) const
creates the signal corresponding to this hit
int ieta() const
get the cell ieta
double simHitToPhotoelectrons() const
void setHBHEScale(std::string &)
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
int readoutFrameSize() const
for now, the LinearFrames and trhe digis will be one-to-one.
const CaloVHitCorrection * theHitCorrection
virtual double delay(const PCaloHit &hit, CLHEP::HepRandomEngine *) const =0
AnalogSignalMap theAnalogSignalMap
int iphi() const
get the cell iphi
double analogSignalAmplitude(const DetId &id, float energy, const CaloSimParameters ¶meters, CLHEP::HepRandomEngine *) const
const CaloShapes * theShapes
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
virtual void add(const PCaloHit &hit, CLHEP::HepRandomEngine *)
process a single SimHit
static const double tzero[3]
const CaloVHitFilter * theHitFilter
volatile std::atomic< bool > shutdown_flag false
const CaloVShape * theShape
DetId id() const
get the (generic) id
Detector det() const
get the detector field from this detid
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
tuple size
Write out results.
virtual const CaloVShape * shape(const DetId &detId) const