Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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