CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DQMOffline/Trigger/interface/EgHLTOfflineSummaryClient.h

Go to the documentation of this file.
00001 #ifndef DQMOFFLINE_TRIGGER_EGHLTOFFLINESUMMARYCLIENT
00002 #define DQMOFFLINE_TRIGGER_EGHLTOFFLINESUMMARYCLIENT
00003 
00004 // -*- C++ -*-
00005 //
00006 // Package:    EgammaHLTOfflineSummaryClient
00007 // Class:      EgammaHLTOffline
00008 // 
00009 /*
00010  Description: This module makes the summary histogram of the E/g HLT offline
00011 
00012  Notes:
00013    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
00014 
00015 */
00016 //
00017 // Original Author:  Sam Harper
00018 //         Created:  March 2009
00019 // 
00020 //
00021 //
00022 
00023 #include "FWCore/Framework/interface/Frameworkfwd.h"
00024 #include "FWCore/Framework/interface/EDAnalyzer.h"
00025 
00026 #include <vector>
00027 #include <string>
00028 
00029 class DQMStore;
00030 class MonitorElement;
00031 
00032 
00033 class EgHLTOfflineSummaryClient : public edm::EDAnalyzer {
00034 
00035 public:
00036   struct SumHistBinData {
00037     std::string name;
00038     std::vector<std::string> qTestPatterns;
00039   };
00040 
00041  private:
00042   DQMStore* dbe_; //dbe seems to be the standard name for this, I dont know why. We of course dont own it
00043   std::string dirName_;
00044   std::string egHLTSumHistName_;
00045 
00046   std::vector<std::string> eleHLTFilterNames_;//names of the filters monitored using electrons to make plots for
00047   std::vector<std::string> phoHLTFilterNames_;//names of the filters monitored using photons to make plots for
00048   std::vector<std::string> egHLTFiltersToMon_;//names of the filters to include in summary histogram
00049 
00050   std::vector<std::string> eleHLTFilterNamesForSumBit_; //names of the filters to include in the summary bit
00051   std::vector<std::string> phoHLTFilterNamesForSumBit_; //names of the filters to include in the summary bit
00052   
00053 
00054   //the name of the bin label and the regex pattern to search for the quality tests to pass
00055   std::vector<SumHistBinData> egHLTSumHistXBins_; 
00056   std::vector<SumHistBinData> eleQTestsForSumBit_;
00057   std::vector<SumHistBinData> phoQTestsForSumBit_;
00058 
00059   bool runClientEndLumiBlock_;
00060   bool runClientEndRun_;
00061   bool runClientEndJob_;
00062   
00063   std::vector<std::string> egHLTFiltersToMonPaths_;
00064   bool usePathNames_;
00065   
00066   bool filterInactiveTriggers_;
00067   bool isSetup_;
00068   std::string hltTag_;
00069   
00070 
00071   //disabling copying/assignment (in theory this is copyable but lets not just in case)
00072   EgHLTOfflineSummaryClient(const EgHLTOfflineSummaryClient& rhs){}
00073   EgHLTOfflineSummaryClient& operator=(const EgHLTOfflineSummaryClient& rhs){return *this;}
00074 
00075  public:
00076   explicit EgHLTOfflineSummaryClient(const edm::ParameterSet& );
00077   virtual ~EgHLTOfflineSummaryClient();
00078   
00079   
00080   virtual void beginJob();
00081   virtual void analyze(const edm::Event&, const edm::EventSetup&); //dummy
00082   virtual void endJob();
00083   virtual void beginRun(const edm::Run& run, const edm::EventSetup& c);
00084   virtual void endRun(const edm::Run& run, const edm::EventSetup& c);
00085   
00086   
00087   virtual void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,const edm::EventSetup& context){}
00088   // DQM Client Diagnostic
00089   virtual void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,const edm::EventSetup& c);
00090 
00091 
00092 
00093 private:
00094   void runClient_(); //master function which runs the client  
00095 
00096   int getQTestBinData_(const edm::ParameterSet&);
00097 
00098   //takes a vector of strings of the form stringA:stringB and splits them into pairs containing stringA stringB
00099   void splitStringsToPairs_(const std::vector<std::string>& stringsToSplit,std::vector<std::pair<std::string,std::string> >& splitStrings);
00100 
00101   MonitorElement* getEgHLTSumHist_(); //makes our histogram
00102   //gets a list of filters we are monitoring
00103   //the reason we pass in ele and photon triggers seperately and then combine rather than passsing in a combined
00104   //list is to be able to share the declearation with the rest of the E/g HLT DQM Offline modules
00105   void getEgHLTFiltersToMon_(std::vector<std::string>& filterNames)const;
00106 
00107 
00108 
00109   //gets the quality tests for the filter matching pattern, if any of them fail it returns a 0, otherwise a 1
00110   //it does not care if the tests exist and in this situation will return a 1 (default to good)
00111   int getQTestResults_(const std::string& filterName,const std::vector<std::string>& pattern)const;
00112  
00113   static void fillQTestData_(const edm::ParameterSet& iConfig,std::vector<SumHistBinData>& qTests,const std::string& label);
00114 };
00115 
00116 #endif