ATLAS Offline Software
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
MenuComponents.HypoAlgNode Class Reference
Inheritance diagram for MenuComponents.HypoAlgNode:
Collaboration diagram for MenuComponents.HypoAlgNode:

Public Member Functions

def __init__ (self, Alg)
 
def addOutput (self, name)
 
def addHypoTool (self, flags, hypoToolConf)
 
def setPreviousDecision (self, prev)
 
def __repr__ (self)
 
def addDefaultOutput (self)
 
def setPar (self, propname, value)
 
def resetPar (self, prop)
 
def getPar (self, prop)
 
def resetOutput (self)
 
def resetInput (self)
 
def readOutputList (self)
 
def addInput (self, name)
 
def readInputList (self)
 
def getOutputList (self)
 
def getInputList (self)
 

Public Attributes

 previous
 
 outputProp
 
 inputProp
 
 name
 
 Alg
 
 inputs
 
 outputs
 

Static Public Attributes

 initialOutput
 

Detailed Description

AlgNode for HypoAlgs

Definition at line 151 of file MenuComponents.py.

Constructor & Destructor Documentation

◆ __init__()

def MenuComponents.HypoAlgNode.__init__ (   self,
  Alg 
)

Reimplemented from MenuComponents.Node.

Definition at line 154 of file MenuComponents.py.

154  def __init__(self, Alg):
155  assert isHypoBase(Alg), "Error in creating HypoAlgNode from Alg " + Alg.name
156  AlgNode.__init__(self, Alg, 'HypoInputDecisions', 'HypoOutputDecisions')
157  self.previous=[]
158 

Member Function Documentation

◆ __repr__()

def MenuComponents.HypoAlgNode.__repr__ (   self)

Reimplemented from MenuComponents.AlgNode.

Definition at line 189 of file MenuComponents.py.

189  def __repr__(self):
190  return "HypoAlg::%s [%s] -> [%s], previous = [%s], HypoTools=[%s]" % \
191  (self.Alg.name,' '.join(map(str, self.getInputList())),
192  ' '.join(map(str, self.getOutputList())),
193  ' '.join(map(str, self.previous)),
194  ' '.join([t.getName() for t in self.Alg.HypoTools]))
195 
196 

◆ addDefaultOutput()

def MenuComponents.AlgNode.addDefaultOutput (   self)
inherited

Definition at line 60 of file MenuComponents.py.

60  def addDefaultOutput(self):
61  if self.outputProp != '':
62  self.addOutput(("%s_%s"%(self.Alg.getName(),self.outputProp)))
63 

◆ addHypoTool()

def MenuComponents.HypoAlgNode.addHypoTool (   self,
  flags,
  hypoToolConf 
)

Definition at line 169 of file MenuComponents.py.

169  def addHypoTool (self, flags, hypoToolConf):
170  log.debug("Adding HypoTool %s for chain %s to %s", hypoToolConf.name, hypoToolConf.chainDict['chainName'], self.Alg.getName())
171  try:
172  result = hypoToolConf.create(flags)
173  if isinstance(result, ComponentAccumulator):
174  tool = result.popPrivateTools()
175  assert not isinstance(tool, list), "Can not handle list of tools"
176  self.Alg.HypoTools.append(tool)
177  return result
178  else:
179  self.Alg.HypoTools = self.Alg.HypoTools + [result] # see ATEAM-773
180 
181  except NoHypoToolCreated as e:
182  log.debug("%s returned empty tool: %s", hypoToolConf.name, e)
183  return None
184 

◆ addInput()

def MenuComponents.AlgNode.addInput (   self,
  name 
)
inherited

Reimplemented from MenuComponents.Node.

Definition at line 104 of file MenuComponents.py.

104  def addInput(self, name):
105  inputs = self.readInputList()
106  if name in inputs:
107  log.debug("Input DH not added in %s: %s already set!", self.Alg.getName(), name)
108  else:
109  if self.inputProp != '':
110  self.setPar(self.inputProp, name)
111  else:
112  log.debug("no InputProp set for input of %s", self.Alg.getName())
113  Node.addInput(self, name)
114  return len(self.readInputList())
115 

◆ addOutput()

def MenuComponents.HypoAlgNode.addOutput (   self,
  name 
)

Reimplemented from MenuComponents.AlgNode.

Definition at line 159 of file MenuComponents.py.

