Skip to content

Commit

Permalink
Merge pull request #32157 from jalimena/DispTrkVal
Browse files Browse the repository at this point in the history
Displaced tracking validation for Run 3 and Phase 2
  • Loading branch information
cmsbuild authored Jan 29, 2021
2 parents b3eca32 + 0141ad3 commit 197a6df
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

# This modifier turns on the dedicated displaced tracking validation
displacedTrackValidation = cms.Modifier()
12 changes: 12 additions & 0 deletions Validation/RecoTrack/python/PostProcessorTracker_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ def _addNoFlow(module):
postProcessorTrackSummaryStandalone
)



postProcessorTrackPhase2 = postProcessorTrack.clone()
postProcessorTrackPhase2.subDirs.extend(["Tracking/TrackTPEtaGreater2p7/*"])
postProcessorTrackSummaryPhase2 = postProcessorTrackSummary.clone()
Expand All @@ -337,6 +339,16 @@ def _addNoFlow(module):
phase2_tracker.toReplaceWith(postProcessorTrack,postProcessorTrackPhase2)
phase2_tracker.toReplaceWith(postProcessorTrackSummary,postProcessorTrackSummaryPhase2)


from Configuration.ProcessModifiers.displacedTrackValidation_cff import displacedTrackValidation
postProcessorTrackDisplaced = postProcessorTrack.clone()
postProcessorTrackDisplaced.subDirs.extend(["Tracking/TrackDisplaced/*"])
postProcessorTrackSummaryDisplaced = postProcessorTrackSummary.clone()
postProcessorTrackSummaryDisplaced.subDirs.extend(["Tracking/TrackDisplaced/*"])
displacedTrackValidation.toReplaceWith(postProcessorTrack,postProcessorTrackDisplaced)
displacedTrackValidation.toReplaceWith(postProcessorTrackSummary,postProcessorTrackSummaryDisplaced)


postProcessorTrackTrackingOnly = postProcessorTrack.clone()
postProcessorTrackTrackingOnly.subDirs.extend(["Tracking/TrackBHadron/*","Tracking/TrackSeeding/*", "Tracking/PixelTrack/*"])
postProcessorTrackSummaryTrackingOnly = postProcessorTrackSummary.clone()
Expand Down
34 changes: 32 additions & 2 deletions Validation/RecoTrack/python/TrackValidation_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,32 @@ def _uniqueFirstLayers(layerList):
)


# for displaced tracks
trackValidatorDisplaced = trackValidator.clone(
dirName = "Tracking/TrackDisplaced/",
label = [x for x in trackValidator.label.value() if ("Pt09" not in x) and ("BtvLike" not in x) and ("AK4PFJets" not in x)],
ptMaxTP = 1e5,
dodEdxPlots = False,
invertRapidityCutTP = False,
histoProducerAlgoBlock = dict(
TpSelectorForEfficiencyVsPt = dict(ptMin=0.005, signalOnly=True, tip=1e5, lip=1e5), # enough to set min pT here
TpSelectorForEfficiencyVsEta = dict(ptMin=0.005, signalOnly=True, tip=1e5, lip=1e5), # enough to set min pT here
TpSelectorForEfficiencyVsPhi = dict(ptMin=0.005, signalOnly=True, tip=1e5, lip=1e5),
TpSelectorForEfficiencyVsVTXR = dict(ptMin=0.005, signalOnly=True, tip=1e5, lip=1e5),
TpSelectorForEfficiencyVsVTXZ = dict(ptMin=0.005, signalOnly=True, tip=1e5, lip=1e5),
generalTpSelector = dict(ptMin=0.005, signalOnly=True, tip=1e5, lip=1e5),
minDxy = -60,
maxDxy = 60,
nintDxy = 120,
minDz = -30,
maxDz = 30,
nintDz = 60,
),
signalOnlyTP = True,
lipTP = 1e5,
tipTP = 1e5,
)

