00001 #ifndef EcalSimAlgos_EcalShapeBase_h 00002 #define EcalSimAlgos_EcalShapeBase_h 00003 00004 #include<vector> 00005 //#include<stdexcept> 00006 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVShape.h" 00007 00012 class EcalShapeBase : public CaloVShape 00013 { 00014 public: 00015 00016 typedef std::vector<double> DVec ; 00017 00018 EcalShapeBase( bool aSaveDerivative ) ; 00019 00020 virtual ~EcalShapeBase() ; 00021 00022 double operator() ( double aTime ) const ; 00023 00024 double timeOfThr() const ; 00025 double timeOfMax() const ; 00026 virtual double timeToRise() const ; 00027 00028 virtual double threshold() const = 0 ; 00029 00030 double derivative ( double time ) const ; // appears to not be used anywhere 00031 00032 enum { kReadoutTimeInterval = 25 , // in nsec 00033 kNBinsPerNSec = 10 , // granularity of internal array 00034 k1NSecBins = kReadoutTimeInterval*kNBinsPerNSec , 00035 k1NSecBinsTotal = 2*k1NSecBins , 00036 kNBinsStored = k1NSecBinsTotal*kNBinsPerNSec 00037 } ; 00038 00039 static const double qNSecPerBin ; 00040 00041 protected: 00042 00043 unsigned int timeIndex( double aTime ) const ; 00044 00045 void buildMe() ; 00046 00047 virtual void fillShape( DVec& aVec ) const = 0 ; 00048 00049 private: 00050 00051 unsigned int m_firstIndexOverThreshold ; 00052 double m_firstTimeOverThreshold ; 00053 unsigned int m_indexOfMax ; 00054 double m_timeOfMax ; 00055 DVec m_shape ; 00056 DVec* m_derivPtr ; 00057 }; 00058 00059 00060 00061 #endif 00062