Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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   // DQMStore* dbe_; //dbe seems to be the standard name for this, I dont know why. We of course dont own it
0037   std::string dirName_;
0038 
0039   std::vector<std::string> eleHLTFilterNames_;  //names of the filters monitored using electrons to make plots for
0040   std::vector<std::string> eleHLTFilterNames2Leg_;
0041   std::vector<std::string> eleTightLooseTrigNames_;
0042   std::vector<std::string> phoHLTFilterNames_;  //names of the filters monitored using photons to make plots for
0043   std::vector<std::string> phoHLTFilterNames2Leg_;
0044   std::vector<std::string> phoTightLooseTrigNames_;
0045 
0046   std::vector<std::string> eleN1EffVars_;
0047   std::vector<std::string> eleSingleEffVars_;
0048   std::vector<std::string> eleEffTags_;
0049 
0050   std::vector<std::string> phoN1EffVars_;
0051   std::vector<std::string> phoSingleEffVars_;
0052   std::vector<std::string> phoEffTags_;
0053 
0054   std::vector<std::string> eleTrigTPEffVsVars_;
0055   std::vector<std::string> phoTrigTPEffVsVars_;
0056   std::vector<std::string> eleLooseTightTrigEffVsVars_;
0057   std::vector<std::string> phoLooseTightTrigEffVsVars_;
0058 
0059   std::vector<std::string> eleHLTvOfflineVars_;
0060   std::vector<std::string> phoHLTvOfflineVars_;
0061 
0062   bool runClientEndLumiBlock_;
0063   bool runClientEndRun_;
0064   bool runClientEndJob_;
0065 
0066   bool filterInactiveTriggers_;
0067   bool isSetup_;
0068   std::string hltTag_;
0069 
0070 public:
0071   explicit EgHLTOfflineClient(const edm::ParameterSet&);
0072   ~EgHLTOfflineClient() override;
0073 
0074   // virtual void beginJob();
0075   // virtual void analyze(const edm::Event&, const edm::EventSetup&); //dummy
0076   // virtual void endJob();
0077   void beginRun(const edm::Run& run, const edm::EventSetup& c) override;
0078   // virtual void endRun(const edm::Run& run, const edm::EventSetup& c);
0079 
0080   // virtual void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,const edm::EventSetup& context){}
0081   // DQM Client Diagnostic
0082   // virtual void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,const edm::EventSetup& c);
0083   void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&) override;  //performed in the endJob
0084   void dqmEndLuminosityBlock(DQMStore::IBooker&,
0085                              DQMStore::IGetter&,
0086                              edm::LuminosityBlock const&,
0087                              edm::EventSetup const&) override;  //performed in the endLumi
0088 
0089   //at somepoint these all may migrate to a helper class
0090   void createN1EffHists(const std::string& filterName,
0091                         const std::string& baseName,
0092                         const std::string& region,
0093                         const std::vector<std::string>& varNames,
0094                         DQMStore::IBooker&,
0095                         DQMStore::IGetter&);
0096 
0097   void createSingleEffHists(const std::string& filterName,
0098                             const std::string& baseName,
0099                             const std::string& region,
0100                             const std::vector<std::string>& varNames,
0101                             DQMStore::IBooker&,
0102                             DQMStore::IGetter&);
0103 
0104   void createLooseTightTrigEff(const std::vector<std::string>& tightLooseTrigNames,
0105                                const std::string& region,
0106                                const std::vector<std::string>& vsVarNames,
0107                                const std::string& objName,
0108                                DQMStore::IBooker&,
0109                                DQMStore::IGetter&);
0110 
0111   void createTrigTagProbeEffHists(const std::string& filterName,
0112                                   const std::string& region,
0113                                   const std::vector<std::string>& vsVarNames,
0114                                   const std::string& objName,
0115                                   DQMStore::IBooker&,
0116                                   DQMStore::IGetter&);
0117 
0118   void createTrigTagProbeEffHistsNewAlgo(const std::string& filterName,
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 createTrigTagProbeEffHists2Leg(const std::string& filterNameLeg1,
0126                                       const std::string& filterNameLeg2,
0127                                       const std::string& region,
0128                                       const std::vector<std::string>& vsVarNames,
0129                                       const std::string& objName,
0130                                       DQMStore::IBooker&,
0131                                       DQMStore::IGetter&);
0132 
0133   void createHLTvsOfflineHists(const std::string& filterName,
0134                                const std::string& baseName,
0135                                const std::string& region,
0136                                const std::vector<std::string>& varNames,
0137                                DQMStore::IBooker&,
0138                                DQMStore::IGetter&);
0139 
0140   MonitorElement* FillHLTvsOfflineHist(const std::string& filter,
0141                                        const std::string& name,
0142                                        const std::string& title,
0143                                        const MonitorElement* numer,
0144                                        const MonitorElement* denom,
0145                                        DQMStore::IBooker&,
0146                                        DQMStore::IGetter&);
0147 
0148   MonitorElement* makeEffMonElemFromPassAndAll(const std::string& filterName,
0149                                                const std::string& name,
0150                                                const std::string& title,
0151                                                const MonitorElement* pass,
0152                                                const MonitorElement* all,
0153                                                DQMStore::IBooker&,
0154                                                DQMStore::IGetter&);
0155 
0156   MonitorElement* makeEffMonElemFromPassAndFail(const std::string& filterName,
0157                                                 const std::string& name,
0158                                                 const std::string& title,
0159                                                 const MonitorElement* pass,
0160                                                 const MonitorElement* fail,
0161                                                 DQMStore::IBooker&,
0162                                                 DQMStore::IGetter&);
0163 
0164   MonitorElement* makeEffMonElemFromPassAndFailAndTagTag(const std::string& filter,
0165                                                          const std::string& name,
0166                                                          const std::string& title,
0167                                                          const MonitorElement* pass,
0168                                                          const MonitorElement* fail,
0169                                                          const MonitorElement* tagtag,
0170                                                          DQMStore::IBooker&,
0171                                                          DQMStore::IGetter&);
0172 
0173   MonitorElement* makeEffMonElem2Leg(const std::string& filter,
0174                                      const std::string& name,
0175                                      const std::string& title,
0176                                      const MonitorElement* Leg1Eff,
0177                                      const MonitorElement* Leg2NotLeg1Source,
0178                                      const MonitorElement* all,
0179                                      DQMStore::IBooker&,
0180                                      DQMStore::IGetter&);
0181 
0182 private:
0183   void runClient_(DQMStore::IBooker&, DQMStore::IGetter&);  //master function which runs the client
0184 };
0185 
0186 #endif