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 
9 #include "CLHEP/Random/RandPoissonQ.h"
11 
12 #include<map>
13 #include<vector>
14 
22 #define ChangeHcalEnergyScale
23 
24 class CaloVShape;
25 class CaloShapes;
27 class CaloVHitCorrection;
28 class CaloVHitFilter;
29 class CaloSimParameters;
30 
32 {
33 public:
34  typedef std::map<DetId, CaloSamples> AnalogSignalMap;
35  // get this from somewhere external
36  enum {BUNCHSPACE=25};
37 
38  CaloHitResponse(const CaloVSimParameterMap * parameterMap, const CaloVShape * shape);
39  CaloHitResponse(const CaloVSimParameterMap * parameterMap, const CaloShapes * shapes);
40 
42  virtual ~CaloHitResponse();
43 
44  // change HBHE scale
45  void initHBHEScale();
46  void setHBHEScale(std::string &); //GMA
47 
49  void setBunchRange(int minBunch, int maxBunch);
50 
53 
54  virtual bool keepBlank() const { return true ; }
55 
57  virtual void initializeHits() {}
58 
60  virtual void finalizeHits() {}
61 
63  virtual void run(MixCollection<PCaloHit> & hits);
64 
66  virtual void add(const PCaloHit & hit);
67 
69  void add(const CaloSamples & signal);
70 
74  }
75 
77  void setHitCorrection(const CaloVHitCorrection * hitCorrection) {
78  theHitCorrection = hitCorrection;
79  }
80 
82  void setPECorrection(const CaloVPECorrection * peCorrection) {
83  thePECorrection = peCorrection;
84  }
85 
86  virtual void setRandomEngine(CLHEP::HepRandomEngine & engine);
87 
89  void clear() {theAnalogSignalMap.clear();}
90 
92  void addHit(const PCaloHit * hit, CaloSamples & frame) const;
93 
95  virtual CaloSamples makeAnalogSignal(const PCaloHit & inputHit) const;
96 
99  double analogSignalAmplitude(const DetId & id, float energy, const CaloSimParameters & parameters) const;
100 
102  CaloSamples * findSignal(const DetId & detId);
103 
105  int nSignals() const {return theAnalogSignalMap.size();}
106 
108  CaloSamples makeBlankSignal(const DetId & detId) const;
109 
110 
113  double timeOfFlight(const DetId & detId) const;
114 
116  void setPhaseShift(const double & thePhaseShift) { thePhaseShift_ = thePhaseShift; }
117 
119 
120  bool withinBunchRange(int bunchCrossing) const {
121  return(bunchCrossing >= theMinBunch && bunchCrossing <= theMaxBunch);
122  }
123 
124 protected:
125 
127 
134 
136 
137  mutable CLHEP::RandPoissonQ * theRandPoisson;
138 
141 
143 
144  // private :
146 #ifdef ChangeHcalEnergyScale
147  float hcal_en_scale[100][72][4];
148 #endif
149 };
150 
151 #endif
152 
153 
float hcal_en_scale[100][72][4]
void setGeometry(const CaloGeometry *geometry)
geometry needed for time-of-flight
dictionary parameters
Definition: Parameters.py:2
CaloSamples makeBlankSignal(const DetId &detId) const
creates an empty signal for this DetId
virtual ~CaloHitResponse()
doesn&#39;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
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
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 void initializeHits()
Initialize hits.
virtual void add(const PCaloHit &hit)
process a single SimHit
void setHBHEScale(std::string &)
double timeOfFlight(const DetId &detId) const
double analogSignalAmplitude(const DetId &id, float energy, const CaloSimParameters &parameters) const
const CaloVHitCorrection * theHitCorrection
AnalogSignalMap theAnalogSignalMap
virtual void run(MixCollection< PCaloHit > &hits)
Complete cell digitization.
Definition: DetId.h:18
virtual void finalizeHits()
Finalize hits.
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.
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
virtual void setRandomEngine(CLHEP::HepRandomEngine &engine)
const CaloVShape * theShape
int nSignals() const
number of signals in the current cache