CMS 3D CMS Logo

CaloHitResponse.h
Go to the documentation of this file.
1 #ifndef CaloSimAlgos_CaloHitResponse_h
2 #define CaloSimAlgos_CaloHitResponse_h
3 
10 
11 #include <map>
12 #include <vector>
13 
22 namespace CLHEP {
23  class HepRandomEngine;
24 }
25 
26 class CaloVShape;
27 class CaloShapes;
29 class CaloVHitCorrection;
30 class CaloVHitFilter;
31 class CaloSimParameters;
32 
34 public:
35  typedef std::map<DetId, CaloSamples> AnalogSignalMap;
36  // get this from somewhere external
37  enum { BUNCHSPACE = 25 };
38  static constexpr double dt = 0.5;
39  static constexpr int invdt = 2;
40 
41  CaloHitResponse(const CaloVSimParameterMap *parameterMap,
42  const CaloVShape *shape,
43  bool PreMix1 = false,
44  bool HighFidelity = false);
45  CaloHitResponse(const CaloVSimParameterMap *parameterMap,
46  const CaloShapes *shapes,
47  bool PreMix1 = false,
48  bool HighFidelity = false);
49 
51  virtual ~CaloHitResponse();
52 
54  void setBunchRange(int minBunch, int maxBunch);
55 
58 
59  virtual bool keepBlank() const { return true; }
60 
62  virtual void initializeHits() {}
63 
65  virtual void finalizeHits(CLHEP::HepRandomEngine *);
66 
68  virtual void run(const MixCollection<PCaloHit> &hits, CLHEP::HepRandomEngine *);
69 
71  virtual void add(const PCaloHit &hit, CLHEP::HepRandomEngine *);
72 
74  virtual void add(const CaloSamples &signal);
75 
79 
81  void setHitCorrection(const CaloVHitCorrection *hitCorrection) { theHitCorrection = hitCorrection; }
82 
84  void setPECorrection(const CaloVPECorrection *peCorrection) { thePECorrection = peCorrection; }
85 
87  void clear() { theAnalogSignalMap.clear(); }
88 
90  void addHit(const PCaloHit *hit, CaloSamples &frame) const;
91 
93  virtual CaloSamples makeAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *) const;
94 
97  double analogSignalAmplitude(const DetId &id,
98  float energy,
100  CLHEP::HepRandomEngine *) const;
101 
104 
106  int nSignals() const { return theAnalogSignalMap.size(); }
107 
108  int getReadoutFrameSize(const DetId &id) const;
109 
111  CaloSamples makeBlankSignal(const DetId &detId) const;
112 
115  double timeOfFlight(const DetId &detId) const;
116 
118  void setPhaseShift(const double &thePhaseShift) { thePhaseShift_ = thePhaseShift; }
119 
121 
122  bool withinBunchRange(int bunchCrossing) const {
123  return (bunchCrossing >= theMinBunch && bunchCrossing <= theMaxBunch);
124  }
125 
126  void setStorePrecise(bool sp) { storePrecise = sp; }
127 
128  void setIgnoreGeantTime(bool gt) { ignoreTime = gt; }
129 
130 protected:
132 
139 
141 
144 
150 };
151 
152 #endif
void setStorePrecise(bool sp)
void setGeometry(const CaloGeometry *geometry)
geometry needed for time-of-flight
CaloHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape, bool PreMix1=false, bool HighFidelity=false)
virtual ~CaloHitResponse()
doesn&#39;t delete the pointers passed in
int nSignals() const
number of signals in the current cache
Electronic response of the preamp.
Definition: CaloVShape.h:11
void addHit(const PCaloHit *hit, CaloSamples &frame) const
adds the amplitude for a single hit to the frame
static constexpr int invdt
void setPECorrection(const CaloVPECorrection *peCorrection)
if you want to correct the photoelectrons
virtual void run(const MixCollection< PCaloHit > &hits, CLHEP::HepRandomEngine *)
Complete cell digitization.
Main class for Parameters in different subdetectors.
const CaloGeometry * theGeometry
void setPhaseShift(const double &thePhaseShift)
setting the phase shift for asynchronous trigger (e.g. test beams)
double analogSignalAmplitude(const DetId &id, float energy, const CaloSimParameters &parameters, CLHEP::HepRandomEngine *) const
const CaloVPECorrection * thePECorrection
std::map< DetId, CaloSamples > AnalogSignalMap
void setHitFilter(const CaloVHitFilter *filter)
Creates electronics signals from hits.
int getReadoutFrameSize(const DetId &id) const
virtual void initializeHits()
Initialize hits.
virtual bool keepBlank() const
const CaloVHitCorrection * theHitCorrection
bool withinBunchRange(int bunchCrossing) const
check if crossing is within bunch range:
AnalogSignalMap theAnalogSignalMap
Definition: DetId.h:17
const CaloShapes * theShapes
const CaloVSimParameterMap * theParameterMap
virtual CaloSamples makeAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *) const
creates the signal corresponding to this hit
void setBunchRange(int minBunch, int maxBunch)
tells it which pileup bunches to do
double timeOfFlight(const DetId &detId) const
CaloSamples * findSignal(const DetId &detId)
users can look for the signal for a given cell
virtual void finalizeHits(CLHEP::HepRandomEngine *)
Finalize hits.
void setHitCorrection(const CaloVHitCorrection *hitCorrection)
If you want to correct hits, for attenuation or delay, set this.
virtual void add(const PCaloHit &hit, CLHEP::HepRandomEngine *)
process a single SimHit
void clear()
frees up memory
static constexpr double dt
const CaloVHitFilter * theHitFilter
const CaloVShape * theShape
CaloSamples makeBlankSignal(const DetId &detId) const
creates an empty signal for this DetId
void setIgnoreGeantTime(bool gt)