Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:12:26

0001 // -*-c++-*-
0002 #ifndef L1Scalers_H
0003 #define L1Scalers_H
0004 
0005 #include "FWCore/Framework/interface/Frameworkfwd.h"
0006 #include "DQMServices/Core/interface/DQMStore.h"
0007 #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
0008 #include "FWCore/Utilities/interface/InputTag.h"
0009 
0010 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
0011 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h"
0012 
0013 #define MAX_LUMI_SEG 2000
0014 #define MAX_LUMI_BIN 400
0015 
0016 namespace l1s {
0017   struct Empty {};
0018 }  // namespace l1s
0019 class L1Scalers : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<l1s::Empty>> {
0020 public:
0021   L1Scalers(const edm::ParameterSet &ps);
0022   ~L1Scalers() override{};
0023   void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0024   void analyze(const edm::Event &e, const edm::EventSetup &c) override;
0025   /// DQM Client Diagnostic should be performed here:
0026   std::shared_ptr<l1s::Empty> globalBeginLuminosityBlock(const edm::LuminosityBlock &lumiSeg,
0027                                                          const edm::EventSetup &c) const final;
0028   void globalEndLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override;
0029 
0030 private:
0031   int nev_;  // Number of events processed
0032 
0033   bool verbose_;
0034   edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> l1GtDataSource_;  // L1 Scalers
0035   edm::EDGetTokenT<L1MuGMTReadoutCollection> l1GmtDataSource_;     // L1 Scalers
0036 
0037   bool denomIsTech_;
0038   unsigned int denomBit_;
0039   bool tfIsTech_;
0040   unsigned int tfBit_;
0041   std::vector<unsigned int> algoSelected_;
0042   std::vector<unsigned int> techSelected_;
0043 
0044   std::string folderName_;  // dqm folder name
0045   MonitorElement *l1scalers_;
0046   MonitorElement *l1techScalers_;
0047   MonitorElement *l1Correlations_;
0048   MonitorElement *bxNum_;
0049 
0050   // 2d versions
0051   MonitorElement *l1scalersBx_;
0052   MonitorElement *l1techScalersBx_;
0053 
0054   // Int
0055   MonitorElement *nLumiBlock_;
0056   MonitorElement *l1AlgoCounter_;  // for total Algo Rate
0057   MonitorElement *l1TtCounter_;    // for total TT Rate
0058 
0059   // timing plots
0060   std::vector<MonitorElement *> algoBxDiff_;
0061   std::vector<MonitorElement *> techBxDiff_;
0062   std::vector<MonitorElement *> algoBxDiffLumi_;
0063   std::vector<MonitorElement *> techBxDiffLumi_;
0064   MonitorElement *dtBxDiff_;
0065   MonitorElement *dtBxDiffLumi_;
0066   MonitorElement *cscBxDiff_;
0067   MonitorElement *cscBxDiffLumi_;
0068   MonitorElement *rpcbBxDiff_;
0069   MonitorElement *rpcbBxDiffLumi_;
0070   MonitorElement *rpcfBxDiff_;
0071   MonitorElement *rpcfBxDiffLumi_;
0072 
0073   // steal from HLTrigger/special
0074   unsigned int threshold_;
0075   unsigned int fedStart_, fedStop_;
0076   // total Rates
0077   unsigned int rateAlgoCounter_;  // for total Algo Rate
0078   unsigned int rateTtCounter_;    // for total TT Rate
0079 
0080   edm::InputTag fedRawCollection_;
0081 
0082   std::vector<int> maskedList_;
0083   edm::InputTag HcalRecHitCollection_;
0084 
0085   int earliestDenom_;
0086   std::vector<int> earliestTech_;
0087   std::vector<int> earliestAlgo_;
0088 };
0089 
0090 #endif  // L1Scalers_H