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 "egammaCaloClusterSelector" not in kwargs:
22 from egammaCaloTools.egammaCaloToolsConfig import (
23 egammaCaloClusterSelectorGSFCfg,
24 )
25
26 kwargs["egammaCaloClusterSelector"] = acc.popToolsAndMerge(
27 egammaCaloClusterSelectorGSFCfg(flags)
28 )
29
30 if 'ExtrapolationTool' not in kwargs:
31 from ActsConfig.ActsGeometryConfig import ActsExtrapolationToolCfg
32 kwargs.setdefault(
33 "ExtrapolationTool",
34 acc.popToolsAndMerge(ActsExtrapolationToolCfg(flags, MaxSteps=10000)),
35 ) # PrivateToolHandle
36
37 kwargs.setdefault("ClusterContainerName",
38 flags.Egamma.Keys.Internal.EgammaTopoClusters)
39 kwargs.setdefault("TrackParticleContainerName",
40 flags.Egamma.Keys.Input.TrackParticles)
41 kwargs.setdefault("OutputTrkPartContainerName",
42 flags.Egamma.Keys.Output.TrkPartContainerName)
43
44 kwargs.setdefault(
45 "ExtraInputs",
46 [
47 (
48 "InDetDD::SiDetectorElementCollection",
49 "ConditionStore+ITkPixelDetectorElementCollection",
50 ),
51 (
52 "InDetDD::SiDetectorElementCollection",
53 "ConditionStore+ITkStripDetectorElementCollection",
54 ),
55 ],
56 )
57
58 actsEgseltrkcpAlg = CompFactory.ActsEgammaSelectedTrackCopy(name, **kwargs)
59
60 acc.addEventAlgo(actsEgseltrkcpAlg)
61 return acc
62
63
64if __name__ == "__main__":
65 from AthenaConfiguration.AllConfigFlags import initConfigFlags
66 from AthenaConfiguration.TestDefaults import defaultTestFiles
67 from AthenaConfiguration.ComponentAccumulator import printProperties
68 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
69 flags = initConfigFlags()
70 flags.Input.Files = defaultTestFiles.RDO_RUN2
71 flags.lock()
72
73 acc = MainServicesCfg(flags)
74 acc.merge(ActsEgammaSelectedTrackCopyCfg(flags))
75 mlog = logging.getLogger("ActsEgammaSelectedTrackCopyConfigTest")
76 mlog.info("Configuring ActsEgammaSelectedTrackCopy: ")
77 printProperties(
78 mlog,
79 acc.getEventAlgo("ActsEgammaSelectedTrackCopy"),
80 nestLevel=1,
81 printDefaults=True,
82 )
83 with open("ActsEgammaSelectedTrackCopy.pkl", "wb") as f:
84 acc.store(f)
ActsEgammaSelectedTrackCopyCfg(flags, name="ActsEgammaSelectedTrackCopy", **kwargs)