5def ITkActsTrackRecoCfg(flags) -> ComponentAccumulator:
6
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()
11
12
13
14 from InDetConfig.ITkActsHelpers import extractTrackingPasses
15 scheduledTrackingPasses = extractTrackingPasses(flags)
16
17 previousExtension = None
18
19
20
21
22 InputCombinedITkTracks = []
23
24
25 trackParticleContainerName = "InDetTrackParticles"
26 primaryVertices = "PrimaryVertices"
27
28
29 from InDetConfig.ITkActsHelpers import isPrimaryPass, primaryPassUsesDevice, secondaryPassUsesDevice
30 for currentFlags in scheduledTrackingPasses:
31
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)
36
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))
47 else:
48
49
50 from InDetConfig.ITkActsDataPreparationConfig import ITkActsDataPreparationCfg
51 acc.merge(ITkActsDataPreparationCfg(currentFlags,
52 previousExtension = previousExtension))
53
54
55
56 from InDetConfig.ITkActsPatternRecognitionConfig import ITkActsTrackReconstructionCfg
57 acc.merge(ITkActsTrackReconstructionCfg(currentFlags,
58 previousExtension = previousExtension))
59
60
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)
65
66
67
68 print(f
"Creating track particle collection '{trackParticleContainerName}' from combination of following track collection:")
69 for trackCollection in InputCombinedITkTracks:
70 print(f
'- {trackCollection}')
71
72
73
74
75
76
77 persistifyCollection = True
78 particleCollection = trackParticleContainerName
79 perigeeExpression = flags.Tracking.perigeeExpression
80 if flags.Tracking.perigeeExpression is PerigeeExpression.Vertex:
81
82 persistifyCollection = False
83 particleCollection = f"{trackParticleContainerName}Temporary"
84 perigeeExpression = PerigeeExpression.BeamLine
85
86
87 from InDetConfig.ITkActsParticleCreationConfig import ITkActsTrackParticleCreationCfg
88 acc.merge(ITkActsTrackParticleCreationCfg(flags,
89 TrackContainers = InputCombinedITkTracks,
90 TrackParticleContainer = particleCollection,
91 persistifyCollection = persistifyCollection,
92 PerigeeExpression = perigeeExpression))
93
94
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))
101
102
103
104
105
106
107
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))
115
116
117 print(
'Starting Post-Processing')
118
119
122 if flags.Tracking.writeExtendedSi_PRDInfo:
123
124
125
126
127
128
129
130 generatedTrackParticleCollections = ["InDetTrackParticles"]
131 if flags.Tracking.PRDInfo.KeepOnlyOnTrackMeasurements:
132 from InDetConfig.ITkActsHelpers import getListOfGeneratedTrackParticles
133 generatedTrackParticleCollections = getListOfGeneratedTrackParticles(flags)
134
135
136
137
138
139 from InDetConfig.InDetPrepRawDataToxAODConfig import ITkActsPrepDataToxAODCfg
140 acc.merge(ITkActsPrepDataToxAODCfg(flags,
141 TrackParticles = generatedTrackParticleCollections))
142
143
144
145
146 if flags.Detector.EnablePLR:
147 from ActsConfig.ActsObjectDecorationConfig import ActsPLRClusterMeasurementDecoratorAlgCfg
148 acc.merge(ActsPLRClusterMeasurementDecoratorAlgCfg(flags))
149
150
151 from ActsConfig.ActsObjectDecorationConfig import ActsTrackStateOnSurfaceDecoratorAlgCfg
152 acc.merge(ActsTrackStateOnSurfaceDecoratorAlgCfg(flags,
153 name=f"Acts{trackParticleContainerName}StateOnSurfaceDecoratorAlg",
154 TrackParticles=trackParticleContainerName))
155
156
157 for currentFlags in scheduledTrackingPasses:
158
159 from InDetConfig.ITkActsParticleCreationConfig import ITkActsTrackParticlePersistificationCfg
160 acc.merge(ITkActsTrackParticlePersistificationCfg(currentFlags))
161
162
163
164
165
166 if flags.Tracking.writeExtendedSi_PRDInfo:
167 from ActsConfig.ActsObjectDecorationConfig import ActsTrackStateOnSurfaceDecoratorAlgCfg
168
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"))
176
177 if currentFlags.Tracking.ActiveConfig.storeSeparateContainer:
178
179
180
181
182
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"))
190
191
192
193 acc.printConfig(withDetails = False, summariseProps = False)
194 return acc
void print(char *figname, TCanvas *c1)