Skip to content

Commit

Permalink
Merge pull request #44657 from 24LopezR/DisplacedDQM_CMSSW_14_0_X_bac…
Browse files Browse the repository at this point in the history
…kport

Add reco::displacedMuons to offline validation (backport)
  • Loading branch information
cmsbuild authored Apr 15, 2024
2 parents 050099f + 59fba37 commit d918912
Show file tree
Hide file tree
Showing 9 changed files with 1,539 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester

postProcessorRecoDisplacedMuon = DQMEDHarvester("DQMGenericClient",
subDirs = cms.untracked.vstring("Muons/RecoDisplacedMuonV/RecoDisplacedMuon_MuonAssoc"),
#efficiencies and fractions
efficiency = cms.vstring("EffP 'Efficiency vs p' P SimP ",
"EffPt 'Efficiency vs p_{T}' Pt SimPt ",
"EffEta 'Efficiency vs #eta' Eta SimEta",
"EffPhi 'Efficiency vs #phi' Phi SimPhi",
"MisQProbPt 'Charge Mis-identification probability vs p_{T}' MisQPt SimPt ",
"MisQProbEta 'Charge Mis-identification probability vs #eta' MisQEta SimEta",
#fractions
"FractP 'Muontype fraction vs p' PMuon PMuonAll",
"FractPt 'Muontype fraction vs p_{T}' PtMuon PtMuonAll",
"FractEta 'Muontype fraction vs #eta' EtaMuon EtaMuonAll",
"FractPhi 'Muontype fraction vs #phi' PhiMuon PhiMuonAll",
),

resolution = cms.vstring("ErrP_vs_P '#sigma(p) vs p' ErrP_vs_P ",
"ErrP_vs_Eta '#sigma(p) vs #eta' ErrP_vs_Eta ",
"ErrPt_vs_Pt '#sigma(p_{T}) vs p_{T}' ErrPt_vs_Pt ",
"ErrPt_vs_Eta '#sigma(p_{T}) vs #eta' ErrPt_vs_Eta ",
"ErrEta_vs_Eta '#sigma(#eta) vs #eta ' ErrEta_vs_Eta ",
"ErrQPt_vs_Pt '#sigma(q/p_{T}) vs p_{T}' ErrQPt_vs_Pt ",
"ErrQPt_vs_Eta '#sigma(q/p_{T}) vs #eta' ErrQPt_vs_Eta ",
"PullEta_vs_Pt 'Pull of #eta vs p_{T}' PullEta_vs_Pt ",
"PullEta_vs_Eta 'Pull of #eta vs #eta' PullEta_vs_Eta",
"PullPhi_vs_Eta 'Pull of #phi vs #eta' PullPhi_vs_Eta",
"PullPt_vs_Pt 'Pull of p_{T} vs p_{T}' PullPt_vs_Pt ",
"PullPt_vs_Eta 'Pull of p_{T} vs #eta' PullPt_vs_Eta ",
),
outputFileName = cms.untracked.string("")
)

