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

Public Member Functions

def __init__ (self, ChainStep, FilterAlg)
 
def createCFSequence (self, ChainStep, FilterAlg)
 
def addStepLeg (self, newstep, chainName)
 
def connect (self, connections)
 
def createHypoTools (self, flags)
 

Public Attributes

 stepDicts
 
 chains
 
 comboToolConfs
 
 sequenceCA
 

Detailed Description

Class to store the Step + its Filter (CFSequence) plus the chains and dictionaries of the legs using that step   

Definition at line 171 of file HLTCFComponents.py.

Constructor & Destructor Documentation

◆ __init__()

def HLTCFComponents.CFGroup.__init__ (   self,
  ChainStep,
  FilterAlg 
)

Definition at line 173 of file HLTCFComponents.py.

173  def __init__(self, ChainStep, FilterAlg):
174  self.stepDicts = [] # will become a list of lists
175  self.chains = []
176  self.comboToolConfs = []
177  self.createCFSequence(ChainStep, FilterAlg)
178  log.debug("CFGroup.__init: created for %s ",ChainStep.name)
179 

Member Function Documentation

◆ addStepLeg()

def HLTCFComponents.CFGroup.addStepLeg (   self,
  newstep,
  chainName 
)

Definition at line 186 of file HLTCFComponents.py.

186  def addStepLeg(self, newstep, chainName):
187  self.stepDicts.append(newstep.stepDicts) # one dict per leg
188  self.chains.append(chainName)
189  self.comboToolConfs.append(newstep.comboToolConfs)
190 
191 

◆ connect()

def HLTCFComponents.CFGroup.connect (   self,
  connections 
)
Connect filter to ChainStep (and all its sequences) through these connections (which are sets of filter outputs)
if a ChainStep contains the same sequence multiple times (for multi-leg chains),
the filter is connected only once (to avoid multiple DH links)

Definition at line 192 of file HLTCFComponents.py.

192  def connect(self, connections):
193  """Connect filter to ChainStep (and all its sequences) through these connections (which are sets of filter outputs)
194  if a ChainStep contains the same sequence multiple times (for multi-leg chains),
195  the filter is connected only once (to avoid multiple DH links)
196  """
197  if log.isEnabledFor(logging.DEBUG):
198  log.debug("CFGroup: connect Filter %s with %d menuSequences of step %s, using %d connections", self.sequenceCA.filterNode.Alg.name, len(self.sequenceCA.step.sequences), self.sequenceCA.step.name, len(connections))
199  log.debug(" --- sequences: ")
200  for seq in self.sequenceCA.step.sequences:
201  log.debug(seq)
202 
203  if len(connections) == 0:
204  log.error("No filter outputs are set!")
205 
206  if len(self.sequenceCA.step.sequences):
207  # check whether the number of filter outputs are the same as the number of sequences in the step
208  if len(connections) != len(self.sequenceCA.step.sequences):
209  log.error("CFGroup: Found %d connections and %d MenuSequences in Step %s", len(connections), len(self.sequenceCA.step.sequences), self.sequenceCA.step.name)
210  raise Exception("[CFGroup] Connections and sequences do not match, this must be fixed!")
211 
212  for nseq, seq in enumerate(self.sequenceCA.step.sequences):
213  filter_out = connections[nseq]
214  log.debug("CFGroup: Found input %s to sequence::%s from Filter::%s", filter_out, seq.name, self.sequenceCA.filterNode.Alg.name)
215  seq.connectToFilter( filter_out )
216  else:
217  log.debug("This CFGroup has no sequences: outputs are the Filter outputs, which are %d", len(self.sequenceCA.decisions))
218 

◆ createCFSequence()

def HLTCFComponents.CFGroup.createCFSequence (   self,
  ChainStep,
  FilterAlg 
)
This creates the CAs for the menu sequences, if fastMenu style, and the CFSequence

Definition at line 180 of file HLTCFComponents.py.

180  def createCFSequence(self, ChainStep, FilterAlg):
181  '''This creates the CAs for the menu sequences, if fastMenu style, and the CFSequence'''
182  log.debug("CFGroup.creating CFSEquence")
183  self.sequenceCA = CFSequence(ChainStep, FilterAlg)
184  return self.sequenceCA
185 

◆ createHypoTools()

def HLTCFComponents.CFGroup.createHypoTools (   self,
  flags 
)
set and create HypoTools accumulated on the self.step from an input step configuration

Definition at line 219 of file HLTCFComponents.py.

219  def createHypoTools(self, flags):
220  """ set and create HypoTools accumulated on the self.step from an input step configuration
221  """
222  if self.sequenceCA.step.combo is None:
223  return
224 
225  log.debug("CFGroup.createHypoTools for Step %s", self.sequenceCA.step.name)
226  for sdict in self.stepDicts:
227  for seq, onePartChainDict in zip(self.sequenceCA.step.sequences, sdict):
228  log.debug(' seq: %s, onePartChainDict:', seq.name)
229  log.debug(' %s', onePartChainDict)
230  if not isinstance(seq, EmptyMenuSequence):
231  hypoToolConf=seq.getHypoToolConf()
232  if hypoToolConf is None: # avoid empty sequences
233  log.error("HypoToolConf not found ", seq.name)
234  hypoToolConf.setConf( onePartChainDict )
235  hypo = HypoAlgNode(Alg = self.sequenceCA.ca.getEventAlgo(seq.hypo.Alg.getName()))
236  hypoToolAcc = hypo.addHypoTool(flags, hypoToolConf) #this creates the HypoTools
237  if isinstance(hypoToolAcc, ComponentAccumulator):
238  self.sequenceCA.ca.merge(hypoToolAcc)
239 
240  for chain,conf in zip(self.chains, self.comboToolConfs):
241  chainDict = HLTMenuConfig.getChainDictFromChainName(chain)
242  self.sequenceCA.step.combo.createComboHypoTools(flags, chainDict, conf)

Member Data Documentation

◆ chains

HLTCFComponents.CFGroup.chains

Definition at line 175 of file HLTCFComponents.py.

◆ comboToolConfs

HLTCFComponents.CFGroup.comboToolConfs

Definition at line 176 of file HLTCFComponents.py.

◆ sequenceCA

HLTCFComponents.CFGroup.sequenceCA

Definition at line 183 of file HLTCFComponents.py.

◆ stepDicts

HLTCFComponents.CFGroup.stepDicts

Definition at line 174 of file HLTCFComponents.py.


The documentation for this class was generated from the following file:
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18