Skip to content

Commit

Permalink
Code maintenance for Run III in the DQMOffline ZCounting
Browse files Browse the repository at this point in the history
  • Loading branch information
ThOliveira23 committed May 23, 2022
1 parent 9c0c506 commit cf8231a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
22 changes: 17 additions & 5 deletions DQMOffline/Lumi/plugins/ZCounting.cc
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,6 @@ void ZCounting::analyzeMuons(const edm::Event& iEvent, const edm::EventSetup& iS

h_npv->Fill(iEvent.luminosityBlock(), nvtx);

// Good vertex requirement
if (nvtx == 0)
return;

//-------------------------------
//--- Trigger
//-------------------------------
Expand Down Expand Up @@ -565,7 +561,7 @@ void ZCounting::analyzeMuons(const edm::Event& iEvent, const edm::EventSetup& iS
continue;

bool isTrackCentral = false;
if (fabs(eta2) > MUON_BOUND)
if (fabs(eta2) < MUON_BOUND)
isTrackCentral = true;

if (itTrk.hitPattern().trackerLayersWithMeasurement() >= 6 && itTrk.hitPattern().numberOfValidPixelHits() >= 1) {
Expand Down Expand Up @@ -864,6 +860,20 @@ bool ZCounting::isMuonTriggerObj(const ZCountingTrigger::TTrigger& triggerMenu,
return false;
}

//--------------------------------------------------------------------------------------------------
// Definition of the CustomTightID function
bool ZCounting::isCustomTightMuon(const reco::Muon& muon) {
if (!muon.isPFMuon() || !muon.isGlobalMuon())
return false;

bool muID = isGoodMuon(muon, muon::GlobalMuonPromptTight) && (muon.numberOfMatchedStations() > 1);

bool hits = muon.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 &&
muon.innerTrack()->hitPattern().numberOfValidPixelHits() > 0;

return muID && hits;
}

//--------------------------------------------------------------------------------------------------
bool ZCounting::passMuonID(
const reco::Muon& muon,
Expand All @@ -876,6 +886,8 @@ bool ZCounting::passMuonID(
return true;
else if (idType == TightID && muon::isTightMuon(muon, vtx))
return true;
else if (idType == CustomTightID && isCustomTightMuon(muon))
return true;
else if (idType == NoneID)
return true;
else
Expand Down
3 changes: 2 additions & 1 deletion DQMOffline/Lumi/plugins/ZCounting.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ZCounting : public DQMEDAnalyzer {
ZCounting(const edm::ParameterSet& ps);
~ZCounting() override;

enum MuonIDTypes { NoneID, LooseID, MediumID, TightID };
enum MuonIDTypes { NoneID, LooseID, MediumID, TightID, CustomTightID };
enum MuonIsoTypes { NoneIso, TrackerIso, PFIso };

protected:
Expand All @@ -59,6 +59,7 @@ class ZCounting : public DQMEDAnalyzer {
bool isMuonTriggerObj(const ZCountingTrigger::TTrigger& triggerMenu, const TriggerObjects& hltMatchBits);
bool passMuonID(const reco::Muon& muon, const reco::Vertex& vtx, const MuonIDTypes& idType);
bool passMuonIso(const reco::Muon& muon, const MuonIsoTypes& isoType, const float isoCut);
bool isCustomTightMuon(const reco::Muon& muon);

// Electron-specific functions
bool isElectronTrigger(ZCountingTrigger::TTrigger triggerMenu, TriggerBits hltBits);
Expand Down
20 changes: 10 additions & 10 deletions DQMOffline/Lumi/python/ZCounting_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
beamspotName = cms.InputTag('offlineBeamSpot'),
conversionsName = cms.InputTag('conversions'),

MuonTriggerNames = cms.vstring("HLT_IsoMu27_v*"),
MuonTriggerObjectNames = cms.vstring("hltL3crIsoL1sMu22Or25L1f0L2f10QL3f27QL3trkIsoFiltered0p07"),
MuonTriggerNames = cms.vstring("HLT_IsoMu24_v*"),
MuonTriggerObjectNames = cms.vstring("hltL3crIsoL1sSingleMu22L1f0L2f10QL3f24QL3trkIsoFiltered0p07"),

IDType = cms.untracked.string("Tight"),# Tight, Medium, Loose
IDType = cms.untracked.string("CustomTight"), # Tight, Medium, Loose, CustomTight
IsoType = cms.untracked.string("NULL"), # Tracker-based, PF-based
IsoCut = cms.untracked.double(0.), # {0.05, 0.10} for Tracker-based, {0.15, 0.25} for PF-based

PtCutL1 = cms.untracked.double(30.0),
PtCutL2 = cms.untracked.double(30.0),
PtCutL1 = cms.untracked.double(27.0),
PtCutL2 = cms.untracked.double(27.0),
EtaCutL1 = cms.untracked.double(2.4),
EtaCutL2 = cms.untracked.double(2.4),

Expand All @@ -38,17 +38,17 @@

ElectronIDType = cms.untracked.string("TIGHT"),

MassBin = cms.untracked.int32(50),
MassMin = cms.untracked.double(66.0),
MassMax = cms.untracked.double(116.0),
MassBin = cms.untracked.int32(80),
MassMin = cms.untracked.double(50.0),
MassMax = cms.untracked.double(130.0),

LumiBin = cms.untracked.int32(2500),
LumiMin = cms.untracked.double(0.5),
LumiMax = cms.untracked.double(2500.5),

PVBin = cms.untracked.int32(60),
PVBin = cms.untracked.int32(100),
PVMin = cms.untracked.double(0.5),
PVMax = cms.untracked.double(60.5),
PVMax = cms.untracked.double(100.5),

VtxNTracksFitMin = cms.untracked.double(0.),
VtxNdofMin = cms.untracked.double(4.),
Expand Down

0 comments on commit cf8231a

Please sign in to comment.