# for each type monitored
postProcessorRecoDisplacedMuonGlb = postProcessorRecoDisplacedMuon.clone(
subDirs = ["Muons/RecoDisplacedMuonV/RecoDisplacedMuon_MuonAssoc_Glb"]
)
postProcessorRecoDisplacedMuonTrk = postProcessorRecoDisplacedMuon.clone(
subDirs = ["Muons/RecoDisplacedMuonV/RecoDisplacedMuon_MuonAssoc_Trk"]
)
postProcessorRecoDisplacedMuonSta = postProcessorRecoDisplacedMuon.clone(
subDirs = ["Muons/RecoDisplacedMuonV/RecoDisplacedMuon_MuonAssoc_Sta"]
)
postProcessorRecoDisplacedMuonTgt = postProcessorRecoDisplacedMuon.clone(
subDirs = ["Muons/RecoDisplacedMuonV/RecoDisplacedMuon_MuonAssoc_Tgt"]
)
postProcessorRecoDisplacedMuonGlbPF = postProcessorRecoDisplacedMuon.clone(
subDirs = ["Muons/RecoDisplacedMuonV/RecoDisplacedMuon_MuonAssoc_GlbPF"]
)
postProcessorRecoDisplacedMuonTrkPF = postProcessorRecoDisplacedMuon.clone(
subDirs = ["Muons/RecoDisplacedMuonV/RecoDisplacedMuon_MuonAssoc_TrkPF"]
)
postProcessorRecoDisplacedMuonStaPF = postProcessorRecoDisplacedMuon.clone(
subDirs = ["Muons/RecoDisplacedMuonV/RecoDisplacedMuon_MuonAssoc_StaPF"]
)
#not sure about this one, which types are monitored
postProcessorRecoDisplacedMuonComp = DQMEDHarvester(
"DQMGenericClient",
subDirs = cms.untracked.vstring("Muons/RecoDisplacedMuonV/"),
efficiency = cms.vstring(
"Eff_GlbSta_Eta 'Eff_{GLB,STA} vs #eta' RecoDisplacedMuon_MuonAssoc_Glb/EffEta RecoDisplacedMuon_MuonAssoc_Sta/EffEta",
"Eff_GlbSta_P 'Eff_{GLB,STA} vs p' RecoDisplacedMuon_MuonAssoc_Glb/EffP RecoDisplacedMuon_MuonAssoc_Sta/EffP",
"Eff_GlbSta_Phi 'Eff_{GLB,STA} vs #phi' RecoDisplacedMuon_MuonAssoc_Glb/EffPhi RecoDisplacedMuon_MuonAssoc_Sta/EffPhi",
"Eff_GlbSta_Pt 'Eff_{GLB,STA} vs p_{T}' RecoDisplacedMuon_MuonAssoc_Glb/EffPt RecoDisplacedMuon_MuonAssoc_Sta/EffPt",
"Eff_TgtGlb_Eta 'Eff_{TGT,GLB} vs #eta' RecoDisplacedMuon_MuonAssoc_Tgt/EffEta RecoDisplacedMuon_MuonAssoc_Glb/EffEta",
"Eff_TgtGlb_P 'Eff_{TGT,GLB} vs p' RecoDisplacedMuon_MuonAssoc_Tgt/EffP RecoDisplacedMuon_MuonAssoc_Glb/EffP",
"Eff_TgtGlb_Phi 'Eff_{TGT,GLB} vs #phi' RecoDisplacedMuon_MuonAssoc_Tgt/EffPhi RecoDisplacedMuon_MuonAssoc_Glb/EffPhi",
"Eff_TgtGlb_Pt 'Eff_{TGT,GLB} vs p_{T}' RecoDisplacedMuon_MuonAssoc_Tgt/EffPt RecoDisplacedMuon_MuonAssoc_Glb/EffPt",
),
resolution = cms.vstring(""),
outputFileName = cms.untracked.string("")
)

postProcessorRecoDisplacedMuonCompPF = DQMEDHarvester(
"DQMGenericClient",
subDirs = cms.untracked.vstring("Muons/RecoDisplacedMuonV/"),
efficiency = cms.vstring(
"Eff_GlbPFStaPF_Eta 'Eff_{GLBPF,STAPF} vs #eta' RecoDisplacedMuon_MuonAssoc_GlbPF/EffEta RecoDisplacedMuon_MuonAssoc_StaPF/EffEta",
"Eff_GlbPFStaPF_P 'Eff_{GLBPF,STAPF} vs p' RecoDisplacedMuon_MuonAssoc_GlbPF/EffP RecoDisplacedMuon_MuonAssoc_StaPF/EffP",
"Eff_GlbPFStaPF_Phi 'Eff_{GLBPF,STAPF} vs #phi' RecoDisplacedMuon_MuonAssoc_GlbPF/EffPhi RecoDisplacedMuon_MuonAssoc_StaPF/EffPhi",
"Eff_GlbPFStaPF_Pt 'Eff_{GLBPF,STAPF} vs p_{T}' RecoDisplacedMuon_MuonAssoc_GlbPF/EffPt RecoDisplacedMuon_MuonAssoc_StaPF/EffPt",
),
resolution = cms.vstring(""),
outputFileName = cms.untracked.string("")
)

