Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-22 02:31:09

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   };
0040 
0041   inline bool TimingTask::analyze(void const* _p, Collections _collection) {
0042     switch (_collection) {
0043       case kEBRecHit:
0044       case kEERecHit:
0045         if (_p)
0046           runOnRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
0047         return true;
0048         break;
0049       case kEBUncalibRecHit:
0050       case kEEUncalibRecHit:
0051         if (_p)
0052           runOnUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(_p));
0053         return true;
0054         break;
0055       default:
0056         break;
0057     }
0058     return false;
0059   }
0060 
0061 }  // namespace ecaldqm
0062 
0063 #endif