-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Update MkFit to support multiple iterations #33802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9b1732d
9f31c6c
465900a
17d5077
5bc1169
61f2f82
9ce4863
5355fcd
8ea9a9f
c8b1553
6ed452a
9b878d5
1127f54
7ed601f
150feaf
0f9bd99
f35ccac
b8d4f68
27c9d22
78094ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import FWCore.ParameterSet.Config as cms | ||
|
|
||
| # This modifier does iteration-independent changes for enabling mkFit | ||
| trackingMkFitCommon = cms.Modifier() |
| 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 detachedQuadStep | ||
| trackingMkFitDetachedQuadStep = cms.Modifier() |
| 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 detachedTripletStep | ||
| trackingMkFitDetachedTripletStep = cms.Modifier() |
| 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 highPtTripletStep | ||
| trackingMkFitHighPtTripletStep = cms.Modifier() |
| 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 | ||
| trackingMkFitInitialStep = cms.Modifier() |
| 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 lowPtQuadStep | ||
| trackingMkFitLowPtQuadStep = cms.Modifier() |
| 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 lowPtTripletStep | ||
| trackingMkFitLowPtTripletStep = cms.Modifier() |
| 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 mixedTripletStep | ||
| trackingMkFitMixedTripletStep = cms.Modifier() |
| 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 pixelLessStep | ||
| trackingMkFitPixelLessStep = cms.Modifier() |
| 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 tobTecStep | ||
| trackingMkFitTobTecStep = cms.Modifier() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,26 @@ | ||
| import FWCore.ParameterSet.Config as cms | ||
|
|
||
| # This modifier sets replaces the default pattern recognition with mkFit (possibly in selected iterations only) | ||
| trackingMkFit = cms.Modifier() | ||
| from Configuration.ProcessModifiers.trackingMkFitCommon_cff import * | ||
| from Configuration.ProcessModifiers.trackingMkFitInitialStep_cff import * | ||
| from Configuration.ProcessModifiers.trackingMkFitLowPtQuadStep_cff import * | ||
| from Configuration.ProcessModifiers.trackingMkFitHighPtTripletStep_cff import * | ||
| from Configuration.ProcessModifiers.trackingMkFitLowPtTripletStep_cff import * | ||
| from Configuration.ProcessModifiers.trackingMkFitDetachedQuadStep_cff import * | ||
| from Configuration.ProcessModifiers.trackingMkFitDetachedTripletStep_cff import * | ||
| from Configuration.ProcessModifiers.trackingMkFitMixedTripletStep_cff import * | ||
| from Configuration.ProcessModifiers.trackingMkFitPixelLessStep_cff import * | ||
| from Configuration.ProcessModifiers.trackingMkFitTobTecStep_cff import * | ||
|
|
||
| # Use mkFit in selected iterations | ||
| trackingMkFit = cms.ModifierChain( | ||
| trackingMkFitCommon, | ||
| trackingMkFitInitialStep, | ||
| trackingMkFitLowPtQuadStep, | ||
| trackingMkFitHighPtTripletStep, | ||
| trackingMkFitLowPtTripletStep, | ||
| trackingMkFitDetachedQuadStep, | ||
| # trackingMkFitDetachedTripletStep, # to be enabled later | ||
| # trackingMkFitMixedTripletStep, # to be enabled later | ||
| trackingMkFitPixelLessStep, | ||
| trackingMkFitTobTecStep, | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -291,18 +291,24 @@ def condition_(self, fragment, stepList, key, hasHarvest): | |
|
|
||
| class UpgradeWorkflow_trackingMkFit(UpgradeWorkflowTracking): | ||
| def setup_(self, step, stepName, stepDict, k, properties): | ||
| if 'Digi' in step: stepDict[stepName][k] = merge([self.step2, stepDict[step][k]]) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure I understand this change :(
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's copied from the similar line below for Reco. IIUC something like that is needed to add the |
||
| if 'Reco' in step: stepDict[stepName][k] = merge([self.step3, stepDict[step][k]]) | ||
| def condition_(self, fragment, stepList, key, hasHarvest): | ||
| return '2017' in key or '2021' in key | ||
| upgradeWFs['trackingMkFit'] = UpgradeWorkflow_trackingMkFit( | ||
| steps = [ | ||
| 'Digi', | ||
| 'DigiTrigger', | ||
| 'Reco', | ||
| 'RecoGlobal', | ||
| ], | ||
| PU = [], | ||
| suffix = '_trackingMkFit', | ||
| offset = 0.7, | ||
| ) | ||
| upgradeWFs['trackingMkFit'].step2 = { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are you going to make use of the mkFit at HLT as well ? I'm confused :(
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This customize function provides a way to test mkFit in HLT menu, regardless of whether it will be used there. Having the customize function in the matrix workflow helps to keep the customize function functional. Written that, I don't feel strongly on this point, so if you think it would be easier to not have the HLT customization, I can remove it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure we really know yet what/if some level of usage in an adapted mkFit for HLT will be needed. So not sure. |
||
| '--customise': 'RecoTracker/MkFit/customizeHLTIter0ToMkFit.customizeHLTIter0ToMkFit' | ||
| } | ||
| upgradeWFs['trackingMkFit'].step3 = { | ||
| '--procModifiers': 'trackingMkFit' | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -186,6 +186,29 @@ | |
| phase2clustersToSkip = cms.InputTag('detachedQuadStepClusters') | ||
| ) | ||
|
|
||
| from Configuration.ProcessModifiers.trackingMkFitDetachedQuadStep_cff import trackingMkFitDetachedQuadStep | ||
| 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 | ||
| detachedQuadStepTrackCandidatesMkFitSeeds = mkFitSeedConverter_cfi.mkFitSeedConverter.clone( | ||
| seeds = 'detachedQuadStepSeeds', | ||
| ) | ||
| detachedQuadStepTrackCandidatesMkFitConfig = mkFitIterationConfigESProducer_cfi.mkFitIterationConfigESProducer.clone( | ||
| config = 'RecoTracker/MkFit/data/mkfit-phase1-detachedQuadStep.json', | ||
| ComponentName = 'detachedQuadStepTrackCandidatesMkFitConfig', | ||
| ) | ||
| detachedQuadStepTrackCandidatesMkFit = mkFitProducer_cfi.mkFitProducer.clone( | ||
| seeds = 'detachedQuadStepTrackCandidatesMkFitSeeds', | ||
| config = ('', 'detachedQuadStepTrackCandidatesMkFitConfig'), | ||
| clustersToSkip = 'detachedQuadStepClusters', | ||
| ) | ||
| trackingMkFitDetachedQuadStep.toReplaceWith(detachedQuadStepTrackCandidates, mkFitOutputConverter_cfi.mkFitOutputConverter.clone( | ||
| seeds = 'detachedQuadStepSeeds', | ||
| mkFitSeeds = 'detachedQuadStepTrackCandidatesMkFitSeeds', | ||
| tracks = 'detachedQuadStepTrackCandidatesMkFit', | ||
| )) | ||
|
|
||
| #For FastSim phase1 tracking | ||
| import FastSimulation.Tracking.TrackCandidateProducer_cfi | ||
| _fastSim_detachedQuadStepTrackCandidates = FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone( | ||
|
|
@@ -337,6 +360,11 @@ | |
| detachedQuadStepTracks, | ||
| detachedQuadStep) | ||
| DetachedQuadStep = cms.Sequence(DetachedQuadStepTask) | ||
|
|
||
| _DetachedQuadStepTask_trackingMkFit = DetachedQuadStepTask.copy() | ||
| _DetachedQuadStepTask_trackingMkFit.add(detachedQuadStepTrackCandidatesMkFitSeeds, detachedQuadStepTrackCandidatesMkFit, detachedQuadStepTrackCandidatesMkFitConfig) | ||
| trackingMkFitDetachedQuadStep.toReplaceWith(DetachedQuadStepTask, _DetachedQuadStepTask_trackingMkFit) | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we will need to test it on Phase2 as well .... ok, after the Run3 developments ;)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but that will need more development than just adjusting configuration files. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Phase2 adaptation is part of the plan, but will only start after we are done w Run3 preparation. |
||
| _DetachedQuadStepTask_Phase2PU140 = DetachedQuadStepTask.copy() | ||
| _DetachedQuadStepTask_Phase2PU140.replace(detachedQuadStep, cms.Task(detachedQuadStepSelector,detachedQuadStep)) | ||
| trackingPhase2PU140.toReplaceWith(DetachedQuadStepTask, _DetachedQuadStepTask_Phase2PU140) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -214,6 +214,29 @@ | |
| detachedTripletStepTrackCandidates.TrajectoryCleaner = 'detachedTripletStepTrajectoryCleanerBySharedHits' | ||
| trackingLowPU.toModify(detachedTripletStepTrajectoryCleanerBySharedHits, fractionShared = 0.19) | ||
|
|
||
| from Configuration.ProcessModifiers.trackingMkFitDetachedTripletStep_cff import trackingMkFitDetachedTripletStep | ||
| 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 | ||
| detachedTripletStepTrackCandidatesMkFitSeeds = mkFitSeedConverter_cfi.mkFitSeedConverter.clone( | ||
| seeds = 'detachedTripletStepSeeds', | ||
| ) | ||
| detachedTripletStepTrackCandidatesMkFitConfig = mkFitIterationConfigESProducer_cfi.mkFitIterationConfigESProducer.clone( | ||
| ComponentName = 'detachedTripletStepTrackCandidatesMkFitConfig', | ||
| config = 'RecoTracker/MkFit/data/mkfit-phase1-detachedTripletStep.json', | ||
| ) | ||
| detachedTripletStepTrackCandidatesMkFit = mkFitProducer_cfi.mkFitProducer.clone( | ||
| seeds = 'detachedTripletStepTrackCandidatesMkFitSeeds', | ||
| config = ('', 'detachedTripletStepTrackCandidatesMkFitConfig'), | ||
| clustersToSkip = 'detachedTripletStepClusters', | ||
| ) | ||
| trackingMkFitDetachedTripletStep.toReplaceWith(detachedTripletStepTrackCandidates, mkFitOutputConverter_cfi.mkFitOutputConverter.clone( | ||
| seeds = 'detachedTripletStepSeeds', | ||
| mkFitSeeds = 'detachedTripletStepTrackCandidatesMkFitSeeds', | ||
| tracks = 'detachedTripletStepTrackCandidatesMkFit', | ||
| )) | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we will need to update the FastSim as well ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? FastSim pattern recognition is something very different anyway. |
||
| import FastSimulation.Tracking.TrackCandidateProducer_cfi | ||
| _fastSim_detachedTripletStepTrackCandidates = FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone( | ||
| src = 'detachedTripletStepSeeds', | ||
|
|
@@ -379,6 +402,11 @@ | |
| detachedTripletStepClassifier1,detachedTripletStepClassifier2, | ||
| detachedTripletStep) | ||
| DetachedTripletStep = cms.Sequence(DetachedTripletStepTask) | ||
|
|
||
| _DetachedTripletStepTask_trackingMkFit = DetachedTripletStepTask.copy() | ||
| _DetachedTripletStepTask_trackingMkFit.add(detachedTripletStepTrackCandidatesMkFitSeeds, detachedTripletStepTrackCandidatesMkFit, detachedTripletStepTrackCandidatesMkFitConfig) | ||
| trackingMkFitDetachedTripletStep.toReplaceWith(DetachedTripletStepTask, _DetachedTripletStepTask_trackingMkFit) | ||
|
|
||
| _DetachedTripletStepTask_LowPU = DetachedTripletStepTask.copyAndExclude([detachedTripletStepClassifier2]) | ||
| _DetachedTripletStepTask_LowPU.replace(detachedTripletStepClassifier1, detachedTripletStepSelector) | ||
| trackingLowPU.toReplaceWith(DetachedTripletStepTask, _DetachedTripletStepTask_LowPU) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you choose to make use of individual modifiers ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Individual Modifiers allow to test switching individual iterations to mkFit (like here a customization for detachedTripletStep can be given without enabling it with the
trackingMkFitModifierchain). This is intended only for short term.