Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-07-15 22:06:17

0001 #ifndef TimingTask_H
0002 #define TimingTask_H
0003 
0004 #include "DQWorkerTask.h"
0005 
0006 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0007 
0008 namespace ecaldqm {
0009 
0010   class TimingTask : public DQWorkerTask {
0011   public:
0012     TimingTask();
0013     ~TimingTask() override {}
0014 
0015     bool filterRunType(short const*) override;
0016 
0017     bool analyze(void const*, Collections) override;
0018 
0019     void runOnRecHits(EcalRecHitCollection const&, Collections);
0020     void runOnUncalibRecHits(EcalUncalibratedRecHitCollection const&);
0021 
0022   private:
0023     void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override;
0024     void setParams(edm::ParameterSet const&) override;
0025 
0026     std::vector<int> bxBinEdges_;
0027     double bxBin_;
0028 
0029     float chi2ThresholdEB_;
0030     float chi2ThresholdEE_;
0031     float energyThresholdEB_;
0032     float energyThresholdEE_;
0033     float energyThresholdEEFwd_;
0034     float timingVsBXThreshold_;
0035     float timeErrorThreshold_;
0036     bool splashSwitch_;
0037 
0038     MESet* meTimeMapByLS;
0039     MESet* meTimeMapByLS_nonCorr;
0040   };
0041 
0042   inline bool TimingTask::analyze(void const* _p, Collections _collection) {
0043     switch (_collection) {
0044       case kEBRecHit:
0045       case kEERecHit:
0046         if (_p)
0047           runOnRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
0048         return true;
0049         break;
0050       case kEBUncalibRecHit:
0051       case kEEUncalibRecHit:
0052         if (_p)
0053           runOnUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(_p));
0054         return true;
0055         break;
0056       default:
0057         break;
0058     }
0059     return false;
0060   }
0061 
0062 }  // namespace ecaldqm
0063 
0064 #endif