Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:50

0001 #ifndef DQMOFFLINE_TRIGGER_EGHLTOFFLINECLIENT
0002 #define DQMOFFLINE_TRIGGER_EGHLTOFFLINECLIENT
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:    EgammaHLTOfflineClient
0007 // Class:      EgammaHLTOffline
0008 //
0009 /*
0010  Description: This is a DQM client meant to plot high-level HLT trigger 
0011  quantities as stored in the HLT results object TriggerResults for the Egamma triggers
0012 
0013  Notes:
0014   Currently I would like to plot simple histograms of three seperate types of variables
0015   1) global event quantities: eg nr of electrons
0016   2) di-object quanities: transverse mass, di-electron mass
0017   3) single object kinematic and id variables: eg et,eta,isolation
0018 
0019 */
0020 //
0021 // Original Author:  Sam Harper
0022 //         Created:  June 2008
0023 //
0024 //
0025 //
0026 
0027 #include "FWCore/Framework/interface/Frameworkfwd.h"
0028 #include "DQMServices/Core/interface/DQMEDHarvester.h"
0029 #include "DQMServices/Core/interface/DQMStore.h"
0030 
0031 #include <vector>
0032 #include <string>
0033 
0034 class EgHLTOfflineClient : public DQMEDHarvester {
0035 private:
0036   std::string dirName_;
0037 
0038   std::vector<std::string> eleHLTFilterNames_;  //names of the filters monitored using electrons to make plots for
0039   std::vector<std::string> eleHLTFilterNames2Leg_;
0040   std::vector<std::string> eleTightLooseTrigNames_;
0041   std::vector<std::string> phoHLTFilterNames_;  //names of the filters monitored using photons to make plots for
0042   std::vector<std::string> phoHLTFilterNames2Leg_;
0043   std::vector<std::string> phoTightLooseTrigNames_;
0044 
0045   std::vector<std::string> eleN1EffVars_;
0046   std::vector<std::string> eleSingleEffVars_;
0047   std::vector<std::string> eleEffTags_;
0048 
0049   std::vector<std::string> phoN1EffVars_;
0050   std::vector<std::string> phoSingleEffVars_;
0051   std::vector<std::string> phoEffTags_;
0052 
0053   std::vector<std::string> eleTrigTPEffVsVars_;
0054   std::vector<std::string> phoTrigTPEffVsVars_;
0055   std::vector<std::string> eleLooseTightTrigEffVsVars_;
0056   std::vector<std::string> phoLooseTightTrigEffVsVars_;
0057 
0058   std::vector<std::string> eleHLTvOfflineVars_;
0059   std::vector<std::string> phoHLTvOfflineVars_;
0060 
0061   bool runClientEndLumiBlock_;
0062   bool runClientEndRun_;
0063   bool runClientEndJob_;
0064 
0065   bool filterInactiveTriggers_;
0066   bool isSetup_;
0067   std::string hltTag_;
0068 
0069 public:
0070   explicit EgHLTOfflineClient(const edm::ParameterSet&);
0071   ~EgHLTOfflineClient() override;
0072 
0073   void beginRun(const edm::Run& run, const edm::EventSetup& c) override;
0074   // DQM Client Diagnostic
0075   void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&) override;  //performed in the endJob
0076   void dqmEndLuminosityBlock(DQMStore::IBooker&,
0077                              DQMStore::IGetter&,
0078                              edm::LuminosityBlock const&,
0079                              edm::EventSetup const&) override;  //performed in the endLumi
0080 
0081   //at somepoint these all may migrate to a helper class
0082   void createN1EffHists(const std::string& filterName,
0083                         const std::string& baseName,
0084                         const std::string& region,
0085                         const std::vector<std::string>& varNames,
0086                         DQMStore::IBooker&,
0087                         DQMStore::IGetter&);
0088 
0089   void createSingleEffHists(const std::string& filterName,
0090                             const std::string& baseName,
0091                             const std::string& region,
0092                             const std::vector<std::string>& varNames,
0093                             DQMStore::IBooker&,
0094                             DQMStore::IGetter&);
0095 
0096   void createLooseTightTrigEff(const std::vector<std::string>& tightLooseTrigNames,
0097                                const std::string& region,
0098                                const std::vector<std::string>& vsVarNames,
0099                                const std::string& objName,
0100                                DQMStore::IBooker&,
0101                                DQMStore::IGetter&);
0102 
0103   void createTrigTagProbeEffHists(const std::string& filterName,
0104                                   const std::string& region,
0105                                   const std::vector<std::string>& vsVarNames,
0106                                   const std::string& objName,
0107                                   DQMStore::IBooker&,
0108                                   DQMStore::IGetter&);
0109 
0110   void createTrigTagProbeEffHistsNewAlgo(const std::string& filterName,
0111                                          const std::string& region,
0112                                          const std::vector<std::string>& vsVarNames,
0113                                          const std::string& objName,
0114                                          DQMStore::IBooker&,
0115                                          DQMStore::IGetter&);
0116 
0117   void createTrigTagProbeEffHists2Leg(const std::string& filterNameLeg1,
0118                                       const std::string& filterNameLeg2,
0119                                       const std::string& region,
0120                                       const std::vector<std::string>& vsVarNames,
0121                                       const std::string& objName,
0122                                       DQMStore::IBooker&,
0123                                       DQMStore::IGetter&);
0124 
0125   void createHLTvsOfflineHists(const std::string& filterName,
0126                                const std::string& baseName,
0127                                const std::string& region,
0128                                const std::vector<std::string>& varNames,
0129                                DQMStore::IBooker&,
0130                                DQMStore::IGetter&);
0131 
0132   MonitorElement* FillHLTvsOfflineHist(const std::string& filter,
0133                                        const std::string& name,
0134                                        const std::string& title,
0135                                        const MonitorElement* numer,
0136                                        const MonitorElement* denom,
0137                                        DQMStore::IBooker&,
0138                                        DQMStore::IGetter&);
0139 
0140   MonitorElement* makeEffMonElemFromPassAndAll(const std::string& filterName,
0141                                                const std::string& name,
0142                                                const std::string& title,
0143                                                const MonitorElement* pass,
0144                                                const MonitorElement* all,
0145                                                DQMStore::IBooker&,
0146                                                DQMStore::IGetter&);
0147 
0148   MonitorElement* makeEffMonElemFromPassAndFail(const std::string& filterName,
0149                                                 const std::string& name,
0150                                                 const std::string& title,
0151                                                 const MonitorElement* pass,
0152                                                 const MonitorElement* fail,
0153                                                 DQMStore::IBooker&,
0154                                                 DQMStore::IGetter&);
0155 
0156   MonitorElement* makeEffMonElemFromPassAndFailAndTagTag(const std::string& filter,
0157                                                          const std::string& name,
0158                                                          const std::string& title,
0159                                                          const MonitorElement* pass,
0160                                                          const MonitorElement* fail,
0161                                                          const MonitorElement* tagtag,
0162                                                          DQMStore::IBooker&,
0163                                                          DQMStore::IGetter&);
0164 
0165   MonitorElement* makeEffMonElem2Leg(const std::string& filter,
0166                                      const std::string& name,
0167                                      const std::string& title,
0168                                      const MonitorElement* Leg1Eff,
0169                                      const MonitorElement* Leg2NotLeg1Source,
0170                                      const MonitorElement* all,
0171                                      DQMStore::IBooker&,
0172                                      DQMStore::IGetter&);
0173 
0174 private:
0175   void runClient_(DQMStore::IBooker&, DQMStore::IGetter&);  //master function which runs the client
0176 };
0177 
0178 #endif