Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef ZCounting_H
0002 #define ZCounting_H
0003 
0004 #include "FWCore/Framework/interface/MakerMacros.h"   // definitions for declaring plug-in modules
0005 #include "FWCore/Framework/interface/Frameworkfwd.h"  // declaration of EDM types
0006 #include "FWCore/Framework/interface/ConsumesCollector.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"  // Parameters
0008 #include "FWCore/Utilities/interface/InputTag.h"
0009 
0010 #include <string>  // string class
0011 #include <cassert>
0012 
0013 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
0014 #include "DataFormats/VertexReco/interface/Vertex.h"
0015 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0016 #include "DataFormats/MuonReco/interface/Muon.h"
0017 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0018 #include "DataFormats/MuonReco/interface/MuonSelectors.h"
0019 
0020 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0021 #include "DQMServices/Core/interface/DQMStore.h"
0022 
0023 #include "DQMOffline/Lumi/interface/TriggerTools.h"
0024 
0025 class ZCounting : public DQMEDAnalyzer {
0026 public:
0027   ZCounting(const edm::ParameterSet& ps);
0028   ~ZCounting() override;
0029 
0030   enum MuonIDTypes { NoneID, LooseID, MediumID, TightID, CustomTightID };
0031   enum MuonIsoTypes { NoneIso, TrackerIso, PFIso };
0032 
0033 protected:
0034   void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
0035   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0036   void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;
0037 
0038 private:
0039   //other functions
0040   bool passMuonID(const reco::Muon& muon, const reco::Vertex* vtx);
0041   bool passMuonIso(const reco::Muon& muon);
0042   bool isCustomTightMuon(const reco::Muon& muon);
0043   bool passGlobalMuon(const reco::Muon& muon);
0044   bool passTrack(const reco::Track& track);
0045 
0046   // EDM object collection names
0047   const edm::InputTag triggerResultsInputTag_;
0048   edm::EDGetTokenT<reco::VertexCollection> fPVName_token;
0049 
0050   // Muons
0051   edm::EDGetTokenT<reco::MuonCollection> fMuonName_token;
0052   std::vector<std::string> fMuonHLTNames;
0053   std::vector<std::string> fMuonHLTObjectNames;
0054 
0055   edm::EDGetTokenT<reco::TrackCollection> fStandaloneRegName_token;
0056   edm::EDGetTokenT<reco::TrackCollection> fStandaloneUpdName_token;
0057 
0058   // Tracks
0059   edm::EDGetTokenT<reco::TrackCollection> fTrackName_token;
0060 
0061   // other input
0062   const double PtCutL1_;
0063   const double PtCutL2_;
0064   const double EtaCutL1_;
0065   const double EtaCutL2_;
0066 
0067   const int MassBin_;
0068   const double MassMin_;
0069   const double MassMax_;
0070 
0071   const int LumiBin_;
0072   const double LumiMin_;
0073   const double LumiMax_;
0074 
0075   const int PVBin_;
0076   const double PVMin_;
0077   const double PVMax_;
0078 
0079   const double VtxNTracksFitCut_;
0080   const double VtxNdofCut_;
0081   const double VtxAbsZCut_;
0082   const double VtxRhoCut_;
0083 
0084   const std::string IDTypestr_;
0085   const std::string IsoTypestr_;
0086   const double IsoCut_;
0087 
0088   // muon ID and ISO parameters
0089   MuonIDTypes IDType_{NoneID};
0090   MuonIsoTypes IsoType_{NoneIso};
0091 
0092   // trigger objects
0093   HLTConfigProvider hltConfigProvider_;
0094   TriggerTools* triggers;
0095 
0096   // constants
0097   const double DRMAX_HLT = 0.01;  // max deltaR^2 matching between muon and hlt object
0098   const double DRMAX_IO = 0.09;   // max deltaR^2 matching between inner and outer muon track
0099 
0100   const double MIN_PT_TRK = 15;    // minimum pT of inner track considered for matching outer to inner track
0101   const double MAX_ETA_TRK = 2.5;  // maximum |eta| of inner track considered for matching outer to inner track
0102   const double MIN_PT_STA = 15;    // minimum pT of outer track considered for matching inner to outer track
0103   const double MAX_ETA_STA = 2.4;  // maximum |eta| of outer track considered for matching inner to outer track
0104 
0105   const int N_STA_HITS = 1;  // minimum number of valid standalone hits
0106 
0107   const double MUON_MASS = 0.105658369;
0108   const double MUON_BOUND = 0.9;
0109 
0110   // General Histograms
0111   MonitorElement* h_npv;
0112 
0113   // Muon Histograms
0114   MonitorElement* h_mass_2HLT_BB;
0115   MonitorElement* h_mass_2HLT_BE;
0116   MonitorElement* h_mass_2HLT_EE;
0117 
0118   MonitorElement* h_mass_1HLT_BB;
0119   MonitorElement* h_mass_1HLT_BE;
0120   MonitorElement* h_mass_1HLT_EE;
0121 
0122   MonitorElement* h_mass_ID_fail_BB;
0123   MonitorElement* h_mass_ID_fail_BE;
0124   MonitorElement* h_mass_ID_fail_EE;
0125 
0126   MonitorElement* h_mass_Glo_pass_BB;
0127   MonitorElement* h_mass_Glo_pass_BE;
0128   MonitorElement* h_mass_Glo_pass_EE;
0129   MonitorElement* h_mass_Glo_fail_BB;
0130   MonitorElement* h_mass_Glo_fail_BE;
0131   MonitorElement* h_mass_Glo_fail_EE;
0132 
0133   MonitorElement* h_mass_Sta_pass_BB;
0134   MonitorElement* h_mass_Sta_pass_BE;
0135   MonitorElement* h_mass_Sta_pass_EE;
0136   MonitorElement* h_mass_Sta_fail_BB;
0137   MonitorElement* h_mass_Sta_fail_BE;
0138   MonitorElement* h_mass_Sta_fail_EE;
0139 };
0140 
0141 #endif