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.ActsTrackFindingConfig import ActsTrackToTrackParticleCnvAlgCfg
37 acc.merge(ActsTrackToTrackParticleCnvAlgCfg(flags,
38 name = f"{prefix}TrackToTrackParticleCnvAlg",
39 ACTSTracksLocation = TrackContainers,
40 TrackParticlesOutKey = TrackParticleContainer,
41 PerigeeExpression = PerigeeExpression))
42
43 if flags.Tracking.doTruth :
44 from AthenaCommon.Constants import WARNING, INFO
45 track_to_truth_maps = []
46 from ActsConfig.ActsTruthConfig import ActsTrackParticleTruthDecorationAlgCfg
47 for trackContainer in TrackContainers:
48 track_to_truth_maps.append(f"{trackContainer}ToTruthParticleAssociation")
49 acc.merge(ActsTrackParticleTruthDecorationAlgCfg(flags,
50 name = f'{prefix}TruthDecorationAlg',
51 TrackToTruthAssociationMaps = track_to_truth_maps,
52 TrackParticleContainerName = TrackParticleContainer,
53 OutputLevel = WARNING if len(TrackContainers)==1 else INFO,
54 ComputeTrackRecoEfficiency = False if len(TrackContainers)==1 else True))
55
56 # Additional decorations
57 if flags.Acts.storeTrackStateInfo:
58 from ActsConfig.ActsObjectDecorationConfig import ActsMeasurementToTrackParticleDecorationAlgCfg
59 acc.merge(ActsMeasurementToTrackParticleDecorationAlgCfg(flags,
60 name = f"ActsMeasurementTo{TrackParticleContainer}DecorationAlg",
61 TrackParticleKey = TrackParticleContainer))
62
63 if flags.Acts.Particles.doAnalysis:
64 from ActsConfig.ActsAnalysisConfig import ActsResidualAnalysisAlgCfg
65 acc.merge(ActsResidualAnalysisAlgCfg(flags,
66 name = f"Acts{TrackParticleContainer}ResidualAnalysisAlg",
67 TrackParticles = TrackParticleContainer))
68
69 # Persistification
70 # By default this is always happening, but in the case the perigee strategy is set
71 # to Vertex we need to create a temporary track particle collection wrt the BeamLine
72 # which does not need to be persistified
73 if persistifyCollection:
74 toAOD = []
75 trackparticles_shortlist = [] if flags.Acts.EDM.PersistifyTracks else ['-actsTrack']
76 trackparticles_variables = ".".join(trackparticles_shortlist)
77 toAOD += [f"xAOD::TrackParticleContainer#{TrackParticleContainer}",
78 f"xAOD::TrackParticleAuxContainer#{TrackParticleContainer}Aux." + trackparticles_variables]
79
80 from OutputStreamAthenaPool.OutputStreamConfig import addToAOD
81 acc.merge(addToAOD(flags, toAOD))
82
83 return acc
84
85
void print(char *figname, TCanvas *c1)

◆ ITkActsTrackParticlePersistificationCfg()

ComponentAccumulator python.ITkActsParticleCreationConfig.ITkActsTrackParticlePersistificationCfg ( flags)

Definition at line 86 of file ITkActsParticleCreationConfig.py.

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