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 
25  static constexpr unsigned int kReadoutTimeInterval = 28; // in nsec
26  static constexpr unsigned int kNBinsPerNSec = 100; // granularity of internal array
27  static constexpr unsigned int k1NSecBinsTotal = kReadoutTimeInterval * kNBinsPerNSec;
28 
29 protected:
30  unsigned int timeIndex(double aTime) const;
31 
32  void buildMe();
33 
34  virtual void fillShape(DVec& aVec) const = 0;
35 
36 private:
37  double linear_interpolation(
38  const double& y, const double& x1, const double& x2, const double& y1, const double& y2) const;
39 
40  const double qNSecPerBin_;
41  unsigned int indexOfMax_;
42  double timeOfMax_;
44 };
45 
46 #endif
std::array< float, 3 > timeAtThr(const float scale, const float threshold1, const float threshold2) const
Definition: MTDShapeBase.cc:9
virtual void fillShape(DVec &aVec) const =0
~MTDShapeBase() override
Definition: MTDShapeBase.cc:4
const double qNSecPerBin_
Definition: MTDShapeBase.h:40
Electronic response of the preamp.
Definition: CaloVShape.h:11
void buildMe()
Definition: MTDShapeBase.cc:73
static constexpr unsigned int kNBinsPerNSec
Definition: MTDShapeBase.h:26
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:27
double operator()(double aTime) const override
Definition: MTDShapeBase.cc:98
double timeToRise() const override
Definition: MTDShapeBase.h:21
double timeOfMax_
Definition: MTDShapeBase.h:42
double timeOfMax() const
Definition: MTDShapeBase.cc:71
unsigned int indexOfMax_
Definition: MTDShapeBase.h:41
static constexpr unsigned int kReadoutTimeInterval
Definition: MTDShapeBase.h:25
unsigned int indexOfMax() const
Definition: MTDShapeBase.cc:69
unsigned int timeIndex(double aTime) const
Definition: MTDShapeBase.cc:87
std::vector< double > DVec
Definition: MTDShapeBase.h:11