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

Functions

 GetTool (theTool)
 ============================================================================= Name: HelperUtils.py
 SetToolProperties (theTool, **kw)

Function Documentation

◆ GetTool()

python.HelperUtils.GetTool ( theTool)

============================================================================= Name: HelperUtils.py

Author: Karsten Koeneke (CERN) Created: October 2011

Description: Define some useful helpers. These cannot rely on Athena!


Try to get the underlying ROOT tool, if needed.

Definition at line 14 of file HelperUtils.py.

14def GetTool(theTool):
15 """
16 Try to get the underlying ROOT tool, if needed.
17 """
18 try:
19 theTool = theTool.getRootTool()
20 pass
21 except AttributeError :
22 theTool = theTool
23 pass
24 return theTool
25
26
27

◆ SetToolProperties()

python.HelperUtils.SetToolProperties ( theTool,
** kw )
Get all provided properties and overwrite the default values with them

Definition at line 28 of file HelperUtils.py.

28def SetToolProperties( theTool, **kw ):
29 """
30 Get all provided properties and overwrite the default values with them
31 """
32 keys = sorted( kw.keys() )
33 for key in keys:
34 if hasattr( theTool, key ):
35 setattr( theTool, key, kw[key] )
36 pass
37 else:
38 print ("(SetToolProperties) ERROR: Could NOT find property %s for tool with name %s" % (key, theTool.getName()))
39 pass
40 pass
41 pass