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
DDAxes::y
MTDShapeBase::operator()
double operator()(double aTime) const override
Definition: MTDShapeBase.cc:98
MTDShapeBase::qNSecPerBin_
const double qNSecPerBin_
Definition: MTDShapeBase.h:40
MTDShapeBase
Definition: MTDShapeBase.h:9
MTDShapeBase::fillShape
virtual void fillShape(DVec &aVec) const =0
MTDShapeBase::~MTDShapeBase
~MTDShapeBase() override
Definition: MTDShapeBase.cc:4
HLT_FULL_cff.scale
scale
Definition: HLT_FULL_cff.py:6637
MTDShapeBase::timeToRise
double timeToRise() const override
Definition: MTDShapeBase.h:21
MTDShapeBase::timeAtThr
std::array< float, 3 > timeAtThr(const float scale, const float threshold1, const float threshold2) const
Definition: MTDShapeBase.cc:9
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
MTDShapeBase::indexOfMax
unsigned int indexOfMax() const
Definition: MTDShapeBase.cc:69
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
testProducerWithPsetDescEmpty_cfi.y1
y1
Definition: testProducerWithPsetDescEmpty_cfi.py:29
MTDShapeBase::DVec
std::vector< double > DVec
Definition: MTDShapeBase.h:11
MTDShapeBase::k1NSecBinsTotal
static constexpr unsigned int k1NSecBinsTotal
Definition: MTDShapeBase.h:27
testProducerWithPsetDescEmpty_cfi.y2
y2
Definition: testProducerWithPsetDescEmpty_cfi.py:30
MTDShapeBase::timeOfMax_
double timeOfMax_
Definition: MTDShapeBase.h:42
MTDShapeBase::timeOfMax
double timeOfMax() const
Definition: MTDShapeBase.cc:71
MTDShapeBase::MTDShapeBase
MTDShapeBase()
Definition: MTDShapeBase.cc:6
MTDShapeBase::shape_
DVec shape_
Definition: MTDShapeBase.h:43
CaloVShape
Electronic response of the preamp.
Definition: CaloVShape.h:11
CaloVShape.h
MTDShapeBase::buildMe
void buildMe()
Definition: MTDShapeBase.cc:73
MTDShapeBase::kNBinsPerNSec
static constexpr unsigned int kNBinsPerNSec
Definition: MTDShapeBase.h:26
MTDShapeBase::indexOfMax_
unsigned int indexOfMax_
Definition: MTDShapeBase.h:41
MTDShapeBase::linear_interpolation
double linear_interpolation(const double &y, const double &x1, const double &x2, const double &y1, const double &y2) const
Definition: MTDShapeBase.cc:104
MTDShapeBase::kReadoutTimeInterval
static constexpr unsigned int kReadoutTimeInterval
Definition: MTDShapeBase.h:25
MTDShapeBase::timeIndex
unsigned int timeIndex(double aTime) const
Definition: MTDShapeBase.cc:87