Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:05

0001 #ifndef CalibCalorimetry_HcalAlgos_HcalPulseContainmentManager_h
0002 #define CalibCalorimetry_HcalAlgos_HcalPulseContainmentManager_h
0003 
0004 #include "CalibCalorimetry/HcalAlgos/interface/HcalPulseContainmentCorrection.h"
0005 #include "CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h"
0006 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0007 #include "CalibCalorimetry/HcalAlgos/interface/HcalTimeSlew.h"
0008 #include "CondFormats/DataRecord/interface/HcalTimeSlewRecord.h"
0009 
0010 class HcalPulseContainmentManager {
0011 public:
0012   // for callers not calling beginRun(EventSetup)
0013   HcalPulseContainmentManager(float max_fracerror, bool phaseAsInSim);
0014   // for callers calling beginRun(EventSetup)
0015   HcalPulseContainmentManager(float max_fracerror, bool phaseAsInSim, edm::ConsumesCollector iC);
0016   double correction(const HcalDetId& detId, int toAdd, float fixedphase_ns, double fc_ampl);
0017   const HcalPulseContainmentCorrection* get(const HcalDetId& detId, int toAdd, float fixedphase_ns);
0018 
0019   void beginRun(edm::EventSetup const& es);
0020   void beginRun(const HcalDbService* conditions, const HcalTimeSlew* delay);
0021 
0022   void setTimeSlew(const HcalTimeSlew* timeSlew) { hcalTimeSlew_delay_ = timeSlew; }
0023 
0024 private:
0025   struct HcalPulseContainmentEntry {
0026     HcalPulseContainmentEntry(int toAdd,
0027                               float fixedphase_ns,
0028                               const HcalPulseShape* shape,
0029                               const HcalPulseContainmentCorrection& correction)
0030         : toAdd_(toAdd), fixedphase_ns_(fixedphase_ns), shape_(shape), correction_(correction) {}
0031     int toAdd_;
0032     float fixedphase_ns_;
0033     const HcalPulseShape* shape_;
0034     HcalPulseContainmentCorrection correction_;
0035   };
0036 
0037   std::vector<HcalPulseContainmentEntry> entries_;
0038   HcalPulseShapes shapes_;
0039   float fixedphase_ns_;
0040   float max_fracerror_;
0041   bool phaseAsInSim_;
0042   const edm::ESGetToken<HcalTimeSlew, HcalTimeSlewRecord> delayToken_;
0043 
0044   const HcalTimeSlew* hcalTimeSlew_delay_;
0045 };
0046 
0047 #endif