ATLAS Offline Software
Loading...
Searching...
No Matches
HelperUtils.py
Go to the documentation of this file.
1# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
2
3
12
13
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
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
SetToolProperties(theTool, **kw)
GetTool(theTool)
============================================================================= Name: HelperUtils....