ATLAS Offline Software
ActsPostIncludes.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 
5 def PersistifyActsEDMCfg(flags) -> ComponentAccumulator:
7 
8  toAOD = []
9 
10  if flags.Acts.EDM.PersistifyClusters or flags.Acts.EDM.PersistifySpacePoints:
11  pixel_cluster_shortlist = ['-pixelClusterLink']
12  strip_cluster_shortlist = ['-sctClusterLink']
13 
14  pixel_cluster_variables = '.'.join(pixel_cluster_shortlist)
15  strip_cluster_variables = '.'.join(strip_cluster_shortlist)
16 
17  toAOD += ['xAOD::PixelClusterContainer#ITkPixelClusters',
18  'xAOD::PixelClusterAuxContainer#ITkPixelClustersAux.' + pixel_cluster_variables,
19  'xAOD::StripClusterContainer#ITkStripClusters',
20  'xAOD::StripClusterAuxContainer#ITkStripClustersAux.' + strip_cluster_variables]
21 
22  if flags.Reco.EnableHGTDExtension:
23  hgtd_cluster_shortlist = ['-hgtdClusterLink']
24 
25  hgtd_cluster_variables = '.'.join(hgtd_cluster_shortlist)
26 
27  toAOD += ['xAOD::HGTDClusterContainer#HGTD_Clusters',
28  'xAOD::HGTDClusterAuxContainer#HGTD_ClustersAux.' + hgtd_cluster_variables]
29 
30  if flags.Acts.doITkConversion:
31  toAOD += ['xAOD::StripClusterContainer#ITkConversionStripClusters',
32  'xAOD::StripClusterAuxContainer#ITkConversionStripClustersAux.' + strip_cluster_variables]
33 
34  if flags.Acts.EDM.PersistifySpacePoints:
35  pixel_spacepoint_shortlist = ['-measurements',
36  '-pixelSpacePointLink']
37  strip_spacepoint_shortlist = ['topHalfStripLength',
38  'bottomHalfStripLength',
39  'topStripDirection',
40  'bottomStripDirection',
41  'stripCenterDistance',
42  'topStripCenter',
43  'measurementLink']
44 
45  pixel_spacepoint_variables = '.'.join(pixel_spacepoint_shortlist)
46  strip_spacepoint_variables = '.'.join(strip_spacepoint_shortlist)
47 
48  toAOD += ['xAOD::SpacePointContainer#ITkPixelSpacePoints',
49  'xAOD::SpacePointAuxContainer#ITkPixelSpacePointsAux.' + pixel_spacepoint_variables,
50  'xAOD::SpacePointContainer#ITkStripSpacePoints',
51  'xAOD::SpacePointAuxContainer#ITkStripSpacePointsAux.' + strip_spacepoint_variables,
52  'xAOD::SpacePointContainer#ITkStripOverlapSpacePoints',
53  'xAOD::SpacePointAuxContainer#ITkStripOverlapSpacePointsAux.' + strip_spacepoint_variables]
54 
55  if flags.Acts.EDM.PersistifyTracks:
56  trackPrefixes = ['Acts', 'ActsResolved',
57  'ActsLargeRadius', 'ActsLargeRadiusResolved',
58  'ActsConversion', 'ActsConversionResolved',
59  'ActsHeavyIon', 'ActsHeavyIonResolved']
60  for prefix in trackPrefixes:
61  toAOD += [f"xAOD::TrackSummaryContainer#{prefix}TrackSummary",
62  f"xAOD::TrackSummaryAuxContainer#{prefix}TrackSummaryAux.",
63  f"xAOD::TrackStateContainer#{prefix}TrackStates",
64  f"xAOD::TrackStateAuxContainer#{prefix}TrackStatesAux.-uncalibratedMeasurement",
65  f"xAOD::TrackParametersContainer#{prefix}TrackParameters",
66  f"xAOD::TrackParametersAuxContainer#{prefix}TrackParametersAux.",
67  f"xAOD::TrackJacobianContainer#{prefix}TrackJacobians",
68  f"xAOD::TrackJacobianAuxContainer#{prefix}TrackJacobiansAux.",
69  f"xAOD::TrackMeasurementContainer#{prefix}TrackMeasurements",
70  f"xAOD::TrackMeasurementAuxContainer#{prefix}TrackMeasurementsAux.",
71  f"xAOD::TrackSurfaceContainer#{prefix}TrackStateSurfaces",
72  f"xAOD::TrackSurfaceAuxContainer#{prefix}TrackStateSurfacesAux.",
73  f"xAOD::TrackSurfaceContainer#{prefix}TrackSurfaces",
74  f"xAOD::TrackSurfaceAuxContainer#{prefix}TrackSurfacesAux."]
75 
76  # add track particles created by the Acts TrackToTrackParticleCnvAlg to the AOD
77  trackCnvPrefixes = ["ActsCombined"]
78  trackparticles_shortlist = [] if flags.Acts.EDM.PersistifyTracks else ['-actsTrack']
79  trackparticles_variables = ".".join(trackparticles_shortlist)
80  for prefix in trackCnvPrefixes:
81  toAOD += [f"xAOD::TrackParticleContainer#{prefix}TracksParticlesAlt",
82  f"xAOD::TrackParticleAuxContainer#{prefix}TracksParticlesAltAux." + trackparticles_variables]
83 
84  # If there is nothing to persistify, returns an empty CA
85  if len(toAOD) == 0:
86  return acc
87 
88  from OutputStreamAthenaPool.OutputStreamConfig import addToAOD
89  acc.merge(addToAOD(flags, toAOD))
90  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.OutputStreamConfig.addToAOD
def addToAOD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:142
ActsPostIncludes.PersistifyActsEDMCfg
ComponentAccumulator PersistifyActsEDMCfg(flags)
Definition: ActsPostIncludes.py:5