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
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 else:
42
43
44 from InDetConfig.ITkActsDataPreparationConfig import ITkActsDataPreparationCfg
45 acc.merge(ITkActsDataPreparationCfg(currentFlags,
46 previousExtension = previousExtension))
47
48
49
50 from InDetConfig.ITkActsPatternRecognitionConfig import ITkActsTrackReconstructionCfg
51 acc.merge(ITkActsTrackReconstructionCfg(currentFlags,
52 previousExtension = previousExtension))
53
54
55 previousExtension = currentFlags.Tracking.ActiveConfig.extension
56 if not currentFlags.Tracking.ActiveConfig.storeSeparateContainer or isPrimaryPass(currentFlags):
57 acts_tracks = f"{currentFlags.Tracking.ActiveConfig.extension}Tracks" if not currentFlags.Acts.doAmbiguityResolution else f"{currentFlags.Tracking.ActiveConfig.extension}ResolvedTracks"
58 InputCombinedITkTracks.append(acts_tracks)
59
60
61
62 print(f
"Creating track particle collection '{trackParticleContainerName}' from combination of following track collection:")
63 for trackCollection in InputCombinedITkTracks:
64 print(f
'- {trackCollection}')
65
66
67
68
69
70
71 persistifyCollection = True
72 particleCollection = trackParticleContainerName
73 perigeeExpression = flags.Tracking.perigeeExpression
74 if flags.Tracking.perigeeExpression == "Vertex":
75
76 persistifyCollection = False
77 particleCollection = f"{trackParticleContainerName}Temporary"
78 perigeeExpression = "BeamLine"
79
80
81 from InDetConfig.ITkActsParticleCreationConfig import ITkActsTrackParticleCreationCfg
82 acc.merge(ITkActsTrackParticleCreationCfg(flags,
83 TrackContainers = InputCombinedITkTracks,
84 TrackParticleContainer = particleCollection,
85 persistifyCollection = persistifyCollection,
86 PerigeeExpression = perigeeExpression))
87
88
89 if flags.Tracking.doVertexFinding:
90 from InDetConfig.ActsPriVxFinderConfig import primaryVertexFindingCfg
91 acc.merge(primaryVertexFindingCfg(flags,
92 name = "ActsPriVxFinderAlg",
93 TracksName = particleCollection,
94 vxCandidatesOutputName = primaryVertices))
95
96
97
98
99
100
101
102 if flags.Tracking.perigeeExpression == "Vertex":
103 assert flags.Tracking.doVertexFinding, \
104 f"Requested the computation of track particles wrt but flags.Tracking.doVertexFinding is set to {flags.Tracking.doVertexFinding}"
105 print(
'Requesting to compute the track particle collection wrt the Vertex')
106 acc.merge(ITkActsTrackParticleCreationCfg(flags,
107 TrackContainers = InputCombinedITkTracks,
108 TrackParticleContainer = trackParticleContainerName))
109
110
111 print(
'Starting Post-Processing')
112
113
116 if flags.Tracking.writeExtendedSi_PRDInfo:
117
118
119
120
121
122
123
124 generatedTrackParticleCollections = ["InDetTrackParticles"]
125 if flags.Tracking.PRDInfo.KeepOnlyOnTrackMeasurements:
126 from InDetConfig.ITkActsHelpers import getListOfGeneratedTrackParticles
127 generatedTrackParticleCollections = getListOfGeneratedTrackParticles(flags)
128
129
130
131
132
133 from InDetConfig.InDetPrepRawDataToxAODConfig import ITkActsPrepDataToxAODCfg
134 acc.merge(ITkActsPrepDataToxAODCfg(flags,
135 TrackParticles = generatedTrackParticleCollections))
136
137
138
139
140 if flags.Detector.EnablePLR:
141 from ActsConfig.ActsObjectDecorationConfig import ActsPLRClusterMeasurementDecoratorAlgCfg
142 acc.merge(ActsPLRClusterMeasurementDecoratorAlgCfg(flags))
143
144
145 from ActsConfig.ActsObjectDecorationConfig import ActsTrackStateOnSurfaceDecoratorAlgCfg
146 acc.merge(ActsTrackStateOnSurfaceDecoratorAlgCfg(flags,
147 name=f"Acts{trackParticleContainerName}StateOnSurfaceDecoratorAlg",
148 TrackParticles=trackParticleContainerName))
149
150
151 for currentFlags in scheduledTrackingPasses:
152
153 from InDetConfig.ITkActsParticleCreationConfig import ITkActsTrackParticlePersistificationCfg
154 acc.merge(ITkActsTrackParticlePersistificationCfg(currentFlags))
155
156
157
158
159
160 if flags.Tracking.writeExtendedSi_PRDInfo:
161 from ActsConfig.ActsObjectDecorationConfig import ActsTrackStateOnSurfaceDecoratorAlgCfg
162
163 if currentFlags.Tracking.ActiveConfig.storeSiSPSeededTracks:
164 TrackParticleCollectionForMsos = f'SiSPSeededTracks{currentFlags.Tracking.ActiveConfig.extension}TrackParticles'
165 acc.merge(ActsTrackStateOnSurfaceDecoratorAlgCfg(currentFlags,
166 name=f"{TrackParticleCollectionForMsos}StateOnSurfaceDecoratorAlg",
167 TrackParticles=TrackParticleCollectionForMsos,
168 PixelMSOSs=f"SiSPSeededITk{currentFlags.Tracking.ActiveConfig.extension}PixelMSOSs",
169 StripMSOSs=f"SiSPSeededITk{currentFlags.Tracking.ActiveConfig.extension}StripMSOSs"))
170
171 if currentFlags.Tracking.ActiveConfig.storeSeparateContainer:
172
173
174
175
176
177 from InDetConfig.ITkActsHelpers import separateTrackParticleContainerName
178 TrackParticleCollectionForMsos = separateTrackParticleContainerName(currentFlags)
179 acc.merge(ActsTrackStateOnSurfaceDecoratorAlgCfg(currentFlags,
180 name=f"{TrackParticleCollectionForMsos}StateOnSurfaceDecoratorAlg",
181 TrackParticles=TrackParticleCollectionForMsos,
182 PixelMSOSs=f"ITk{currentFlags.Tracking.ActiveConfig.extension}PixelMSOSs",
183 StripMSOSs=f"ITk{currentFlags.Tracking.ActiveConfig.extension}StripMSOSs"))
184
185
186
187 acc.printConfig(withDetails = False, summariseProps = False)
188 return acc
void print(char *figname, TCanvas *c1)