postProcessorsRecoDisplacedMuonValidator_seq = cms.Sequence( postProcessorRecoDisplacedMuonGlb
* postProcessorRecoDisplacedMuonTrk
* postProcessorRecoDisplacedMuonSta
* postProcessorRecoDisplacedMuonTgt
* postProcessorRecoDisplacedMuonGlbPF
* postProcessorRecoDisplacedMuonTrkPF
* postProcessorRecoDisplacedMuonStaPF
* postProcessorRecoDisplacedMuonComp
* postProcessorRecoDisplacedMuonCompPF )
4 changes: 3 additions & 1 deletion Validation/RecoMuon/python/PostProcessor_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester

from Validation.RecoMuon.PostProcessor_RecoMuonValidator_cff import *
from Validation.RecoMuon.PostProcessor_RecoDisplacedMuonValidator_cff import *

postProcessorMuonTrack = DQMEDHarvester("DQMGenericClient",
subDirs = cms.untracked.vstring("Muons/RecoMuonV/MuonTrack/*"),
Expand Down Expand Up @@ -95,4 +96,5 @@

recoMuonPostProcessors = cms.Sequence( postProcessorMuonTrack
* postProcessorMuonTrackComp
* postProcessorsRecoMuonValidator_seq )
* postProcessorsRecoMuonValidator_seq
* postProcessorsRecoDisplacedMuonValidator_seq )
87 changes: 87 additions & 0 deletions Validation/RecoMuon/python/RecoDisplacedMuonValidator_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import FWCore.ParameterSet.Config as cms

#####################################################################################
# Configurations for RecoDisplacedMuonValidator
#

from RecoMuon.TrackingTools.MuonServiceProxy_cff import *
from Validation.RecoMuon.RecoDisplacedMuonValidator_cfi import *
#
from SimMuon.MCTruth.muonAssociatorByHitsNoSimHitsHelper_cfi import *
from SimMuon.MCTruth.MuonAssociatorByHits_cfi import muonAssociatorByHitsCommonParameters

