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

Public Member Functions

def __init__ (self, name, comboHypoCfg)
 
def __del__ (self)
 
def create (self, name)
 
def mapRawInputsToInputsIndex (self)
 
def addChain (self, chainDict)
 
def getChains (self)
 
def createComboHypoTools (self, flags, chainDict, comboToolConfs)
 
def setPar (self, propname, value)
 
def addOutput (self, name)
 
def readOutputList (self)
 
def addInput (self, name)
 
def readInputList (self)
 
def __repr__ (self)
 
def getOutputList (self)
 
def getInputList (self)
 

Public Attributes

 comboHypoCfg
 
 acc
 
 outputProp
 
 inputProp
 
 name
 
 Alg
 
 inputs
 
 outputs
 

Detailed Description

AlgNode for Combo HypoAlgs

Definition at line 180 of file MenuComponents.py.

Constructor & Destructor Documentation

◆ __init__()

def MenuComponents.ComboHypoNode.__init__ (   self,
  name,
  comboHypoCfg 
)

Definition at line 182 of file MenuComponents.py.

182  def __init__(self, name, comboHypoCfg):
183  self.comboHypoCfg = comboHypoCfg
184  self.acc = self.create( name )
185  thealgs= self.acc.getEventAlgos()
186  if thealgs is None:
187  log.error("ComboHypoNode: Combo alg %s not found", name)
188  if len(thealgs) != 1:
189  log.error("ComboHypoNode: Combo alg %s len is %d",name, len(thealgs))
190  Alg=thealgs[0]
191 
192  log.debug("ComboHypoNode init: Alg %s", name)
193  AlgNode.__init__(self, Alg, 'HypoInputDecisions', 'HypoOutputDecisions')
194 

◆ __del__()

def MenuComponents.ComboHypoNode.__del__ (   self)

Definition at line 195 of file MenuComponents.py.

195  def __del__(self):
196  self.acc.wasMerged()
197 

Member Function Documentation

◆ __repr__()

def MenuComponents.AlgNode.__repr__ (   self)
inherited

Reimplemented from MenuComponents.Node.

Reimplemented in MenuComponents.HypoAlgNode.

Definition at line 100 of file MenuComponents.py.

100  def __repr__(self):
101  return "Alg::%s [%s] -> [%s]"%(self.Alg.getName(), ' '.join(map(str, self.getInputList())), ' '.join(map(str, self.getOutputList())))
102 
103 

◆ addChain()

def MenuComponents.ComboHypoNode.addChain (   self,
  chainDict 
)

Definition at line 219 of file MenuComponents.py.

219  def addChain(self, chainDict):
220  chainName = chainDict['chainName']
221  chainMult = chainDict['chainMultiplicities']
222  legsToInputCollections = self.mapRawInputsToInputsIndex()
223  if len(chainMult) != len(legsToInputCollections):
224  log.error("ComboHypoNode for Alg:{} with addChain for:{} Chain multiplicity:{} Per leg input collection index:{}."
225  .format(self.Alg.name, chainName, tuple(chainMult), tuple(legsToInputCollections)))
226  log.error("The size of the multiplicies vector must be the same size as the per leg input collection vector.")
227  log.error("The ComboHypo needs to know which input DecisionContainers contain the DecisionObjects to be used for each leg.")
228  log.error("Check why ComboHypoNode.addInput(...) was not called exactly once per leg.")
229  raise Exception("[createDataFlow] Error in ComboHypoNode.addChain. Cannot proceed.")
230 
231  if chainName in self.Alg.MultiplicitiesMap:
232  log.error("ComboAlg %s has already been configured for chain %s", self.Alg.name, chainName)
233  raise Exception("[createDataFlow] Error in ComboHypoNode.addChain. Cannot proceed.")
234  else:
235  self.Alg.MultiplicitiesMap[chainName] = chainMult
236  self.Alg.LegToInputCollectionMap[chainName] = legsToInputCollections
237 
238 

◆ addInput()

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

Reimplemented from MenuComponents.Node.

Definition at line 83 of file MenuComponents.py.

83  def addInput(self, name):
84  inputs = self.readInputList()
85  if name in inputs:
86  log.debug("Input DH not added in %s: %s already set!", self.Alg.getName(), name)
87  else:
88  if self.inputProp != '':
89  self.setPar(self.inputProp, name)
90  else:
91  log.debug("no InputProp set for input of %s", self.Alg.getName())
92  Node.addInput(self, name)
93  return len(self.readInputList())
94 

◆ addOutput()

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

Reimplemented from MenuComponents.Node.

Reimplemented in MenuComponents.HypoAlgNode.

Definition at line 67 of file MenuComponents.py.

67  def addOutput(self, name):
68  outputs = self.readOutputList()
69  if name in outputs:
70  log.debug("Output DH not added in %s: %s already set!", self.Alg.getName(), name)
71  else:
72  if self.outputProp != '':
73  self.setPar(self.outputProp, name)
74  else:
75  log.debug("no outputProp set for output of %s", self.Alg.getName())
76  Node.addOutput(self, name)
77 

