Skip to content

Commit

Permalink
Add option to run mkFit in initialStepPreSplitting
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel committed Jun 21, 2021
1 parent ac5ca81 commit 8a7dcbf
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

# This modifier sets replaces the default pattern recognition with mkFit for initialStep
trackingMkFitInitialStepPreSplitting = cms.Modifier()
2 changes: 2 additions & 0 deletions Configuration/ProcessModifiers/python/trackingMkFit_cff.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import FWCore.ParameterSet.Config as cms

from Configuration.ProcessModifiers.trackingMkFitCommon_cff import *
from Configuration.ProcessModifiers.trackingMkFitInitialStepPreSplitting_cff import *
from Configuration.ProcessModifiers.trackingMkFitInitialStep_cff import *
from Configuration.ProcessModifiers.trackingMkFitLowPtQuadStep_cff import *
from Configuration.ProcessModifiers.trackingMkFitHighPtTripletStep_cff import *
Expand All @@ -14,6 +15,7 @@
# Use mkFit in selected iterations
trackingMkFit = cms.ModifierChain(
trackingMkFitCommon,
trackingMkFitInitialStepPreSplitting,
trackingMkFitInitialStep,
trackingMkFitLowPtQuadStep,
trackingMkFitHighPtTripletStep,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,45 @@
)
initialStepTrackCandidatesPreSplitting.MeasurementTrackerEvent = 'MeasurementTrackerEventPreSplitting'

from Configuration.ProcessModifiers.trackingMkFitInitialStepPreSplitting_cff import trackingMkFitInitialStepPreSplitting
from RecoTracker.MkFit.mkFitGeometryESProducer_cfi import mkFitGeometryESProducer
import RecoTracker.MkFit.mkFitSiPixelHitConverter_cfi as mkFitSiPixelHitConverter_cfi
import RecoTracker.MkFit.mkFitSiStripHitConverter_cfi as mkFitSiStripHitConverter_cfi
import RecoTracker.MkFit.mkFitEventOfHitsProducer_cfi as mkFitEventOfHitsProducer_cfi
import RecoTracker.MkFit.mkFitSeedConverter_cfi as mkFitSeedConverter_cfi
import RecoTracker.MkFit.mkFitIterationConfigESProducer_cfi as mkFitIterationConfigESProducer_cfi
import RecoTracker.MkFit.mkFitProducer_cfi as mkFitProducer_cfi
import RecoTracker.MkFit.mkFitOutputConverter_cfi as mkFitOutputConverter_cfi
# TODO: Split the MkHitConverter to two to avoid re-converting strip hits in initialStep
mkFitSiPixelHitsPreSplitting = mkFitSiPixelHitConverter_cfi.mkFitSiPixelHitConverter.clone(
hits = 'siPixelRecHitsPreSplitting'
)
mkFitSiStripHits = mkFitSiStripHitConverter_cfi.mkFitSiStripHitConverter.clone() # TODO: figure out better place for this module?
mkFitEventOfHitsPreSplitting = mkFitEventOfHitsProducer_cfi.mkFitEventOfHitsProducer.clone(
pixelHits = 'mkFitSiPixelHitsPreSplitting'
)
initialStepTrackCandidatesMkFitSeedsPreSplitting = mkFitSeedConverter_cfi.mkFitSeedConverter.clone(
seeds = 'initialStepSeedsPreSplitting',
)
# TODO: or try to re-use the ESProducer of initialStep?
initialStepTrackCandidatesMkFitConfigPreSplitting = mkFitIterationConfigESProducer_cfi.mkFitIterationConfigESProducer.clone(
ComponentName = 'initialStepTrackCandidatesMkFitConfigPreSplitting',
config = 'RecoTracker/MkFit/data/mkfit-phase1-initialStep.json',
)
initialStepTrackCandidatesMkFitPreSplitting = mkFitProducer_cfi.mkFitProducer.clone(
pixelHits = 'mkFitSiPixelHitsPreSplitting',
eventOfHits = 'mkFitEventOfHitsPreSplitting',
seeds = 'initialStepTrackCandidatesMkFitSeedsPreSplitting',
config = ('', 'initialStepTrackCandidatesMkFitConfigPreSplitting'),
)
trackingMkFitInitialStepPreSplitting.toReplaceWith(initialStepTrackCandidatesPreSplitting, mkFitOutputConverter_cfi.mkFitOutputConverter.clone(
mkFitPixelHits = 'mkFitSiPixelHitsPreSplitting',
mkFitEventOfHits = 'mkFitEventOfHitsPreSplitting',
seeds = 'initialStepSeedsPreSplitting',
mkFitSeeds = 'initialStepTrackCandidatesMkFitSeedsPreSplitting',
tracks = 'initialStepTrackCandidatesMkFitPreSplitting',
))