#tracker
muondispAssociatorByHitsNoSimHitsHelperTrk = muonAssociatorByHitsNoSimHitsHelper.clone(
UseTracker = True,
UseMuon = False
)
recoDisplacedMuonVMuAssoc_trk = recoDisplacedMuonValidator.clone(
subDir = 'Muons/RecoDisplacedMuonV/RecoDisplacedMuon_MuonAssoc_Trk',
muAssocLabel = 'muondispAssociatorByHitsNoSimHitsHelperTrk',
trackType = 'inner',
selection = "isTrackerMuon",
simLabel = ("TPmu"),
tpRefVector = True
)
recoDisplacedMuonVMuAssoc_trk.tpSelector.src = ("TPmu")
#standalone
muondispAssociatorByHitsNoSimHitsHelperStandalone = muonAssociatorByHitsNoSimHitsHelper.clone(
UseTracker = False,
UseMuon = True
)
recoDisplacedMuonVMuAssoc_sta = recoDisplacedMuonValidator.clone(
subDir = 'Muons/RecoDisplacedMuonV/RecoDisplacedMuon_MuonAssoc_Sta',
muAssocLabel = 'muondispAssociatorByHitsNoSimHitsHelperStandalone',
trackType = 'outer',
selection = "isStandAloneMuon",
simLabel = ("TPmu"),
tpRefVector = True,
nBinDxy = cms.untracked.uint32(100),
minDxy = cms.untracked.double(-350),
maxDxy = cms.untracked.double(350),
nBinDz = cms.untracked.uint32(100),
minDz = cms.untracked.double(-350),
maxDz = cms.untracked.double(350)
)
recoDisplacedMuonVMuAssoc_sta.tpSelector.src = ("TPmu")
#global
muondispAssociatorByHitsNoSimHitsHelperGlobal = muonAssociatorByHitsNoSimHitsHelper.clone(
UseTracker = True,
UseMuon = True
)
recoDisplacedMuonVMuAssoc_glb = recoDisplacedMuonValidator.clone(
subDir = 'Muons/RecoDisplacedMuonV/RecoDisplacedMuon_MuonAssoc_Glb',
muAssocLabel = 'muondispAssociatorByHitsNoSimHitsHelperGlobal',
trackType = 'global',
selection = "isGlobalMuon",
simLabel = ("TPmu"),
tpRefVector = True,
)
recoDisplacedMuonVMuAssoc_glb.tpSelector.src = ("TPmu")
#tight
muondispAssociatorByHitsNoSimHitsHelperTight = muonAssociatorByHitsNoSimHitsHelper.clone(
UseTracker = True,
UseMuon = True
)
recoDisplacedMuonVMuAssoc_tgt = recoDisplacedMuonValidator.clone(
subDir = 'Muons/RecoDisplacedMuonV/RecoDisplacedMuon_MuonAssoc_Tgt',
muAssocLabel = 'muondispAssociatorByHitsNoSimHitsHelperTight',
trackType = 'global',
selection = 'isGlobalMuon',
wantTightMuon = True,
beamSpot = 'offlineBeamSpot',
primaryVertex = 'offlinePrimaryVertices',
simLabel = ("TPmu"),
tpRefVector = True,
)
recoDisplacedMuonVMuAssoc_tgt.tpSelector.src = ("TPmu")
##########################################################################
# Muon validation sequence using RecoDisplacedMuonValidator
#

muonValidationRDMV_seq = cms.Sequence(
muondispAssociatorByHitsNoSimHitsHelperTrk+recoDisplacedMuonVMuAssoc_trk
+muondispAssociatorByHitsNoSimHitsHelperStandalone+recoDisplacedMuonVMuAssoc_sta
+muondispAssociatorByHitsNoSimHitsHelperGlobal+recoDisplacedMuonVMuAssoc_glb
+muondispAssociatorByHitsNoSimHitsHelperTight+recoDisplacedMuonVMuAssoc_tgt
)
99 changes: 99 additions & 0 deletions Validation/RecoMuon/python/RecoDisplacedMuonValidator_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import FWCore.ParameterSet.Config as cms
from RecoMuon.TrackingTools.MuonServiceProxy_cff import MuonServiceProxy
from Validation.RecoMuon.selectors_cff import muonTPSet, displacedMuonTPSet

