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 class MTDShapeBase : public CaloVShape {
10 public:
11  typedef std::vector<double> DVec;
12 
13  MTDShapeBase();
14 
15  ~MTDShapeBase() override;
16 
17  double operator()(double aTime) const override;
18 
19  unsigned int indexOfMax() const;
20  double timeOfMax() const;
21  double timeToRise() const override { return 0.; }
22 
23  std::array<float, 3> timeAtThr(const float scale, const float threshold1, const float threshold2) const;
24  float maximum() const;
25  float fallTime() const;
26 
27  static constexpr unsigned int kReadoutTimeInterval = 28; // in nsec
28  static constexpr unsigned int kNBinsPerNSec = 100; // granularity of internal array
30 
31 protected:
32  unsigned int timeIndex(double aTime) const;
33 
34  void buildMe();
35 
36  virtual void fillShape(DVec& aVec) const = 0;
37 
38 private:
39  double linear_interpolation(
40  const double& y, const double& x1, const double& x2, const double& y1, const double& y2) const;
41 
42  const double qNSecPerBin_;
43  unsigned int indexOfMax_;
44  double timeOfMax_;
45  float fallTime_;
47 };
48 
49 #endif
std::array< float, 3 > timeAtThr(const float scale, const float threshold1, const float threshold2) const
Definition: MTDShapeBase.cc:13
virtual void fillShape(DVec &aVec) const =0
~MTDShapeBase() override
Definition: MTDShapeBase.cc:4
const double qNSecPerBin_
Definition: MTDShapeBase.h:42
Electronic response of the preamp.
Definition: CaloVShape.h:11
void buildMe()
Definition: MTDShapeBase.cc:81
float fallTime() const
Definition: MTDShapeBase.cc:79
static constexpr unsigned int kNBinsPerNSec
Definition: MTDShapeBase.h:28
double linear_interpolation(const double &y, const double &x1, const double &x2, const double &y1, const double &y2) const
static constexpr unsigned int k1NSecBinsTotal
Definition: MTDShapeBase.h:29
double operator()(double aTime) const override
double timeToRise() const override
Definition: MTDShapeBase.h:21
double timeOfMax_
Definition: MTDShapeBase.h:44
float maximum() const
Definition: MTDShapeBase.cc:77
double timeOfMax() const
Definition: MTDShapeBase.cc:75
unsigned int indexOfMax_
Definition: MTDShapeBase.h:43
static constexpr unsigned int kReadoutTimeInterval
Definition: MTDShapeBase.h:27
unsigned int indexOfMax() const
Definition: MTDShapeBase.cc:73
unsigned int timeIndex(double aTime) const
std::vector< double > DVec
Definition: MTDShapeBase.h:11
float fallTime_
Definition: MTDShapeBase.h:45