File indexing completed on 2024-10-14 22:39:35
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 ESIntLSCache {
0013 int ievtLS_;
0014 int DIErrorsByLS_[2][2][40][40];
0015 };
0016
0017 class ESIntegrityTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ESIntLSCache>> {
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
0026 void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0027
0028
0029 void endJob(void) override;
0030
0031
0032 void dqmEndRun(const edm::Run& r, const edm::EventSetup& c) override;
0033
0034
0035 std::shared_ptr<ESIntLSCache> globalBeginLuminosityBlock(const edm::LuminosityBlock& lumi,
0036 const edm::EventSetup& c) const override;
0037
0038
0039 void globalEndLuminosityBlock(const edm::LuminosityBlock& lumi, const edm::EventSetup& c) override;
0040
0041
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* meSLinkCRCErrByLS_;
0056 MonitorElement* meDCCErr_;
0057 MonitorElement* meDCCCRCErr_;
0058 MonitorElement* meDCCCRCErrByLS_;
0059 MonitorElement* meOptoRX_;
0060 MonitorElement* meOptoBC_;
0061 MonitorElement* meOptoBCByLS_;
0062 MonitorElement* meFiberBadStatus_;
0063 MonitorElement* meFiberErrCode_;
0064 MonitorElement* meFiberErrCodeByLS_;
0065 MonitorElement* meFiberOff_;
0066 MonitorElement* meFiberOffByLS_;
0067 MonitorElement* meEVDR_;
0068 MonitorElement* meKF1_;
0069 MonitorElement* meKF2_;
0070 MonitorElement* meKBC_;
0071 MonitorElement* meKEC_;
0072 MonitorElement* meDIErrors_[2][2];
0073 MonitorElement* meDIErrorsByLS_[2][2];
0074 MonitorElement* meDIFraction_;
0075
0076 edm::FileInPath lookup_;
0077
0078 int runNum_, eCount_, runtype_, seqtype_, dac_, gain_, precision_;
0079 int firstDAC_, nDAC_, isPed_, vDAC_[5];
0080 int fed_[2][2][40][40], kchip_[2][2][40][40], fiber_[2][2][40][40];
0081 bool doLumiAnalysis_;
0082 };
0083
0084 #endif