Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SimCalorimetry_EcalSimAlgos_ComponentShape_h
0002 #define SimCalorimetry_EcalSimAlgos_ComponentShape_h
0003 
0004 #include "FWCore/Framework/interface/ConsumesCollector.h"
0005 #include "SimCalorimetry/EcalSimAlgos/interface/EcalShapeBase.h"
0006 #include "CondFormats/EcalObjects/interface/EcalSimComponentShape.h"
0007 #include "CondFormats/DataRecord/interface/EcalSimComponentShapeRcd.h"
0008 
0009 class ComponentShape : public EcalShapeBase {
0010 public:
0011   // useDB = false
0012   ComponentShape(int shapeIndex) : EcalShapeBase(false), shapeIndex_(shapeIndex) { buildMe(nullptr, false); }
0013   // useDB = true, buildMe is executed when setEventSetup and DB conditions are available
0014   ComponentShape(int shapeIndex, edm::ESGetToken<EcalSimComponentShape, EcalSimComponentShapeRcd> espsToken)
0015       : EcalShapeBase(true), espsToken_(espsToken), shapeIndex_(shapeIndex) {}
0016 
0017   // override EcalShapeBase timeToRise, so that it does not align component shapes to same peaking time
0018   double timeToRise() const override;
0019 
0020 protected:
0021   void fillShape(float& time_interval,
0022                  double& m_thresh,
0023                  EcalShapeBase::DVec& aVec,
0024                  const edm::EventSetup* es) const override;
0025 
0026 private:
0027   edm::ESGetToken<EcalSimComponentShape, EcalSimComponentShapeRcd> espsToken_;
0028   int shapeIndex_;
0029   static constexpr double kTimeToRise = 16.;  //used for timeToRise
0030                                               // 16 nanoseconds ~aligns the phase II component
0031                                               // sim to the default with the current setup
0032 };
0033 
0034 #endif