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 82 of file TrkG4UserActionsConfig.py.

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

◆ MaterialStepRecorder()

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

Definition at line 38 of file TrkG4UserActionsConfig.py.

38def MaterialStepRecorder(configFlags, name="G4UA::ISFFullUserActionSvc", **kwargs):
39
40 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
41 from AthenaConfiguration.ComponentFactory import CompFactory
42
43 result = ComponentAccumulator()
44 #Setting up the CA
45 actionAcc = ComponentAccumulator()
46 actions = []
47 actions += [actionAcc.popToolsAndMerge(MaterialStepRecorderCfg(configFlags,**kwargs))]
48 actionAcc.setPrivateTools(actions)
49 MaterialStepRecorderAction = result.popToolsAndMerge(actionAcc)
50
51 actionList = MaterialStepRecorderAction
52 #We clear it here because UserActionsTools also wants kwargs, different
53 #from the tool above - probably this caq be improved...
54 kwargs_UATools = {}
55 kwargs_UATools.setdefault("UserActionTools",actionList)
56 result.addService(CompFactory.G4UA.UserActionSvc(name,**kwargs_UATools))
57
58 AthenaOutputStream=CompFactory.AthenaOutputStream
59 AthenaOutputStreamTool=CompFactory.AthenaOutputStreamTool
60 writingTool = AthenaOutputStreamTool( "MaterialStepCollectionStreamTool" )
61
62 outputStream = AthenaOutputStream(name = "MaterialStepCollectionStream",
63 WritingTool = writingTool,
64 ItemList=['EventInfo#*', 'Trk::MaterialStepCollection#*'],
65 MetadataItemList = [ "EventStreamInfo#MaterialStepCollectionStream", "IOVMetaDataContainer#*" ],
66 OutputFile = "MaterialStepCollection.root")
67
68 StoreGateSvc=CompFactory.StoreGateSvc
69 result.addService(StoreGateSvc("MetaDataStore"))
70 outputStream.MetadataStore = result.getService("MetaDataStore")
71
72 MakeEventStreamInfo=CompFactory.MakeEventStreamInfo
73 streamInfoTool = MakeEventStreamInfo( "MaterialStepCollectionStream_MakeEventStreamInfo" )
74 streamInfoTool.Key = "MaterialStepCollectionStream"
75 streamInfoTool.EventInfoKey = "EventInfo"
76 outputStream.HelperTools.append(streamInfoTool)
77
78 result.addEventAlgo(outputStream)
79
80 return result
81
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 material recorder action to defaults
31 actionList = (defaultActions + MaterialStepRecorderAction)
32
33 kwargs.setdefault("UserActionTools",actionList)
34 result.addService(CompFactory.G4UA.UserActionSvc(name,**kwargs), primary = True)
35
36 return result
37