Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:10:03

0001 #ifndef ESIntegrityTask_H
0002 #define ESIntegrityTask_H
0003 
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 
0007 #include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h"
0008 
0009 #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
0010 #include "DQMServices/Core/interface/DQMStore.h"
0011 
0012 struct ESLSCache {
0013   int ievtLS_;
0014   int DIErrorsLS_[2][2][40][40];
0015 };
0016 
0017 class ESIntegrityTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ESLSCache>> {
0018 public:
0019   ESIntegrityTask(const edm::ParameterSet& ps);
0020   ~ESIntegrityTask() override {}
0021 
0022 protected:
0023   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0024 
0025   /// Analyze
0026   void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0027 
0028   /// EndJob
0029   void endJob(void) override;
0030 
0031   /// EndRun
0032   void dqmEndRun(const edm::Run& r, const edm::EventSetup& c) override;
0033 
0034   /// Begin Lumi
0035   std::shared_ptr<ESLSCache> globalBeginLuminosityBlock(const edm::LuminosityBlock& lumi,
0036                                                         const edm::EventSetup& c) const override;
0037 
0038   /// End Lumi
0039   void globalEndLuminosityBlock(const edm::LuminosityBlock& lumi, const edm::EventSetup& c) override;
0040 
0041   /// Calculate Data Integrity Fraction
0042   void calculateDIFraction(const edm::LuminosityBlock& lumi, const edm::EventSetup& c);
0043 
0044 private:
0045   int ievt_;
0046 
0047   std::string prefixME_;
0048 
0049   edm::EDGetTokenT<ESRawDataCollection> dccCollections_;
0050   edm::EDGetTokenT<ESLocalRawDataCollection> kchipCollections_;
0051 
0052   MonitorElement* meGain_;
0053   MonitorElement* meFED_;
0054   MonitorElement* meSLinkCRCErr_;
0055   MonitorElement* meDCCErr_;
0056   MonitorElement* meDCCCRCErr_;
0057   MonitorElement* meOptoRX_;
0058   MonitorElement* meOptoBC_;
0059   MonitorElement* meFiberBadStatus_;
0060   MonitorElement* meFiberErrCode_;
0061   MonitorElement* meFiberOff_;
0062   MonitorElement* meEVDR_;
0063   MonitorElement* meKF1_;
0064   MonitorElement* meKF2_;
0065   MonitorElement* meKBC_;
0066   MonitorElement* meKEC_;
0067   MonitorElement* meDIErrors_[2][2];
0068   MonitorElement* meDIErrorsLS_[2][2];
0069   MonitorElement* meDIFraction_;
0070 
0071   edm::FileInPath lookup_;
0072 
0073   int runNum_, eCount_, runtype_, seqtype_, dac_, gain_, precision_;
0074   int firstDAC_, nDAC_, isPed_, vDAC_[5];
0075   int fed_[2][2][40][40], kchip_[2][2][40][40], fiber_[2][2][40][40];
0076   bool doLumiAnalysis_;
0077 };
0078 
0079 #endif