Skip to content

Commit

Permalink
DQM plots for lepton time-life variables added as part of customization
Browse files Browse the repository at this point in the history
  • Loading branch information
mbluj committed Feb 20, 2024
1 parent 8e9ce20 commit bef9e17
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 93 deletions.
50 changes: 47 additions & 3 deletions PhysicsTools/NanoAOD/python/leptonTimeLifeInfo_common_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from PhysicsTools.PatAlgos.patTauTimeLifeInfoProducer_cfi import patTauTimeLifeInfoProducer
from PhysicsTools.NanoAOD.simpleCandidate2TrackTimeLifeInfoFlatTableProducer_cfi import simpleCandidate2TrackTimeLifeInfoFlatTableProducer
from TrackingTools.TransientTrack.TransientTrackBuilder_cfi import *
from PhysicsTools.NanoAOD.nanoDQM_tools_cff import *

# common settings of lepton life-time info producer
prod_common = cms.PSet(
Expand Down Expand Up @@ -77,6 +78,39 @@
run2_nanoAOD_ANY.toModify(
prod_common, pvSource = "refittedPV")

# Definition of DQM plots
ipVarsPlots = cms.VPSet(
Plot1D('ipLength', 'ipLength', 25, -0.25, 0.25, 'signed lenght of impact parameter (3d)'),
Plot1D('ipLengthSig', 'ipLengthSig', 60, -5, 10, 'signed significance of impact parameter'),
Plot1D('IPx', 'IPx', 40, -0.02, 0.02, 'x coordinate of impact parameter vector'),
Plot1D('IPy', 'IPy', 40, -0.02, 0.02, 'y coordinate of impact parameter vector'),
Plot1D('IPz', 'IPz', 40, -0.02, 0.02, 'z coordinate of impact parameter vector')
)
trackVarsPlots = cms.VPSet(
Plot1D('track_qoverp', 'track_qoverp', 40, -0.2, 0.2, 'track q/p'),
Plot1D('track_lambda', 'track_lambda', 30, -1.5, 1.5, 'track lambda'),
Plot1D('track_phi', 'track_phi', 20, -3.14159, 3.14159, 'track phi'),
Plot1D('track_dxy', 'track_dxy', 20, -0.1, 0.1, 'track dxy'),
Plot1D('track_dsz', 'track_dsz', 20, -10, 10, 'track dsz'),
NoPlot('bField_z')
)
#no plots for track covariance elements, but store placeholders
for i in range(0,5):
for j in range(i,5):
trackVarsPlots.append(NoPlot('track_cov'+str(j)+str(i)))
svVarsPlots = cms.VPSet(
Plot1D('hasRefitSV', 'hasRefitSV', 2, 0, 2, 'has SV refit using miniAOD quantities'),
Plot1D('refitSVx', 'refitSVx', 20, -0.1, 0.1, 'x coordinate of refitted SV'),
Plot1D('refitSVy', 'refitSVy', 20, -0.1, 0.1, 'y coordinate of refitted SV'),
Plot1D('refitSVz', 'refitSVz', 20, -20, 20, 'z coordinate of refitted SV'),
Plot1D('refitSVchi2', 'refitSVchi2', 20, 0, 100, 'chi2 of SV fit'),
Plot1D('refitSVndof', 'refitSVndof', 10, 0, 10, 'ndof of SV fit')
)
#no plots for SV covariance elements, but store placeholders
for i in range(0,3):
for j in range(i,3):
svVarsPlots.append(NoPlot('refitSVcov'+str(j)+str(i)))

#
# Customization sequences and functions
#
Expand Down Expand Up @@ -113,6 +147,10 @@ def addTimeLifeInfoToElectrons(process):
run2_nanoAOD_ANY.toReplaceWith(process.electronTimeLifeInfoTask,
_electronTimeLifeInfoTaskRun2)
process.electronTablesTask.add(process.electronTimeLifeInfoTask)
# add DQM plots if needed
if hasattr(process,'nanoDQM'):
process.nanoDQM.vplots.Electron.plots.extend(ipVarsPlots)
process.nanoDQM.vplots.Electron.plots.extend(trackVarsPlots)
return process

# muons
Expand Down Expand Up @@ -148,6 +186,10 @@ def addTimeLifeInfoToMuons(process):
run2_nanoAOD_ANY.toReplaceWith(process.muonTimeLifeInfoTask,
_muonTimeLifeInfoTaskRun2)
process.muonTablesTask.add(process.muonTimeLifeInfoTask)
# add DQM plots if needed
if hasattr(process,'nanoDQM'):
process.nanoDQM.vplots.Muon.plots.extend(ipVarsPlots)
process.nanoDQM.vplots.Muon.plots.extend(trackVarsPlots)
return process

# taus
Expand Down Expand Up @@ -183,6 +225,11 @@ def addTimeLifeInfoToTaus(process):
run2_nanoAOD_ANY.toReplaceWith(process.tauTimeLifeInfoTask,
_tauTimeLifeInfoTaskRun2)
process.tauTablesTask.add(process.tauTimeLifeInfoTask)
# add DQM plots if needed
if hasattr(process,'nanoDQM'):
process.nanoDQM.vplots.Tau.plots.extend(ipVarsPlots)
process.nanoDQM.vplots.Tau.plots.extend(trackVarsPlots)
process.nanoDQM.vplots.Tau.plots.extend(svVarsPlots)
return process

# Vertices
Expand Down Expand Up @@ -212,9 +259,6 @@ def addExtendVertexInfo(process):
process.vertexTablesTask.add(process.pvbsTableTask)
return process

# DQM
#FIXME!

# Full
def addTimeLifeInfo(process):
addTimeLifeInfoToElectrons(process)
Expand Down
90 changes: 0 additions & 90 deletions PhysicsTools/NanoAOD/python/nanoDQM_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,32 +132,6 @@
NoPlot('vidNestedWPBitmap'),
NoPlot('vidNestedWPBitmap_Fall17V2'),
NoPlot('vidNestedWPBitmapHEEP'),
Plot1D('ipLength', 'ipLength', 25, -0.25, 0.25, 'signed lenght of impact parameter (3d)'),
Plot1D('ipLengthSig', 'ipLengthSig', 60, -5, 10, 'signed significance of impact parameter'),
Plot1D('IPx', 'IPx', 40, -0.02, 0.02, 'x coordinate of impact parameter vector'),
Plot1D('IPy', 'IPy', 40, -0.02, 0.02, 'y coordinate of impact parameter vector'),
Plot1D('IPz', 'IPz', 40, -0.02, 0.02, 'z coordinate of impact parameter vector'),
Plot1D('track_qoverp', 'track_qoverp', 40, -0.2, 0.2, 'track q/p'),
Plot1D('track_lambda', 'track_lambda', 30, -1.5, 1.5, 'track lambda'),
Plot1D('track_phi', 'track_phi', 20, -3.14159, 3.14159, 'track phi'),
Plot1D('track_dxy', 'track_dxy', 20, -0.1, 0.1, 'track dxy'),
Plot1D('track_dsz', 'track_dsz', 20, -10, 10, 'track dsz'),
NoPlot('bField_z'),
NoPlot('track_cov00'),
NoPlot('track_cov10'),
NoPlot('track_cov20'),
NoPlot('track_cov30'),
NoPlot('track_cov40'),
NoPlot('track_cov11'),
NoPlot('track_cov21'),
NoPlot('track_cov31'),
NoPlot('track_cov41'),
NoPlot('track_cov22'),
NoPlot('track_cov32'),
NoPlot('track_cov42'),
NoPlot('track_cov33'),
NoPlot('track_cov43'),
NoPlot('track_cov44'),
)
),

