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 
21 #define ChangeHcalEnergyScale
22 
23 namespace CLHEP {
24  class HepRandomEngine;
25 }
26 
27 class CaloVShape;
28 class CaloShapes;
30 class CaloVHitCorrection;
31 class CaloVHitFilter;
32 class CaloSimParameters;
33 
35 {
36 public:
37  typedef std::map<DetId, CaloSamples> AnalogSignalMap;
38  // get this from somewhere external
39  enum {BUNCHSPACE=25};
40 
41  CaloHitResponse(const CaloVSimParameterMap * parameterMap, const CaloVShape * shape);
42  CaloHitResponse(const CaloVSimParameterMap * parameterMap, const CaloShapes * shapes);
43 
45  virtual ~CaloHitResponse();
46 
47  // change HBHE scale
48  void initHBHEScale();
49  void setHBHEScale(std::string &); //GMA
50 
52  void setBunchRange(int minBunch, int maxBunch);
53 
56 
57  virtual bool keepBlank() const { return true ; }
58 
60  virtual void initializeHits() {}
61 
63  virtual void finalizeHits(CLHEP::HepRandomEngine*) {}
64 
66  virtual void run(MixCollection<PCaloHit> & hits, CLHEP::HepRandomEngine*);
67 
69  virtual void add(const PCaloHit & hit, CLHEP::HepRandomEngine*);
70 
72  void add(const CaloSamples & signal);
73 
77  }
78 
80  void setHitCorrection(const CaloVHitCorrection * hitCorrection) {
81  theHitCorrection = hitCorrection;
82  }
83 
85  void setPECorrection(const CaloVPECorrection * peCorrection) {
86  thePECorrection = peCorrection;
87  }
88 
90  void clear() {theAnalogSignalMap.clear();}
91 
93  void addHit(const PCaloHit * hit, CaloSamples & frame) const;
94 
96  virtual CaloSamples makeAnalogSignal(const PCaloHit & inputHit, CLHEP::HepRandomEngine*) const;
97 
100  double analogSignalAmplitude(const DetId & id, float energy, const CaloSimParameters & parameters, CLHEP::HepRandomEngine*) const;
101 
103  CaloSamples * findSignal(const DetId & detId);
104 
106  int nSignals() const {return theAnalogSignalMap.size();}
107 
109  CaloSamples makeBlankSignal(const DetId & detId) const;
110 
111 
114  double timeOfFlight(const DetId & detId) const;
115 
117  void setPhaseShift(const double & thePhaseShift) { thePhaseShift_ = thePhaseShift; }
118 
120 
121  bool withinBunchRange(int bunchCrossing) const {
122  return(bunchCrossing >= theMinBunch && bunchCrossing <= theMaxBunch);
123  }
124 
125 protected:
126 
128 
135 
137 
140 
142 
143  // private :
145 #ifdef ChangeHcalEnergyScale
146  float hcal_en_scale[100][72][4];
147 #endif
148 };
149 
150 #endif
float hcal_en_scale[100][72][4]
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.
void setHBHEScale(std::string &)
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
const CaloVShape * theShape
int nSignals() const
number of signals in the current cache