00001 #ifndef CALIBCALORIMETRY_HCALALGOS_HCALPULSESHAPES_H 00002 #define CALIBCALORIMETRY_HCALALGOS_HCALPULSESHAPES_H 1 00003 00004 #include <vector> 00005 00012 class HcalPulseShapes { 00013 public: 00014 HcalPulseShapes(); 00015 00016 class Shape { 00017 public: 00018 Shape(); 00019 void setNBin(int n); 00020 void setShapeBin(int i, float f); 00021 float getTpeak() const { return tpeak_; } 00022 float operator()(double time) const; 00023 float at(double time) const; 00024 float integrate(double tmin, double tmax) const; 00025 private: 00026 std::vector<float> shape_; 00027 int nbin_; 00028 float tpeak_; 00029 }; 00030 00031 00032 const Shape& hbShape() const { return hpdShape_; } 00033 const Shape& heShape() const { return hpdShape_; } 00034 const Shape& hfShape() const { return hfShape_; } 00035 const Shape& hoShape(bool sipm=false) const { return hpdShape_; } 00036 00037 private: 00038 Shape hpdShape_, hfShape_; 00039 void computeHPDShape(Shape& s); 00040 void computeHFShape(Shape& s); 00041 }; 00042 #endif