ATLAS Offline Software
Loading...
Searching...
No Matches
python.TrkG4UserActionsConfig Namespace Reference

Functions

 MaterialStepRecorderCfg (configFlags, name="G4UA::UserActionSvc.MaterialStepRecorderTool", **kwargs)
 MaterialStepRecorderUserActionSvcCfg (configFlags, name="G4UA::MaterialStepRecorderUserActionSvc", **kwargs)
 MaterialStepRecorder (configFlags, name="G4UA::ISFFullUserActionSvc", **kwargs)
 GeantFollowerMSToolCfg (configFlags, name="G4UA::GeantFollowerMSTool", **kwargs)

Detailed Description

Define methods to configure TrkG4UserActions

Function Documentation

◆ GeantFollowerMSToolCfg()

python.TrkG4UserActionsConfig.GeantFollowerMSToolCfg ( configFlags,
name = "G4UA::GeantFollowerMSTool",
** kwargs )

Definition at line 86 of file TrkG4UserActionsConfig.py.

86def GeantFollowerMSToolCfg(configFlags, name="G4UA::GeantFollowerMSTool", **kwargs):
87 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
88 from AthenaConfiguration.ComponentFactory import CompFactory
89
90 THistSvc= CompFactory.THistSvc
91 result = ComponentAccumulator()
92 histsvc = THistSvc(name="THistSvc")
93 histsvc.Output = ["val DATAFILE='GeantFollowing.root' OPT='RECREATE'"]
94 result.addService(histsvc)
95 result.setPrivateTools(CompFactory.G4UA.GeantFollowerMSTool(name, **kwargs))
96
97 return result

◆ MaterialStepRecorder()

python.TrkG4UserActionsConfig.MaterialStepRecorder ( configFlags,
name = "G4UA::ISFFullUserActionSvc",
** kwargs )

Definition at line 42 of file TrkG4UserActionsConfig.py.

42def MaterialStepRecorder(configFlags, name="G4UA::ISFFullUserActionSvc", **kwargs):
43
44 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
45 from AthenaConfiguration.ComponentFactory import CompFactory
46
47 result = ComponentAccumulator()
48 #Setting up the CA
49 actionAcc = ComponentAccumulator()
50 actions = []
51 actions += [actionAcc.popToolsAndMerge(MaterialStepRecorderCfg(configFlags,**kwargs))]
52 actionAcc.setPrivateTools(actions)
53 MaterialStepRecorderAction = result.popToolsAndMerge(actionAcc)
54
55 actionList = MaterialStepRecorderAction
56 #We clear it here because UserActionsTools also wants kwargs, different
57 #from the tool above - probably this caq be improved...
58 kwargs_UATools = {}
59 kwargs_UATools.setdefault("UserActionTools",actionList)
60 result.addService(CompFactory.G4UA.UserActionSvc(name,**kwargs_UATools))
61
62 AthenaOutputStream=CompFactory.AthenaOutputStream
63 AthenaOutputStreamTool=CompFactory.AthenaOutputStreamTool
64 writingTool = AthenaOutputStreamTool( "MaterialStepCollectionStreamTool" )
65
66 outputStream = AthenaOutputStream(name = "MaterialStepCollectionStream",
67 WritingTool = writingTool,
68 ItemList=['EventInfo#*', 'Trk::MaterialStepCollection#*'],
69 MetadataItemList = [ "EventStreamInfo#MaterialStepCollectionStream", "IOVMetaDataContainer#*" ],
70 OutputFile = "MaterialStepCollection.root")
71
72 StoreGateSvc=CompFactory.StoreGateSvc
73 result.addService(StoreGateSvc("MetaDataStore"))
74 outputStream.MetadataStore = result.getService("MetaDataStore")
75
76 MakeEventStreamInfo=CompFactory.MakeEventStreamInfo
77 streamInfoTool = MakeEventStreamInfo( "MaterialStepCollectionStream_MakeEventStreamInfo" )
78 streamInfoTool.Key = "MaterialStepCollectionStream"
79 streamInfoTool.EventInfoKey = "EventInfo"
80 outputStream.HelperTools.append(streamInfoTool)
81
82 result.addEventAlgo(outputStream)
83
84 return result
85
This is the implementation of IAthenaOutputStreamTool.
algorithm that marks for write data objects in SG
This class provides an algorithm to make the EventStreamInfo object and update it.
The Athena Transient Store API.

◆ MaterialStepRecorderCfg()

python.TrkG4UserActionsConfig.MaterialStepRecorderCfg ( configFlags,
name = "G4UA::UserActionSvc.MaterialStepRecorderTool",
** kwargs )

Definition at line 5 of file TrkG4UserActionsConfig.py.

5def MaterialStepRecorderCfg(configFlags, name="G4UA::UserActionSvc.MaterialStepRecorderTool", **kwargs):
6 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
7 from AthenaConfiguration.ComponentFactory import CompFactory
8 result = ComponentAccumulator()
9 result.setPrivateTools(CompFactory.G4UA.MaterialStepRecorderTool(name, **kwargs))
10 return result
11
12

◆ MaterialStepRecorderUserActionSvcCfg()

python.TrkG4UserActionsConfig.MaterialStepRecorderUserActionSvcCfg ( configFlags,
name = "G4UA::MaterialStepRecorderUserActionSvc",
** kwargs )

Definition at line 13 of file TrkG4UserActionsConfig.py.

13def MaterialStepRecorderUserActionSvcCfg(configFlags, name="G4UA::MaterialStepRecorderUserActionSvc", **kwargs):
14 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
15 from AthenaConfiguration.ComponentFactory import CompFactory
16
17 result = ComponentAccumulator()
18
19 #Setting up the CA for the MaterialStepRecorder
20 actionAcc = ComponentAccumulator()
21 actions = []
22 actions += [actionAcc.popToolsAndMerge(MaterialStepRecorderCfg(configFlags))]
23 actionAcc.setPrivateTools(actions)
24 MaterialStepRecorderAction = result.popToolsAndMerge(actionAcc)
25
26 #Retrieving the default action list
27 from G4AtlasServices.G4AtlasUserActionConfig import getDefaultActions
28 defaultActions = result.popToolsAndMerge(getDefaultActions(configFlags))
29
30 #Adding LengthIntegrator to defaults
31 actionList = (defaultActions + MaterialStepRecorderAction)
32
33 #Setting up UserActionsService
34
36 kwargs_UATools = {}
37 kwargs_UATools.setdefault("UserActionTools",actionList)
38 result.addService(CompFactory.G4UA.UserActionSvc(name,**kwargs_UATools))
39
40 return result
41