Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef EcalSimAlgos_EcalShapeBase_h
0002 #define EcalSimAlgos_EcalShapeBase_h
0003 
0004 #include <vector>
0005 //#include<stdexcept>
0006 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVShape.h"
0007 
0008 #include "FWCore/Framework/interface/EventSetup.h"
0009 #include "FWCore/Framework/interface/ESHandle.h"
0010 #include "CondFormats/EcalObjects/interface/EcalSimPulseShape.h"
0011 #include "CondFormats/DataRecord/interface/EcalSimPulseShapeRcd.h"
0012 
0013 #include <iostream>
0014 #include <fstream>
0015 /**
0016    \class EcalShape
0017    \brief  shaper for Ecal
0018    
0019    The constructor has been updated on CMSSW10X (2018) as to expect a bool, 
0020    set this to true if DB conditions will be used to retrive the shape array 
0021    and sampling time from the DB or false if the Phase I hard coded arrays
0022    with 1 ns sampling should be used. -- K. Theofilatos
0023 */
0024 class EcalShapeBase : public CaloVShape {
0025 public:
0026   typedef std::vector<double> DVec;
0027 
0028   EcalShapeBase(bool);
0029 
0030   ~EcalShapeBase() override;
0031 
0032   double operator()(double aTime) const override;
0033 
0034   double timeOfThr() const;
0035   double timeOfMax() const;
0036   double timeToRise() const override;
0037 
0038   double threshold() const;
0039 
0040   double derivative(double time) const;  // appears to not be used anywhere
0041 
0042   void m_shape_print(const char* fileName) const;
0043   void setEventSetup(const edm::EventSetup& evtSetup, bool normalize = true);
0044 
0045 protected:
0046   unsigned int timeIndex(double aTime) const;
0047 
0048   void buildMe(const edm::EventSetup* = nullptr, bool normalize = true);
0049 
0050   virtual void fillShape(float& time_interval,
0051                          double& m_thresh,
0052                          EcalShapeBase::DVec& aVec,
0053                          const edm::EventSetup* es) const = 0;
0054   bool m_useDBShape;
0055 
0056 private:
0057   unsigned int m_firstIndexOverThreshold;
0058   double m_firstTimeOverThreshold;
0059   unsigned int m_indexOfMax;
0060   double m_timeOfMax;
0061   double m_thresh;
0062   unsigned int m_kNBinsPerNSec;
0063   DVec m_shape;
0064   DVec m_deriv;
0065 
0066   unsigned int m_arraySize;
0067   unsigned int m_denseArraySize;
0068   double m_qNSecPerBin;
0069 };
0070 
0071 #endif