ATLAS Offline Software
HLTCFTools.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaCommon.Logging import logging
4 log = logging.getLogger( __name__ )
5 
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 RoRSeqFilter = CompFactory.RoRSeqFilter
8 PassFilter = CompFactory.PassFilter
9 
10 
11 class NoHypoToolCreated(Exception):
12  """Exception thrown by HypoTool generators if no HypoTool is needed""" # see ATR-23920
13 
14 
15 def algColor(alg):
16  """ Set given color to Alg type"""
17  if isComboHypoAlg(alg):
18  return "darkorange"
19  if isHypoBase(alg):
20  return "darkorchid1"
21  if isInputMakerBase(alg):
22  return "cyan3"
23  if isFilterAlg(alg):
24  return "chartreuse3"
25  if isPassFilterAlg(alg):
26  return "darkgreen"
27  return "cadetblue1"
28 
29 
30 
31 def isHypoBase(alg):
32  if 'HypoInputDecisions' in alg.__class__.__dict__:
33  return True
34  prop = alg.__class__.__dict__.get('_properties')
35  if type(prop) is dict:
36  return ('HypoInputDecisions' in prop)
37  else:
38  return False
39 
41  return ('InputMakerInputDecisions' in alg.__class__.__dict__)
42 
43 def isFilterAlg(alg):
44  return isinstance(alg, RoRSeqFilter)
45 
46 def isPassFilterAlg(alg):
47  return isinstance(alg, PassFilter)
48 
49 def isComboHypoAlg(alg):
50  return ('MultiplicitiesMap' in alg.__class__.__dict__)
51 
52 def isHypoAlg(alg):
53  return isHypoBase(alg) and not isComboHypoAlg(alg)
54 
HLTCFTools.isHypoAlg
def isHypoAlg(alg)
Definition: HLTCFTools.py:52
HLTCFTools.NoHypoToolCreated
Definition: HLTCFTools.py:11
HLTCFTools.isHypoBase
def isHypoBase(alg)
Definition: HLTCFTools.py:31
HLTCFTools.isInputMakerBase
def isInputMakerBase(alg)
Definition: HLTCFTools.py:40
HLTCFTools.isFilterAlg
def isFilterAlg(alg)
Definition: HLTCFTools.py:43
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
HLTCFTools.algColor
def algColor(alg)
Definition: HLTCFTools.py:15
HLTCFTools.isPassFilterAlg
def isPassFilterAlg(alg)
Definition: HLTCFTools.py:46
HLTCFTools.isComboHypoAlg
def isComboHypoAlg(alg)
Definition: HLTCFTools.py:49