ATLAS Offline Software
Loading...
Searching...
No Matches
python.ITkActsTrackRecoConfig Namespace Reference

Functions

ComponentAccumulator ITkActsTrackRecoCfg (flags)

Function Documentation

◆ ITkActsTrackRecoCfg()

ComponentAccumulator ITkActsTrackRecoCfg ( flags)

Definition at line 4 of file ITkActsTrackRecoConfig.py.

4def ITkActsTrackRecoCfg(flags) -> ComponentAccumulator:
5 # Main Job Option for ACTS Track Reconstruction with ITk
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 # Pre-Processing
12 # Retrieve all the tracking passes
13 from InDetConfig.ITkActsHelpers import extractTrackingPasses
14 scheduledTrackingPasses = extractTrackingPasses(flags)
15 # Keep track of previous pass (used for PRD mapping)
16 previousExtension = None
17
18 # Track Collections to be merged for main track particle collection
19 # This is the groups of tracks generated in tracking passes that do not store
20 # tracks in separate containers
21 InputCombinedITkTracks = []
22
23 # Container names
24 trackParticleContainerName = "InDetTrackParticles"
25 primaryVertices = "PrimaryVertices"
26
27 # Reconstruction
28 from InDetConfig.ITkActsHelpers import isPrimaryPass, primaryPassUsesDevice, secondaryPassUsesDevice
29 for currentFlags in scheduledTrackingPasses:
30 # Printing configuration
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 # Data Preparation
48 # This includes Region-of-Interest creation, Cluster and Space Point formation
49 from InDetConfig.ITkActsDataPreparationConfig import ITkActsDataPreparationCfg
50 acc.merge(ITkActsDataPreparationCfg(currentFlags,
51 previousExtension = previousExtension))
52
53 # Track Reconstruction
54 # This includes Seeding, Track Finding (CKF) and Ambiguity Resolution
55 from InDetConfig.ITkActsPatternRecognitionConfig import ITkActsTrackReconstructionCfg
56 acc.merge(ITkActsTrackReconstructionCfg(currentFlags,
57 previousExtension = previousExtension))
58
59 # Update variables
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 # Track particle creation
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 # In case perigee expression is Vertex we have a situation where
72 # there is a first temporary track particle creation wrt BeamLine
73 # followed, after vertex reco, of a second particle creation wrt vertex
74 #
75 # The final track particle collection will still be the one defined in trackParticleContainerName
76 persistifyCollection = True
77 particleCollection = trackParticleContainerName
78 perigeeExpression = flags.Tracking.perigeeExpression
79 if flags.Tracking.perigeeExpression == "Vertex":
80 # We do not want to persistify this temporary collection
81 persistifyCollection = False
82 particleCollection = f"{trackParticleContainerName}Temporary"
83 perigeeExpression = "BeamLine"
84
85 # Track particles wrt BeamLine
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 # Vertex reconstruction
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 # Track particles wrt Vertex
102 #
103 # In case perigee expression is Vertex we need to schedule the final
104 # track particle creation using the vertex
105 # The track collection(s) unchanged, only the final track particle container
106 # has a different name
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 # Post-Processing
116 print('Starting Post-Processing')
117
118
121 if flags.Tracking.writeExtendedSi_PRDInfo:
122 # Get all the track particle collections being generated
123 # this covers the main tracking collection InDetTrackParticles
124 # as well as the converted seeds, tracks from CKF and all those
125 # track collection that do not get merged.
126 # This operation is necessary only if we desire to only persistify
127 # on-track PRD info, since we need to get all the measurements used by
128 # all tracks we want to persistify
129 generatedTrackParticleCollections = ["InDetTrackParticles"]
130 if flags.Tracking.PRDInfo.KeepOnlyOnTrackMeasurements:
131 from InDetConfig.ITkActsHelpers import getListOfGeneratedTrackParticles
132 generatedTrackParticleCollections = getListOfGeneratedTrackParticles(flags)
133
134 # Add the truth origin to the truth particles
135 # This handles:
136 # - Pixel detector
137 # - Strip detector
138 from InDetConfig.InDetPrepRawDataToxAODConfig import ITkActsPrepDataToxAODCfg
139 acc.merge(ITkActsPrepDataToxAODCfg(flags,
140 TrackParticles = generatedTrackParticleCollections))
141
142 # PLR measurements are produced as a dedicated sidecar container.
143 # They are never filtered to "on-track" subsets because PLR is not
144 # injected into the ITk tracking chain.
145 if flags.Detector.EnablePLR:
146 from ActsConfig.ActsObjectDecorationConfig import ActsPLRClusterMeasurementDecoratorAlgCfg
147 acc.merge(ActsPLRClusterMeasurementDecoratorAlgCfg(flags))
148
149 # Create MSOS on final InDetTrackParticles collection
150 from ActsConfig.ActsObjectDecorationConfig import ActsTrackStateOnSurfaceDecoratorAlgCfg
151 acc.merge(ActsTrackStateOnSurfaceDecoratorAlgCfg(flags,
152 name=f"Acts{trackParticleContainerName}StateOnSurfaceDecoratorAlg",
153 TrackParticles=trackParticleContainerName))
154
155 # Run on the specific tracking passes
156 for currentFlags in scheduledTrackingPasses:
157 # Particle persistification for tracking pass
158 from InDetConfig.ITkActsParticleCreationConfig import ITkActsTrackParticlePersistificationCfg
159 acc.merge(ITkActsTrackParticlePersistificationCfg(currentFlags))
160
161 # Create MSOS for the intermediate track particle collections
162 # this may be the CKF and/or the ambi tracks and can only happen if
163 # - storeSiSPSeededTracks for this tracking pass is requested
164 # - storeSeparateContainer for this tracking pass is requested
165 if flags.Tracking.writeExtendedSi_PRDInfo:
166 from ActsConfig.ActsObjectDecorationConfig import ActsTrackStateOnSurfaceDecoratorAlgCfg
167 # CKF tracks are called: SiSPSeededTracks{currentFlags.Tracking.ActiveConfig.extension}TrackParticles
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 # track collection can be the CKF or the ambi depending
178 # on the presence of the ambiguity resolution algorithm
179 # but the track particle collection remains the same
180 # name: InDet{currentFlags.Tracking.ActiveConfig.extension}TrackParticles
181 # (unless the pass overrides it via storedTrackParticlesExtension)
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)