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