Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:44:23

0001 #ifndef TriggerMatchMonitor_H
0002 #define TriggerMatchMonitor_H
0003 /** \class TriggerMatch monitor
0004  *
0005  *  DQM monitoring source for Trigger matching feature added to miniAOD
0006  *
0007  *  \author Bibhuprasad Mahakud (Purdue University, West Lafayette, USA)
0008  */
0009 
0010 #include <memory>
0011 #include <fstream>
0012 #include "FWCore/Framework/interface/Frameworkfwd.h"
0013 #include "FWCore/Framework/interface/Event.h"
0014 #include "FWCore/Framework/interface/MakerMacros.h"
0015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0016 #include "FWCore/ServiceRegistry/interface/Service.h"
0017 #include "DQMServices/Core/interface/DQMStore.h"
0018 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0019 
0020 #include "DataFormats/Common/interface/Handle.h"
0021 #include "DataFormats/MuonReco/interface/Muon.h"
0022 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0023 #include "DataFormats/MuonReco/interface/MuonEnergy.h"
0024 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0025 #include "DataFormats/VertexReco/interface/Vertex.h"
0026 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0027 #include "DataFormats/TrackReco/interface/Track.h"
0028 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0029 #include "DataFormats/MuonReco/interface/MuonSelectors.h"
0030 #include "FWCore/Common/interface/TriggerNames.h"
0031 #include "DataFormats/Common/interface/TriggerResults.h"
0032 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
0033 #include "DataFormats/PatCandidates/interface/Muon.h"
0034 #include "DataFormats/PatCandidates/interface/TriggerObjectStandAlone.h"
0035 
0036 class TriggerMatchMonitor : public DQMEDAnalyzer {
0037 public:
0038   /// Constructor
0039   TriggerMatchMonitor(const edm::ParameterSet& pSet);
0040 
0041   /// Destructor
0042   ~TriggerMatchMonitor() override;
0043 
0044   void analyze(const edm::Event&, const edm::EventSetup&) override;
0045   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0046 
0047 private:
0048   // ----------member data ---------------------------
0049   edm::ParameterSet parameters;
0050 
0051   // triggerNames to be passed from config
0052   std::string triggerPathName1_;
0053   std::string triggerHistName1_;
0054   double triggerPtThresholdPath1_;
0055   std::string triggerPathName2_;
0056   std::string triggerHistName2_;
0057   double triggerPtThresholdPath2_;
0058 
0059   //Vertex requirements
0060   edm::EDGetTokenT<edm::View<reco::Muon>> theMuonCollectionLabel_;
0061   edm::EDGetTokenT<edm::View<pat::Muon>> thePATMuonCollectionLabel_;
0062   edm::EDGetTokenT<reco::VertexCollection> theVertexLabel_;
0063   edm::EDGetTokenT<reco::BeamSpot> theBeamSpotLabel_;
0064   edm::EDGetTokenT<edm::TriggerResults> triggerResultsToken_;
0065   edm::EDGetTokenT<std::vector<pat::TriggerObjectStandAlone>> triggerObjects_;
0066 
0067   edm::EDGetTokenT<reco::BeamSpot> beamSpotToken_;
0068   edm::EDGetTokenT<std::vector<reco::Vertex>> primaryVerticesToken_;
0069 
0070   // histograms
0071   std::vector<MonitorElement*> matchHists;
0072   MonitorElement* h_passHLTPath1_eta_Tight;
0073   MonitorElement* h_passHLTPath1_pt_Tight;
0074   MonitorElement* h_passHLTPath1_phi_Tight;
0075   MonitorElement* h_totalHLTPath1_eta_Tight;
0076   MonitorElement* h_totalHLTPath1_pt_Tight;
0077   MonitorElement* h_totalHLTPath1_phi_Tight;
0078 
0079   MonitorElement* h_passHLTPath2_eta_Tight;
0080   MonitorElement* h_passHLTPath2_pt_Tight;
0081   MonitorElement* h_passHLTPath2_phi_Tight;
0082   MonitorElement* h_totalHLTPath2_eta_Tight;
0083   MonitorElement* h_totalHLTPath2_pt_Tight;
0084   MonitorElement* h_totalHLTPath2_phi_Tight;
0085 
0086   std::string theFolder;
0087 };
0088 #endif