Skip to content

Commit

Permalink
Add MTV instance for pixel tracks from PV (cms-sw#156)
Browse files Browse the repository at this point in the history
Add separate plots for tracks associated to the primary vertex.
  • Loading branch information
makortel authored and fwyzard committed Sep 12, 2018
1 parent 1fdc54a commit 489effc
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Validation/RecoTrack/python/PostProcessorTracker_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ def _addNoFlow(module):
)

postProcessorTrackTrackingOnly = postProcessorTrack.clone()
postProcessorTrackTrackingOnly.subDirs.extend(["Tracking/TrackSeeding/*", "Tracking/PixelTrack/*"])
postProcessorTrackTrackingOnly.subDirs.extend(["Tracking/TrackSeeding/*", "Tracking/PixelTrack/*", "Tracking/PixelTrackFromPV/*", "Tracking/PixelTrackFromPVAllTP/*"])
postProcessorTrackSummaryTrackingOnly = postProcessorTrackSummary.clone()
postProcessorTrackSummaryTrackingOnly.subDirs.extend(["Tracking/TrackSeeding", "Tracking/PixelTrack"])
postProcessorTrackSummaryTrackingOnly.subDirs.extend(["Tracking/TrackSeeding", "Tracking/PixelTrack", "Tracking/PixelTrackFromPV/*", "Tracking/PixelTrackFromPVAllTP/*"])

postProcessorTrackSequenceTrackingOnly = cms.Sequence(
postProcessorTrackTrackingOnly+
Expand Down
34 changes: 33 additions & 1 deletion Validation/RecoTrack/python/TrackValidation_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,12 @@ def _uniqueFirstLayers(layerList):
trackAssociation = "trackingParticlePixelTrackAsssociation"
)

pixelTracksFromPV = generalTracksFromPV.clone(
src = "pixelTracks",
vertexTag = "pixelVertices",
quality = "undefQuality",
)

trackValidatorPixelTrackingOnly = trackValidator.clone(
dirName = "Tracking/PixelTrack/",
label = ["pixelTracks"],
Expand All @@ -743,6 +749,28 @@ def _uniqueFirstLayers(layerList):
vertexAssociator = "PixelVertexAssociatorByPositionAndTracks",
dodEdxPlots = False,
)
trackValidatorFromPVPixelTrackingOnly = trackValidatorPixelTrackingOnly.clone(
dirName = "Tracking/PixelTrackFromPV/",
label = ["pixelTracksFromPV"],
label_tp_effic = "trackingParticlesSignal",
label_tp_fake = "trackingParticlesSignal",
label_tp_effic_refvector = True,
label_tp_fake_refvector = True,
trackCollectionForDrCalculation = "pixelTracksFromPV",
doPlotsOnlyForTruePV = True,
doPVAssociationPlots = False,
doResolutionPlotsForLabels = ["disabled"],
)
trackValidatorFromPVAllTPPixelTrackingOnly = trackValidatorFromPVPixelTrackingOnly.clone(
dirName = "Tracking/PixelTrackFromPVAllTP/",
label_tp_effic = trackValidatorPixelTrackingOnly.label_tp_effic.value(),
label_tp_fake = trackValidatorPixelTrackingOnly.label_tp_fake.value(),
label_tp_effic_refvector = False,
label_tp_fake_refvector = False,
doSimPlots = False,
doSimTrackPlots = False,
)


tracksValidationTruthPixelTrackingOnly = tracksValidationTruth.copy()
tracksValidationTruthPixelTrackingOnly.replace(tpClusterProducer, tpClusterProducerPixelTrackingOnly)
Expand All @@ -756,7 +784,11 @@ def _uniqueFirstLayers(layerList):

tracksValidationPixelTrackingOnly = cms.Sequence(
tracksValidationTruthPixelTrackingOnly +
trackValidatorPixelTrackingOnly
cms.ignore(trackingParticlesSignal) +
pixelTracksFromPV +
trackValidatorPixelTrackingOnly +
trackValidatorFromPVPixelTrackingOnly +
trackValidatorFromPVAllTPPixelTrackingOnly
)


Expand Down
6 changes: 6 additions & 0 deletions Validation/RecoTrack/python/plotting/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def _allToBTV(s):
return s.replace("All", "BTV-like")
def _ptCut(s):
return s.replace("Tracks", "Tracks pT > 0.9 GeV").replace("tracks", "tracks pT > 0.9 GeV")
def _toPixel(s):
return s.replace("Tracks", "Pixel tracks")
_trackQualityNameOrder = collections.OrderedDict([
("seeding_seeds", "Seeds"),
("seeding_seedsa", "Seeds A"),
Expand Down Expand Up @@ -194,6 +196,8 @@ def _ptCut(s):
("bhadron_highPurity", _allToHP(_bhadronName)),
# Pixel tracks
("pixel", "Pixel tracks"),
("pixelFromPV", _toPixel(_fromPVName)),
("pixelFromPVAllTP", _toPixel(_fromPVAllTPName)),
# These are for vertices
("genvertex", "Gen vertices"),
("pixelVertices", "Pixel vertices"),
Expand Down Expand Up @@ -242,6 +246,8 @@ def _sectionNameLegend():
"bhadron_": _bhadronLegend,
"bhadron_highPurity": _allToHP(_bhadronLegend),
"bhadron_btvLike": _bhadronLegend.replace("All tracks", _btvLegend),
"pixelFromPV": _fromPVLegend,
"pixelFromPVAllTP": _fromPVAllTPLegend,
}

class Table:
Expand Down
17 changes: 12 additions & 5 deletions Validation/RecoTrack/python/plotting/trackingPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,11 +1335,18 @@ def _appendTrackingPlots(lastDirName, name, algoPlots, onlyForPileup=False, only
_appendTrackingPlots("TrackGsf", "gsf", _simBasedPlots+_recoBasedPlots, onlyForElectron=True, rawSummary=True, highPuritySummary=False)
_appendTrackingPlots("TrackBHadron", "bhadron", _simBasedPlots+_recoBasedPlots, onlyForBHadron=True)
# Pixel tracks
_common = dict(purpose=PlotPurpose.Pixel, page="pixel")
plotter.append("pixelTrack", _trackingFolders("PixelTrack"), TrackingPlotFolder(*(_simBasedPlots+_recoBasedPlots), **_common))
plotterExt.append("pixelTrack", _trackingFolders("PixelTrack"), TrackingPlotFolder(*_extendedPlots, **_common))
plotter.append("pixelTrack_summary", _trackingFolders("PixelTrack"), PlotFolder(_summaryRaw, _summaryRawN, loopSubFolders=False, purpose=PlotPurpose.TrackingSummary, page="summary", section="pixel"))
plotter.appendTable("pixelTrack_summary", _trackingFolders("PixelTrack"), TrackingSummaryTable(section="pixel", collection=TrackingSummaryTable.Pixel))
def _appendPixelTrackingPlots(lastDirName, name):
_common = dict(section=name, 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.appendTable(name+"_summary", _folders, TrackingSummaryTable(section=name, collection=TrackingSummaryTable.Pixel))
_appendPixelTrackingPlots("PixelTrack", "pixel")
_appendPixelTrackingPlots("PixelTrackFromPV", "pixelFromPV")
_appendPixelTrackingPlots("PixelTrackFromPVAllTP", "pixelFromPVAllTP")


# MiniAOD
Expand Down

0 comments on commit 489effc

Please sign in to comment.