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 
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 
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:
122 
129 
131 
134 
138 };
139 
140 #endif
CaloHitResponse::CaloHitResponse
CaloHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
Definition: CaloHitResponse.cc:21
geometry
ESHandle< TrackerGeometry > geometry
Definition: TkLasBeamFitter.cc:200
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
CaloHitResponse::analogSignalAmplitude
double analogSignalAmplitude(const DetId &id, float energy, const CaloSimParameters &parameters, CLHEP::HepRandomEngine *) const
Definition: CaloHitResponse.cc:147
CaloVSimParameterMap
Definition: CaloVSimParameterMap.h:7
MixingModule_cfi.maxBunch
maxBunch
Definition: MixingModule_cfi.py:42
CaloSamples.h
geometry
Definition: geometry.py:1
CaloHitResponse::thePhaseShift_
double thePhaseShift_
Definition: CaloHitResponse.h:135
CaloHitResponse::keepBlank
virtual bool keepBlank() const
Definition: CaloHitResponse.h:51
CaloHitResponse::withinBunchRange
bool withinBunchRange(int bunchCrossing) const
check if crossing is within bunch range:
Definition: CaloHitResponse.h:112
CaloHitResponse::setIgnoreGeantTime
void setIgnoreGeantTime(bool gt)
Definition: CaloHitResponse.h:118
CaloVPECorrection
Definition: CaloVPECorrection.h:14
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
DetId
Definition: DetId.h:17
CaloGeometry
Definition: CaloGeometry.h:21
CaloHitResponse::nSignals
int nSignals() const
number of signals in the current cache
Definition: CaloHitResponse.h:98
MixCollection.h
MixCollection
Definition: MixCollection.h:11
CaloHitResponse::addHit
void addHit(const PCaloHit *hit, CaloSamples &frame) const
adds the amplitude for a single hit to the frame
CaloVPECorrection.h
CaloHitResponse::~CaloHitResponse
virtual ~CaloHitResponse()
doesn't delete the pointers passed in
Definition: CaloHitResponse.cc:51
CaloHitResponse::initializeHits
virtual void initializeHits()
Initialize hits.
Definition: CaloHitResponse.h:54
CaloSimParameters
Main class for Parameters in different subdetectors.
Definition: CaloSimParameters.h:14
CaloHitResponse::theHitCorrection
const CaloVHitCorrection * theHitCorrection
Definition: CaloHitResponse.h:126
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
CaloHitResponse::setPhaseShift
void setPhaseShift(const double &thePhaseShift)
setting the phase shift for asynchronous trigger (e.g. test beams)
Definition: CaloHitResponse.h:108
CaloHitResponse::timeOfFlight
double timeOfFlight(const DetId &detId) const
Definition: CaloHitResponse.cc:185
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
CLHEP
Definition: CocoaGlobals.h:27
CaloHitResponse::add
virtual void add(const PCaloHit &hit, CLHEP::HepRandomEngine *)
process a single SimHit
Definition: CaloHitResponse.cc:66
CaloHitResponse::finalizeHits
virtual void finalizeHits(CLHEP::HepRandomEngine *)
Finalize hits.
Definition: CaloHitResponse.h:57
CaloHitResponse::makeAnalogSignal
virtual CaloSamples makeAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *) const
creates the signal corresponding to this hit
Definition: CaloHitResponse.cc:102
CaloHitResponse::theShapes
const CaloShapes * theShapes
Definition: CaloHitResponse.h:124
CaloHitResponse::setPECorrection
void setPECorrection(const CaloVPECorrection *peCorrection)
if you want to correct the photoelectrons
Definition: CaloHitResponse.h:76
CaloHitResponse::setHitFilter
void setHitFilter(const CaloVHitFilter *filter)
Definition: CaloHitResponse.h:70
CaloVHitCorrection
Definition: CaloVHitCorrection.h:10
CaloHitResponse::setBunchRange
void setBunchRange(int minBunch, int maxBunch)
tells it which pileup bunches to do
Definition: CaloHitResponse.cc:53
PCaloHit.h
CaloHitResponse::theHitFilter
const CaloVHitFilter * theHitFilter
Definition: CaloHitResponse.h:128
CaloHitResponse
Creates electronics signals from hits.
Definition: CaloHitResponse.h:33
CaloHitResponse::theParameterMap
const CaloVSimParameterMap * theParameterMap
Definition: CaloHitResponse.h:123
CaloHitResponse::AnalogSignalMap
std::map< DetId, CaloSamples > AnalogSignalMap
Definition: CaloHitResponse.h:35
CaloHitResponse::theMaxBunch
int theMaxBunch
Definition: CaloHitResponse.h:133
CaloSamples
Definition: CaloSamples.h:14
CaloHitResponse::makeBlankSignal
CaloSamples makeBlankSignal(const DetId &detId) const
creates an empty signal for this DetId
Definition: CaloHitResponse.cc:175
PCaloHit
Definition: PCaloHit.h:8
CaloVShape
Electronic response of the preamp.
Definition: CaloVShape.h:11
CaloShapes
Definition: CaloShapes.h:9
CaloHitResponse::thePECorrection
const CaloVPECorrection * thePECorrection
Definition: CaloHitResponse.h:127
CaloHitResponse::theAnalogSignalMap
AnalogSignalMap theAnalogSignalMap
Definition: CaloHitResponse.h:121
DetId.h
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
CaloGeometry.h
CaloVHitFilter
Definition: CaloVHitFilter.h:6
CaloHitResponse::theGeometry
const CaloGeometry * theGeometry
Definition: CaloHitResponse.h:130
CaloHitResponse::BUNCHSPACE
Definition: CaloHitResponse.h:37
CaloHitResponse::theShape
const CaloVShape * theShape
Definition: CaloHitResponse.h:125
MixingModule_cfi.minBunch
minBunch
Definition: MixingModule_cfi.py:43
CaloHitResponse::ignoreTime
bool ignoreTime
Definition: CaloHitResponse.h:137
CaloHitResponse::findSignal
CaloSamples * findSignal(const DetId &detId)
users can look for the signal for a given cell
Definition: CaloHitResponse.cc:164
CaloHitResponse::theMinBunch
int theMinBunch
Definition: CaloHitResponse.h:132
CaloHitResponse::setHitCorrection
void setHitCorrection(const CaloVHitCorrection *hitCorrection)
If you want to correct hits, for attenuation or delay, set this.
Definition: CaloHitResponse.h:73
CaloHitResponse::clear
void clear()
frees up memory
Definition: CaloHitResponse.h:79
CaloHitResponse::setStorePrecise
void setStorePrecise(bool sp)
Definition: CaloHitResponse.h:116
CaloHitResponse::storePrecise
bool storePrecise
Definition: CaloHitResponse.h:136
CaloHitResponse::setGeometry
void setGeometry(const CaloGeometry *geometry)
geometry needed for time-of-flight
Definition: CaloHitResponse.h:49
hit
Definition: SiStripHitEffFromCalibTree.cc:88
CaloHitResponse::run
virtual void run(const MixCollection< PCaloHit > &hits, CLHEP::HepRandomEngine *)
Complete cell digitization.
Definition: CaloHitResponse.cc:58