00001 #ifndef DQMOFFLINE_TRIGGER_EGHLTOFFLINESOURCE 00002 #define DQMOFFLINE_TRIGGER_EGHLTOFFLINESOURCE 00003 00004 // -*- C++ -*- 00005 // 00006 // Package: EgammaHLTOffline 00007 // Class: EgammaHLTOffline 00008 // 00009 /* 00010 Description: This is a DQM source meant to plot high-level HLT trigger 00011 quantities as stored in the HLT results object TriggerResults for the Egamma triggers 00012 00013 Notes: 00014 Currently I would like to plot simple histograms of three seperate types of variables 00015 1) global event quantities: eg nr of electrons 00016 2) di-object quanities: transverse mass, di-electron mass 00017 3) single object kinematic and id variables: eg et,eta,isolation 00018 00019 */ 00020 // 00021 // Original Author: Sam Harper 00022 // Created: June 2008 00023 // 00024 // 00025 // 00026 00027 //#include "DataFormats/HLTReco/interface/TriggerEvent.h" 00028 //#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" 00029 00030 #include "FWCore/Framework/interface/Frameworkfwd.h" 00031 #include "FWCore/Framework/interface/EDAnalyzer.h" 00032 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00033 #include "FWCore/Framework/interface/Event.h" 00034 00035 #include "DQMOffline/Trigger/interface/EgHLTBinData.h" 00036 #include "DQMOffline/Trigger/interface/EgHLTCutMasks.h" 00037 #include "DQMOffline/Trigger/interface/EgHLTMonElemContainer.h" 00038 #include "DQMOffline/Trigger/interface/EgHLTOffHelper.h" 00039 #include "DQMOffline/Trigger/interface/EgHLTOffEvt.h" 00040 #include "DQMOffline/Trigger/interface/EgHLTTrigCodes.h" 00041 00042 class DQMStore; 00043 class MonitorElement; 00044 class HLTConfigProvider; 00045 00046 namespace egHLT { 00047 class EleHLTFilterMon; 00048 class PhoHLTFilterMon; 00049 } 00050 00051 // namespace trigger{ 00052 // class TriggerObject; 00053 00054 // } 00055 00056 class EgHLTOfflineSource : public edm::EDAnalyzer { 00057 00058 private: 00059 DQMStore* dbe_; //dbe seems to be the standard name for this, I dont know why. We of course dont own it 00060 MonitorElement* dqmErrsMonElem_; //monitors DQM errors (ie failing to get trigger info, etc) 00061 MonitorElement* nrEventsProcessedMonElem_; //number of events processed mon elem 00062 int nrEventsProcessed_; //number of events processed 00063 00064 std::vector<egHLT::EleHLTFilterMon*> eleFilterMonHists_; //monitoring histograms for different trigger paths, we own them 00065 std::vector<egHLT::PhoHLTFilterMon*> phoFilterMonHists_; //monitoring histograms for different trigger paths, we own them 00066 std::vector<egHLT::MonElemContainer<egHLT::OffEle>*> eleMonElems_; //mon elements for monitoring electrons, we own them 00067 std::vector<egHLT::MonElemContainer<egHLT::OffPho>*> phoMonElems_; //mon elements for monitoring photons, we own them 00068 00069 std::string dirName_; 00070 00071 egHLT::OffEvt offEvt_; 00072 egHLT::OffHelper offEvtHelper_;// this is where up wrap up nasty code which will be replaced by offical tools at some point 00073 00074 //note ele,pho does not refer to whether the trigger is electron or photon, it refers to what type 00075 //of object passing the trigger will be monitored, eg ele = offline gsf electrons 00076 std::vector<std::string> eleHLTFilterNames_;//names of the filter names to use for offline ele 00077 std::vector<std::string> phoHLTFilterNames_;//names of the filter names to use for offline pho 00078 std::vector<std::string> eleHLTFilterNames2Leg_;//names of the first leg of 2Leg filter names to use for offline ele in form filter1::filter2 00079 std::vector<std::string> eleTightLooseTrigNames_; // list of 'tightTrig:looseTrig' pairs for ele 00080 std::vector<std::string> phoTightLooseTrigNames_; // list of 'tightTrig:looseTrig' pairs for pho 00081 std::vector<std::string> diEleTightLooseTrigNames_; // list of 'tightTrig:looseTrig' pairs for di-ele triggers 00082 std::vector<std::string> diPhoTightLooseTrigNames_; // list of 'tightTrig:looseTrig' pairs for di-pho triggers 00083 00084 egHLT::BinData binData_; 00085 egHLT::CutMasks cutMasks_; 00086 00087 bool isSetup_; 00088 bool filterInactiveTriggers_; 00089 std::string hltTag_; 00090 00091 //disabling copying/assignment (copying this class would be bad, mkay) 00092 EgHLTOfflineSource(const EgHLTOfflineSource& rhs){} 00093 EgHLTOfflineSource& operator=(const EgHLTOfflineSource& rhs){return *this;} 00094 00095 public: 00096 explicit EgHLTOfflineSource(const edm::ParameterSet& ); 00097 virtual ~EgHLTOfflineSource(); 00098 00099 virtual void beginJob(); 00100 virtual void endJob(); 00101 virtual void beginRun(const edm::Run& run, const edm::EventSetup& c); 00102 virtual void endRun(const edm::Run& run, const edm::EventSetup& c); 00103 virtual void analyze(const edm::Event&, const edm::EventSetup&); 00104 00105 void addEleTrigPath(const std::string& name); 00106 void addPhoTrigPath(const std::string& name); 00107 void getHLTFilterNamesUsed(std::vector<std::string>& filterNames)const; 00108 void filterTriggers(const HLTConfigProvider& hltConfig); 00109 }; 00110 00111 00112 00113 #endif