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 
14 def 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 
28 def 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
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename R::value_type > sorted(const R &r, PROJ proj={})
Helper function to create a sorted vector from an unsorted range.
python.HelperUtils.SetToolProperties
def SetToolProperties(theTool, **kw)
Definition: HelperUtils.py:28
python.HelperUtils.GetTool
def GetTool(theTool)
============================================================================= Name: HelperUtils....
Definition: HelperUtils.py:14