test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
35 public:
36  typedef std::map<DetId, CaloSamples> AnalogSignalMap;
37  // get this from somewhere external
38  enum {BUNCHSPACE=25};
39 
40  CaloHitResponse(const CaloVSimParameterMap * parameterMap, const CaloVShape * shape);
41  CaloHitResponse(const CaloVSimParameterMap * parameterMap, const CaloShapes * shapes);
42 
44  virtual ~CaloHitResponse();
45 
47  void setBunchRange(int minBunch, int maxBunch);
48 
51 
52  virtual bool keepBlank() const { return true ; }
53 
55  virtual void initializeHits() {}
56 
58  virtual void finalizeHits(CLHEP::HepRandomEngine*) {}
59 
61  virtual void run(MixCollection<PCaloHit> & hits, CLHEP::HepRandomEngine*);
62 
64  virtual void add(const PCaloHit & hit, CLHEP::HepRandomEngine*);
65 
67  void add(const CaloSamples & signal);
68 
72  }
73 
75  void setHitCorrection(const CaloVHitCorrection * hitCorrection) {
76  theHitCorrection = hitCorrection;
77  }
78 
80  void setPECorrection(const CaloVPECorrection * peCorrection) {
81  thePECorrection = peCorrection;
82  }
83 
85  void clear() {theAnalogSignalMap.clear();}
86 
88  void addHit(const PCaloHit * hit, CaloSamples & frame) const;
89 
91  virtual CaloSamples makeAnalogSignal(const PCaloHit & inputHit, CLHEP::HepRandomEngine*) const;
92 
95  double analogSignalAmplitude(const DetId & id, float energy, const CaloSimParameters & parameters, CLHEP::HepRandomEngine*) const;
96 
98  CaloSamples * findSignal(const DetId & detId);
99 
101  int nSignals() const {return theAnalogSignalMap.size();}
102 
104  CaloSamples makeBlankSignal(const DetId & detId) const;
105 
106 
109  double timeOfFlight(const DetId & detId) const;
110 
112  void setPhaseShift(const double & thePhaseShift) { thePhaseShift_ = thePhaseShift; }
113 
115 
116  bool withinBunchRange(int bunchCrossing) const {
117  return(bunchCrossing >= theMinBunch && bunchCrossing <= theMaxBunch);
118  }
119 
120  void setStorePrecise(bool sp) {
121  storePrecise = sp;
122  }
123 
124  void setIgnoreGeantTime(bool gt) {
125  ignoreTime = gt;
126  }
127 
128 protected:
129 
131 
138 
140 
143 
147 };
148 
149 #endif
void setStorePrecise(bool sp)
void setGeometry(const CaloGeometry *geometry)
geometry needed for time-of-flight
CaloSamples makeBlankSignal(const DetId &detId) const
creates an empty signal for this DetId
virtual ~CaloHitResponse()
doesn&#39;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.
virtual bool keepBlank() const
Electronic response of the preamp.
Definition: CaloVShape.h:11
CaloHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
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)
if you want to reject hits, for example, from a certain subdetector, set this
Creates electronics signals from hits.
virtual CaloSamples makeAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *) const
creates the signal corresponding to this hit
virtual void initializeHits()
Initialize hits.
double timeOfFlight(const DetId &detId) const
const CaloVHitCorrection * theHitCorrection
AnalogSignalMap theAnalogSignalMap
Definition: DetId.h:18
double analogSignalAmplitude(const DetId &id, float energy, const CaloSimParameters &parameters, CLHEP::HepRandomEngine *) const
const CaloShapes * theShapes
const CaloVSimParameterMap * theParameterMap
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
ESHandle< TrackerGeometry > geometry
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
void addHit(const PCaloHit *hit, CaloSamples &frame) const
adds the amplitude for a single hit to the frame
const CaloVHitFilter * theHitFilter
Definition: sp.h:21
const CaloVShape * theShape
int nSignals() const
number of signals in the current cache
void setIgnoreGeantTime(bool gt)