# the track selectors
tracksValidationSelectors = cms.Task(
tracksValidationSelectorsByAlgo,
Expand Down Expand Up @@ -711,8 +737,10 @@ def _uniqueFirstLayers(layerList):
from Configuration.ProcessModifiers.seedingDeepCore_cff import seedingDeepCore
seedingDeepCore.toReplaceWith(tracksValidation, cms.Sequence(tracksValidation.copy()+trackValidatorJetCore))

from Configuration.ProcessModifiers.displacedTrackValidation_cff import displacedTrackValidation
displacedTrackValidation.toReplaceWith(tracksValidation, cms.Sequence(tracksValidation.copy()+trackValidatorDisplaced))

from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
#tracksValidationPhase2 = cms.Sequence(tracksValidation+trackValidatorTPEtaGreater2p7) # it does not work
tracksPreValidationPhase2 = tracksPreValidation.copy()
tracksPreValidationPhase2.add(trackingParticlesEtaGreater2p7)
phase2_tracker.toReplaceWith(tracksPreValidation, tracksPreValidationPhase2)
Expand All @@ -723,7 +751,6 @@ def _uniqueFirstLayers(layerList):
tracksValidationPhase2+=trackValidatorTPEtaGreater2p7
phase2_tracker.toReplaceWith(tracksValidation, tracksValidationPhase2)


fastSim.toReplaceWith(tracksValidation, tracksValidation.copyAndExclude([
trackValidatorBuildingPreSplitting,
trackValidatorConversion,
Expand Down Expand Up @@ -921,6 +948,9 @@ def _uniqueFirstLayers(layerList):
trackValidatorJetCore,
trackValidatorJetCoreSeedingTrackingOnly
]))

displacedTrackValidation.toReplaceWith(trackValidatorsTrackingOnly, cms.Sequence(trackValidatorsTrackingOnly.copy()+trackValidatorDisplaced))

fastSim.toReplaceWith(trackValidatorsTrackingOnly, trackValidatorsTrackingOnly.copyAndExclude([
trackValidatorBuildingPreSplitting,
trackValidatorSeedingPreSplittingTrackingOnly,
Expand Down
9 changes: 9 additions & 0 deletions Validation/RecoTrack/python/plotting/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def _lowerFirst(s):
_conversionName = "Tracks for conversions"
_gsfName = "Electron GSF tracks"
_bhadronName = "All tracks (B-hadron TPs)"
_displacedName = "All tracks (TPs with no tip or lip cuts)"
def _toHP(s):
return "High purity "+_lowerFirst(s)
def _toOriAlgo(s):
Expand Down Expand Up @@ -113,6 +114,12 @@ def _ptCut(s):
("bhadron_ByAlgoMask", _toAlgoMask(_bhadronName)),
("bhadron_highPurityByAlgoMask", _toAlgoMask(_allToHP(_bhadronName))),
("bhadron_btvLike", _allToBTV(_bhadronName)),
("displaced_", _displacedName),
("displaced_highPurity", _allToHP(_displacedName)),
("displaced_ByOriginalAlgo", _toOriAlgo(_displacedName)),
("displaced_highPurityByOriginalAlgo", _toOriAlgo(_allToHP(_displacedName))),
("displaced_ByAlgoMask", _toAlgoMask(_displacedName)),
("displaced_highPurityByAlgoMask", _toAlgoMask(_allToHP(_displacedName))),
])

_trackAlgoName = {
Expand Down Expand Up @@ -199,6 +206,8 @@ def _ptCut(s):
("gsf", _gsfName),
("bhadron", _bhadronName),
("bhadron_highPurity", _allToHP(_bhadronName)),
("displaced", _displacedName),
("displaced_highPurity", _allToHP(_displacedName)),
# Pixel tracks
("pixel", "Pixel tracks"),
# These are for vertices
Expand Down
1 change: 1 addition & 0 deletions Validation/RecoTrack/python/plotting/trackingPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,7 @@ def _appendTrackingPlots(lastDirName, name, algoPlots, onlyForPileup=False, only
_appendTrackingPlots("TrackConversion", "conversion", _simBasedPlots+_recoBasedPlots, onlyForConversion=True, rawSummary=True, highPuritySummary=False)
_appendTrackingPlots("TrackGsf", "gsf", _simBasedPlots+_recoBasedPlots, onlyForElectron=True, rawSummary=True, highPuritySummary=False)
_appendTrackingPlots("TrackBHadron", "bhadron", _simBasedPlots+_recoBasedPlots, onlyForBHadron=True)
_appendTrackingPlots("TrackDisplaced", "displaced", _simBasedPlots+_recoBasedPlots)
# Pixel tracks
_common = dict(purpose=PlotPurpose.Pixel, page="pixel")
plotter.append("pixelTrack", _trackingFolders("PixelTrack"), TrackingPlotFolder(*(_simBasedPlots+_recoBasedPlots), **_common))
Expand Down
2 changes: 2 additions & 0 deletions Validation/RecoTrack/scripts/makeTrackValidationPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def main(opts):
"seeding": limitProcessing,
"building": limitProcessing,
"bhadron": limitProcessing,
"displaced": limitProcessing,
}
}
if opts.limit_relval:
Expand All @@ -64,6 +65,7 @@ def main(opts):
"tpEtaGreater2p7": limitRelVal,
"seeding": ignore,
"bhadron": limitRelVal,
"displaced": limitRelVal,
}

trk = [trackingPlots.plotter]
Expand Down
1 change: 1 addition & 0 deletions Validation/RecoTrack/test/trackingCompare.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def __call__(self, algo, quality):
"tpEtaGreater2p7": limit, # Efficiency for TrackingParticles with |eta| > 2.7 (phase 2)
"allTPEffic": ignore, # Efficiency with all TrackingParticles
"bhadron": limit, # Efficiency with B-hadron TrackingParticles
"displaced": limit, # Efficiency for TrackingParticles with no tip or lip cuts
"fromPV": limit, # Tracks from PV, signal TrackingParticles for efficiency and fakes
"fromPVAllTP": limit, # Tracks from PV, all TrackingParticles for fakes
"building": ignore, # Built tracks (as opposed to selected tracks in above)
Expand Down
1 change: 1 addition & 0 deletions Validation/RecoTrack/test/trackingPerformanceValidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def ignore(a, q):
"": limitRelVal,
"tpPtLess09": limitRelVal,
"tpEtaGreater2p7": limitRelVal,
"displaced": limitRelVal,
"allTPEffic": limitRelVal,
"fromPV": limitRelVal,
"fromPVAllTP": limitRelVal,
Expand Down

0 comments on commit 197a6df

Please sign in to comment.