from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
recoDisplacedMuonValidator = DQMEDAnalyzer('RecoDisplacedMuonValidator',
MuonServiceProxy,
tpSelector = displacedMuonTPSet,

usePFMuon = cms.untracked.bool(False),

simLabel = cms.InputTag("mix","MergedTrackTruth"),
tpRefVector = cms.bool(False),
muonLabel = cms.InputTag("displacedMuons"),

muAssocLabel = cms.InputTag("muonAssociatorByHitsHelper"),

doAssoc = cms.untracked.bool(True),

outputFileName = cms.untracked.string(''),
subDir = cms.untracked.string('Muons/RecoDisplacedMuonV/'),
trackType = cms.string("global"),
#string cut selection
selection = cms.string(""),

wantTightMuon = cms.bool(False),
beamSpot = cms.InputTag("offlineBeamSpot"),
primaryVertex = cms.InputTag('offlinePrimaryVertices'),

#
# Histogram dimensions #
#
nBinP = cms.untracked.uint32(100),
minP = cms.untracked.double(0.0),
maxP = cms.untracked.double(1500.0),

nBinPt = cms.untracked.uint32(100),
minPt = cms.untracked.double(0.0),
maxPt = cms.untracked.double(1500.0),

doAbsEta = cms.untracked.bool(False),

nBinEta = cms.untracked.uint32(50),
minEta = cms.untracked.double(-2.5),
maxEta = cms.untracked.double(2.5),

nBinDxy = cms.untracked.uint32(100),
minDxy = cms.untracked.double(-60), # 350 for DSA, 60 for DGL/DTK
maxDxy = cms.untracked.double(60),

nBinDz = cms.untracked.uint32(100),
minDz = cms.untracked.double(-60),
maxDz = cms.untracked.double(60),

nBinPhi = cms.untracked.uint32(25),

# Pull width #
nBinPull = cms.untracked.uint32(50),
wPull = cms.untracked.double(5.0),

nBinErr = cms.untracked.uint32(50),

# |p| resolution #
minErrP = cms.untracked.double(-0.3),
maxErrP = cms.untracked.double(0.3),

# pT resolution #
minErrPt = cms.untracked.double(-0.3),
maxErrPt = cms.untracked.double(0.3),

# q/pT resolution #
minErrQPt = cms.untracked.double(-0.1),
maxErrQPt = cms.untracked.double(0.1),

# Eta resolution #
minErrEta = cms.untracked.double(-0.01),
maxErrEta = cms.untracked.double(0.01),

# Phi resolution #
minErrPhi = cms.untracked.double(-0.05),
maxErrPhi = cms.untracked.double(0.05),

# Dxy resolution #
minErrDxy = cms.untracked.double(-0.1),
maxErrDxy = cms.untracked.double(0.1),

# Dz resolution #
minErrDz = cms.untracked.double(-0.1),
maxErrDz = cms.untracked.double(0.1),

# Number of sim-reco associations #
nAssoc = cms.untracked.uint32(10),

# Number of sim,reco Tracks #
nTrks = cms.untracked.uint32(50)
)

from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2
premix_stage2.toModify(recoDisplacedMuonValidator, simLabel = "mixData:MergedTrackTruth")
1 change: 1 addition & 0 deletions Validation/RecoMuon/python/RelValCustoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def validation_only(process):
*process.trackingParticles
*process.tracksValidation
*process.recoMuonValidation
*process.recoDisplacedMuonValidation
*process.HLTMuonVal
)
process.validation_step.replace(process.validation,process.only_validation_and_TP)
Expand Down
5 changes: 3 additions & 2 deletions Validation/RecoMuon/python/muonValidation_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from Validation.RecoMuon.histoParameters_cff import *

from Validation.RecoMuon.RecoMuonValidator_cff import *
from Validation.RecoMuon.RecoDisplacedMuonValidator_cff import *

import Validation.RecoMuon.MuonTrackValidator_cfi
MTV = Validation.RecoMuon.MuonTrackValidator_cfi.muonTrackValidator.clone(
Expand Down Expand Up @@ -314,12 +315,12 @@
# The full offline muon validation sequence
#
recoMuonValidation = cms.Sequence( TPtrack_seq + TPmu_seq + TPpfmu_seq +
muonValidation_seq + muonValidationTEV_seq + muonValidationRefit_seq + muonValidationDisplaced_seq + muonValidationRMV_seq
muonValidation_seq + muonValidationTEV_seq + muonValidationRefit_seq + muonValidationDisplaced_seq + muonValidationRMV_seq + muonValidationRDMV_seq
)

# optionally omit TABH
recoMuonValidation_noTABH = cms.Sequence( TPtrack_seq + TPmu_seq + TPpfmu_seq +
muonValidation_noTABH_seq + muonValidationTEV_seq + muonValidationRefit_seq + muonValidationDisplaced_seq + muonValidationRMV_seq
muonValidation_noTABH_seq + muonValidationTEV_seq + muonValidationRefit_seq + muonValidationDisplaced_seq + muonValidationRMV_seq + muonValidationRDMV_seq
)

# ... and also displaced muons
Expand Down
Loading

0 comments on commit d918912

Please sign in to comment.