ATLAS Offline Software
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 from __future__ import print_function
14 
15 def GetTool(theTool):
16  """
17  Try to get the underlying ROOT tool, if needed.
18  """
19  try:
20  theTool = theTool.getRootTool()
21  pass
22  except AttributeError :
23  theTool = theTool
24  pass
25  return theTool
26 
27 
28 
29 def SetToolProperties( theTool, **kw ):
30  """
31  Get all provided properties and overwrite the default values with them
32  """
33  keys = sorted( kw.keys() )
34  for key in keys:
35  if hasattr( theTool, key ):
36  setattr( theTool, key, kw[key] )
37  pass
38  else:
39  print ("(SetToolProperties) ERROR: Could NOT find property %s for tool with name %s" % (key, theTool.getName()))
40  pass
41  pass
42  pass
python.HelperUtils.SetToolProperties
def SetToolProperties(theTool, **kw)
Definition: HelperUtils.py:29
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
python.HelperUtils.GetTool
def GetTool(theTool)
Definition: HelperUtils.py:15