Skip to content

Commit

Permalink
Merge pull request #46749 from dsidirop1/topDQMReco
Browse files Browse the repository at this point in the history
Updated Input tags and code additions for TOP Production DQM GEN-SIM-RECO
  • Loading branch information
cmsbuild authored Nov 27, 2024
2 parents 80fe037 + fd13e2c commit 0137291
Show file tree
Hide file tree
Showing 12 changed files with 292 additions and 289 deletions.
10 changes: 3 additions & 7 deletions DQM/Physics/interface/TopDQMHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,17 +378,13 @@ bool SelectionStep<Object>::select(const edm::Event& event, const std::string& t
if (dynamic_cast<const reco::PFCandidate*>(&*obj)) {
reco::PFCandidate objtmp = dynamic_cast<const reco::PFCandidate&>(*obj);

if (objtmp.muonRef().isNonnull() && type == "muon") {
if (type == "muon") {
if (select_(*obj)) {
++n;
}
} else if (objtmp.gsfElectronRef().isNonnull() && type == "electron") {
} else if (type == "electron") {
if (select_(*obj)) {
if (electronId_.isUninitialized()) {
++n;
} else if (((double)(*electronId)[obj->gsfElectronRef()] >= eidCutValue_)) {
++n;
}
++n;
}
// idx_gsf++;
}
Expand Down
48 changes: 24 additions & 24 deletions DQM/Physics/python/singleTopDQM_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
tightJetCut = "(chargedHadronEnergyFraction()>0 && chargedMultiplicity()>0 && chargedEmEnergyFraction()<0.99 && neutralHadronEnergyFraction()<0.90 && neutralEmEnergyFraction()<0.90 && (chargedMultiplicity()+neutralMultiplicity())>1) && abs(eta)<=2.4 "

#Loose muon selection
looseMuonCut = "(muonRef.isNonnull && (muonRef.isGlobalMuon || muonRef.isTrackerMuon) && muonRef.isPFMuon)"
looseIsoCut = "(muonRef.pfIsolationR04.sumChargedHadronPt + max(0., muonRef.pfIsolationR04.sumNeutralHadronEt + muonRef.pfIsolationR04.sumPhotonEt - 0.5 * muonRef.pfIsolationR04.sumPUPt) ) / muonRef.pt < 0.25"
looseMuonCut = "((isGlobalMuon || isTrackerMuon) && isPFMuon)"
looseIsoCut = "((pfIsolationR04.sumChargedHadronPt + max(0., pfIsolationR04.sumNeutralHadronEt + pfIsolationR04.sumPhotonEt - 0.5 * pfIsolationR04.sumPUPt) ) / pt < 0.25)"

#Medium muon selection. Also requires either good global muon or tight segment compatibility
mediumMuonCut = looseMuonCut + " muonRef.innerTrack.validFraction > 0.8"
mediumMuonCut = looseMuonCut + " innerTrack.validFraction > 0.8"

#Tight muon selection. Lacks distance to primary vertex variables, dz<0.5, dxy < 0.2. Now done at .cc
tightMuonCut = "muonRef.isNonnull && muonRef.isGlobalMuon && muonRef.isPFMuon && muonRef.globalTrack.normalizedChi2 < 10. && muonRef.globalTrack.hitPattern.numberOfValidMuonHits > 0 && " + \
"muonRef.numberOfMatchedStations > 1 && muonRef.innerTrack.hitPattern.numberOfValidPixelHits > 0 && muonRef.innerTrack.hitPattern.trackerLayersWithMeasurement > 5 "
tightIsoCut = "(muonRef.pfIsolationR04.sumChargedHadronPt + max(0., muonRef.pfIsolationR04.sumNeutralHadronEt + muonRef.pfIsolationR04.sumPhotonEt - 0.5 * muonRef.pfIsolationR04.sumPUPt) ) / muonRef.pt < 0.15"
tightMuonCut = "isGlobalMuon && isPFMuon && globalTrack.normalizedChi2 < 10. && globalTrack.hitPattern.numberOfValidMuonHits > 0 && " + \
"numberOfMatchedStations > 1 && innerTrack.hitPattern.numberOfValidPixelHits > 0 && innerTrack.hitPattern.trackerLayersWithMeasurement > 5 "
tightIsoCut = "(pfIsolationR04.sumChargedHadronPt + max(0., pfIsolationR04.sumNeutralHadronEt + pfIsolationR04.sumPhotonEt - 0.5 * pfIsolationR04.sumPUPt) ) / pt < 0.15"

#Electron selections
looseEleCut = "(( gsfElectronRef.full5x5_sigmaIetaIeta() < 0.011 && gsfElectronRef.superCluster().isNonnull() && gsfElectronRef.superCluster().seed().isNonnull() && (gsfElectronRef.deltaEtaSuperClusterTrackAtVtx() - gsfElectronRef.superCluster().eta() + gsfElectronRef.superCluster().seed().eta()) < 0.00477 && abs(gsfElectronRef.deltaPhiSuperClusterTrackAtVtx()) < 0.222 && gsfElectronRef.hadronicOverEm() < 0.298 && abs(1.0 - gsfElectronRef.eSuperClusterOverP())*1.0/gsfElectronRef.ecalEnergy() < 0.241 && gsfElectronRef.gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 1 && abs(gsfElectronRef.superCluster().eta()) < 1.479) || (gsfElectronRef.full5x5_sigmaIetaIeta() < 0.0314 && gsfElectronRef.superCluster().isNonnull() && gsfElectronRef.superCluster().seed().isNonnull() && (gsfElectronRef.deltaEtaSuperClusterTrackAtVtx() - gsfElectronRef.superCluster().eta() + gsfElectronRef.superCluster().seed().eta()) < 0.00868 && abs(gsfElectronRef.deltaPhiSuperClusterTrackAtVtx()) < 0.213 && gsfElectronRef.hadronicOverEm() < 0.101 && abs(1.0 - gsfElectronRef.eSuperClusterOverP())*1.0/gsfElectronRef.ecalEnergy() < 0.14 && gsfElectronRef.gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 1 && abs(gsfElectronRef.superCluster().eta()) > 1.479))"
looseEleCut = "((full5x5_sigmaIetaIeta() < 0.011 && superCluster().isNonnull() && superCluster().seed().isNonnull() && (deltaEtaSuperClusterTrackAtVtx() - superCluster().eta() + superCluster().seed().eta()) < 0.00477 && abs(deltaPhiSuperClusterTrackAtVtx()) < 0.222 && hadronicOverEm() < 0.298 && abs(1.0 - eSuperClusterOverP())*1.0/ecalEnergy() < 0.241 && gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 1 && abs(superCluster().eta()) < 1.479) || (full5x5_sigmaIetaIeta() < 0.0314 && superCluster().isNonnull() && superCluster().seed().isNonnull() && (deltaEtaSuperClusterTrackAtVtx() - superCluster().eta() + superCluster().seed().eta()) < 0.00868 && abs(deltaPhiSuperClusterTrackAtVtx()) < 0.213 && hadronicOverEm() < 0.101 && abs(1.0 - eSuperClusterOverP())*1.0/ecalEnergy() < 0.14 && gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 1 && abs(superCluster().eta()) > 1.479))"

tightEleCut = "((gsfElectronRef.full5x5_sigmaIetaIeta() < 0.00998 && gsfElectronRef.superCluster().isNonnull() && gsfElectronRef.superCluster().seed().isNonnull() && (gsfElectronRef.deltaEtaSuperClusterTrackAtVtx() - gsfElectronRef.superCluster().eta() + gsfElectronRef.superCluster().seed().eta()) < 0.00308 && abs(gsfElectronRef.deltaPhiSuperClusterTrackAtVtx()) < 0.0816 && gsfElectronRef.hadronicOverEm() < 0.0414 && abs(1.0 - gsfElectronRef.eSuperClusterOverP())*1.0/gsfElectronRef.ecalEnergy() < 0.0129 && gsfElectronRef.gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 1 && abs(gsfElectronRef.superCluster().eta()) < 1.479) || (gsfElectronRef.full5x5_sigmaIetaIeta() < 0.0292 && gsfElectronRef.superCluster().isNonnull() && gsfElectronRef.superCluster().seed().isNonnull() && (gsfElectronRef.deltaEtaSuperClusterTrackAtVtx() - gsfElectronRef.superCluster().eta() + gsfElectronRef.superCluster().seed().eta()) < 0.00605 && abs(gsfElectronRef.deltaPhiSuperClusterTrackAtVtx()) < 0.0394 && gsfElectronRef.hadronicOverEm() < 0.0641 && abs(1.0 - gsfElectronRef.eSuperClusterOverP())*1.0/gsfElectronRef.ecalEnergy() < 0.0129 && gsfElectronRef.gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 1 && abs(gsfElectronRef.superCluster().eta()) > 1.479))"
tightEleCut = "((full5x5_sigmaIetaIeta() < 0.00998 && superCluster().isNonnull() && superCluster().seed().isNonnull() && (deltaEtaSuperClusterTrackAtVtx() - superCluster().eta() + superCluster().seed().eta()) < 0.00308 && abs(deltaPhiSuperClusterTrackAtVtx()) < 0.0816 && hadronicOverEm() < 0.0414 && abs(1.0 - eSuperClusterOverP())*1.0/ecalEnergy() < 0.0129 && gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 1 && abs(superCluster().eta()) < 1.479) || (full5x5_sigmaIetaIeta() < 0.0292 && superCluster().isNonnull() && superCluster().seed().isNonnull() && (deltaEtaSuperClusterTrackAtVtx() - superCluster().eta() + superCluster().seed().eta()) < 0.00605 && abs(deltaPhiSuperClusterTrackAtVtx()) < 0.0394 && hadronicOverEm() < 0.0641 && abs(1.0 - eSuperClusterOverP())*1.0/ecalEnergy() < 0.0129 && gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 1 && abs(superCluster().eta()) > 1.479))"

from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer

Expand All @@ -37,8 +37,8 @@
setup = cms.PSet(
directory = cms.string("Physics/Top/SingleTopMuonMediumDQM/"),
sources = cms.PSet(
muons = cms.InputTag("pfIsolatedMuonsEI"),
elecs = cms.InputTag("pfIsolatedElectronsEI"),
muons = cms.InputTag("muons"),
elecs = cms.InputTag("gedGsfElectrons"),
jets = cms.InputTag("ak4PFJetsCHS"),
mets = cms.VInputTag("pfMet"),
pvs = cms.InputTag("offlinePrimaryVertices")
Expand All @@ -50,7 +50,7 @@
select = cms.string(PVCut)
),
elecExtras = cms.PSet(
select = cms.string(tightEleCut + "& pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660)"),
select = cms.string(tightEleCut + "& pt>20 & abs(eta)<2.5 & (abs(superCluster().eta()) <= 1.4442 || abs(superCluster().eta()) >= 1.5660)"),
rho = cms.InputTag("fixedGridRhoFastjetAll"),
),
muonExtras = cms.PSet(
Expand All @@ -62,10 +62,10 @@
select = cms.string("pt>30 & abs(eta)< 2.4"),
jetBTaggers = cms.PSet(
cvsVertex = cms.PSet(
label = cms.InputTag("pfCombinedInclusiveSecondaryVertexV2BJetTags"),
workingPoint = cms.double(0.890)
label = cms.InputTag("pfDeepCSVJetTags:probb"),
workingPoint = cms.double(0.4168)
)
),
)
),
massExtras = cms.PSet(
lowerEdge = cms.double( 70.),
Expand All @@ -87,7 +87,7 @@
selection = cms.VPSet(
cms.PSet(
label = cms.string("muons/pf:step0"),
src = cms.InputTag("pfIsolatedMuonsEI"),
src = cms.InputTag("muons"),
select = cms.string(tightMuonCut + " && pt>20 & abs(eta)<2.4"),
min = cms.int32(1),
),
Expand Down Expand Up @@ -118,8 +118,8 @@
## communication to TopCom!
directory = cms.string("Physics/Top/SingleTopElectronMediumDQM/"),
sources = cms.PSet(
muons = cms.InputTag("pfIsolatedMuonsEI"),
elecs = cms.InputTag("pfIsolatedElectronsEI"),
muons = cms.InputTag("muons"),
elecs = cms.InputTag("gedGsfElectrons"),
jets = cms.InputTag("ak4PFJetsCHS"),
mets = cms.VInputTag("pfMet"),
pvs = cms.InputTag("offlinePrimaryVertices")
Expand All @@ -131,7 +131,7 @@
select = cms.string(PVCut)
),
elecExtras = cms.PSet(
select = cms.string(tightEleCut + "& pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660)"),
select = cms.string(tightEleCut + "& pt>20 & abs(eta)<2.5 & (abs(superCluster().eta()) <= 1.4442 || abs(superCluster().eta()) >= 1.5660)"),
rho = cms.InputTag("fixedGridRhoFastjetAll"),
),
muonExtras = cms.PSet(
Expand All @@ -143,10 +143,10 @@
select = cms.string("pt>30 & abs(eta)< 2.4"),
jetBTaggers = cms.PSet(
cvsVertex = cms.PSet(
label = cms.InputTag("pfCombinedInclusiveSecondaryVertexV2BJetTags"),
workingPoint = cms.double(0.890)
label = cms.InputTag("pfDeepCSVJetTags:probb"),
workingPoint = cms.double(0.4168)
)
),
)
),
massExtras = cms.PSet(
lowerEdge = cms.double( 70.),
Expand Down Expand Up @@ -175,14 +175,14 @@
# label = cms.string("elecs/pf:step0"),
# src = cms.InputTag("pfIsolatedElectronsEI"),
# electronId = cms.PSet( src = cms.InputTag("mvaTrigV0"), cutValue = cms.double(0.5) ),
# select = cms.string("pt>30 & abs(eta)<2.5 & abs(gsfElectronRef.gsfTrack.d0)<0.02 && gsfElectronRef.gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 0 && (abs(gsfElectronRef.superCluster.eta) <= 1.4442 || abs(gsfElectronRef.superCluster.eta) >= 1.5660) && " + EletightIsoCut),
# select = cms.string("pt>30 & abs(eta)<2.5 & abs(gsfTrack.d0)<0.02 && gsfTrack.hitPattern().numberOfLostHits('MISSING_INNER_HITS') <= 0 && (abs(superCluster.eta) <= 1.4442 || abs(superCluster.eta) >= 1.5660) && " + EletightIsoCut),
# min = cms.int32(1),
# max = cms.int32(1),
# ),*/
cms.PSet(
label = cms.string("elecs/pf:step0"),
src = cms.InputTag("pfIsolatedElectronsEI"),
select = cms.string("pt>20 & abs(eta)<2.5 & (abs(gsfElectronRef.superCluster().eta()) <= 1.4442 || abs(gsfElectronRef.superCluster().eta()) >= 1.5660) &&" + tightEleCut),
src = cms.InputTag("gedGsfElectrons"),
select = cms.string("pt>20 & abs(eta)<2.5 & (abs(superCluster().eta()) <= 1.4442 || abs(superCluster().eta()) >= 1.5660) &&" + tightEleCut),
min = cms.int32(1),
),
cms.PSet(
Expand Down
Loading

0 comments on commit 0137291

Please sign in to comment.