CMS 3D CMS Logo

EgHLTOfflineSummaryClient.h
Go to the documentation of this file.
1 #ifndef DQMOFFLINE_TRIGGER_EGHLTOFFLINESUMMARYCLIENT
2 #define DQMOFFLINE_TRIGGER_EGHLTOFFLINESUMMARYCLIENT
3 
4 // -*- C++ -*-
5 //
6 // Package: EgammaHLTOfflineSummaryClient
7 // Class: EgammaHLTOffline
8 //
9 /*
10  Description: This module makes the summary histogram of the E/g HLT offline
11 
12  Notes:
13  this takes the results of the quality tests and produces a module summarising each one. There are two summary histograms, one with each E/g trigger which is either green or red and one eta/phi bad/good region
14 
15 */
16 //
17 // Original Author: Sam Harper
18 // Created: March 2009
19 //
20 //
21 //
22 
26 
27 #include <vector>
28 #include <string>
29 
31  : public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
32 public:
35 
36  struct SumHistBinData {
38  std::vector<std::string> qTestPatterns;
39  };
40 
41 private:
42  DQMStore* dbe_; //dbe seems to be the standard name for this, I dont know why. We of course dont own it
45 
46  std::vector<std::string> eleHLTFilterNames_; //names of the filters monitored using electrons to make plots for
47  std::vector<std::string> phoHLTFilterNames_; //names of the filters monitored using photons to make plots for
48  std::vector<std::string> egHLTFiltersToMon_; //names of the filters to include in summary histogram
49 
50  std::vector<std::string> eleHLTFilterNamesForSumBit_; //names of the filters to include in the summary bit
51  std::vector<std::string> phoHLTFilterNamesForSumBit_; //names of the filters to include in the summary bit
52 
53  //the name of the bin label and the regex pattern to search for the quality tests to pass
54  std::vector<SumHistBinData> egHLTSumHistXBins_;
55  std::vector<SumHistBinData> eleQTestsForSumBit_;
56  std::vector<SumHistBinData> phoQTestsForSumBit_;
57 
61 
62  std::vector<std::string> egHLTFiltersToMonPaths_;
64 
66  bool isSetup_;
68 
69  //disabling copying/assignment (in theory this is copyable but lets not just in case)
72 
73 public:
75  ~EgHLTOfflineSummaryClient() override;
76 
77  void beginJob() override;
78  void analyze(const edm::Event&, const edm::EventSetup&) override; //dummy
79  void endJob() override;
80  void beginRun(const edm::Run& run, const edm::EventSetup& c) override;
81  void endRun(const edm::Run& run, const edm::EventSetup& c) override;
82 
83  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& context) override {}
84  // DQM Client Diagnostic
85  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c) override;
86 
87 private:
88  void runClient_(); //master function which runs the client
89 
91 
92  //takes a vector of strings of the form stringA:stringB and splits them into pairs containing stringA stringB
93  void splitStringsToPairs_(const std::vector<std::string>& stringsToSplit,
94  std::vector<std::pair<std::string, std::string> >& splitStrings);
95 
96  MonitorElement* getEgHLTSumHist_(); //makes our histogram
97  //gets a list of filters we are monitoring
98  //the reason we pass in ele and photon triggers seperately and then combine rather than passsing in a combined
99  //list is to be able to share the declearation with the rest of the E/g HLT DQM Offline modules
100  void getEgHLTFiltersToMon_(std::vector<std::string>& filterNames) const;
101 
102  //gets the quality tests for the filter matching pattern, if any of them fail it returns a 0, otherwise a 1
103  //it does not care if the tests exist and in this situation will return a 1 (default to good)
104  int getQTestResults_(const std::string& filterName, const std::vector<std::string>& pattern) const;
105 
106  static void fillQTestData_(const edm::ParameterSet& iConfig,
107  std::vector<SumHistBinData>& qTests,
108  const std::string& label);
109 };
110 
111 #endif
std::vector< std::string > phoHLTFilterNamesForSumBit_
void splitStringsToPairs_(const std::vector< std::string > &stringsToSplit, std::vector< std::pair< std::string, std::string > > &splitStrings)
std::vector< std::string > egHLTFiltersToMonPaths_
std::vector< std::string > eleHLTFilterNamesForSumBit_
dqm::legacy::MonitorElement MonitorElement
std::vector< SumHistBinData > egHLTSumHistXBins_
std::vector< std::string > eleHLTFilterNames_
std::vector< SumHistBinData > eleQTestsForSumBit_
std::vector< std::string > egHLTFiltersToMon_
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
int getQTestResults_(const std::string &filterName, const std::vector< std::string > &pattern) const
void endRun(const edm::Run &run, const edm::EventSetup &c) override
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
char const * label
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
void analyze(const edm::Event &, const edm::EventSetup &) override
EgHLTOfflineSummaryClient & operator=(const EgHLTOfflineSummaryClient &rhs)
~EgHLTOfflineSummaryClient() override
std::vector< SumHistBinData > phoQTestsForSumBit_
std::vector< std::string > phoHLTFilterNames_
void getEgHLTFiltersToMon_(std::vector< std::string > &filterNames) const
EgHLTOfflineSummaryClient(const EgHLTOfflineSummaryClient &rhs)
int getQTestBinData_(const edm::ParameterSet &)
Definition: Run.h:45
static void fillQTestData_(const edm::ParameterSet &iConfig, std::vector< SumHistBinData > &qTests, const std::string &label)