3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
8 types = (
'xAOD::TrackSummaryContainer',
9 'xAOD::TrackStateContainer',
10 'xAOD::TrackParametersContainer',
11 'xAOD::TrackJacobianContainer',
12 'xAOD::TrackMeasurementContainer',
13 'xAOD::TrackSurfaceContainer')
15 postFixes = (
'TrackSummary',
25 for el
in TrackBackends.postFixes:
30 for el
in TrackBackends.postFixes:
31 message += f
"{el}={self.collections[el]} "
37 assert isinstance(collection, str)
38 for el
in TrackBackends.postFixes:
39 if collection.endswith(el):
40 return collection.replace(el,
"")
42 raise Exception(f
"Collection {collection} is a NOT KNOWN ACTS track backend, prefix could not be deduced")
52 collection: str) ->
None:
53 assert isinstance(collection, str)
54 for el
in TrackBackends.postFixes:
55 if collection.endswith(el):
57 raise Exception(f
"Trying to add collection '{collection}', but this backend is already recorded")
61 raise Exception(f
"Collection {collection} is a NOT KNOWN ACTS track backend")
64 prefix: str) -> ComponentAccumulator:
65 assert isinstance(prefix, str)
67 Setup algorithm that reads xAOD track backends and produced TrackContainer
68 name - the collections prefix, for consistency it also is the prefix of the output container name
71 from ActsConfig.ActsGeometryConfig
import ActsTrackingGeometryToolCfg
72 acc.addEventAlgo(CompFactory.ActsTrk.TrackContainerReader(f
"{prefix}TrackContainerReaderAlg",
73 TrackContainer=prefix+
"Tracks",
82 from InDetConfig.InDetPoolReadConfig
import InDetPoolReadCfg
86 typedCollections = flags.Input.TypedCollections
88 for typedCollection
in typedCollections:
89 [colType, colName] = typedCollection.split(
'#')
92 if colType
in TrackBackends.types:
93 prefix = TrackBackends.extractPrefix(collection=colName)
94 StoredTracks[prefix] = StoredTracks.get(prefix,
TrackBackends())
98 for (key, backends)
in StoredTracks.items():
99 if not backends.isValid():
100 raise Exception(f
'Track backends with prefix {key} are not consistent. Be sure all the backends have been properly persistified in the file: {backends}')
106 if __name__ ==
"__main__":
108 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
109 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
114 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
120 if status.isFailure():
122 sys.exit(
"Execution failed")