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 179 of file MenuComponents.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 181 of file MenuComponents.py.

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

◆ __del__()

def MenuComponents.ComboHypoNode.__del__ (   self)

Definition at line 194 of file MenuComponents.py.

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

Member Function Documentation

◆ __repr__()

def MenuComponents.AlgNode.__repr__ (   self)
inherited

Reimplemented from MenuComponents.Node.

Reimplemented in MenuComponents.HypoAlgNode.

Definition at line 99 of file MenuComponents.py.

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

◆ addChain()

def MenuComponents.ComboHypoNode.addChain (   self,
  chainDict 
)

Definition at line 218 of file MenuComponents.py.

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

◆ addInput()

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

Reimplemented from MenuComponents.Node.

Definition at line 82 of file MenuComponents.py.

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

◆ addOutput()

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

Reimplemented from MenuComponents.Node.

Reimplemented in MenuComponents.HypoAlgNode.

Definition at line 66 of file MenuComponents.py.

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

◆ create()

def MenuComponents.ComboHypoNode.create (   self,
  name 
)

Definition at line 197 of file MenuComponents.py.

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

◆ createComboHypoTools()

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

Definition at line 242 of file MenuComponents.py.

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

◆ getChains()

def MenuComponents.ComboHypoNode.getChains (   self)

Definition at line 238 of file MenuComponents.py.

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

◆ getInputList()

def MenuComponents.Node.getInputList (   self)
inherited

Definition at line 43 of file MenuComponents.py.

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

◆ getOutputList()

def MenuComponents.Node.getOutputList (   self)
inherited

Definition at line 40 of file MenuComponents.py.

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

◆ mapRawInputsToInputsIndex()

def MenuComponents.ComboHypoNode.mapRawInputsToInputsIndex (   self)

Definition at line 210 of file MenuComponents.py.

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

◆ readInputList()

def MenuComponents.AlgNode.readInputList (   self)
inherited

Definition at line 94 of file MenuComponents.py.

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

◆ readOutputList()

def MenuComponents.AlgNode.readOutputList (   self)
inherited

Definition at line 77 of file MenuComponents.py.

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

◆ setPar()

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

Definition at line 58 of file MenuComponents.py.

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

Member Data Documentation

◆ acc

MenuComponents.ComboHypoNode.acc

Definition at line 183 of file MenuComponents.py.

◆ Alg

MenuComponents.Node.Alg
inherited

Definition at line 30 of file MenuComponents.py.

◆ comboHypoCfg

MenuComponents.ComboHypoNode.comboHypoCfg

Definition at line 182 of file MenuComponents.py.

◆ inputProp

MenuComponents.AlgNode.inputProp
inherited

Definition at line 56 of file MenuComponents.py.

◆ inputs

MenuComponents.Node.inputs
inherited

Definition at line 31 of file MenuComponents.py.

◆ name

MenuComponents.Node.name
inherited

Definition at line 29 of file MenuComponents.py.

◆ outputProp

MenuComponents.AlgNode.outputProp
inherited

Definition at line 55 of file MenuComponents.py.

◆ outputs

MenuComponents.Node.outputs
inherited

Definition at line 32 of file MenuComponents.py.


The documentation for this class was generated from the following file:
vtune_athena.format
format
Definition: vtune_athena.py:14
python.processes.powheg.ZZj_MiNNLO.ZZj_MiNNLO.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZj_MiNNLO.py:18
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.AthDsoLogger.__del__
def __del__(self)
Definition: AthDsoLogger.py:81
str
Definition: BTagTrackIpAccessor.cxx:11