CMS 3D CMS Logo

MTDShapeBase.h
Go to the documentation of this file.
1 #ifndef __SimFastTiming_FastTimingCommon_MTDShapeBase_h__
2 #define __SimFastTiming_FastTimingCommon_MTDShapeBase_h__
3 
4 #include <vector>
5 #include <array>
6 
8 
9 
10 class MTDShapeBase : public CaloVShape
11 {
12  public:
13 
14  typedef std::vector<double> DVec ;
15 
16  MTDShapeBase() ;
17 
18  ~MTDShapeBase() override ;
19 
20  double operator() ( double aTime ) const override ;
21 
22  unsigned int indexOfMax() const;
23  double timeOfMax() const;
24  double timeToRise() const override { return 0.; }
25 
26  std::array<float,3> timeAtThr(const float scale,
27  const float threshold1,
28  const float threshold2) const;
29 
30  static constexpr unsigned int kReadoutTimeInterval = 28; // in nsec
31  static constexpr unsigned int kNBinsPerNSec = 100; // granularity of internal array
32  static constexpr unsigned int k1NSecBinsTotal = kReadoutTimeInterval*kNBinsPerNSec;
33 
34 
35  protected:
36 
37  unsigned int timeIndex( double aTime ) const;
38 
39  void buildMe() ;
40 
41  virtual void fillShape( DVec& aVec ) const = 0;
42 
43 
44  private:
45 
46  double linear_interpolation(const double& y,
47  const double& x1, const double& x2,
48  const double& y1, const double& y2) const;
49 
50  const double qNSecPerBin_;
51  unsigned int indexOfMax_;
52  double timeOfMax_ ;
53  DVec shape_;
54 
55 };
56 
57 #endif
~MTDShapeBase() override
Definition: MTDShapeBase.cc:5
const double qNSecPerBin_
Definition: MTDShapeBase.h:50
Electronic response of the preamp.
Definition: CaloVShape.h:11
unsigned int timeIndex(double aTime) const
unsigned int indexOfMax() const
Definition: MTDShapeBase.cc:89
static constexpr unsigned int kNBinsPerNSec
Definition: MTDShapeBase.h:31
double operator()(double aTime) const override
static constexpr unsigned int k1NSecBinsTotal
Definition: MTDShapeBase.h:32
double timeOfMax_
Definition: MTDShapeBase.h:52
std::array< float, 3 > timeAtThr(const float scale, const float threshold1, const float threshold2) const
Definition: MTDShapeBase.cc:15
unsigned int indexOfMax_
Definition: MTDShapeBase.h:51
static constexpr unsigned int kReadoutTimeInterval
Definition: MTDShapeBase.h:30
double timeToRise() const override
Definition: MTDShapeBase.h:24
double linear_interpolation(const double &y, const double &x1, const double &x2, const double &y1, const double &y2) const
std::vector< double > DVec
Definition: MTDShapeBase.h:14
double timeOfMax() const
Definition: MTDShapeBase.cc:95
#define constexpr
virtual void fillShape(DVec &aVec) const =0