ATLAS Offline Software
ConfiguredAsgElectronRingerSelector.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
2 
3 
13 
14 from RingerSelectorTools.ElectronRingerSelectorMapping import ElectronRingerMap
15 
16 def ConfiguredAsgElectronRingerSelector( quality, menu, cutIDConfDict = None, **kwargs ):
17  """
18  Configure the AsgElectronRingerSelector with the quality cuts
19  and allow for setting its configurable properties through
20  cutIDConfDict and kwargs arguments.
21 
22  Use cutIDConfDict argument to set the properties from the CutIDSelector.
23  It can also be set directly by setting the property CutIDSelector through
24  kwargs. Beware not to set them together, as setting CutIDSelector
25  through kwargs will overwrite cutIDConfDict configurations and, thus, it
26  will be the only configuration used for the job.
27  """
28  try:
29  RingerSelectorConfigurable = ElectronRingerMap[(quality, menu)]
30 
31  if cutIDConfDict is None:
32  cutIDConfDict = {}
33  # Configure it
34  ringerSelectorTool = RingerSelectorConfigurable(cutIDConfDict = cutIDConfDict,
35  **kwargs)
36  return ringerSelectorTool
37  except KeyError:
38  from AthenaCommon.Logging import logging
39  import traceback
40  mlog = logging.getLogger( 'ConfiguredAsgElectronRingerSelector.py' )
41  mlog.error("There is no such configuration available:\n %s", traceback.format_exc())
42  raise
43 
ConfiguredAsgElectronRingerSelector.ConfiguredAsgElectronRingerSelector
def ConfiguredAsgElectronRingerSelector(quality, menu, cutIDConfDict=None, **kwargs)
Definition: ConfiguredAsgElectronRingerSelector.py:16