6 print(
"Scheduling the ACTS Job Option for ITk Track Reconstruction")
7 if flags.Tracking.doITkFastTracking:
8 print(
"- Configuration requested: Fast Tracking")
9 acc = ComponentAccumulator()
13 from InDetConfig.ITkActsHelpers
import extractTrackingPasses
14 scheduledTrackingPasses = extractTrackingPasses(flags)
16 previousExtension =
None
21 InputCombinedITkTracks = []
24 trackParticleContainerName =
"InDetTrackParticles"
25 primaryVertices =
"PrimaryVertices"
28 from InDetConfig.ITkActsHelpers
import isPrimaryPass, primaryPassUsesDevice, secondaryPassUsesDevice
29 for currentFlags
in scheduledTrackingPasses:
31 print(f
"---- Preparing scheduling of algorithms for tracking pass: {currentFlags.Tracking.ActiveConfig.extension}")
32 print(f
"---- - Is primary pass: {isPrimaryPass(currentFlags)}")
33 from TrkConfig.TrackingPassFlags
import printActiveConfig
34 printActiveConfig(currentFlags)
36 if isPrimaryPass(currentFlags)
and primaryPassUsesDevice(currentFlags):
37 print(
"Configuring track reconstruction on device")
38 from InDetConfig.ITkActsDeviceTrackRecoConfig
import ITkActsDeviceTrackRecoCfg
39 acc.merge(ITkActsDeviceTrackRecoCfg(currentFlags,
40 previousExtension = previousExtension))
41 elif not isPrimaryPass(currentFlags)
and secondaryPassUsesDevice(currentFlags):
42 print(
"Configuring secondary pass track reconstruction on device")
43 from InDetConfig.ITkActsDeviceTrackRecoConfig
import ITkActsDeviceSecondaryPassTrackRecoCfg
44 acc.merge(ITkActsDeviceSecondaryPassTrackRecoCfg(currentFlags,
45 previousExtension = previousExtension))
49 from InDetConfig.ITkActsDataPreparationConfig
import ITkActsDataPreparationCfg
50 acc.merge(ITkActsDataPreparationCfg(currentFlags,
51 previousExtension = previousExtension))
55 from InDetConfig.ITkActsPatternRecognitionConfig
import ITkActsTrackReconstructionCfg
56 acc.merge(ITkActsTrackReconstructionCfg(currentFlags,
57 previousExtension = previousExtension))
60 previousExtension = currentFlags.Tracking.ActiveConfig.extension
61 if not currentFlags.Tracking.ActiveConfig.storeSeparateContainer
or isPrimaryPass(currentFlags):
62 acts_tracks = f
"{currentFlags.Tracking.ActiveConfig.extension}Tracks" if not currentFlags.Acts.doAmbiguityResolution
else f
"{currentFlags.Tracking.ActiveConfig.extension}ResolvedTracks"
63 InputCombinedITkTracks.append(acts_tracks)
67 print(f
"Creating track particle collection '{trackParticleContainerName}' from combination of following track collection:")
68 for trackCollection
in InputCombinedITkTracks:
69 print(f
'- {trackCollection}')
76 persistifyCollection =
True
77 particleCollection = trackParticleContainerName
78 perigeeExpression = flags.Tracking.perigeeExpression
79 if flags.Tracking.perigeeExpression ==
"Vertex":
81 persistifyCollection =
False
82 particleCollection = f
"{trackParticleContainerName}Temporary"
83 perigeeExpression =
"BeamLine"
86 from InDetConfig.ITkActsParticleCreationConfig
import ITkActsTrackParticleCreationCfg
87 acc.merge(ITkActsTrackParticleCreationCfg(flags,
88 TrackContainers = InputCombinedITkTracks,
89 TrackParticleContainer = particleCollection,
90 persistifyCollection = persistifyCollection,
91 PerigeeExpression = perigeeExpression))
94 if flags.Tracking.doVertexFinding:
95 from InDetConfig.ActsPriVxFinderConfig
import primaryVertexFindingCfg
96 acc.merge(primaryVertexFindingCfg(flags,
97 name =
"ActsPriVxFinderAlg",
98 TracksName = particleCollection,
99 vxCandidatesOutputName = primaryVertices))
107 if flags.Tracking.perigeeExpression ==
"Vertex":
108 assert flags.Tracking.doVertexFinding, \
109 f
"Requested the computation of track particles wrt but flags.Tracking.doVertexFinding is set to {flags.Tracking.doVertexFinding}"
110 print(
'Requesting to compute the track particle collection wrt the Vertex')
111 acc.merge(ITkActsTrackParticleCreationCfg(flags,
112 TrackContainers = InputCombinedITkTracks,
113 TrackParticleContainer = trackParticleContainerName))
116 print(
'Starting Post-Processing')
121 if flags.Tracking.writeExtendedSi_PRDInfo:
129 generatedTrackParticleCollections = [
"InDetTrackParticles"]
130 if flags.Tracking.PRDInfo.KeepOnlyOnTrackMeasurements:
131 from InDetConfig.ITkActsHelpers
import getListOfGeneratedTrackParticles
132 generatedTrackParticleCollections = getListOfGeneratedTrackParticles(flags)
138 from InDetConfig.InDetPrepRawDataToxAODConfig
import ITkActsPrepDataToxAODCfg
139 acc.merge(ITkActsPrepDataToxAODCfg(flags,
140 TrackParticles = generatedTrackParticleCollections))
145 if flags.Detector.EnablePLR:
146 from ActsConfig.ActsObjectDecorationConfig
import ActsPLRClusterMeasurementDecoratorAlgCfg
147 acc.merge(ActsPLRClusterMeasurementDecoratorAlgCfg(flags))
150 from ActsConfig.ActsObjectDecorationConfig
import ActsTrackStateOnSurfaceDecoratorAlgCfg
151 acc.merge(ActsTrackStateOnSurfaceDecoratorAlgCfg(flags,
152 name=f
"Acts{trackParticleContainerName}StateOnSurfaceDecoratorAlg",
153 TrackParticles=trackParticleContainerName))
156 for currentFlags
in scheduledTrackingPasses:
158 from InDetConfig.ITkActsParticleCreationConfig
import ITkActsTrackParticlePersistificationCfg
159 acc.merge(ITkActsTrackParticlePersistificationCfg(currentFlags))
165 if flags.Tracking.writeExtendedSi_PRDInfo:
166 from ActsConfig.ActsObjectDecorationConfig
import ActsTrackStateOnSurfaceDecoratorAlgCfg
168 if currentFlags.Tracking.ActiveConfig.storeSiSPSeededTracks:
169 TrackParticleCollectionForMsos = f
'SiSPSeededTracks{currentFlags.Tracking.ActiveConfig.extension}TrackParticles'
170 acc.merge(ActsTrackStateOnSurfaceDecoratorAlgCfg(currentFlags,
171 name=f
"{TrackParticleCollectionForMsos}StateOnSurfaceDecoratorAlg",
172 TrackParticles=TrackParticleCollectionForMsos,
173 PixelMSOSs=f
"SiSPSeededITk{currentFlags.Tracking.ActiveConfig.extension}PixelMSOSs",
174 StripMSOSs=f
"SiSPSeededITk{currentFlags.Tracking.ActiveConfig.extension}StripMSOSs"))
176 if currentFlags.Tracking.ActiveConfig.storeSeparateContainer:
182 from InDetConfig.ITkActsHelpers
import separateTrackParticleContainerName
183 TrackParticleCollectionForMsos = separateTrackParticleContainerName(currentFlags)
184 acc.merge(ActsTrackStateOnSurfaceDecoratorAlgCfg(currentFlags,
185 name=f
"{TrackParticleCollectionForMsos}StateOnSurfaceDecoratorAlg",
186 TrackParticles=TrackParticleCollectionForMsos,
187 PixelMSOSs=f
"ITk{currentFlags.Tracking.ActiveConfig.extension}PixelMSOSs",
188 StripMSOSs=f
"ITk{currentFlags.Tracking.ActiveConfig.extension}StripMSOSs"))
192 acc.printConfig(withDetails =
False, summariseProps =
False)