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 
39  CaloHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape);
40  CaloHitResponse(const CaloVSimParameterMap *parameterMap, const CaloShapes *shapes);
41 
43  virtual ~CaloHitResponse();
44 
46  void setBunchRange(int minBunch, int maxBunch);
47 
49  void setGeometry(const CaloGeometry *geometry) { theGeometry = geometry; }
50 
51  virtual bool keepBlank() const { return true; }
52 
54  virtual void initializeHits() {}
55 
57  virtual void finalizeHits(CLHEP::HepRandomEngine *) {}
58 
60  virtual void run(const MixCollection<PCaloHit> &hits, CLHEP::HepRandomEngine *);
61 
63  virtual void add(const PCaloHit &hit, CLHEP::HepRandomEngine *);
64 
66  virtual void add(const CaloSamples &signal);
67 
70  void setHitFilter(const CaloVHitFilter *filter) { theHitFilter = filter; }
71 
73  void setHitCorrection(const CaloVHitCorrection *hitCorrection) { theHitCorrection = hitCorrection; }
74 
76  void setPECorrection(const CaloVPECorrection *peCorrection) { thePECorrection = peCorrection; }
77 
79  void clear() { theAnalogSignalMap.clear(); }
80 
82  void addHit(const PCaloHit *hit, CaloSamples &frame) const;
83 
85  virtual CaloSamples makeAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *) const;
86 
89  double analogSignalAmplitude(const DetId &id,
90  float energy,
92  CLHEP::HepRandomEngine *) const;
93 
95  CaloSamples *findSignal(const DetId &detId);
96 
98  int nSignals() const { return theAnalogSignalMap.size(); }
99 
101  CaloSamples makeBlankSignal(const DetId &detId) const;
102 
105  double timeOfFlight(const DetId &detId) const;
106 
108  void setPhaseShift(const double &thePhaseShift) { thePhaseShift_ = thePhaseShift; }
109 
111 
112  bool withinBunchRange(int bunchCrossing) const {
113  return (bunchCrossing >= theMinBunch && bunchCrossing <= theMaxBunch);
114  }
115 
116  void setStorePrecise(bool sp) { storePrecise = sp; }
117 
118  void setIgnoreGeantTime(bool gt) { ignoreTime = gt; }
119 
120 protected:
121  AnalogSignalMap theAnalogSignalMap;
122 
129 
131 
134 
138 };
139 
140 #endif
void setStorePrecise(bool sp)
void setGeometry(const CaloGeometry *geometry)
geometry needed for time-of-flight
bool withinBunchRange(int bunchCrossing) const
check if crossing is within bunch range:
virtual bool keepBlank() const
Electronic response of the preamp.
Definition: CaloVShape.h:11
void setPECorrection(const CaloVPECorrection *peCorrection)
if you want to correct the photoelectrons
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)
const CaloVPECorrection * thePECorrection
std::map< DetId, CaloSamples > AnalogSignalMap
virtual void finalizeHits(CLHEP::HepRandomEngine *)
Finalize hits.
void setHitFilter(const CaloVHitFilter *filter)
Creates electronics signals from hits.
virtual void initializeHits()
Initialize hits.
const CaloVHitCorrection * theHitCorrection
AnalogSignalMap theAnalogSignalMap
Definition: DetId.h:17
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
const CaloShapes * theShapes
const CaloVSimParameterMap * theParameterMap
ESHandle< TrackerGeometry > geometry
void setHitCorrection(const CaloVHitCorrection *hitCorrection)
If you want to correct hits, for attenuation or delay, set this.
void clear()
frees up memory
const CaloVHitFilter * theHitFilter
const CaloVShape * theShape
int nSignals() const
number of signals in the current cache
double timeOfFlight(DetId id, const CaloGeometry *geo, bool debug=false)
Definition: CaloSimInfo.cc:17
void setIgnoreGeantTime(bool gt)