Skip to content

Commit

Permalink
Various updates to pixel track/vertex DQM and MTV (#285)
Browse files Browse the repository at this point in the history
* Add DQM for pixel vertices

* Add pT>0.9GeV pixel track collections to MTV

* Add dzPV0p1, Pt0to1, Pt1 variants of pixel track DQM
  • Loading branch information
makortel authored and felicepantaleo committed Mar 15, 2019
1 parent 644ac5b commit 0170373
Show file tree
Hide file tree
Showing 10 changed files with 147 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Configuration/StandardSequences/python/RawToDigi_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
RawToDigiTask_noTk = RawToDigiTask.copyAndExclude([siPixelDigisTask, siStripDigis])
RawToDigi_noTk = cms.Sequence(RawToDigiTask_noTk)

RawToDigiTask_pixelOnly = cms.Task(siPixelDigisTask)
RawToDigiTask_pixelOnly = cms.Task(siPixelDigisTask, scalersRawToDigi)
RawToDigi_pixelOnly = cms.Sequence(RawToDigiTask_pixelOnly)

scalersRawToDigi.scalersInputTag = 'rawDataCollector'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ def _layers(suffix, quant, histoPostfix):
]

pixelTrackingEffFromHitPattern = DQMEDHarvester("DQMGenericClient",
subDirs = cms.untracked.vstring("Tracking/PixelTrackParameters/HitEffFromHitPattern*"),
subDirs = cms.untracked.vstring("Tracking/PixelTrackParameters/pixelTracks/HitEffFromHitPattern*",
"Tracking/PixelTrackParameters/dzPV0p1/HitEffFromHitPattern*",
"Tracking/PixelTrackParameters/pt_0to1/HitEffFromHitPattern*",
"Tracking/PixelTrackParameters/pt_1/HitEffFromHitPattern*"),
efficiency = cms.vstring(
_layers("PU", "GoodNumVertices", "") +
_layers("BX", "BX", "VsBX") +
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import FWCore.ParameterSet.Config as cms

from DQM.TrackingMonitorClient.primaryVertexResolutionClient_cfi import primaryVertexResolutionClient as _primaryVertexResolutionClient

pixelVertexResolutionClient = _primaryVertexResolutionClient.clone(
subDirs = ["OfflinePixelPV/Resolution/*"]
)
92 changes: 73 additions & 19 deletions DQM/TrackingMonitorSource/python/pixelTracksMonitoring_cff.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,77 @@
import FWCore.ParameterSet.Config as cms

import DQM.TrackingMonitor.TrackerCollisionTrackingMonitor_cfi
pixelTracksMonitoring = DQM.TrackingMonitor.TrackerCollisionTrackingMonitor_cfi.TrackerCollisionTrackMon.clone()
pixelTracksMonitoring.FolderName = 'Tracking/PixelTrackParameters'
pixelTracksMonitoring.TrackProducer = 'pixelTracks'
pixelTracksMonitoring.allTrackProducer = 'pixelTracks'
pixelTracksMonitoring.beamSpot = 'offlineBeamSpot'
pixelTracksMonitoring.primaryVertex = 'pixelVertices'
pixelTracksMonitoring.pvNDOF = 1
pixelTracksMonitoring.doAllPlots = True
pixelTracksMonitoring.doLumiAnalysis = True
pixelTracksMonitoring.doProfilesVsLS = True
pixelTracksMonitoring.doDCAPlots = True
pixelTracksMonitoring.doProfilesVsLS = True
pixelTracksMonitoring.doPlotsVsGoodPVtx = True
pixelTracksMonitoring.doEffFromHitPatternVsPU = False
pixelTracksMonitoring.doEffFromHitPatternVsBX = False
pixelTracksMonitoring.doEffFromHitPatternVsLUMI = False
pixelTracksMonitoring.doPlotsVsGoodPVtx = True
pixelTracksMonitoring.doPlotsVsLUMI = True
pixelTracksMonitoring.doPlotsVsBX = True
pixelTracksMonitor = DQM.TrackingMonitor.TrackerCollisionTrackingMonitor_cfi.TrackerCollisionTrackMon.clone()
pixelTracksMonitor.FolderName = 'Tracking/PixelTrackParameters/pixelTracks'
pixelTracksMonitor.TrackProducer = 'pixelTracks'
pixelTracksMonitor.allTrackProducer = 'pixelTracks'
pixelTracksMonitor.beamSpot = 'offlineBeamSpot'
pixelTracksMonitor.primaryVertex = 'pixelVertices'
pixelTracksMonitor.pvNDOF = 1
pixelTracksMonitor.doAllPlots = True
pixelTracksMonitor.doLumiAnalysis = True
pixelTracksMonitor.doProfilesVsLS = True
pixelTracksMonitor.doDCAPlots = True
pixelTracksMonitor.doProfilesVsLS = True
pixelTracksMonitor.doPlotsVsGoodPVtx = True
pixelTracksMonitor.doEffFromHitPatternVsPU = False
pixelTracksMonitor.doEffFromHitPatternVsBX = False
pixelTracksMonitor.doEffFromHitPatternVsLUMI = False
pixelTracksMonitor.doPlotsVsGoodPVtx = True
pixelTracksMonitor.doPlotsVsLUMI = True
pixelTracksMonitor.doPlotsVsBX = True

_trackSelector = cms.EDFilter('TrackSelector',
src = cms.InputTag('pixelTracks'),
cut = cms.string("")
)

pixelTracksPt0to1 = _trackSelector.clone(cut = "pt >= 0 & pt < 1 ")
pixelTracksPt1 = _trackSelector.clone(cut = "pt >= 1 ")
from DQM.TrackingMonitorSource.TrackCollections2monitor_cff import highPurityPV0p1 as _highPurityPV0p1
pixelTracksPV0p1 = _highPurityPV0p1.clone(
src = "pixelTracks",
quality = "",
vertexTag = "goodPixelVertices"
)

pixelTracksMonitorPt0to1 = pixelTracksMonitor.clone(
TrackProducer = "pixelTracksPt0to1",
FolderName = "Tracking/PixelTrackParameters/pt_0to1"
)
pixelTracksMonitorPt1 = pixelTracksMonitor.clone(
TrackProducer = "pixelTracksPt1",
FolderName = "Tracking/PixelTrackParameters/pt_1"
)
pixelTracksMonitorPV0p1 = pixelTracksMonitor.clone(
TrackProducer = "pixelTracksPV0p1",
FolderName = "Tracking/PixelTrackParameters/dzPV0p1"
)


from CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi import goodOfflinePrimaryVertices as _goodOfflinePrimaryVertices
goodPixelVertices = _goodOfflinePrimaryVertices.clone(
src = "pixelVertices",
)

from DQM.TrackingMonitor.primaryVertexResolution_cfi import primaryVertexResolution as _primaryVertexResolution
pixelVertexResolution = _primaryVertexResolution.clone(
vertexSrc = "goodPixelVertices",
rootFolder = "OfflinePixelPV/Resolution",
)

pixelTracksMonitoringTask = cms.Task(
goodPixelVertices,
pixelTracksPt0to1,
pixelTracksPt1,
pixelTracksPV0p1,
)

pixelTracksMonitoring = cms.Sequence(
pixelTracksMonitor +
pixelTracksMonitorPt0to1 +
pixelTracksMonitorPt1 +
pixelTracksMonitorPV0p1 +
pixelVertexResolution,
pixelTracksMonitoringTask
)
4 changes: 3 additions & 1 deletion DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
from DQMOffline.JetMET.dataCertificationJetMET_cff import *
from DQM.TrackingMonitorClient.TrackingClientConfig_Tier0_cff import *
from DQM.TrackingMonitorClient.pixelTrackingEffFromHitPattern_cff import *
from DQM.TrackingMonitorClient.pixelVertexResolutionClient_cfi import *
from DQM.SiOuterTracker.OuterTrackerClientConfig_cff import *

DQMOffline_SecondStep_PrePOG = cms.Sequence( TrackingOfflineDQMClient *
Expand Down Expand Up @@ -117,7 +118,8 @@
DQMHarvestTracking = cms.Sequence( TrackingOfflineDQMClient *
dqmFastTimerServiceClient )

DQMHarvestPixelTracking = cms.Sequence( pixelTrackingEffFromHitPattern )
DQMHarvestPixelTracking = cms.Sequence( pixelTrackingEffFromHitPattern *
pixelVertexResolutionClient )

DQMHarvestOuterTracker = cms.Sequence( dqmRefHistoRootFileGetter *
dqmDcsInfoClient *
Expand Down
4 changes: 3 additions & 1 deletion DQMOffline/Configuration/python/DQMOffline_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
from Validation.RecoTau.DQMSequences_cfi import *
from DQM.TrackingMonitorSource.TrackingSourceConfig_Tier0_cff import *
from DQM.TrackingMonitorSource.pixelTracksMonitoring_cff import *
from DQMOffline.RecoB.PixelVertexMonitor_cff import *
from DQM.SiOuterTracker.OuterTrackerSourceConfig_cff import *
# miniAOD DQM validation
from Validation.RecoParticleFlow.miniAODDQM_cff import *
Expand Down Expand Up @@ -114,7 +115,8 @@
materialDumperAnalyzer
)

DQMOfflinePixelTracking = cms.Sequence( pixelTracksMonitoring )
DQMOfflinePixelTracking = cms.Sequence( pixelTracksMonitoring +
pixelPVMonitor )

DQMOuterTracker = cms.Sequence( dqmDcsInfo *
OuterTrackerSource *
Expand Down
7 changes: 7 additions & 0 deletions DQMOffline/RecoB/python/PixelVertexMonitor_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import FWCore.ParameterSet.Config as cms

from DQMOffline.RecoB.PrimaryVertexMonitor_cff import pvMonitor as _pvMonitor
pixelPVMonitor = _pvMonitor.clone(
TopFolderName = "OfflinePixelPV",
vertexLabel = "pixelVertices",
)
14 changes: 9 additions & 5 deletions Validation/RecoTrack/python/TrackValidation_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,15 +756,17 @@ def _uniqueFirstLayers(layerList):
trackAssociation = "trackingParticlePixelTrackAsssociation"
)

pixelTracksFromPV = generalTracksFromPV.clone(
_pixelTracksCustom = dict(
src = "pixelTracks",
vertexTag = "pixelVertices",
quality = "undefQuality",
)
pixelTracksPt09 = generalTracksPt09.clone(quality = ["undefQuality"], **_pixelTracksCustom)
pixelTracksFromPV = generalTracksFromPV.clone(quality = "undefQuality", **_pixelTracksCustom)
pixelTracksFromPVPt09 = pixelTracksPt09.clone(src = "pixelTracksFromPV")

trackValidatorPixelTrackingOnly = trackValidator.clone(
dirName = "Tracking/PixelTrack/",
label = ["pixelTracks"],
label = ["pixelTracks", "pixelTracksPt09"],
doResolutionPlotsForLabels = [],
trackCollectionForDrCalculation = "pixelTracks",
associators = ["trackingParticlePixelTrackAsssociation"],
Expand All @@ -774,7 +776,7 @@ def _uniqueFirstLayers(layerList):
)
trackValidatorFromPVPixelTrackingOnly = trackValidatorPixelTrackingOnly.clone(
dirName = "Tracking/PixelTrackFromPV/",
label = ["pixelTracksFromPV"],
label = ["pixelTracksFromPV", "pixelTracksFromPVPt09"],
label_tp_effic = "trackingParticlesSignal",
label_tp_fake = "trackingParticlesSignal",
label_tp_effic_refvector = True,
Expand Down Expand Up @@ -811,7 +813,9 @@ def _uniqueFirstLayers(layerList):
tracksPreValidationPixelTrackingOnly = cms.Task(
tracksValidationTruthPixelTrackingOnly,
trackingParticlesSignal,
pixelTracksFromPV,
pixelTracksPt09,
pixelTracksFromPV,
pixelTracksFromPVPt09,
)
tracksValidationPixelTrackingOnly = cms.Sequence(
trackValidatorPixelTrackingOnly +
Expand Down
44 changes: 32 additions & 12 deletions Validation/RecoTrack/python/plotting/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def _allToHP(s):
return s.replace("All", "High purity")
def _allToBTV(s):
return s.replace("All", "BTV-like")
def _allPtCut(s):
return s.replace("All tracks", "Tracks pT &gt; 0.9 GeV")
def _ptCut(s):
return s.replace("Tracks", "Tracks pT &gt; 0.9 GeV").replace("tracks", "tracks pT &gt; 0.9 GeV")
def _allToPixel(s):
Expand All @@ -77,8 +79,8 @@ def _toPixel(s):
("building_", "Built tracks"),
("", _allName),
("highPurity", _allToHP(_allName)),
("Pt09", "Tracks pT &gt; 0.9 GeV"),
("highPurityPt09", "High purity tracks pT &gt; 0.9 GeV"),
("Pt09", _allPtCut(_allName)),
("highPurityPt09", _ptCut(_allToHP(_allName))),
("ByOriginalAlgo", _toOriAlgo(_allName)),
("highPurityByOriginalAlgo", _toOriAlgo(_toHP(_allName))),
("ByAlgoMask", _toAlgoMask(_allName)),
Expand Down Expand Up @@ -114,6 +116,15 @@ def _toPixel(s):
("bhadron_ByAlgoMask", _toAlgoMask(_bhadronName)),
("bhadron_highPurityByAlgoMask", _toAlgoMask(_allToHP(_bhadronName))),
("bhadron_btvLike", _allToBTV(_bhadronName)),
# Pixel tracks
("pixel_", _allToPixel(_allName)),
("pixel_Pt09", _ptCut(_allToPixel(_allName))),
("pixelFromPV_", _toPixel(_fromPVName)),
("pixelFromPV_Pt09", _ptCut(_toPixel(_fromPVName))),
("pixelFromPVAllTP_", _toPixel(_fromPVAllTPName)),
("pixelFromPVAllTP_Pt09", _ptCut(_toPixel(_fromPVAllTPName))),
("pixelbhadron_", _allToPixel(_bhadronName)),
("pixelbhadron_Pt09", _ptCut(_allToPixel(_bhadronName))),
])

_trackAlgoName = {
Expand All @@ -128,6 +139,7 @@ def _toPixel(s):
"iter7" : "Iterative Step 7",
"iter9" : "Iterative Step 9",
"iter10": "Iterative Step 10",
"pixel": "Pixel tracks",
}

_trackAlgoOrder = [
Expand Down Expand Up @@ -162,6 +174,7 @@ def _toPixel(s):
'iter7',
'iter9',
'iter10',
"pixel",
]

_pageNameMap = {
Expand All @@ -171,17 +184,16 @@ def _toPixel(s):
"miniaod": "MiniAOD",
"timing": "Timing",
"hlt": "HLT",
"pixel": "Pixel tracks",
}

_sectionNameMapOrder = collections.OrderedDict([
# These are for the summary page
("seeding_seeds", "Seeds"),
("building", "Built tracks"),
("", "All tracks"),
("Pt09", "All tracks (pT&gt;0.9 GeV)"),
("highPurity", "High purity tracks"),
("highPurityPt09", "High purity tracks (pT&gt;0.9 GeV)"),
("", _allName),
("Pt09", _allPtCut(_allName)),
("highPurity", _allToHP(_allName)),
("highPurityPt09", _ptCut(_allToHP(_allName))),
("tpPtLess09", _tpPtLess09Name),
("tpPtLess09_highPurity", _allToHP(_tpPtLess09Name)),
("btvLike", "BTV-like"),
Expand All @@ -197,10 +209,14 @@ def _toPixel(s):
("bhadron", _bhadronName),
("bhadron_highPurity", _allToHP(_bhadronName)),
# Pixel tracks
("pixel", "Pixel tracks"),
("pixel", _allToPixel(_allName)),
("pixelPt09", _ptCut(_allToPixel(_allName))),
("pixelFromPV", _toPixel(_fromPVName)),
("pixelFromPVPt09", _ptCut(_toPixel(_fromPVName))),
("pixelFromPVAllTP", _toPixel(_fromPVAllTPName)),
("pixelFromPVAllTPPt09", _ptCut(_toPixel(_fromPVAllTPName))),
("pixelbhadron", _allToPixel(_bhadronName)),
("pixelbhadronPt09", _ptCut(_allToPixel(_bhadronName))),
# These are for vertices
("genvertex", "Gen vertices"),
("pixelVertices", "Pixel vertices"),
Expand All @@ -224,6 +240,7 @@ def _toPixel(s):
_fromPVAllTP2Legend = "Tracks from reco PV (another method), fake rate numerator contains all TrackingParticles (separates fake tracks from pileup tracks)"
_fromPVAllTPPt2Legend = "Tracks (pT &gt; 0.9 GeV) from reco PV (another method), fake rate numerator contains all TrackingParticles (separates fake tracks from pileup tracks)"
_bhadronLegend = "All tracks, efficiency denominator contains only TrackingParticles from B-hadron decays"
_bhadronPtLegend = "Tracks (pT &gt; 0.9 GeV), efficiency denominator contains only TrackingParticles from B-hadron decays"

def _sectionNameLegend():
return {
Expand All @@ -249,9 +266,12 @@ def _sectionNameLegend():
"bhadron_": _bhadronLegend,
"bhadron_highPurity": _allToHP(_bhadronLegend),
"bhadron_btvLike": _bhadronLegend.replace("All tracks", _btvLegend),
"pixelFromPV": _fromPVLegend,
"pixelFromPVAllTP": _fromPVAllTPLegend,
"pixelbhadron": _bhadronLegend,
"pixelFromPV_": _fromPVLegend,
"pixelFromPV_Pt09": _fromPVPtLegend,
"pixelFromPVAllTP_": _fromPVAllTPLegend,
"pixelFromPVAllTP_Pt09": _fromPVAllTPPtLegend,
"pixelbhadron_": _bhadronLegend,
"pixelbhadron_Pt09": _bhadronPtLegend,
}

class Table:
Expand Down Expand Up @@ -687,7 +707,7 @@ def __init__(self, sample, title, fastVsFull, pileupComparison):
self._miniaodPage = PageSet(*params)
self._timingPage = PageSet(*params)
self._hltPages = PageSet(*params, dqmSubFolderTranslatedToSectionName=lambda algoQuality: algoQuality[0])
self._pixelPages = PageSet(*params, dqmSubFolderTranslatedToSectionName=lambda algoQuality: algoQuality[0])
self._pixelPages = TrackingPageSet(*params)
self._otherPages = PageSet(*params)

self._purposePageMap = {
Expand Down
9 changes: 8 additions & 1 deletion Validation/RecoTrack/python/plotting/trackingPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,8 @@ def _mapCollectionToAlgoQuality(collName):
prefixes = ["cutsreco", "cutsrecofrompv", "cutsrecofrompv2", "cutsrecofrompvalltp"]
if collNameLow in ["general", "generalfrompv"]+prefixes:
algo = "ootb"
elif collNameLow in ["pixel", "pixelfrompv", "pixelfrompvalltp"]:
algo = "pixel"
else:
def testColl(coll):
for pfx in prefixes:
Expand Down Expand Up @@ -938,6 +940,7 @@ class HighPurityPt09: pass
class BTVLike: pass
class AK4PFJets: pass
class Pixel: pass
class PixelPt09: pass

def __init__(self, section, collection=GeneralTracks):
self._collection = collection
Expand Down Expand Up @@ -980,6 +983,8 @@ def _getN(hname):
return _getAlgoQuality(data, "ak4PFJets", "")
elif self._collection == TrackingSummaryTable.Pixel:
return _getAlgoQuality(data, "pixel", "")
elif self._collection == TrackingSummaryTable.PixelPt09:
return _getAlgoQuality(data, "pixel", "Pt09")
else:
raise Exception("Collection not recognized, %s" % str(self._collection))
def _formatOrNone(num, func):
Expand Down Expand Up @@ -1349,14 +1354,16 @@ def _appendTrackingPlots(lastDirName, name, algoPlots, onlyForPileup=False, only
_appendTrackingPlots("TrackBHadron", "bhadron", _simBasedPlots+_recoBasedPlots, onlyForBHadron=True)
# Pixel tracks
def _appendPixelTrackingPlots(lastDirName, name):
_common = dict(section=name, purpose=PlotPurpose.Pixel, page="pixel")
_common = dict(purpose=PlotPurpose.Pixel, page="pixel")
_folders = _trackingFolders(lastDirName)

plotter.append(name, _folders, TrackingPlotFolder(*(_simBasedPlots+_recoBasedPlots), **_common))
plotterExt.append(name, _folders, TrackingPlotFolder(*_extendedPlots, **_common))

plotter.append(name+"_summary", _folders, PlotFolder(_summaryRaw, _summaryRawN, loopSubFolders=False, purpose=PlotPurpose.TrackingSummary, page="summary", section=name))
plotter.append(name+"_summary", _folders, PlotFolder(_summaryRaw, _summaryRawN, loopSubFolders=False, purpose=PlotPurpose.TrackingSummary, page="summary", section=name+"Pt09"))
plotter.appendTable(name+"_summary", _folders, TrackingSummaryTable(section=name, collection=TrackingSummaryTable.Pixel))
plotter.appendTable(name+"_summary", _folders, TrackingSummaryTable(section=name+"Pt09", collection=TrackingSummaryTable.PixelPt09))
_appendPixelTrackingPlots("PixelTrack", "pixel")
_appendPixelTrackingPlots("PixelTrackFromPV", "pixelFromPV")
_appendPixelTrackingPlots("PixelTrackFromPVAllTP", "pixelFromPVAllTP")
Expand Down

0 comments on commit 0170373

Please sign in to comment.