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