CastorPulseShapes

Shape

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#ifndef CALIBCALORIMETRY_CASTORALGOS_CASTORPULSESHAPES_H
#define CALIBCALORIMETRY_CASTORALGOS_CASTORPULSESHAPES_H 1

#include <vector>

/** \class CastorPulseShapes
  *  
  * \author P. Katsas - Univ. of Athens
  */
class CastorPulseShapes {
public:
  CastorPulseShapes();

  class Shape {
  public:
    Shape();
    void setNBin(int n);
    void setShapeBin(int i, float f);
    float getTpeak() const { return tpeak_; }
    float operator()(double time) const;
    float at(double time) const;
    float integrate(double tmin, double tmax) const;

  private:
    std::vector<float> shape_;
    int nbin_;
    float tpeak_;
  };

  const Shape& castorShape() const { return castorShape_; }

private:
  Shape castorShape_;
  void computeCastorShape(Shape& s);
};
#endif