7 print(
"Scheduling the ACTS Job Option for ITk Track Reconstruction")
8 if flags.Tracking.doITkFastTracking:
9 print(
"- Configuration requested: Fast Tracking")
10 acc = ComponentAccumulator()
14 from InDetConfig.ITkActsHelpers
import extractTrackingPasses
15 scheduledTrackingPasses = extractTrackingPasses(flags)
17 previousExtension =
None
22 InputCombinedITkTracks = []
25 trackParticleContainerName =
"InDetTrackParticles"
26 primaryVertices =
"PrimaryVertices"
29 from InDetConfig.ITkActsHelpers
import isPrimaryPass, primaryPassUsesDevice, secondaryPassUsesDevice
30 for currentFlags
in scheduledTrackingPasses:
32 print(f
"---- Preparing scheduling of algorithms for tracking pass: {currentFlags.Tracking.ActiveConfig.extension}")
33 print(f
"---- - Is primary pass: {isPrimaryPass(currentFlags)}")
34 from TrkConfig.TrackingPassFlags
import printActiveConfig
35 printActiveConfig(currentFlags)
37 if isPrimaryPass(currentFlags)
and primaryPassUsesDevice(currentFlags):
38 print(
"Configuring track reconstruction on device")
39 from InDetConfig.ITkActsDeviceTrackRecoConfig
import ITkActsDeviceTrackRecoCfg
40 acc.merge(ITkActsDeviceTrackRecoCfg(currentFlags,
41 previousExtension = previousExtension))
42 elif not isPrimaryPass(currentFlags)
and secondaryPassUsesDevice(currentFlags):
43 print(
"Configuring secondary pass track reconstruction on device")
44 from InDetConfig.ITkActsDeviceTrackRecoConfig
import ITkActsDeviceSecondaryPassTrackRecoCfg
45 acc.merge(ITkActsDeviceSecondaryPassTrackRecoCfg(currentFlags,
46 previousExtension = previousExtension))
50 from InDetConfig.ITkActsDataPreparationConfig
import ITkActsDataPreparationCfg
51 acc.merge(ITkActsDataPreparationCfg(currentFlags,
52 previousExtension = previousExtension))
56 from InDetConfig.ITkActsPatternRecognitionConfig
import ITkActsTrackReconstructionCfg
57 acc.merge(ITkActsTrackReconstructionCfg(currentFlags,
58 previousExtension = previousExtension))
61 previousExtension = currentFlags.Tracking.ActiveConfig.extension
62 if not currentFlags.Tracking.ActiveConfig.storeSeparateContainer
or isPrimaryPass(currentFlags):
63 acts_tracks = f
"{currentFlags.Tracking.ActiveConfig.extension}Tracks" if not currentFlags.Acts.doAmbiguityResolution
else f
"{currentFlags.Tracking.ActiveConfig.extension}ResolvedTracks"
64 InputCombinedITkTracks.append(acts_tracks)
68 print(f
"Creating track particle collection '{trackParticleContainerName}' from combination of following track collection:")
69 for trackCollection
in InputCombinedITkTracks:
70 print(f
'- {trackCollection}')
77 persistifyCollection =
True
78 particleCollection = trackParticleContainerName
79 perigeeExpression = flags.Tracking.perigeeExpression
80 if flags.Tracking.perigeeExpression
is PerigeeExpression.Vertex:
82 persistifyCollection =
False
83 particleCollection = f
"{trackParticleContainerName}Temporary"
84 perigeeExpression = PerigeeExpression.BeamLine
87 from InDetConfig.ITkActsParticleCreationConfig
import ITkActsTrackParticleCreationCfg
88 acc.merge(ITkActsTrackParticleCreationCfg(flags,
89 TrackContainers = InputCombinedITkTracks,
90 TrackParticleContainer = particleCollection,
91 persistifyCollection = persistifyCollection,
92 PerigeeExpression = perigeeExpression))
95 if flags.Tracking.doVertexFinding:
96 from InDetConfig.ActsPriVxFinderConfig
import primaryVertexFindingCfg
97 acc.merge(primaryVertexFindingCfg(flags,
98 name =
"ActsPriVxFinderAlg",
99 TracksName = particleCollection,
100 vxCandidatesOutputName = primaryVertices))
108 if flags.Tracking.perigeeExpression
is PerigeeExpression.Vertex:
109 assert flags.Tracking.doVertexFinding, \
110 f
"Requested the computation of track particles wrt but flags.Tracking.doVertexFinding is set to {flags.Tracking.doVertexFinding}"
111 print(
'Requesting to compute the track particle collection wrt the Vertex')
112 acc.merge(ITkActsTrackParticleCreationCfg(flags,
113 TrackContainers = InputCombinedITkTracks,
114 TrackParticleContainer = trackParticleContainerName))
117 print(
'Starting Post-Processing')
122 if flags.Tracking.writeExtendedSi_PRDInfo:
130 generatedTrackParticleCollections = [
"InDetTrackParticles"]
131 if flags.Tracking.PRDInfo.KeepOnlyOnTrackMeasurements:
132 from InDetConfig.ITkActsHelpers
import getListOfGeneratedTrackParticles
133 generatedTrackParticleCollections = getListOfGeneratedTrackParticles(flags)
139 from InDetConfig.InDetPrepRawDataToxAODConfig
import ITkActsPrepDataToxAODCfg
140 acc.merge(ITkActsPrepDataToxAODCfg(flags,
141 TrackParticles = generatedTrackParticleCollections))
146 if flags.Detector.EnablePLR:
147 from ActsConfig.ActsObjectDecorationConfig
import ActsPLRClusterMeasurementDecoratorAlgCfg
148 acc.merge(ActsPLRClusterMeasurementDecoratorAlgCfg(flags))
151 from ActsConfig.ActsObjectDecorationConfig
import ActsTrackStateOnSurfaceDecoratorAlgCfg
152 acc.merge(ActsTrackStateOnSurfaceDecoratorAlgCfg(flags,
153 name=f
"Acts{trackParticleContainerName}StateOnSurfaceDecoratorAlg",
154 TrackParticles=trackParticleContainerName))
157 for currentFlags
in scheduledTrackingPasses:
159 from InDetConfig.ITkActsParticleCreationConfig
import ITkActsTrackParticlePersistificationCfg
160 acc.merge(ITkActsTrackParticlePersistificationCfg(currentFlags))
166 if flags.Tracking.writeExtendedSi_PRDInfo:
167 from ActsConfig.ActsObjectDecorationConfig
import ActsTrackStateOnSurfaceDecoratorAlgCfg
169 if currentFlags.Tracking.ActiveConfig.storeSiSPSeededTracks:
170 TrackParticleCollectionForMsos = f
'SiSPSeededTracks{currentFlags.Tracking.ActiveConfig.extension}TrackParticles'
171 acc.merge(ActsTrackStateOnSurfaceDecoratorAlgCfg(currentFlags,
172 name=f
"{TrackParticleCollectionForMsos}StateOnSurfaceDecoratorAlg",
173 TrackParticles=TrackParticleCollectionForMsos,
174 PixelMSOSs=f
"SiSPSeededITk{currentFlags.Tracking.ActiveConfig.extension}PixelMSOSs",
175 StripMSOSs=f
"SiSPSeededITk{currentFlags.Tracking.ActiveConfig.extension}StripMSOSs"))
177 if currentFlags.Tracking.ActiveConfig.storeSeparateContainer:
183 from InDetConfig.ITkActsHelpers
import separateTrackParticleContainerName
184 TrackParticleCollectionForMsos = separateTrackParticleContainerName(currentFlags)
185 acc.merge(ActsTrackStateOnSurfaceDecoratorAlgCfg(currentFlags,
186 name=f
"{TrackParticleCollectionForMsos}StateOnSurfaceDecoratorAlg",
187 TrackParticles=TrackParticleCollectionForMsos,
188 PixelMSOSs=f
"ITk{currentFlags.Tracking.ActiveConfig.extension}PixelMSOSs",
189 StripMSOSs=f
"ITk{currentFlags.Tracking.ActiveConfig.extension}StripMSOSs"))
193 acc.printConfig(withDetails =
False, summariseProps =
False)