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

Functions

ComponentAccumulator ITkActsTrackParticleCreationCfg (flags, *, list[str] TrackContainers, str TrackParticleContainer, bool persistifyCollection=True, str PerigeeExpression=None)
ComponentAccumulator ITkActsTrackParticlePersistificationCfg (flags)

Function Documentation

◆ ITkActsTrackParticleCreationCfg()

ComponentAccumulator python.ITkActsParticleCreationConfig.ITkActsTrackParticleCreationCfg ( flags,
* ,
list[str] TrackContainers,
str TrackParticleContainer,
bool persistifyCollection = True,
str PerigeeExpression = None )

Definition at line 4 of file ITkActsParticleCreationConfig.py.

9 PerigeeExpression: str = None) -> ComponentAccumulator:
10 # This function does the following:
11 # - Creates track particles from a collection of track containers
12 # - Attaches truth decoration to the track particles
13 # - Persistifies the track particles
14 # The function will be called within the loop on the tracking passes, if the uses asks
15 # for collections to be stored in different containers, as well as just before the primary
16 # vertex reconstruction, on the ensamble of track collections requested during reconstruction
17 # (but always on the primary pass tracks)
18
19 assert isinstance(TrackContainers, list)
20 for container in TrackContainers:
21 assert isinstance(container, str)
22
23 # Set the perigee expression to be used for track particle creation
24 # This is used by Heavy Ion configuration
25 if PerigeeExpression is None:
26 PerigeeExpression = flags.Tracking.perigeeExpression
27
28 print("Storing track and track particle containers:")
29 print(f"- track collection(s): {TrackContainers}")
30 print(f"- track particle collection: {TrackParticleContainer}")
31
32 acc = ComponentAccumulator()
33
34 prefix = "ActsCombined" if not flags.hasCategory("Tracking.ActiveConfig") else flags.Tracking.ActiveConfig.extension
35 prefix += f"To{TrackParticleContainer}"
36 from ActsConfig.ActsEventCnvConfig import ActsTrackToTrackParticleCnvAlgCfg, xAODtoTrkConverterAlgCfg
37 acc.merge(ActsTrackToTrackParticleCnvAlgCfg(flags,
38 name = f"{prefix}TrackToTrackParticleCnvAlg",
39 ACTSTracksLocation = TrackContainers,
40 TrackParticlesOutKey = TrackParticleContainer,
41 PerigeeExpression = PerigeeExpression))
42
44 if flags.Acts.doxAODToTrkConversion and \
45 "Temporary" not in TrackParticleContainer and \
46 "Seed" not in TrackParticleContainer:
47 acc.merge(xAODtoTrkConverterAlgCfg(flags,
48 name=f"{prefix}TrackParticleToTrkCnvAlg",
49 TrackParticles = TrackParticleContainer,
50 OutTrackContainer="Combined{tracks}Tracks".format(tracks =
51 TrackParticleContainer[:TrackParticleContainer.rfind("Track")]) ))
52 if flags.Tracking.doTruth :
53 from AthenaCommon.Constants import WARNING, INFO
54 track_to_truth_maps = []
55 from ActsConfig.ActsTruthConfig import ActsTrackParticleTruthDecorationAlgCfg
56 for trackContainer in TrackContainers:
57 track_to_truth_maps.append(f"{trackContainer}ToTruthParticleAssociation")
58 acc.merge(ActsTrackParticleTruthDecorationAlgCfg(flags,
59 name = f'{prefix}TruthDecorationAlg',
60 TrackToTruthAssociationMaps = track_to_truth_maps,
61 TrackParticleContainerName = TrackParticleContainer,
62 OutputLevel = WARNING if len(TrackContainers)==1 else INFO,
63 ComputeTrackRecoEfficiency = False if len(TrackContainers)==1 else True))
64
65 # Additional decorations
66 if flags.Acts.storeTrackStateInfo:
67 from ActsConfig.ActsObjectDecorationConfig import ActsMeasurementToTrackParticleDecorationAlgCfg
68 acc.merge(ActsMeasurementToTrackParticleDecorationAlgCfg(flags,
69 name = f"ActsMeasurementTo{TrackParticleContainer}DecorationAlg",
70 TrackParticleKey = TrackParticleContainer))
71
72 if flags.Acts.Particles.doAnalysis:
73 from ActsConfig.ActsAnalysisConfig import ActsResidualAnalysisAlgCfg
74 acc.merge(ActsResidualAnalysisAlgCfg(flags,
75 name = f"Acts{TrackParticleContainer}ResidualAnalysisAlg",
76 TrackParticles = TrackParticleContainer))
77
78 # Persistification
79 # By default this is always happening, but in the case the perigee strategy is set
80 # to Vertex we need to create a temporary track particle collection wrt the BeamLine
81 # which does not need to be persistified
82 if persistifyCollection:
83 from ActsConfig.ActsPersistificationConfig import PersistifyTrackParticles
84 acc.merge(PersistifyTrackParticles(flags,
85 trackParticleCollections=[TrackParticleContainer]))
86 return acc
87
88
void print(char *figname, TCanvas *c1)

◆ ITkActsTrackParticlePersistificationCfg()

ComponentAccumulator python.ITkActsParticleCreationConfig.ITkActsTrackParticlePersistificationCfg ( flags)

Definition at line 89 of file ITkActsParticleCreationConfig.py.

89def ITkActsTrackParticlePersistificationCfg(flags) -> ComponentAccumulator:
90 acc = ComponentAccumulator()
91 # Particle creation and persistification
92 # Tracks from CKF and SiSPSeededTracks{extension}TrackParticles
93 if flags.Tracking.ActiveConfig.storeSiSPSeededTracks:
94 # Naming convention for track particles: SiSPSeededTracks{extension}TrackParticles
95 TrackParticleContainer = f'SiSPSeededTracks{flags.Tracking.ActiveConfig.extension}TrackParticles'
96 acc.merge(ITkActsTrackParticleCreationCfg(flags,
97 TrackContainers = [f"{flags.Tracking.ActiveConfig.extension}Tracks"],
98 TrackParticleContainer = TrackParticleContainer))
99
100
101 # Track from CKF or ambiguity resolution if we want separate containers
102 # In case no ambiguity resolution is scheduled, the CKF tracks will be used instead of those from the ambiguity resolution
103 if flags.Tracking.ActiveConfig.storeSeparateContainer:
104 # If we do not want the track collection to be merged with another collection
105 # then we immediately create the track particles from it
106 # Naming convention for track particles: InDet{extension}TrackParticles
107 # (unless the pass overrides it via storedTrackParticlesExtension)
108 acts_tracks = f"{flags.Tracking.ActiveConfig.extension}Tracks" if not flags.Acts.doAmbiguityResolution else f"{flags.Tracking.ActiveConfig.extension}ResolvedTracks"
109 from InDetConfig.ITkActsHelpers import separateTrackParticleContainerName
110 TrackParticles = separateTrackParticleContainerName(flags)
111 acc.merge(ITkActsTrackParticleCreationCfg(flags,
112 TrackContainers = [acts_tracks],
113 TrackParticleContainer = TrackParticles))
114
115 return acc