Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:24:25

0001 #ifndef HBHETIMINGSHAPEDFLAG_GUARD_H
0002 #define HBHETIMINGSHAPEDFLAG_GUARD_H
0003 
0004 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0005 #include "DataFormats/HcalRecHit/interface/HBHERecHit.h"
0006 #include "DataFormats/METReco/interface/HcalCaloFlagLabels.h"
0007 
0008 class HBHETimingShapedFlagSetter {
0009 public:
0010   HBHETimingShapedFlagSetter();
0011   HBHETimingShapedFlagSetter(const std::vector<double>& tfilterEnvelope);
0012   HBHETimingShapedFlagSetter(const std::vector<double>& tfilterEnvelope,
0013                              bool ignorelowest,
0014                              bool ignorehighest,
0015                              double win_offset,
0016                              double win_gain);
0017   ~HBHETimingShapedFlagSetter();
0018   void Clear();
0019 
0020   void dumpInfo();
0021 
0022   // returns status suitable for flag setting
0023   // This routine made available for reflagger code
0024   //
0025   int timingStatus(const HBHERecHit& hbhe);
0026 
0027   // Sets "HBHETimingShapedCutsBits" field in response to output
0028   // from "timingStatus()"
0029   //
0030   void SetTimingShapedFlags(HBHERecHit& hbhe);
0031 
0032 private:
0033   // key   = integer GeV (to avoid FP issues),
0034   // value = low/high values for timing in ns
0035   //
0036   typedef std::map<int, std::pair<double, double> > TfilterEnvelope_t;
0037   TfilterEnvelope_t tfilterEnvelope_;
0038 
0039   void makeTfilterEnvelope(const std::vector<double>& v_userEnvelope);
0040 
0041   bool ignorelowest_;
0042   bool ignorehighest_;
0043   double win_offset_;
0044   double win_gain_;
0045 };
0046 
0047 #endif