Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:43:57

0001 // -*-c++-*-
0002 //
0003 // Client class for L1 Scalers module.
0004 //
0005 
0006 #ifndef L1ScalersCLIENT_H
0007 #define L1ScalersCLIENT_H
0008 
0009 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0010 #include "FWCore/Framework/interface/Frameworkfwd.h"
0011 
0012 #include "DQMServices/Core/interface/DQMStore.h"
0013 
0014 #include "FWCore/Utilities/interface/InputTag.h"
0015 
0016 // HARD CODE THE NUMBER OF HISTOGRAMS TO 200, LENGTH OF MONITOR to 2000
0017 // segments
0018 #define MAX_ALGOS 140
0019 #define MAX_TT 80
0020 #define MAX_LUMI_SEG 2000
0021 
0022 class L1ScalersClient
0023     : public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
0024 public:
0025   typedef dqm::legacy::MonitorElement MonitorElement;
0026   typedef dqm::legacy::DQMStore DQMStore;
0027 
0028   /// Constructors
0029   L1ScalersClient(const edm::ParameterSet &ps);
0030 
0031   /// Destructor
0032   ~L1ScalersClient() override{};
0033 
0034   /// BeginJob
0035   void beginJob(void) override;
0036 
0037   //   /// Endjob
0038   //   void endJob(void);
0039 
0040   /// BeginRun
0041   void beginRun(const edm::Run &run, const edm::EventSetup &c) override;
0042 
0043   /// EndRun
0044   void endRun(const edm::Run &run, const edm::EventSetup &c) override;
0045 
0046   /// End LumiBlock
0047   /// DQM Client Diagnostic should be performed here
0048   void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override {}
0049   void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override;
0050 
0051   // unused
0052   void analyze(const edm::Event &e, const edm::EventSetup &c) override;
0053 
0054 private:
0055   DQMStore *dbe_;
0056 
0057   int nev_;    // Number of events processed
0058   int nLumi_;  // number of lumi blocks
0059   int currentRun_;
0060 
0061   float totAlgoPrevCount;
0062   float totTtPrevCount;
0063 
0064   unsigned long int l1AlgoScalerCounters_[MAX_ALGOS];
0065   MonitorElement *l1AlgoCurrentRate_;
0066   MonitorElement *l1AlgoRateHistories_[MAX_ALGOS];  // HARD CODE FOR NOW
0067   MonitorElement *l1AlgoCurrentRatePerAlgo_[MAX_ALGOS];
0068   MonitorElement *totalAlgoRate_;
0069 
0070   unsigned long int l1TechTrigScalerCounters_[MAX_TT];
0071   MonitorElement *l1TechTrigCurrentRate_;
0072   MonitorElement *l1TechTrigRateHistories_[MAX_TT];  // HARD CODE FOR NOW
0073   MonitorElement *l1TechTrigCurrentRatePerAlgo_[MAX_TT];
0074   MonitorElement *totalTtRate_;
0075 
0076   // this is a selected list of guys
0077   MonitorElement *selected_;
0078   MonitorElement *bxSelected_;
0079   std::vector<int> algoSelected_;
0080   std::vector<int> techSelected_;
0081   std::string folderName_;
0082   int numSelected_;
0083 
0084   int currentLumiBlockNumber_;
0085   bool first_algo;
0086   bool first_tt;
0087 };
0088 
0089 #endif  // L1ScalersCLIENT_H