ATLAS Offline Software
Loading...
Searching...
No Matches
ActsEgammaSelectedTrackCopyConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3""" Instantiate ActsEgammaSelectedTrackCopy with default configuration
4"""
5
6from AthenaCommon.Logging import logging
7from AthenaConfiguration.ComponentFactory import CompFactory
8from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
9
10
11def ActsEgammaSelectedTrackCopyCfg(flags, name="ActsEgammaSelectedTrackCopy", **kwargs):
12 acc = ComponentAccumulator()
13
14 assert flags.Acts.TrackingGeometry.UseBlueprint, "Must use ACTS Gen3 geometry"
15 assert flags.Detector.GeometryCalo, "Calorimeter must be enabled"
16
17 # I guess it makes sense to enforce ITk here, though technical one can run this with
18 # Calo geometry only...
19 assert flags.Detector.GeometryITk
20
21 if "TrackingGeometryTool" not in kwargs:
22 from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
23 kwargs["TrackingGeometryTool"] = acc.getPrimaryAndMerge(ActsTrackingGeometryToolCfg(flags))
24
25 if "egammaCaloClusterSelector" not in kwargs:
26 from egammaCaloTools.egammaCaloToolsConfig import (
27 egammaCaloClusterSelectorGSFCfg,
28 )
29
30 kwargs["egammaCaloClusterSelector"] = acc.popToolsAndMerge(
31 egammaCaloClusterSelectorGSFCfg(flags)
32 )
33
34 if 'ExtrapolationTool' not in kwargs:
35 from ActsConfig.ActsGeometryConfig import ActsExtrapolationToolCfg
36 kwargs.setdefault(
37 "ExtrapolationTool",
38 acc.popToolsAndMerge(ActsExtrapolationToolCfg(flags, MaxSteps=10000)),
39 ) # PrivateToolHandle
40
41 kwargs.setdefault("ClusterContainerName",
42 flags.Egamma.Keys.Internal.EgammaTopoClusters)
43 kwargs.setdefault("TrackParticleContainerName",
44 flags.Egamma.Keys.Input.TrackParticles)
45 kwargs.setdefault("OutputTrkPartContainerName",
46 flags.Egamma.Keys.Output.TrkPartContainerName)
47
48 kwargs.setdefault(
49 "ExtraInputs",
50 [
51 (
52 "InDetDD::SiDetectorElementCollection",
53 "ConditionStore+ITkPixelDetectorElementCollection",
54 ),
55 (
56 "InDetDD::SiDetectorElementCollection",
57 "ConditionStore+ITkStripDetectorElementCollection",
58 ),
59 ],
60 )
61
62 actsEgseltrkcpAlg = CompFactory.ActsEgammaSelectedTrackCopy(name, **kwargs)
63
64 acc.addEventAlgo(actsEgseltrkcpAlg)
65 return acc
66
67
68if __name__ == "__main__":
69 from AthenaConfiguration.AllConfigFlags import initConfigFlags
70 from AthenaConfiguration.TestDefaults import defaultTestFiles
71 from AthenaConfiguration.ComponentAccumulator import printProperties
72 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
73 flags = initConfigFlags()
74 flags.Input.Files = defaultTestFiles.RDO_RUN2
75 flags.lock()
76
77 acc = MainServicesCfg(flags)
78 acc.merge(ActsEgammaSelectedTrackCopyCfg(flags))
79 mlog = logging.getLogger("ActsEgammaSelectedTrackCopyConfigTest")
80 mlog.info("Configuring ActsEgammaSelectedTrackCopy: ")
81 printProperties(
82 mlog,
83 acc.getEventAlgo("ActsEgammaSelectedTrackCopy"),
84 nestLevel=1,
85 printDefaults=True,
86 )
87 with open("ActsEgammaSelectedTrackCopy.pkl", "wb") as f:
88 acc.store(f)
ActsEgammaSelectedTrackCopyCfg(flags, name="ActsEgammaSelectedTrackCopy", **kwargs)