Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:03:52

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 
0025   static constexpr unsigned int kReadoutTimeInterval = 28;  // in nsec
0026   static constexpr unsigned int kNBinsPerNSec = 100;        // granularity of internal array
0027   static constexpr unsigned int k1NSecBinsTotal = kReadoutTimeInterval * kNBinsPerNSec;
0028 
0029 protected:
0030   unsigned int timeIndex(double aTime) const;
0031 
0032   void buildMe();
0033 
0034   virtual void fillShape(DVec& aVec) const = 0;
0035 
0036 private:
0037   double linear_interpolation(
0038       const double& y, const double& x1, const double& x2, const double& y1, const double& y2) const;
0039 
0040   const double qNSecPerBin_;
0041   unsigned int indexOfMax_;
0042   double timeOfMax_;
0043   DVec shape_;
0044 };
0045 
0046 #endif