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:
34 
35  struct SumHistBinData {
37  std::vector<std::string> qTestPatterns;
38  };
39 
40 private:
41  DQMStore* dbe_; //dbe seems to be the standard name for this, I dont know why. We of course dont own it
44 
45  std::vector<std::string> eleHLTFilterNames_; //names of the filters monitored using electrons to make plots for
46  std::vector<std::string> phoHLTFilterNames_; //names of the filters monitored using photons to make plots for
47  std::vector<std::string> egHLTFiltersToMon_; //names of the filters to include in summary histogram
48 
49  std::vector<std::string> eleHLTFilterNamesForSumBit_; //names of the filters to include in the summary bit
50  std::vector<std::string> phoHLTFilterNamesForSumBit_; //names of the filters to include in the summary bit
51 
52  //the name of the bin label and the regex pattern to search for the quality tests to pass
53  std::vector<SumHistBinData> egHLTSumHistXBins_;
54  std::vector<SumHistBinData> eleQTestsForSumBit_;
55  std::vector<SumHistBinData> phoQTestsForSumBit_;
56 
60 
61  std::vector<std::string> egHLTFiltersToMonPaths_;
63 
65  bool isSetup_;
67 
68  //disabling copying/assignment (in theory this is copyable but lets not just in case)
71 
72 public:
74  ~EgHLTOfflineSummaryClient() override;
75 
76  void beginJob() override;
77  void analyze(const edm::Event&, const edm::EventSetup&) override; //dummy
78  void endJob() override;
79  void beginRun(const edm::Run& run, const edm::EventSetup& c) override;
80  void endRun(const edm::Run& run, const edm::EventSetup& c) override;
81 
82  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& context) override {}
83  // DQM Client Diagnostic
84  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c) override;
85 
86 private:
87  void runClient_(); //master function which runs the client
88 
90 
91  //takes a vector of strings of the form stringA:stringB and splits them into pairs containing stringA stringB
92  void splitStringsToPairs_(const std::vector<std::string>& stringsToSplit,
93  std::vector<std::pair<std::string, std::string> >& splitStrings);
94 
95  MonitorElement* getEgHLTSumHist_(); //makes our histogram
96  //gets a list of filters we are monitoring
97  //the reason we pass in ele and photon triggers seperately and then combine rather than passsing in a combined
98  //list is to be able to share the declearation with the rest of the E/g HLT DQM Offline modules
99  void getEgHLTFiltersToMon_(std::vector<std::string>& filterNames) const;
100 
101  //gets the quality tests for the filter matching pattern, if any of them fail it returns a 0, otherwise a 1
102  //it does not care if the tests exist and in this situation will return a 1 (default to good)
103  int getQTestResults_(const std::string& filterName, const std::vector<std::string>& pattern) const;
104 
105  static void fillQTestData_(const edm::ParameterSet& iConfig,
106  std::vector<SumHistBinData>& qTests,
107  const std::string& label);
108 };
109 
110 #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)