Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:31

0001 // -*- C++ -*-
0002 #ifndef HcalSimAlgos_HcalSiPMShape_h
0003 #define HcalSimAlgos_HcalSiPMShape_h
0004 
0005 #include "CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h"
0006 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVShape.h"
0007 #include <vector>
0008 
0009 class HcalSiPMShape final : public CaloVShape {
0010 public:
0011   HcalSiPMShape(unsigned int signalShape = 206);
0012   HcalSiPMShape(const HcalSiPMShape& other);
0013 
0014   ~HcalSiPMShape() override {}
0015 
0016   int nBins() const { return nBins_; }
0017   double operator[](int i) const { return nt_[i]; }
0018 
0019   double operator()(double time) const override {
0020     int jtime(time * HcalPulseShapes::invDeltaTSiPM_ + 0.5);
0021     return (jtime >= 0 && jtime < nBins_) ? nt_[jtime] : 0;
0022   }
0023 
0024   double timeToRise() const override { return 0.0; }
0025 
0026 protected:
0027   void computeShape(unsigned int signalShape);
0028 
0029 private:
0030   int nBins_;
0031   std::vector<double> nt_;
0032 };
0033 
0034 #endif  //HcalSimAlgos_HcalSiPMShape_h