File indexing completed on 2023-03-17 10:58:02
0001 #ifndef DQMOFFLINE_L1TRIGGER_L1TRATE_OFFLINE_H
0002 #define DQMOFFLINE_L1TRIGGER_L1TRATE_OFFLINE_H
0003
0004
0005 #include <memory>
0006 #include <unistd.h>
0007
0008
0009 #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
0010 #include "FWCore/Framework/interface/Frameworkfwd.h"
0011 #include "FWCore/Framework/interface/Event.h"
0012 #include "FWCore/Framework/interface/LuminosityBlock.h"
0013 #include "FWCore/Framework/interface/MakerMacros.h"
0014
0015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0016
0017 #include "DQMServices/Core/interface/DQMStore.h"
0018 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0019
0020
0021 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
0022 #include "DataFormats/Scalers/interface/LumiScalers.h"
0023 #include "DataFormats/Scalers/interface/Level1TriggerRates.h"
0024 #include "DataFormats/Scalers/interface/Level1TriggerScalers.h"
0025 #include "DataFormats/Common/interface/ConditionsInEdm.h" // Parameters associated to Run, LS and Event
0026 #include "DataFormats/Luminosity/interface/LumiDetails.h" // Luminosity Information
0027 #include "DataFormats/Luminosity/interface/LumiSummary.h" // Luminosity Information
0028
0029 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h"
0030
0031 #include "DQM/L1TMonitor/interface/L1TMenuHelper.h"
0032
0033 #include <TString.h>
0034
0035 #include <iostream>
0036 #include <fstream>
0037 #include <vector>
0038
0039
0040
0041
0042
0043 class L1TRate_Offline : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
0044 public:
0045 enum Errors { UNKNOWN = 1, WARNING_PY_MISSING_FIT = 2 };
0046
0047 public:
0048 L1TRate_Offline(const edm::ParameterSet& ps);
0049 ~L1TRate_Offline() override;
0050
0051 protected:
0052 void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0053 void bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, const edm::EventSetup& iSetup) override;
0054
0055 void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
0056 void endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
0057
0058
0059
0060
0061
0062 bool getXSexFitsPython(const edm::ParameterSet& ps);
0063
0064
0065 private:
0066
0067 bool m_verbose;
0068
0069
0070 int m_refPrescaleSet;
0071 int m_maxNbins;
0072 int m_lsShiftGTRates;
0073
0074
0075 std::string m_outputFile;
0076
0077
0078 const std::vector<std::vector<int> >* m_listsPrescaleFactors;
0079
0080
0081 std::map<int, double> m_lsDeadTime;
0082 std::map<int, int> m_lsPrescaleIndex;
0083 std::map<int, double> m_lsLuminosity;
0084 std::map<int, std::map<TString, double> > m_lsRates;
0085 std::map<TString, int> m_algoBit;
0086 std::map<TString, TF1*> m_algoFit;
0087 std::map<std::string, bool> m_inputCategories;
0088 std::map<std::string, std::string> m_selectedTriggers;
0089 std::map<TString, MonitorElement*> m_xSecObservedToExpected;
0090 std::map<TString, MonitorElement*> m_xSecVsInstLumi;
0091
0092 std::map<TString, MonitorElement*> m_xSecObservedVsDelivLumi;
0093 std::map<TString, MonitorElement*> m_xSecObservedVsRecorLumi;
0094
0095 std::map<TString, MonitorElement*> m_CountsVsLS;
0096 std::map<TString, MonitorElement*> m_InstLumiVsLS;
0097 std::map<TString, MonitorElement*> m_PrescIndexVsLS;
0098
0099
0100 std::map<TString, MonitorElement*> m_xSecObservedVsLS;
0101 std::map<TString, MonitorElement*> m_DelivLumiVsLS;
0102 std::map<TString, MonitorElement*> m_RecorLumiVsLS;
0103
0104 std::map<TString, TF1*> m_templateFunctions;
0105
0106 std::map<int, std::map<TString, double> > m_lsCounts;
0107
0108
0109 edm::EDGetTokenT<LumiScalersCollection> m_scalersSource_LSCollection;
0110 edm::EDGetTokenT<Level1TriggerScalersCollection> m_scalersSource_L1TSCollection;
0111 edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> m_l1GtDataDaqInputTag;
0112
0113
0114 edm::ParameterSet m_parameters;
0115
0116
0117 MonitorElement* m_ErrorMonitor;
0118
0119 const edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> m_menuToken;
0120 const edm::ESGetToken<L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd> m_l1GtPfAlgoToken;
0121 L1TMenuHelper::Tokens m_helperTokens;
0122 L1GtUtils m_l1GtUtils;
0123 };
0124
0125 #endif