159  def addOutput(self, name):
160  outputs = self.readOutputList()
161  if name in outputs:
162  log.debug("Output DH not added in %s: %s already set!", self.name, name)
163  elif self.initialOutput in outputs:
164  AlgNode.addOutput(self, name)
165  else:
166  log.error("Hypo %s has already %s as configured output: you may want to duplicate the Hypo!",
167  self.name, outputs[0])
168 

◆ getInputList()

def MenuComponents.Node.getInputList (   self)
inherited

Definition at line 45 of file MenuComponents.py.

45  def getInputList(self):
46  return self.inputs
47 

◆ getOutputList()

def MenuComponents.Node.getOutputList (   self)
inherited

Definition at line 42 of file MenuComponents.py.

42  def getOutputList(self):
43  return self.outputs
44 

◆ getPar()

def MenuComponents.AlgNode.getPar (   self,
  prop 
)
inherited

Definition at line 79 of file MenuComponents.py.

79  def getPar(self, prop):
80  return getattr(self.Alg, prop)
81 

◆ readInputList()

def MenuComponents.AlgNode.readInputList (   self)
inherited

Definition at line 116 of file MenuComponents.py.

116  def readInputList(self):
117  cval = self.getPar(self.inputProp)
118  return (cval if isinstance(cval, MutableSequence) else
119  ([str(cval)] if cval else []))
120 

◆ readOutputList()

def MenuComponents.AlgNode.readOutputList (   self)
inherited

Definition at line 99 of file MenuComponents.py.

99  def readOutputList(self):
100  cval = self.getPar(self.outputProp)
101  return (cval if isinstance(cval, MutableSequence) else
102  ([str(cval)] if cval else []))
103 

◆ resetInput()

def MenuComponents.AlgNode.resetInput (   self)
inherited

Definition at line 85 of file MenuComponents.py.

85  def resetInput(self):
86  self.resetPar(self.inputProp)
87 

◆ resetOutput()

def MenuComponents.AlgNode.resetOutput (   self)
inherited

Definition at line 82 of file MenuComponents.py.

82  def resetOutput(self):
83  self.resetPar(self.outputProp)
84 

◆ resetPar()

def MenuComponents.AlgNode.resetPar (   self,
  prop 
)
inherited

Definition at line 72 of file MenuComponents.py.

72  def resetPar(self, prop):
73  cval = getattr(self.Alg, prop)
74  if isinstance(cval, MutableSequence):
75  return setattr(self.Alg, prop, [])
76  else:
77  return setattr(self.Alg, prop, "")
78 

◆ setPar()

def MenuComponents.AlgNode.setPar (   self,
  propname,
  value 
)
inherited

Definition at line 64 of file MenuComponents.py.

64  def setPar(self, propname, value):
65  cval = getattr( self.Alg, propname)
66  if isinstance(cval, MutableSequence):
67  cval.append(value)
68  return setattr(self.Alg, propname, cval)
69  else:
70  return setattr(self.Alg, propname, value)
71 

◆ setPreviousDecision()

def MenuComponents.HypoAlgNode.setPreviousDecision (   self,
  prev 
)

Definition at line 185 of file MenuComponents.py.

185  def setPreviousDecision(self,prev):
186  self.previous.append(prev)
187  return self.addInput(prev)
188 

Member Data Documentation

◆ Alg

MenuComponents.Node.Alg
inherited

Definition at line 32 of file MenuComponents.py.

◆ initialOutput

MenuComponents.HypoAlgNode.initialOutput
static

Definition at line 153 of file MenuComponents.py.

◆ inputProp

MenuComponents.AlgNode.inputProp
inherited

Definition at line 58 of file MenuComponents.py.

◆ inputs

MenuComponents.Node.inputs
inherited

Definition at line 33 of file MenuComponents.py.

◆ name

MenuComponents.Node.name
inherited

Definition at line 31 of file MenuComponents.py.

◆ outputProp

MenuComponents.AlgNode.outputProp
inherited

Definition at line 57 of file MenuComponents.py.

◆ outputs

MenuComponents.Node.outputs
inherited

Definition at line 34 of file MenuComponents.py.

◆ previous

MenuComponents.HypoAlgNode.previous

Definition at line 157 of file MenuComponents.py.


The documentation for this class was generated from the following file:
detail::addInput
void addInput(T &c, const Primitive &input, A a=defaultAccessor< T >)
Definition: PrimitiveHelpers.h:50
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
dumpTruth.getName
getName
Definition: dumpTruth.py:34
HLTCFTools.isHypoBase
def isHypoBase(alg)
Definition: HLTCFTools.py:31
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
str
Definition: BTagTrackIpAccessor.cxx:11