Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-04 02:02:32

0001 #ifndef DQMOFFLINE_TRIGGER_EGHLTOFFLINESOURCE
0002 #define DQMOFFLINE_TRIGGER_EGHLTOFFLINESOURCE
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:    EgammaHLTOffline
0007 // Class:      EgammaHLTOffline
0008 //
0009 /*
0010  Description: This is a DQM source 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 "DataFormats/HLTReco/interface/TriggerEvent.h"
0028 //#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
0029 
0030 #include "FWCore/Framework/interface/Frameworkfwd.h"
0031 #include "FWCore/Framework/interface/EDAnalyzer.h"
0032 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0033 #include "FWCore/Framework/interface/Event.h"
0034 
0035 #include "DQMOffline/Trigger/interface/EgHLTBinData.h"
0036 #include "DQMOffline/Trigger/interface/EgHLTCutMasks.h"
0037 #include "DQMOffline/Trigger/interface/EgHLTMonElemContainer.h"
0038 #include "DQMOffline/Trigger/interface/EgHLTMonElemFuncs.h"
0039 #include "DQMOffline/Trigger/interface/EgHLTOffHelper.h"
0040 #include "DQMOffline/Trigger/interface/EgHLTOffEvt.h"
0041 #include "DQMOffline/Trigger/interface/EgHLTTrigCodes.h"
0042 
0043 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0044 #include "DQMServices/Core/interface/DQMStore.h"
0045 
0046 class HLTConfigProvider;
0047 
0048 namespace egHLT {
0049   class EleHLTFilterMon;
0050   class PhoHLTFilterMon;
0051 }  // namespace egHLT
0052 
0053 // namespace trigger{
0054 //   class TriggerObject;
0055 
0056 // }
0057 
0058 class EgHLTOfflineSource : public DQMEDAnalyzer {
0059 private:
0060   MonitorElement* dqmErrsMonElem_;            //monitors DQM errors (ie failing to get trigger info, etc)
0061   MonitorElement* nrEventsProcessedMonElem_;  //number of events processed mon elem
0062   int nrEventsProcessed_;                     //number of events processed
0063 
0064   std::vector<egHLT::EleHLTFilterMon*>
0065       eleFilterMonHists_;  //monitoring histograms for different trigger paths, we own them
0066   std::vector<egHLT::PhoHLTFilterMon*>
0067       phoFilterMonHists_;  //monitoring histograms for different trigger paths, we own them
0068   std::vector<egHLT::MonElemContainer<egHLT::OffEle>*> eleMonElems_;  //mon elements for monitoring electrons, we own them
0069   std::vector<egHLT::MonElemContainer<egHLT::OffPho>*> phoMonElems_;  //mon elements for monitoring photons, we own them
0070 
0071   std::string dirName_;
0072   std::string subdirName_;
0073   bool dohep_;
0074   egHLT::OffEvt offEvt_;
0075   egHLT::OffHelper
0076       offEvtHelper_;  // this is where up wrap up nasty code which will be replaced by offical tools at some point
0077   std::unique_ptr<egHLT::TrigCodes> trigCodes;  // the only place instantiate them
0078 
0079   //note ele,pho does not refer to whether the trigger is electron or photon, it refers to what type
0080   //of object passing the trigger will be monitored, eg ele = offline gsf electrons
0081   std::vector<std::string> eleHLTFilterNames_;  //names of the filter names to use for offline ele
0082   std::vector<std::string> phoHLTFilterNames_;  //names of the filter names to use for offline pho
0083   std::vector<std::string>
0084       eleHLTFilterNames2Leg_;  //names of the first leg of 2Leg filter names to use for offline ele in form filter1::filter2
0085   std::vector<std::string> eleTightLooseTrigNames_;    // list of 'tightTrig:looseTrig' pairs for ele
0086   std::vector<std::string> phoTightLooseTrigNames_;    // list of 'tightTrig:looseTrig' pairs for pho
0087   std::vector<std::string> diEleTightLooseTrigNames_;  // list of 'tightTrig:looseTrig' pairs for di-ele triggers
0088   std::vector<std::string> diPhoTightLooseTrigNames_;  // list of 'tightTrig:looseTrig' pairs for di-pho triggers
0089 
0090   egHLT::BinData binData_;
0091   egHLT::CutMasks cutMasks_;
0092 
0093   bool filterInactiveTriggers_;
0094   std::string hltTag_;
0095 
0096 public:
0097   explicit EgHLTOfflineSource(const edm::ParameterSet&);
0098 
0099   //disabling copying/assignment (copying this class would be bad, mkay)
0100   EgHLTOfflineSource(const EgHLTOfflineSource& rhs) = delete;
0101   EgHLTOfflineSource& operator=(const EgHLTOfflineSource& rhs) = delete;
0102 
0103   ~EgHLTOfflineSource() override;
0104 
0105   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0106   void analyze(const edm::Event&, const edm::EventSetup&) override;
0107 
0108   void addEleTrigPath(egHLT::MonElemFuncs& monElemFuncs, const std::string& name);
0109   void addPhoTrigPath(egHLT::MonElemFuncs& monElemFuncs, const std::string& name);
0110   void getHLTFilterNamesUsed(std::vector<std::string>& filterNames) const;
0111   void filterTriggers(const HLTConfigProvider& hltConfig);
0112 };
0113 
0114 #endif