15 #include "CLHEP/Random/RandPoissonQ.h"
16 #include "CLHEP/Random/RandFlat.h"
20 #include "CLHEP/Units/GlobalPhysicalConstants.h"
21 #include "CLHEP/Units/GlobalSystemOfUnits.h"
27 : theAnalogSignalMap(),
28 theParameterMap(parametersMap),
43 : theAnalogSignalMap(),
44 theParameterMap(parametersMap),
62 #ifdef ChangeHcalEnergyScale
63 for (
int ij=0; ij<100; ij++) {
64 for (
int jk=0; jk<72; jk++) {
65 for (
int kl=0; kl<4; kl++) {
75 std::ifstream
infile(fileIn.c_str());
76 LogDebug(
"CaloHitResponse") <<
"Reading from " << fileIn;
77 #ifdef ChangeHcalEnergyScale
79 edm::LogError(
"CaloHitResponse") <<
"** ERROR: Can't open '" << fileIn <<
"' for the input file";
84 infile >> eta >> phi >> depth >> cFactor;
109 hitItr != hits.
end(); ++hitItr) {
128 const unsigned int size ( signal.
size() ) ;
131 for(
unsigned int i ( 0 ) ;
i !=
size ; ++
i )
133 keep = keep || signal[
i] > 1.e-7 ;
140 if( keep )
add(signal);
149 if (oldSignal == 0) {
155 int sampleSize = oldSignal->
size();
156 assert(sampleSize == signal.
size());
157 assert(signal.
presamples() == oldSignal->presamples());
159 for(
int i = 0;
i < sampleSize; ++
i) {
160 (*oldSignal)[
i] += signal[
i];
186 + parameters.timePhase()
190 double binTime =
tzero;
195 result[
bin] += (*shape)(binTime)* signal;
209 <<
"CaloHitResponse requires the RandomNumberGeneratorService\n"
210 "which is not present in the configuration file. You must add the service\n"
211 "in the configuration file or remove the modules that require it.";
220 #ifdef ChangeHcalEnergyScale
225 int ieta = dId.
ieta()+50;
226 int iphi = dId.
iphi()-1;
227 int idep = dId.
depth()-1;
229 LogDebug(
"CaloHitResponse") <<
" ID " << dId <<
" Scale " << scl;
250 result = &(signalItr->second);
269 edm::LogWarning(
"CaloHitResponse") <<
"No Calo Geometry set, so no time of flight correction";
273 if(cellGeometry == 0) {
275 << detId.
rawId() <<
" so no time-of-flight subtraction will be done";
279 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
CLHEP::RandPoissonQ * theRandPoisson
bool withinBunchRange(int bunchCrossing) const
check if crossing is within bunch range:
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 double delay(const PCaloHit &hit) 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 void add(const PCaloHit &hit)
process a single SimHit
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
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
double analogSignalAmplitude(const DetId &id, float energy, const CaloSimParameters ¶meters) const
int readoutFrameSize() const
for now, the LinearFrames and trhe digis will be one-to-one.
const CaloVHitCorrection * theHitCorrection
AnalogSignalMap theAnalogSignalMap
int iphi() const
get the cell iphi
virtual void run(MixCollection< PCaloHit > &hits)
Complete cell digitization.
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
static const double tzero[3]
const CaloVHitFilter * theHitFilter
virtual void setRandomEngine(CLHEP::HepRandomEngine &engine)
volatile std::atomic< bool > shutdown_flag false
const CaloVShape * theShape
DetId id() const
get the (generic) id
virtual double correctPE(const DetId &detId, double npe) const =0
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