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 173 of file HLTCFComponents.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 175 of file HLTCFComponents.py.

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

Member Function Documentation

◆ addStepLeg()

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

Definition at line 188 of file HLTCFComponents.py.

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

◆ 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 194 of file HLTCFComponents.py.

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

◆ 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 182 of file HLTCFComponents.py.

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

◆ createHypoTools()

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

Definition at line 221 of file HLTCFComponents.py.

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

Member Data Documentation

◆ chains

HLTCFComponents.CFGroup.chains

Definition at line 177 of file HLTCFComponents.py.

◆ comboToolConfs

HLTCFComponents.CFGroup.comboToolConfs

Definition at line 178 of file HLTCFComponents.py.

◆ sequenceCA

HLTCFComponents.CFGroup.sequenceCA

Definition at line 185 of file HLTCFComponents.py.

◆ stepDicts

HLTCFComponents.CFGroup.stepDicts

Definition at line 176 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