Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-25 01:53:23

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/EDAnalyzer.h"    // EDAnalyzer class
0007 #include "FWCore/Framework/interface/ConsumesCollector.h"
0008 #include "FWCore/ParameterSet/interface/ParameterSet.h"  // Parameters
0009 #include "FWCore/Utilities/interface/InputTag.h"
0010 
0011 #include <string>  // string class
0012 #include <cassert>
0013 
0014 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
0015 #include "DataFormats/VertexReco/interface/Vertex.h"
0016 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0017 #include "DataFormats/MuonReco/interface/Muon.h"
0018 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0019 #include "DataFormats/MuonReco/interface/MuonSelectors.h"
0020 
0021 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0022 #include "DQMServices/Core/interface/DQMStore.h"
0023 
0024 #include "DQMOffline/Lumi/interface/TriggerTools.h"
0025 
0026 class ZCounting : public DQMEDAnalyzer {
0027 public:
0028   ZCounting(const edm::ParameterSet& ps);
0029   ~ZCounting() override;
0030 
0031   enum MuonIDTypes { NoneID, LooseID, MediumID, TightID, CustomTightID };
0032   enum MuonIsoTypes { NoneIso, TrackerIso, PFIso };
0033 
0034 protected:
0035   void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
0036   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0037   void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;
0038 
0039 private:
0040   //other functions
0041   bool passMuonID(const reco::Muon& muon, const reco::Vertex* vtx);
0042   bool passMuonIso(const reco::Muon& muon);
0043   bool isCustomTightMuon(const reco::Muon& muon);
0044 
0045   // EDM object collection names
0046   const edm::InputTag triggerResultsInputTag_;
0047   edm::EDGetTokenT<reco::VertexCollection> fPVName_token;
0048 
0049   // Muons
0050   edm::EDGetTokenT<reco::MuonCollection> fMuonName_token;
0051   std::vector<std::string> fMuonHLTNames;
0052   std::vector<std::string> fMuonHLTObjectNames;
0053 
0054   // Tracks
0055   edm::EDGetTokenT<reco::TrackCollection> fTrackName_token;
0056 
0057   // other input
0058   const double PtCutL1_;
0059   const double PtCutL2_;
0060   const double EtaCutL1_;
0061   const double EtaCutL2_;
0062 
0063   const int MassBin_;
0064   const double MassMin_;
0065   const double MassMax_;
0066 
0067   const int LumiBin_;
0068   const double LumiMin_;
0069   const double LumiMax_;
0070 
0071   const int PVBin_;
0072   const double PVMin_;
0073   const double PVMax_;
0074 
0075   const double VtxNTracksFitCut_;
0076   const double VtxNdofCut_;
0077   const double VtxAbsZCut_;
0078   const double VtxRhoCut_;
0079 
0080   const std::string IDTypestr_;
0081   const std::string IsoTypestr_;
0082   const double IsoCut_;
0083 
0084   // muon ID and ISO parameters
0085   MuonIDTypes IDType_{NoneID};
0086   MuonIsoTypes IsoType_{NoneIso};
0087 
0088   // trigger objects
0089   HLTConfigProvider hltConfigProvider_;
0090   TriggerTools* triggers;
0091 
0092   // constants
0093   const double DRMAX = 0.1;  // max dR matching between muon and hlt object
0094 
0095   const double MUON_MASS = 0.105658369;
0096   const double MUON_BOUND = 0.9;
0097 
0098   // General Histograms
0099   MonitorElement* h_npv;
0100 
0101   // Muon Histograms
0102   MonitorElement* h_mass_2HLT_BB;
0103   MonitorElement* h_mass_2HLT_BE;
0104   MonitorElement* h_mass_2HLT_EE;
0105 
0106   MonitorElement* h_mass_1HLT_BB;
0107   MonitorElement* h_mass_1HLT_BE;
0108   MonitorElement* h_mass_1HLT_EE;
0109 
0110   MonitorElement* h_mass_SIT_fail_BB;
0111   MonitorElement* h_mass_SIT_fail_BE;
0112   MonitorElement* h_mass_SIT_fail_EE;
0113 
0114   MonitorElement* h_mass_Glo_fail_BB;
0115   MonitorElement* h_mass_Glo_fail_BE;
0116   MonitorElement* h_mass_Glo_fail_EE;
0117 };
0118 
0119 #endif