◆ create()

def MenuComponents.ComboHypoNode.create (   self,
  name 
)

Definition at line 198 of file MenuComponents.py.

198  def create (self, name):
199  log.debug("ComboHypoNode.create %s",name)
200  return self.comboHypoCfg(name=name)
201 

◆ createComboHypoTools()

def MenuComponents.ComboHypoNode.createComboHypoTools (   self,
  flags,
  chainDict,
  comboToolConfs 
)
Create the ComboHypoTools and add them to the main alg

Definition at line 243 of file MenuComponents.py.

243  def createComboHypoTools(self, flags, chainDict, comboToolConfs):
244  """Create the ComboHypoTools and add them to the main alg"""
245  if not len(comboToolConfs):
246  return
247  confs = [ HypoToolConf( tool ) for tool in comboToolConfs ]
248  log.debug("ComboHypoNode.createComboHypoTools for chain %s, Alg %s with %d tools", chainDict["chainName"],self.Alg.getName(), len(comboToolConfs))
249  for conf in confs:
250  log.debug("ComboHypoNode.createComboHypoTools adding %s", conf)
251  tools = self.Alg.ComboHypoTools
252  self.Alg.ComboHypoTools = tools + [ conf.confAndCreate( flags, chainDict ) ]
253 
254 

◆ getChains()

def MenuComponents.ComboHypoNode.getChains (   self)

Definition at line 239 of file MenuComponents.py.

239  def getChains(self):
240  return self.Alg.MultiplicitiesMap.keys()
241 
242 

◆ getInputList()

def MenuComponents.Node.getInputList (   self)
inherited

Definition at line 44 of file MenuComponents.py.

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

◆ getOutputList()

def MenuComponents.Node.getOutputList (   self)
inherited

Definition at line 41 of file MenuComponents.py.

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

◆ mapRawInputsToInputsIndex()

def MenuComponents.ComboHypoNode.mapRawInputsToInputsIndex (   self)

Definition at line 211 of file MenuComponents.py.

211  def mapRawInputsToInputsIndex(self):
212  mapping = []
213  theInputs = self.readInputList() #only unique inputs
214  for rawInput in self.inputs: # all inputs
215  mapping.append( theInputs.index(rawInput) )
216  return mapping
217 
218 

◆ readInputList()

def MenuComponents.AlgNode.readInputList (   self)
inherited

Definition at line 95 of file MenuComponents.py.

95  def readInputList(self):
96  cval = getattr(self.Alg, self.inputProp)
97  return (cval if isinstance(cval, MutableSequence) else
98  ([str(cval)] if cval else []))
99 

◆ readOutputList()

def MenuComponents.AlgNode.readOutputList (   self)
inherited

Definition at line 78 of file MenuComponents.py.

78  def readOutputList(self):
79  cval = getattr(self.Alg, self.outputProp)
80  return (cval if isinstance(cval, MutableSequence) else
81  ([str(cval)] if cval else []))
82 

◆ setPar()

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

Definition at line 59 of file MenuComponents.py.

59  def setPar(self, propname, value):
60  cval = getattr( self.Alg, propname)
61  if isinstance(cval, MutableSequence):
62  cval.append(value)
63  return setattr(self.Alg, propname, cval)
64  else:
65  return setattr(self.Alg, propname, value)
66 

Member Data Documentation

◆ acc

MenuComponents.ComboHypoNode.acc

Definition at line 184 of file MenuComponents.py.

◆ Alg

MenuComponents.Node.Alg
inherited

Definition at line 31 of file MenuComponents.py.

◆ comboHypoCfg

MenuComponents.ComboHypoNode.comboHypoCfg

Definition at line 183 of file MenuComponents.py.

◆ inputProp

MenuComponents.AlgNode.inputProp
inherited

Definition at line 57 of file MenuComponents.py.

◆ inputs

MenuComponents.Node.inputs
inherited

Definition at line 32 of file MenuComponents.py.

◆ name

MenuComponents.Node.name
inherited

Definition at line 30 of file MenuComponents.py.

◆ outputProp

MenuComponents.AlgNode.outputProp
inherited

Definition at line 56 of file MenuComponents.py.

◆ outputs

MenuComponents.Node.outputs
inherited

Definition at line 33 of file MenuComponents.py.


The documentation for this class was generated from the following file:
vtune_athena.format
format
Definition: vtune_athena.py:14
detail::addInput
void addInput(T &c, const Primitive &input, A a=defaultAccessor< T >)
Definition: PrimitiveHelpers.h:50
python.TrigConfigSvcUtils.getChains
def getChains(connection, smk)
Definition: TrigConfigSvcUtils.py:592
dumpTruth.getName
getName
Definition: dumpTruth.py:34
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
python.AthDsoLogger.__del__
def __del__(self)
Definition: AthDsoLogger.py:81
str
Definition: BTagTrackIpAccessor.cxx:11