Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:13:18

0001 #ifndef DQMOFFLINE_TRIGGER_EGHLTOFFLINESUMMARYCLIENT
0002 #define DQMOFFLINE_TRIGGER_EGHLTOFFLINESUMMARYCLIENT
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:    EgammaHLTOfflineSummaryClient
0007 // Class:      EgammaHLTOffline
0008 //
0009 /*
0010  Description: This module makes the summary histogram of the E/g HLT offline
0011 
0012  Notes:
0013    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
0014 
0015 */
0016 //
0017 // Original Author:  Sam Harper
0018 //         Created:  March 2009
0019 //
0020 //
0021 //
0022 
0023 #include "FWCore/Framework/interface/Frameworkfwd.h"
0024 #include "FWCore/Framework/interface/EDAnalyzer.h"
0025 #include "DQMServices/Core/interface/DQMStore.h"
0026 
0027 #include <vector>
0028 #include <string>
0029 
0030 class EgHLTOfflineSummaryClient : public edm::EDAnalyzer {
0031 public:
0032   typedef dqm::legacy::MonitorElement MonitorElement;
0033   typedef dqm::legacy::DQMStore DQMStore;
0034 
0035   struct SumHistBinData {
0036     std::string name;
0037     std::vector<std::string> qTestPatterns;
0038   };
0039 
0040 private:
0041   DQMStore* dbe_;  //dbe seems to be the standard name for this, I dont know why. We of course dont own it
0042   std::string dirName_;
0043   std::string egHLTSumHistName_;
0044 
0045   std::vector<std::string> eleHLTFilterNames_;  //names of the filters monitored using electrons to make plots for
0046   std::vector<std::string> phoHLTFilterNames_;  //names of the filters monitored using photons to make plots for
0047   std::vector<std::string> egHLTFiltersToMon_;  //names of the filters to include in summary histogram
0048 
0049   std::vector<std::string> eleHLTFilterNamesForSumBit_;  //names of the filters to include in the summary bit
0050   std::vector<std::string> phoHLTFilterNamesForSumBit_;  //names of the filters to include in the summary bit
0051 
0052   //the name of the bin label and the regex pattern to search for the quality tests to pass
0053   std::vector<SumHistBinData> egHLTSumHistXBins_;
0054   std::vector<SumHistBinData> eleQTestsForSumBit_;
0055   std::vector<SumHistBinData> phoQTestsForSumBit_;
0056 
0057   bool runClientEndLumiBlock_;
0058   bool runClientEndRun_;
0059   bool runClientEndJob_;
0060 
0061   std::vector<std::string> egHLTFiltersToMonPaths_;
0062   bool usePathNames_;
0063 
0064   bool filterInactiveTriggers_;
0065   bool isSetup_;
0066   std::string hltTag_;
0067 
0068   //disabling copying/assignment (in theory this is copyable but lets not just in case)
0069   EgHLTOfflineSummaryClient(const EgHLTOfflineSummaryClient& rhs) {}
0070   EgHLTOfflineSummaryClient& operator=(const EgHLTOfflineSummaryClient& rhs) { return *this; }
0071 
0072 public:
0073   explicit EgHLTOfflineSummaryClient(const edm::ParameterSet&);
0074   ~EgHLTOfflineSummaryClient() override;
0075 
0076   void beginJob() override;
0077   void analyze(const edm::Event&, const edm::EventSetup&) override;  //dummy
0078   void endJob() override;
0079   void beginRun(const edm::Run& run, const edm::EventSetup& c) override;
0080   void endRun(const edm::Run& run, const edm::EventSetup& c) override;
0081 
0082   void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& context) override {}
0083   // DQM Client Diagnostic
0084   void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c) override;
0085 
0086 private:
0087   void runClient_();  //master function which runs the client
0088 
0089   int getQTestBinData_(const edm::ParameterSet&);
0090 
0091   //takes a vector of strings of the form stringA:stringB and splits them into pairs containing stringA stringB
0092   void splitStringsToPairs_(const std::vector<std::string>& stringsToSplit,
0093                             std::vector<std::pair<std::string, std::string> >& splitStrings);
0094 
0095   MonitorElement* getEgHLTSumHist_();  //makes our histogram
0096   //gets a list of filters we are monitoring
0097   //the reason we pass in ele and photon triggers seperately and then combine rather than passsing in a combined
0098   //list is to be able to share the declearation with the rest of the E/g HLT DQM Offline modules
0099   void getEgHLTFiltersToMon_(std::vector<std::string>& filterNames) const;
0100 
0101   //gets the quality tests for the filter matching pattern, if any of them fail it returns a 0, otherwise a 1
0102   //it does not care if the tests exist and in this situation will return a 1 (default to good)
0103   int getQTestResults_(const std::string& filterName, const std::vector<std::string>& pattern) const;
0104 
0105   static void fillQTestData_(const edm::ParameterSet& iConfig,
0106                              std::vector<SumHistBinData>& qTests,
0107                              const std::string& label);
0108 };
0109 
0110 #endif