00001 #ifndef CaloSimAlgos_CaloHitResponse_h 00002 #define CaloSimAlgos_CaloHitResponse_h 00003 00004 #include "CalibFormats/CaloObjects/interface/CaloSamples.h" 00005 #include "DataFormats/DetId/interface/DetId.h" 00006 #include "Geometry/CaloGeometry/interface/CaloGeometry.h" 00007 #include "SimDataFormats/CrossingFrame/interface/MixCollection.h" 00008 #include "SimDataFormats/CaloHit/interface/PCaloHit.h" 00009 #include "CLHEP/Random/RandPoissonQ.h" 00010 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVPECorrection.h" 00011 00012 #include<map> 00013 #include<vector> 00014 00024 class CaloVShape; 00025 class CaloVSimParameterMap; 00026 class CaloVHitCorrection; 00027 class CaloVHitFilter; 00028 class CaloSimParameters; 00029 00030 class CaloHitResponse 00031 { 00032 public: 00033 typedef std::map<DetId, CaloSamples> AnalogSignalMap; 00034 // get this from somewhere external 00035 enum {BUNCHSPACE=25}; 00036 00037 CaloHitResponse(const CaloVSimParameterMap * parameterMap, const CaloVShape * shape); 00038 00040 virtual ~CaloHitResponse(); 00041 00043 void setBunchRange(int minBunch, int maxBunch); 00044 00046 void setGeometry(const CaloGeometry * geometry) { theGeometry = geometry; } 00047 00048 00049 virtual bool keepBlank() const { return true ; } 00050 00052 virtual void run(MixCollection<PCaloHit> & hits); 00053 00055 virtual void add(const PCaloHit & hit); 00056 00058 void add(const CaloSamples & signal); 00059 00061 void setHitFilter(const CaloVHitFilter * filter) { 00062 theHitFilter = filter; 00063 } 00064 00066 void setHitCorrection(const CaloVHitCorrection * hitCorrection) { 00067 theHitCorrection = hitCorrection; 00068 } 00069 00071 void setPECorrection(const CaloVPECorrection * peCorrection) { 00072 thePECorrection = peCorrection; 00073 } 00074 00075 virtual void setRandomEngine(CLHEP::HepRandomEngine & engine); 00076 00078 void clear() {theAnalogSignalMap.clear();} 00079 00081 void addHit(const PCaloHit * hit, CaloSamples & frame) const; 00082 00084 virtual CaloSamples makeAnalogSignal(const PCaloHit & inputHit) const; 00085 00088 double analogSignalAmplitude(const PCaloHit & hit, const CaloSimParameters & parameters) const; 00089 00091 CaloSamples * findSignal(const DetId & detId); 00092 00094 int nSignals() const {return theAnalogSignalMap.size();} 00095 00097 CaloSamples makeBlankSignal(const DetId & detId) const; 00098 00099 00102 double timeOfFlight(const DetId & detId) const; 00103 00105 void setPhaseShift(const double & thePhaseShift) { thePhaseShift_ = thePhaseShift; } 00106 00107 protected: 00108 00109 AnalogSignalMap theAnalogSignalMap; 00110 00111 const CaloVSimParameterMap * theParameterMap; 00112 const CaloVShape * theShape; 00113 const CaloVHitCorrection * theHitCorrection; 00114 const CaloVPECorrection * thePECorrection; 00115 const CaloVHitFilter * theHitFilter; 00116 00117 const CaloGeometry * theGeometry; 00118 00119 mutable CLHEP::RandPoissonQ * theRandPoisson; 00120 00121 int theMinBunch; 00122 int theMaxBunch; 00123 00124 double thePhaseShift_; 00125 00126 }; 00127 00128 #endif 00129 00130