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 CaloShapes; 00026 class CaloVSimParameterMap; 00027 class CaloVHitCorrection; 00028 class CaloVHitFilter; 00029 class CaloSimParameters; 00030 00031 class CaloHitResponse 00032 { 00033 public: 00034 typedef std::map<DetId, CaloSamples> AnalogSignalMap; 00035 // get this from somewhere external 00036 enum {BUNCHSPACE=25}; 00037 00038 CaloHitResponse(const CaloVSimParameterMap * parameterMap, const CaloVShape * shape); 00039 CaloHitResponse(const CaloVSimParameterMap * parameterMap, const CaloShapes * shapes); 00040 00042 virtual ~CaloHitResponse(); 00043 00044 00046 void setBunchRange(int minBunch, int maxBunch); 00047 00049 void setGeometry(const CaloGeometry * geometry) { theGeometry = geometry; } 00050 00051 00052 virtual bool keepBlank() const { return true ; } 00053 00055 virtual void run(MixCollection<PCaloHit> & hits); 00056 00058 virtual void add(const PCaloHit & hit); 00059 00061 void add(const CaloSamples & signal); 00062 00064 void setHitFilter(const CaloVHitFilter * filter) { 00065 theHitFilter = filter; 00066 } 00067 00069 void setHitCorrection(const CaloVHitCorrection * hitCorrection) { 00070 theHitCorrection = hitCorrection; 00071 } 00072 00074 void setPECorrection(const CaloVPECorrection * peCorrection) { 00075 thePECorrection = peCorrection; 00076 } 00077 00078 virtual void setRandomEngine(CLHEP::HepRandomEngine & engine); 00079 00081 void clear() {theAnalogSignalMap.clear();} 00082 00084 void addHit(const PCaloHit * hit, CaloSamples & frame) const; 00085 00087 virtual CaloSamples makeAnalogSignal(const PCaloHit & inputHit) const; 00088 00091 double analogSignalAmplitude(const PCaloHit & hit, const CaloSimParameters & parameters) const; 00092 00094 CaloSamples * findSignal(const DetId & detId); 00095 00097 int nSignals() const {return theAnalogSignalMap.size();} 00098 00100 CaloSamples makeBlankSignal(const DetId & detId) const; 00101 00102 00105 double timeOfFlight(const DetId & detId) const; 00106 00108 void setPhaseShift(const double & thePhaseShift) { thePhaseShift_ = thePhaseShift; } 00109 00110 protected: 00111 00112 AnalogSignalMap theAnalogSignalMap; 00113 00114 const CaloVSimParameterMap * theParameterMap; 00115 const CaloShapes * theShapes; 00116 const CaloVShape * theShape; 00117 const CaloVHitCorrection * theHitCorrection; 00118 const CaloVPECorrection * thePECorrection; 00119 const CaloVHitFilter * theHitFilter; 00120 00121 const CaloGeometry * theGeometry; 00122 00123 mutable CLHEP::RandPoissonQ * theRandPoisson; 00124 00125 int theMinBunch; 00126 int theMaxBunch; 00127 00128 double thePhaseShift_; 00129 00130 }; 00131 00132 #endif 00133 00134