Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:20:58

0001 /* HLTJetMET Path Validation Analyzer
0002    Migrated to use DQMEDAnalyzer by: Jyothsna Rani Komaragiri, Oct 2014
0003 */
0004 
0005 #ifndef HLTJetMETValidation_h
0006 #define HLTJetMETValidation_h
0007 
0008 #include "DataFormats/Math/interface/LorentzVector.h"
0009 #include "FWCore/Framework/interface/EDAnalyzer.h"
0010 #include "FWCore/Framework/interface/Event.h"
0011 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 #include "FWCore/ServiceRegistry/interface/Service.h"
0014 
0015 #include "DataFormats/Common/interface/TriggerResults.h"
0016 #include "DataFormats/HLTReco/interface/TriggerEventWithRefs.h"
0017 #include "DataFormats/HLTReco/interface/TriggerRefsCollections.h"
0018 
0019 #include "DataFormats/L1Trigger/interface/L1EmParticle.h"
0020 #include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h"
0021 #include "DataFormats/L1Trigger/interface/L1JetParticle.h"
0022 #include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"
0023 #include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
0024 #include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h"
0025 
0026 #include "DataFormats/JetReco/interface/CaloJet.h"
0027 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
0028 #include "DataFormats/JetReco/interface/GenJet.h"
0029 #include "DataFormats/JetReco/interface/PFJet.h"
0030 #include "DataFormats/JetReco/interface/PFJetCollection.h"
0031 
0032 #include "DataFormats/METReco/interface/CaloMET.h"
0033 #include "DataFormats/METReco/interface/CaloMETCollection.h"
0034 
0035 #include "DataFormats/METReco/interface/GenMET.h"
0036 #include "DataFormats/METReco/interface/GenMETCollection.h"
0037 
0038 #include "DataFormats/EgammaCandidates/interface/Electron.h"
0039 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
0040 // Include DQM core
0041 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0042 #include "DQMServices/Core/interface/DQMStore.h"
0043 
0044 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
0045 
0046 #include "TPRegexp.h"
0047 #include <string>
0048 #include <vector>
0049 
0050 namespace edm {
0051   class TriggerNames;
0052 }
0053 
0054 class HLTJetMETValidation : public DQMEDAnalyzer {
0055 public:
0056   explicit HLTJetMETValidation(const edm::ParameterSet &);
0057   ~HLTJetMETValidation() override;
0058 
0059 private:
0060   void analyze(const edm::Event &, const edm::EventSetup &) override;
0061   void bookHistograms(DQMStore::IBooker &, edm::Run const &iRun, edm::EventSetup const &iSetup) override;
0062   void dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) override;
0063 
0064   void getHLTResults(const edm::TriggerResults &, const edm::TriggerNames &triggerNames);
0065 
0066   /// InputTag of TriggerEventWithRefs to analyze
0067   edm::EDGetTokenT<trigger::TriggerEventWithRefs> triggerEventObject_;
0068   edm::EDGetTokenT<reco::PFJetCollection> PFJetAlgorithm;
0069   edm::EDGetTokenT<reco::GenJetCollection> GenJetAlgorithm;
0070   edm::EDGetTokenT<reco::CaloMETCollection> CaloMETColl;
0071   edm::EDGetTokenT<reco::GenMETCollection> GenMETColl;
0072   edm::EDGetTokenT<edm::TriggerResults> HLTriggerResults;
0073 
0074   // Just a tag for better file organization
0075   std::string triggerTag_, patternJetTrg_, patternMetTrg_, patternMuTrg_;
0076 
0077   std::vector<MonitorElement *> _meHLTJetPt;
0078   std::vector<MonitorElement *> _meHLTJetPtTrgMC;
0079   std::vector<MonitorElement *> _meHLTJetPtTrg;
0080   std::vector<MonitorElement *> _meHLTJetPtTrgLow;
0081   std::vector<MonitorElement *> _meHLTJetEta;
0082   std::vector<MonitorElement *> _meHLTJetEtaTrgMC;
0083   std::vector<MonitorElement *> _meHLTJetEtaTrg;
0084   std::vector<MonitorElement *> _meHLTJetEtaTrgLow;
0085   std::vector<MonitorElement *> _meHLTJetPhi;
0086   std::vector<MonitorElement *> _meHLTJetPhiTrgMC;
0087   std::vector<MonitorElement *> _meHLTJetPhiTrg;
0088   std::vector<MonitorElement *> _meHLTJetPhiTrgLow;
0089 
0090   std::vector<MonitorElement *> _meGenJetPt;
0091   std::vector<MonitorElement *> _meGenJetPtTrgMC;
0092   std::vector<MonitorElement *> _meGenJetPtTrg;
0093   std::vector<MonitorElement *> _meGenJetPtTrgLow;
0094   std::vector<MonitorElement *> _meGenJetEta;
0095   std::vector<MonitorElement *> _meGenJetEtaTrgMC;
0096   std::vector<MonitorElement *> _meGenJetEtaTrg;
0097   std::vector<MonitorElement *> _meGenJetEtaTrgLow;
0098   std::vector<MonitorElement *> _meGenJetPhi;
0099   std::vector<MonitorElement *> _meGenJetPhiTrgMC;
0100   std::vector<MonitorElement *> _meGenJetPhiTrg;
0101   std::vector<MonitorElement *> _meGenJetPhiTrgLow;
0102 
0103   std::vector<MonitorElement *> _meHLTMET;
0104   std::vector<MonitorElement *> _meHLTMETTrgMC;
0105   std::vector<MonitorElement *> _meHLTMETTrg;
0106   std::vector<MonitorElement *> _meHLTMETTrgLow;
0107   std::vector<MonitorElement *> _meGenMET;
0108   std::vector<MonitorElement *> _meGenMETTrgMC;
0109   std::vector<MonitorElement *> _meGenMETTrg;
0110   std::vector<MonitorElement *> _meGenMETTrgLow;
0111 
0112   MonitorElement *_triggerResults;
0113 
0114   // Define Numbers
0115   int evtCnt;
0116 
0117   HLTConfigProvider hltConfig_;
0118   std::vector<std::string> hltTrgJet;
0119   std::vector<std::string> hltTrgJetLow;
0120   std::vector<std::string> hltTrgMet;
0121   std::vector<std::string> hltTrgMetLow;
0122 
0123   // store hlt information in a map
0124   std::vector<bool> hlttrigs;
0125   std::map<std::string, bool> hltTriggerMap;
0126   std::map<std::string, bool>::iterator trig_iter;
0127 
0128   bool HLTinit_;
0129 
0130   bool writeFile_;
0131 };
0132 #endif