File indexing completed on 2024-04-06 12:29:45
0001 #ifndef __SimFastTiming_FastTimingCommon_MTDShapeBase_h__
0002 #define __SimFastTiming_FastTimingCommon_MTDShapeBase_h__
0003
0004 #include <vector>
0005 #include <array>
0006
0007 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVShape.h"
0008
0009 class MTDShapeBase : public CaloVShape {
0010 public:
0011 typedef std::vector<double> DVec;
0012
0013 MTDShapeBase();
0014
0015 ~MTDShapeBase() override;
0016
0017 double operator()(double aTime) const override;
0018
0019 unsigned int indexOfMax() const;
0020 double timeOfMax() const;
0021 double timeToRise() const override { return 0.; }
0022
0023 std::array<float, 3> timeAtThr(const float scale, const float threshold1, const float threshold2) const;
0024 float maximum() const;
0025 float fallTime() const;
0026
0027 static constexpr unsigned int kReadoutTimeInterval = 28;
0028 static constexpr unsigned int kNBinsPerNSec = 100;
0029 static constexpr unsigned int k1NSecBinsTotal = kReadoutTimeInterval * kNBinsPerNSec;
0030
0031 protected:
0032 unsigned int timeIndex(double aTime) const;
0033
0034 void buildMe();
0035
0036 virtual void fillShape(DVec& aVec) const = 0;
0037
0038 private:
0039 double linear_interpolation(
0040 const double& y, const double& x1, const double& x2, const double& y1, const double& y2) const;
0041
0042 const double qNSecPerBin_;
0043 unsigned int indexOfMax_;
0044 double timeOfMax_;
0045 float fallTime_;
0046 DVec shape_;
0047 };
0048
0049 #endif