ATLAS Offline Software
Loading...
Searching...
No Matches
ActsMaterialConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3def MaterialTrackRecorderCfg(configFlags, name="ActsTrk::UserActionSvc.MaterialTrackRecorderTool", **kwargs):
4 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5 from AthenaConfiguration.ComponentFactory import CompFactory
6 acc = ComponentAccumulator()
7 acc.setPrivateTools(CompFactory.ActsTrk.MaterialTrackRecorderTool(name, **kwargs))
8 return acc
9
10
11def MaterialTrackRecorderUserActionSvcCfg(configFlags, name="ActsTrk::MaterialTrackRecorderUserActionSvc", **kwargs):
12 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
13 from AthenaConfiguration.ComponentFactory import CompFactory
14
15 acc = ComponentAccumulator()
16
17 #Setting up the CA for the MaterialStepRecorder
18 actionAcc = ComponentAccumulator()
19 actions = []
20 actions += [actionAcc.popToolsAndMerge(MaterialTrackRecorderCfg(configFlags))]
21 actionAcc.setPrivateTools(actions)
22 MaterialTrackRecorderAction = acc.popToolsAndMerge(actionAcc)
23
24 #Retrieving the default action list
25 from G4AtlasServices.G4AtlasUserActionConfig import getDefaultActions
26 defaultActions = acc.popToolsAndMerge(getDefaultActions(configFlags))
27
28 #Adding material recorder action to defaults
29 actionList = (defaultActions + MaterialTrackRecorderAction)
30
31 kwargs.setdefault("UserActionTools",actionList)
32 acc.addService(CompFactory.G4UA.UserActionSvc(name,**kwargs), primary = True)
33
34 return acc
35
36def MaterialTrackWriterCfg(configFlags, name="MaterialTrackWriter", **kwargs) :
37 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
38 from AthenaConfiguration.ComponentFactory import CompFactory
39 acc = ComponentAccumulator()
40
41 # Need geometry
42 from ActsConfig.ActsGeometryConfig import ActsTrackingGeometrySvcCfg
43 acc.merge( ActsTrackingGeometrySvcCfg(configFlags,
44 RunConsistencyChecks=False,
45 ObjDebugOutput=False))
46
47 acc.addEventAlgo(CompFactory.ActsTrk.MaterialTrackWriter(name, **kwargs), primary = True)
48
49 return acc
50
MaterialTrackWriterCfg(configFlags, name="MaterialTrackWriter", **kwargs)
MaterialTrackRecorderCfg(configFlags, name="ActsTrk::UserActionSvc.MaterialTrackRecorderTool", **kwargs)
MaterialTrackRecorderUserActionSvcCfg(configFlags, name="ActsTrk::MaterialTrackRecorderUserActionSvc", **kwargs)