# fitting
import RecoTracker.TrackProducer.TrackProducer_cfi
initialStepTracksPreSplitting = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
Expand Down Expand Up @@ -195,6 +234,10 @@
_InitialStepPreSplittingTask_trackingPhase1.replace(initialStepHitTripletsPreSplitting, cms.Task(initialStepHitTripletsPreSplitting,initialStepHitQuadrupletsPreSplitting))
trackingPhase1.toReplaceWith(InitialStepPreSplittingTask, _InitialStepPreSplittingTask_trackingPhase1.copyAndExclude([initialStepHitTripletsPreSplitting]))

_InitialStepPreSplittingTask_trackingMkFit = InitialStepPreSplittingTask.copy()
_InitialStepPreSplittingTask_trackingMkFit.add(mkFitSiPixelHitsPreSplitting, mkFitSiStripHits, mkFitEventOfHitsPreSplitting, initialStepTrackCandidatesMkFitSeedsPreSplitting, initialStepTrackCandidatesMkFitPreSplitting, initialStepTrackCandidatesMkFitConfigPreSplitting)
trackingMkFitInitialStepPreSplitting.toReplaceWith(InitialStepPreSplittingTask, _InitialStepPreSplittingTask_trackingMkFit)


# Although InitialStepPreSplitting is not really part of LowPU/Run1/Phase2PU140
# tracking, we use it to get siPixelClusters and siPixelRecHits
Expand Down
3 changes: 1 addition & 2 deletions RecoTracker/IterativeTracking/python/InitialStep_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@
import RecoTracker.MkFit.mkFitProducer_cfi as mkFitProducer_cfi
import RecoTracker.MkFit.mkFitOutputConverter_cfi as mkFitOutputConverter_cfi
mkFitSiPixelHits = mkFitSiPixelHitConverter_cfi.mkFitSiPixelHitConverter.clone() # TODO: figure out better place for this module?
mkFitSiStripHits = mkFitSiStripHitConverter_cfi.mkFitSiStripHitConverter.clone() # TODO: figure out better place for this module?
mkFitEventOfHits = mkFitEventOfHitsProducer_cfi.mkFitEventOfHitsProducer.clone() # TODO: figure out better place for this module?
initialStepTrackCandidatesMkFitSeeds = mkFitSeedConverter_cfi.mkFitSeedConverter.clone(
seeds = 'initialStepSeeds',
Expand Down Expand Up @@ -428,7 +427,7 @@

from Configuration.ProcessModifiers.trackingMkFitCommon_cff import trackingMkFitCommon
_InitialStepTask_trackingMkFitCommon = InitialStepTask.copy()
_InitialStepTask_trackingMkFitCommon.add(mkFitSiPixelHits, mkFitSiStripHits, mkFitEventOfHits, mkFitGeometryESProducer)
_InitialStepTask_trackingMkFitCommon.add(mkFitSiPixelHits, mkFitEventOfHits, mkFitGeometryESProducer)
trackingMkFitCommon.toReplaceWith(InitialStepTask, _InitialStepTask_trackingMkFitCommon)

_InitialStepTask_trackingMkFit = InitialStepTask.copy()
Expand Down
10 changes: 7 additions & 3 deletions Validation/RecoTrack/python/plotting/trackingPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,9 @@ def modules(self):
"initialStepHitTripletsPreSplitting",
"initialStepHitQuadrupletsPreSplitting",
"initialStepSeedsPreSplitting"],
building=["initialStepTrackCandidatesPreSplitting"],
building=["initialStepTrackCandidatesPreSplitting"
"initialStepTrackCandidatesMkFitSeedsPreSplitting",
"initialStepTrackCandidatesMkFitPreSplitting"],
fit=["initialStepTracksPreSplitting"],
other=["firstStepPrimaryVerticesPreSplitting",
"initialStepTrackRefsForJetsPreSplitting",
Expand All @@ -1466,7 +1468,10 @@ def modules(self):
"siPixelClusters",
"siPixelRecHits",
"MeasurementTrackerEvent",
"siPixelClusterShapeCache"]),
"siPixelClusterShapeCache",
"mkFitSiPixelHitsPreSplitting",
"mkFitSiStripHits",
"mkFitEventOfHitsPreSplitting"]),
Iteration("initialStep", clusterMasking=[],
selection=["initialStepClassifier1",
"initialStepClassifier2",
Expand All @@ -1479,7 +1484,6 @@ def modules(self):
"ak4CaloJetsForTrk",
"firstStepPrimaryVertices",
"mkFitSiPixelHits",
"mkFitSiStripHits",
"mkFitEventOfHits"]),
Iteration("highPtTripletStep",
selection=["highPtTripletStepClassifier1",
Expand Down

0 comments on commit 8a7dcbf

Please sign in to comment.