Expand Down Expand Up @@ -613,32 +587,6 @@
Plot1D('tkRelIso', 'tkRelIso', 100, 0, 1, 'Tracker-based relative isolation dR=0.3 for highPt, trkIso/tunePpt'),
Plot1D('triggerIdLoose', 'triggerIdLoose', 2, -0.5, 1.5, 'TriggerIdLoose ID'),
Plot1D('tunepRelPt', 'tunepRelPt', 200, 0, 200, 'TuneP relative pt, tunePpt/pt'),
Plot1D('ipLength', 'ipLength', 25, -0.25, 0.25, 'signed lenght of impact parameter (3d)'),
Plot1D('ipLengthSig', 'ipLengthSig', 60, -5, 10, 'signed significance of impact parameter'),
Plot1D('IPx', 'IPx', 40, -0.02, 0.02, 'x coordinate of impact parameter vector'),
Plot1D('IPy', 'IPy', 40, -0.02, 0.02, 'y coordinate of impact parameter vector'),
Plot1D('IPz', 'IPz', 40, -0.02, 0.02, 'z coordinate of impact parameter vector'),
Plot1D('track_qoverp', 'track_qoverp', 40, -0.2, 0.2, 'track q/p'),
Plot1D('track_lambda', 'track_lambda', 30, -1.5, 1.5, 'track lambda'),
Plot1D('track_phi', 'track_phi', 20, -3.14159, 3.14159, 'track phi'),
Plot1D('track_dxy', 'track_dxy', 20, -0.1, 0.1, 'track dxy'),
Plot1D('track_dsz', 'track_dsz', 20, -10, 10, 'track dsz'),
NoPlot('bField_z'),
NoPlot('track_cov00'),
NoPlot('track_cov10'),
NoPlot('track_cov20'),
NoPlot('track_cov30'),
NoPlot('track_cov40'),
NoPlot('track_cov11'),
NoPlot('track_cov21'),
NoPlot('track_cov31'),
NoPlot('track_cov41'),
NoPlot('track_cov22'),
NoPlot('track_cov32'),
NoPlot('track_cov42'),
NoPlot('track_cov33'),
NoPlot('track_cov43'),
NoPlot('track_cov44'),
)
),
OtherPV = cms.PSet(
Expand Down Expand Up @@ -921,44 +869,6 @@
Plot1D('probDM2PNet', 'probDM2PNet', 20, 0, 1, 'normalised probablity of decayMode 2, 1h+2pi0 (PNet 2023)'),
Plot1D('probDM10PNet', 'probDM10PNet', 20, 0, 1, 'normalised probablity of decayMode 10, 3h+0pi0 (PNet 2023)'),
Plot1D('probDM11PNet', 'probDM11PNet', 20, 0, 1, 'normalised probablity of decayMode 11, 3h+1pi0 (PNet 2023)'),
Plot1D('ipLength', 'ipLength', 25, -0.25, 0.25, 'signed lenght of impact parameter (3d)'),
Plot1D('ipLengthSig', 'ipLengthSig', 60, -5, 10, 'signed significance of impact parameter'),
Plot1D('IPx', 'IPx', 40, -0.02, 0.02, 'x coordinate of impact parameter vector'),
Plot1D('IPy', 'IPy', 40, -0.02, 0.02, 'y coordinate of impact parameter vector'),
Plot1D('IPz', 'IPz', 40, -0.02, 0.02, 'z coordinate of impact parameter vector'),
Plot1D('track_qoverp', 'track_qoverp', 40, -0.2, 0.2, 'track q/p'),
Plot1D('track_lambda', 'track_lambda', 30, -1.5, 1.5, 'track lambda'),
Plot1D('track_phi', 'track_phi', 20, -3.14159, 3.14159, 'track phi'),
Plot1D('track_dxy', 'track_dxy', 20, -0.1, 0.1, 'track dxy'),
Plot1D('track_dsz', 'track_dsz', 20, -10, 10, 'track dsz'),
NoPlot('bField_z'),
NoPlot('track_cov00'),
NoPlot('track_cov10'),
NoPlot('track_cov20'),
NoPlot('track_cov30'),
NoPlot('track_cov40'),
NoPlot('track_cov11'),
NoPlot('track_cov21'),
NoPlot('track_cov31'),
NoPlot('track_cov41'),
NoPlot('track_cov22'),
NoPlot('track_cov32'),
NoPlot('track_cov42'),
NoPlot('track_cov33'),
NoPlot('track_cov43'),
NoPlot('track_cov44'),
Plot1D('hasRefitSV', 'hasRefitSV', 2, 0, 2, 'has SV refit using miniAOD quantities'),
Plot1D('refitSVx', 'refitSVx', 20, -0.1, 0.1, 'x coordinate of refitted SV'),
Plot1D('refitSVy', 'refitSVy', 20, -0.1, 0.1, 'y coordinate of refitted SV'),
Plot1D('refitSVz', 'refitSVz', 20, -20, 20, 'z coordinate of refitted SV'),
Plot1D('refitSVchi2', 'refitSVchi2', 20, 0, 100, 'chi2 of SV fit'),
Plot1D('refitSVndof', 'refitSVndof', 10, 0, 10, 'ndof of SV fit'),
NoPlot('refitSVcov00'),
NoPlot('refitSVcov10'),
NoPlot('refitSVcov20'),
NoPlot('refitSVcov11'),
NoPlot('refitSVcov21'),
NoPlot('refitSVcov22'),
)
),
TauProd = cms.PSet(
Expand Down

0 comments on commit bef9e17

Please sign in to comment.