ATLAS Offline Software
Public Member Functions | Public Attributes | Private Attributes | List of all members
python.ConfigAccumulator.ConfigAccumulator Class Reference
Collaboration diagram for python.ConfigAccumulator.ConfigAccumulator:

Public Member Functions

def __init__ (self, algSeq, dataType=None, isPhyslite=False, geometry=None, dsid=0, campaign=None, runNumber=None, autoconfigFromFlags=None, noSysSuffix=False, noSystematics=None, dataYear=0)
 
def noSystematics (self)
 
def autoconfigFlags (self)
 
def dataType (self)
 
def isPhyslite (self)
 
def geometry (self)
 
def dsid (self)
 
def campaign (self)
 
def runNumber (self)
 
def dataYear (self)
 
def generatorInfo (self)
 
def hltSummary (self)
 
def createAlgorithm (self, type, name, reentrant=False)
 
def createService (self, type, name)
 
def createPublicTool (self, type, name)
 
def addPrivateTool (self, propertyName, toolType)
 
def setSourceName (self, containerName, sourceName, *originalName=None)
 
def writeName (self, containerName, *isMet=None)
 
def readName (self, containerName)
 
def copyName (self, containerName)
 
def wantCopy (self, containerName)
 
def originalName (self, containerName)
 
def isMetContainer (self, containerName)
 
def readNameAndSelection (self, containerName, *excludeFrom=None)
 
def nextPass (self)
 
def getPreselection (self, containerName, selectionName, *asList=False)
 
def getFullSelection (self, containerName, selectionName, *skipBase=False, excludeFrom=None)
 
def getSelectionCutFlow (self, containerName, selectionName)
 
def addEventCutFlow (self, selection, decorations)
 
def getEventCutFlow (self, selection)
 
def addSelection (self, containerName, selectionName, decoration, **kwargs)
 
def addOutputContainer (self, containerName, outputContainerName)
 
def getOutputContainerOrigin (self, outputContainerName)
 
def addOutputVar (self, containerName, variableName, outputName, *noSys=False, enabled=True)
 
def getOutputVars (self, containerName)
 
def getSelectionNames (self, containerName, excludeFrom=None)
 

Public Attributes

 CA
 

Private Attributes

 _autoconfigFlags
 
 _dataType
 
 _isPhyslite
 
 _geometry
 
 _dsid
 
 _campaign
 
 _runNumber
 
 _dataYear
 
 _generatorInfo
 
 _algSeq
 
 _noSystematics
 
 _noSysSuffix
 
 _containerConfig
 
 _outputContainers
 
 _pass
 
 _algorithms
 
 _currentAlg
 
 _selectionNameExpr
 
 _eventcutflow
 
 _muonCalibMode
 
 _hltSummary
 

Detailed Description

a class that accumulates a configuration from blocks into an
algorithm sequence

This is used as argument to the ConfigurationBlock methods, which
need to be called in the correct order.  This class will track all
meta-information that needs to be communicated between blocks
during configuration, and also add the created algorithms to the
sequence.

Use/access of containers in the event store is handled via
references that this class hands out.  This happens in a separate
step before the algorithms are created, as the naming of
containers will depend on where in the chain the container is
used.

Definition at line 93 of file ConfigAccumulator.py.

Constructor & Destructor Documentation

◆ __init__()

def python.ConfigAccumulator.ConfigAccumulator.__init__ (   self,
  algSeq,
  dataType = None,
  isPhyslite = False,
  geometry = None,
  dsid = 0,
  campaign = None,
  runNumber = None,
  autoconfigFromFlags = None,
  noSysSuffix = False,
  noSystematics = None,
  dataYear = 0 
)

Definition at line 110 of file ConfigAccumulator.py.

110  def __init__ (self, algSeq, dataType=None, isPhyslite=False, geometry=None, dsid=0,
111  campaign=None, runNumber=None, autoconfigFromFlags=None, noSysSuffix=False,
112  noSystematics=None, dataYear=0):
113  self._autoconfigFlags = autoconfigFromFlags
114  if autoconfigFromFlags is not None:
115  if autoconfigFromFlags.Input.isMC:
116  if autoconfigFromFlags.Sim.ISF.Simulator.usesFastCaloSim():
117  dataType = DataType.FastSim
118  else:
119  dataType = DataType.FullSim
120  else:
121  dataType = DataType.Data
122  isPhyslite = 'StreamDAOD_PHYSLITE' in autoconfigFromFlags.Input.ProcessingTags
123  if geometry is None:
124  geometry = autoconfigFromFlags.GeoModel.Run
125  if dsid == 0 and dataType is not DataType.Data:
126  dsid = autoconfigFromFlags.Input.MCChannelNumber
127  if campaign is None:
128  campaign = autoconfigFromFlags.Input.MCCampaign
129  if runNumber is None:
130  runNumber = int(autoconfigFromFlags.Input.RunNumbers[0])
131  if dataYear == 0:
132  dataYear = autoconfigFromFlags.Input.DataYear
133  generatorInfo = autoconfigFromFlags.Input.GeneratorsInfo
134  from TrigDecisionTool.TrigDecisionToolHelpers import (
135  getRun3NavigationContainerFromInput_forAnalysisBase)
136  hltSummary = getRun3NavigationContainerFromInput_forAnalysisBase(autoconfigFromFlags)
137  else:
138  # legacy mappings of string arguments
139  if isinstance(dataType, str):
140  if dataType == 'mc':
141  dataType = DataType.FullSim
142  elif dataType == 'afii':
143  dataType = DataType.FastSim
144  else:
145  dataType = DataType(dataType)
146  generatorInfo = None
147  hltSummary = 'HLTNav_Summary_DAODSlimmed'
148  if runNumber is None:
149  runNumber = 284500
150  # allow possible string argument for `geometry` and convert it to enum
151  geometry = LHCPeriod(geometry)
152  if geometry is LHCPeriod.Run1:
153  raise ValueError ("invalid Run geometry: %s" % geometry.value)
154  # store also the data year for data
155  self._dataType = dataType
156  self._isPhyslite = isPhyslite
157  self._geometry = geometry
158  self._dsid = dsid
159  self._campaign = campaign
160  self._runNumber = runNumber
161  self._dataYear = dataYear
162  self._generatorInfo = generatorInfo
163  self._algSeq = algSeq
164  self._noSystematics = noSystematics
165  self._noSysSuffix = noSysSuffix
166  self._containerConfig = {}
167  self._outputContainers = {}
168  self._pass = 0
169  self._algorithms = {}
170  self._currentAlg = None
171  self._selectionNameExpr = re.compile ('[A-Za-z_][A-Za-z_0-9]+')
172  self.setSourceName ('EventInfo', 'EventInfo')
173  self._eventcutflow = {}
174  self._muonCalibMode = -1
175  self._hltSummary = hltSummary
176 
177  # If we are in an Athena environment with ComponentAccumulator configuration
178  # then the AlgSequence, which is Gaudi.AthSequencer, does not support '+=',
179  # and we in any case want to produce an output ComponentAccumulator
180  self.CA = None
181  if DualUseConfig.useComponentAccumulator:
182  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
183  self.CA = ComponentAccumulator()
184  # if we have a component accumulator the user is not required to pass
185  # in a sequence, but if they do let's add it
186  if algSeq :
187  self.CA.addSequence(algSeq)
188 
189 

Member Function Documentation

◆ addEventCutFlow()

def python.ConfigAccumulator.ConfigAccumulator.addEventCutFlow (   self,
  selection,
  decorations 
)
register a new event cutflow, adding it to the dictionary with key 'selection'
and value 'decorations', a list of decorated selections

Definition at line 560 of file ConfigAccumulator.py.

560  def addEventCutFlow (self, selection, decorations) :
561 
562  """register a new event cutflow, adding it to the dictionary with key 'selection'
563  and value 'decorations', a list of decorated selections
564  """
565  if self._pass == 0:
566  if selection in self._eventcutflow.keys():
567  raise ValueError ('the event cutflow dictionary already contains an entry ' + selection)
568  else:
569  self._eventcutflow[selection] = decorations
570 
571 

◆ addOutputContainer()

def python.ConfigAccumulator.ConfigAccumulator.addOutputContainer (   self,
  containerName,
  outputContainerName 
)
register a copy of a container used in outputs

Definition at line 593 of file ConfigAccumulator.py.

593  def addOutputContainer (self, containerName, outputContainerName) :
594  """register a copy of a container used in outputs"""
595  if containerName not in self._containerConfig :
596  raise KeyError ("container unknown: " + containerName)
597  if outputContainerName in self._outputContainers :
598  raise KeyError ("duplicate output container name: " + outputContainerName)
599  self._outputContainers[outputContainerName] = containerName
600 
601 

◆ addOutputVar()

def python.ConfigAccumulator.ConfigAccumulator.addOutputVar (   self,
  containerName,
  variableName,
  outputName,
noSys = False,
  enabled = True 
)
add an output variable for the given container to the output

Definition at line 613 of file ConfigAccumulator.py.

613  def addOutputVar (self, containerName, variableName, outputName,
614  *, noSys=False, enabled=True) :
615  """add an output variable for the given container to the output
616  """
617 
618  if containerName not in self._containerConfig :
619  raise KeyError ("container unknown: " + containerName)
620  baseConfig = self._containerConfig[containerName].outputs
621  if outputName in baseConfig :
622  raise KeyError ("duplicate output variable name: " + outputName)
623  config = OutputConfig (containerName, variableName, noSys=noSys, enabled=enabled)
624  baseConfig[outputName] = config
625 
626 

◆ addPrivateTool()

def python.ConfigAccumulator.ConfigAccumulator.addPrivateTool (   self,
  propertyName,
  toolType 
)
add a private tool to the current algorithm

Definition at line 311 of file ConfigAccumulator.py.

311  def addPrivateTool (self, propertyName, toolType) :
312  """add a private tool to the current algorithm"""
313  if self._pass == 0 :
314  DualUseConfig.addPrivateTool (self._currentAlg, propertyName, toolType)
315 
316 

◆ addSelection()

def python.ConfigAccumulator.ConfigAccumulator.addSelection (   self,
  containerName,
  selectionName,
  decoration,
**  kwargs 
)
add another selection decoration to the selection of the given
name for the given container

Definition at line 580 of file ConfigAccumulator.py.

580  def addSelection (self, containerName, selectionName, decoration,
581  **kwargs) :
582  """add another selection decoration to the selection of the given
583  name for the given container"""
584  if selectionName != '' and not self._selectionNameExpr.fullmatch (selectionName) :
585  raise ValueError ('invalid selection name: ' + selectionName)
586  if containerName not in self._containerConfig :
587  self._containerConfig[containerName] = ContainerConfig (containerName, containerName, noSysSuffix=self._noSysSuffix)
588  config = self._containerConfig[containerName]
589  selection = SelectionConfig (selectionName, decoration, **kwargs)
590  config.selections.append (selection)
591 
592 

◆ autoconfigFlags()

def python.ConfigAccumulator.ConfigAccumulator.autoconfigFlags (   self)
auto configuration flags

Definition at line 194 of file ConfigAccumulator.py.

194  def autoconfigFlags (self) :
195  """auto configuration flags"""
196  return self._autoconfigFlags
197 

◆ campaign()

def python.ConfigAccumulator.ConfigAccumulator.campaign (   self)
the MC campaign we run on

Definition at line 214 of file ConfigAccumulator.py.

214  def campaign(self) :
215  """the MC campaign we run on"""
216  return self._campaign
217 

◆ copyName()

def python.ConfigAccumulator.ConfigAccumulator.copyName (   self,
  containerName 
)
register that a copy of the container will be made and return
its name

Definition at line 363 of file ConfigAccumulator.py.

363  def copyName (self, containerName) :
364  """register that a copy of the container will be made and return
365  its name"""
366  if containerName not in self._containerConfig :
367  raise Exception ("unknown container: " + containerName)
368  self._containerConfig[containerName].index += 1
369  return self._containerConfig[containerName].currentName()
370 
371 

◆ createAlgorithm()

def python.ConfigAccumulator.ConfigAccumulator.createAlgorithm (   self,
  type,
  name,
  reentrant = False 
)
create a new algorithm and register it as the current algorithm

Definition at line 234 of file ConfigAccumulator.py.

234  def createAlgorithm (self, type, name, reentrant=False) :
235  """create a new algorithm and register it as the current algorithm"""
236  if self._pass == 0 :
237  if name in self._algorithms :
238  raise Exception ('duplicate algorithms: ' + name)
239  if reentrant:
240  alg = DualUseConfig.createReentrantAlgorithm (type, name)
241  else:
242  alg = DualUseConfig.createAlgorithm (type, name)
243 
244  if DualUseConfig.useComponentAccumulator:
245  if self._algSeq :
246  self.CA.addEventAlgo(alg,self._algSeq.name)
247  else :
248  self.CA.addEventAlgo(alg)
249  else:
250  self._algSeq += alg
251  self._algorithms[name] = alg
252  self._currentAlg = alg
253  return alg
254  else :
255  if name not in self._algorithms :
256  raise Exception ('unknown algorithm requested: ' + name)
257  self._currentAlg = self._algorithms[name]
258  if self.CA and self._currentAlg != self.CA.getEventAlgo(name) :
259  raise Exception ('change to algorithm object: ' + name)
260  return self._algorithms[name]
261 
262 

◆ createPublicTool()

def python.ConfigAccumulator.ConfigAccumulator.createPublicTool (   self,
  type,
  name 
)
create a new public tool and register it as the "current algorithm"

Definition at line 287 of file ConfigAccumulator.py.

287  def createPublicTool (self, type, name) :
288  '''create a new public tool and register it as the "current algorithm"'''
289  if self._pass == 0 :
290  if name in self._algorithms :
291  raise Exception ('duplicate public tool: ' + name)
292  tool = DualUseConfig.createPublicTool (type, name)
293  # Avoid importing AthenaCommon.AppMgr in a CA Athena job
294  # as it modifies Gaudi behaviour
295  if DualUseConfig.isAthena:
296  if DualUseConfig.useComponentAccumulator:
297  self.CA.addPublicTool(tool)
298  else:
299  # We're not, so let's remember this as a "normal" algorithm:
300  self._algSeq += tool
301  self._algorithms[name] = tool
302  self._currentAlg = tool
303  return tool
304  else :
305  if name not in self._algorithms :
306  raise Exception ('unknown public tool requested: ' + name)
307  self._currentAlg = self._algorithms[name]
308  return self._algorithms[name]
309 
310 

◆ createService()

def python.ConfigAccumulator.ConfigAccumulator.createService (   self,
  type,
  name 
)
create a new service and register it as the "current algorithm"

Definition at line 263 of file ConfigAccumulator.py.

263  def createService (self, type, name) :
264  '''create a new service and register it as the "current algorithm"'''
265  if self._pass == 0 :
266  if name in self._algorithms :
267  raise Exception ('duplicate service: ' + name)
268  service = DualUseConfig.createService (type, name)
269  # Avoid importing AthenaCommon.AppMgr in a CA Athena job
270  # as it modifies Gaudi behaviour
271  if DualUseConfig.isAthena:
272  if DualUseConfig.useComponentAccumulator:
273  self.CA.addService(service)
274  else:
275  # We're not, so let's remember this as a "normal" algorithm:
276  self._algSeq += service
277  self._algorithms[name] = service
278  self._currentAlg = service
279  return service
280  else :
281  if name not in self._algorithms :
282  raise Exception ('unknown service requested: ' + name)
283  self._currentAlg = self._algorithms[name]
284  return self._algorithms[name]
285 
286 

◆ dataType()

def python.ConfigAccumulator.ConfigAccumulator.dataType (   self)
the data type we run on (data, fullsim, fastsim)

Definition at line 198 of file ConfigAccumulator.py.

198  def dataType (self) :
199  """the data type we run on (data, fullsim, fastsim)"""
200  return self._dataType
201 

◆ dataYear()

def python.ConfigAccumulator.ConfigAccumulator.dataYear (   self)
for data, the corresponding year; for MC, zero

Definition at line 222 of file ConfigAccumulator.py.

222  def dataYear(self) :
223  """for data, the corresponding year; for MC, zero"""
224  return self._dataYear
225 

◆ dsid()

def python.ConfigAccumulator.ConfigAccumulator.dsid (   self)
the mcChannelNumber or DSID of the sample we run on

Definition at line 210 of file ConfigAccumulator.py.

210  def dsid(self) :
211  """the mcChannelNumber or DSID of the sample we run on"""
212  return self._dsid
213 

◆ generatorInfo()

def python.ConfigAccumulator.ConfigAccumulator.generatorInfo (   self)
the dictionary of MC generators and their versions for the sample we run on

Definition at line 226 of file ConfigAccumulator.py.

226  def generatorInfo(self) :
227  """the dictionary of MC generators and their versions for the sample we run on"""
228  return self._generatorInfo
229 

◆ geometry()

def python.ConfigAccumulator.ConfigAccumulator.geometry (   self)
the LHC Run period we run on

Definition at line 206 of file ConfigAccumulator.py.

206  def geometry (self) :
207  """the LHC Run period we run on"""
208  return self._geometry
209 

◆ getEventCutFlow()

def python.ConfigAccumulator.ConfigAccumulator.getEventCutFlow (   self,
  selection 
)
get the list of decorated selections for an event cutflow,  corresponding to
key 'selection'

Definition at line 572 of file ConfigAccumulator.py.

572  def getEventCutFlow (self, selection) :
573 
574  """get the list of decorated selections for an event cutflow, corresponding to
575  key 'selection'
576  """
577  return self._eventcutflow[selection]
578 
579 

◆ getFullSelection()

def python.ConfigAccumulator.ConfigAccumulator.getFullSelection (   self,
  containerName,
  selectionName,
skipBase = False,
  excludeFrom = None 
)
get the selection string for the given selection on the given
container

This can handle both individual selections or selection
expressions (e.g. `loose||tight`) with the later being
properly expanded.  Either way the base selection (i.e. the
selection without a name) will always be applied on top.

containerName --- the container the selection is defined on
selectionName --- the name of the selection, or a selection
          expression based on multiple named selections
skipBase --- will avoid the base selection, and should normally
     not be used by the end-user.
excludeFrom --- a set of string names of selection sources to exclude
        e.g. to exclude OR selections from MET

Definition at line 465 of file ConfigAccumulator.py.

465  def getFullSelection (self, containerName, selectionName,
466  *, skipBase = False, excludeFrom = None) :
467 
468  """get the selection string for the given selection on the given
469  container
470 
471  This can handle both individual selections or selection
472  expressions (e.g. `loose||tight`) with the later being
473  properly expanded. Either way the base selection (i.e. the
474  selection without a name) will always be applied on top.
475 
476  containerName --- the container the selection is defined on
477  selectionName --- the name of the selection, or a selection
478  expression based on multiple named selections
479  skipBase --- will avoid the base selection, and should normally
480  not be used by the end-user.
481  excludeFrom --- a set of string names of selection sources to exclude
482  e.g. to exclude OR selections from MET
483  """
484  if containerName not in self._containerConfig :
485  return ""
486 
487  if excludeFrom is None :
488  excludeFrom = set()
489  elif not isinstance(excludeFrom, set) :
490  raise ValueError ('invalid excludeFrom argument (need set of strings): ' + str(excludeFrom))
491 
492  # Check if this is actually a selection expression,
493  # e.g. `A||B` and if so translate it into a complex expression
494  # for the user. I'm not trying to do any complex syntax
495  # recognition, but instead just produce an expression that the
496  # C++ parser ought to be able to read.
497  if selectionName != '' and \
498  not self._selectionNameExpr.fullmatch (selectionName) :
499  result = ''
500  while selectionName != '' :
501  match = self._selectionNameExpr.match (selectionName)
502  if not match :
503  result += selectionName[0]
504  selectionName = selectionName[1:]
505  else :
506  subname = match.group(0)
507  subresult = self.getFullSelection (containerName, subname, skipBase = True, excludeFrom=excludeFrom)
508  if subresult != '' :
509  result += '(' + subresult + ')'
510  else :
511  result += 'true'
512  selectionName = selectionName[len(subname):]
513  subresult = self.getFullSelection (containerName, '', excludeFrom=excludeFrom)
514  if subresult != '' :
515  result = subresult + '&&(' + result + ')'
516  return result
517 
518  config = self._containerConfig[containerName]
519  decorations = []
520  hasSelectionName = False
521  for selection in config.selections :
522  if ((selection.name == '' and not skipBase) or selection.name == selectionName) and (selection.comesFrom not in excludeFrom) :
523  decorations += [selection.decoration]
524  if selection.name == selectionName :
525  hasSelectionName = True
526  if not hasSelectionName and selectionName != '' :
527  raise KeyError ('invalid selection name: ' + containerName + '.' + selectionName)
528  return '&&'.join (decorations)
529 
530 

◆ getOutputContainerOrigin()

def python.ConfigAccumulator.ConfigAccumulator.getOutputContainerOrigin (   self,
  outputContainerName 
)
Get the name of the actual container, for which an output is registered

Definition at line 602 of file ConfigAccumulator.py.

602  def getOutputContainerOrigin (self, outputContainerName) :
603  """Get the name of the actual container, for which an output is registered"""
604  try:
605  return self._outputContainers[outputContainerName]
606  except KeyError:
607  try:
608  return self._containerConfig[outputContainerName].name
609  except KeyError:
610  raise KeyError ("output container unknown: " + outputContainerName)
611 
612 

◆ getOutputVars()

def python.ConfigAccumulator.ConfigAccumulator.getOutputVars (   self,
  containerName 
)
get the output variables for the given container

Definition at line 627 of file ConfigAccumulator.py.

627  def getOutputVars (self, containerName) :
628  """get the output variables for the given container"""
629  if containerName in self._outputContainers :
630  containerName = self._outputContainers[containerName]
631  if containerName not in self._containerConfig :
632  raise KeyError ("unknown container for output: " + containerName)
633  return self._containerConfig[containerName].outputs
634 
635 

◆ getPreselection()

def python.ConfigAccumulator.ConfigAccumulator.getPreselection (   self,
  containerName,
  selectionName,
asList = False 
)
get the preselection string for the given selection on the given
container

Definition at line 444 of file ConfigAccumulator.py.

444  def getPreselection (self, containerName, selectionName, *, asList = False) :
445 
446  """get the preselection string for the given selection on the given
447  container
448  """
449  if selectionName != '' and not self._selectionNameExpr.fullmatch (selectionName) :
450  raise ValueError ('invalid selection name: ' + selectionName)
451  if containerName not in self._containerConfig :
452  return ""
453  config = self._containerConfig[containerName]
454  decorations = []
455  for selection in config.selections :
456  if (selection.name == '' or selection.name == selectionName) and \
457  selection.preselection :
458  decorations += [selection.decoration]
459  if asList :
460  return decorations
461  else :
462  return '&&'.join (decorations)
463 
464 

◆ getSelectionCutFlow()

def python.ConfigAccumulator.ConfigAccumulator.getSelectionCutFlow (   self,
  containerName,
  selectionName 
)
get the individual selections as a list for producing the cutflow for
the given selection on the given container

This can only handle individual selections, not selection
expressions (e.g. `loose||tight`).

Definition at line 531 of file ConfigAccumulator.py.

531  def getSelectionCutFlow (self, containerName, selectionName) :
532 
533  """get the individual selections as a list for producing the cutflow for
534  the given selection on the given container
535 
536  This can only handle individual selections, not selection
537  expressions (e.g. `loose||tight`).
538 
539  """
540  if containerName not in self._containerConfig :
541  return []
542 
543  # Check if this is actually a selection expression,
544  # e.g. `A||B` and if so translate it into a complex expression
545  # for the user. I'm not trying to do any complex syntax
546  # recognition, but instead just produce an expression that the
547  # C++ parser ought to be able to read.
548  if selectionName != '' and \
549  not self._selectionNameExpr.fullmatch (selectionName) :
550  raise ValueError ('not allowed to do cutflow on selection expression: ' + selectionName)
551 
552  config = self._containerConfig[containerName]
553  decorations = []
554  for selection in config.selections :
555  if (selection.name == '' or selection.name == selectionName) :
556  decorations += [selection.decoration]
557  return decorations
558 
559 

◆ getSelectionNames()

def python.ConfigAccumulator.ConfigAccumulator.getSelectionNames (   self,
  containerName,
  excludeFrom = None 
)
Retrieve set of unique selections defined for a given container

Definition at line 636 of file ConfigAccumulator.py.

636  def getSelectionNames (self, containerName, excludeFrom = None) :
637  """Retrieve set of unique selections defined for a given container"""
638  if containerName not in self._containerConfig :
639  return []
640  if excludeFrom is None:
641  excludeFrom = set()
642  elif not isinstance(excludeFrom, set) :
643  raise ValueError ('invalid excludeFrom argument (need set of strings): ' + str(excludeFrom))
644 
645  config = self._containerConfig[containerName]
646  # because cuts are registered individually, selection names can repeat themselves
647  # but we are interested in unique names only
648  selectionNames = set()
649  for selection in config.selections:
650  if selection.comesFrom in excludeFrom:
651  continue
652  # skip flags which should be disabled in output
653  if selection.writeToOutput:
654  selectionNames.add(selection.name)
655  return selectionNames

◆ hltSummary()

def python.ConfigAccumulator.ConfigAccumulator.hltSummary (   self)
the HLTSummary configuration to be used for the trigger decision tool

Definition at line 230 of file ConfigAccumulator.py.

230  def hltSummary(self) :
231  """the HLTSummary configuration to be used for the trigger decision tool"""
232  return self._hltSummary
233 

◆ isMetContainer()

def python.ConfigAccumulator.ConfigAccumulator.isMetContainer (   self,
  containerName 
)
whether the given container is registered as a MET container

This is mostly/exclusively used for determining whether to
write out the whole container or just a single MET term.

Definition at line 398 of file ConfigAccumulator.py.

398  def isMetContainer (self, containerName) :
399  """whether the given container is registered as a MET container
400 
401  This is mostly/exclusively used for determining whether to
402  write out the whole container or just a single MET term.
403  """
404  if containerName not in self._containerConfig :
405  raise Exception ("container unknown: " + containerName)
406  return self._containerConfig[containerName].isMet
407 
408 

◆ isPhyslite()

def python.ConfigAccumulator.ConfigAccumulator.isPhyslite (   self)
whether we run on PHYSLITE

Definition at line 202 of file ConfigAccumulator.py.

202  def isPhyslite (self) :
203  """whether we run on PHYSLITE"""
204  return self._isPhyslite
205 

◆ nextPass()

def python.ConfigAccumulator.ConfigAccumulator.nextPass (   self)
switch to the next configuration pass

Configuration happens in two steps, with all the blocks processed
twice.  This switches from the first to the second pass.

Definition at line 429 of file ConfigAccumulator.py.

429  def nextPass (self) :
430  """switch to the next configuration pass
431 
432  Configuration happens in two steps, with all the blocks processed
433  twice. This switches from the first to the second pass.
434  """
435  if self._pass != 0 :
436  raise Exception ("already performed final pass")
437  for name in self._containerConfig :
438  self._containerConfig[name].nextPass ()
439  self._pass = 1
440  self._currentAlg = None
441  self._outputContainers = {}
442 
443 

◆ noSystematics()

def python.ConfigAccumulator.ConfigAccumulator.noSystematics (   self)
noSystematics flag used by CommonServices block

Definition at line 190 of file ConfigAccumulator.py.

190  def noSystematics (self) :
191  """noSystematics flag used by CommonServices block"""
192  return self._noSystematics
193 

◆ originalName()

def python.ConfigAccumulator.ConfigAccumulator.originalName (   self,
  containerName 
)
get the "original" name of the given container

This is mostly/exclusively used for jet containers, so that
subsequent configurations know which jet container they
operate on.

Definition at line 383 of file ConfigAccumulator.py.

383  def originalName (self, containerName) :
384  """get the "original" name of the given container
385 
386  This is mostly/exclusively used for jet containers, so that
387  subsequent configurations know which jet container they
388  operate on.
389  """
390  if containerName not in self._containerConfig :
391  raise Exception ("container unknown: " + containerName)
392  result = self._containerConfig[containerName].originalName
393  if result is None :
394  raise Exception ("no original name for: " + containerName)
395  return result
396 
397 

◆ readName()

def python.ConfigAccumulator.ConfigAccumulator.readName (   self,
  containerName 
)
get the name of the "current copy" of the given container

As extra copies get created during processing this will track
the correct name of the current copy.  Optionally one can pass
in the name of the container before the first copy.

Definition at line 351 of file ConfigAccumulator.py.

351  def readName (self, containerName) :
352  """get the name of the "current copy" of the given container
353 
354  As extra copies get created during processing this will track
355  the correct name of the current copy. Optionally one can pass
356  in the name of the container before the first copy.
357  """
358  if containerName not in self._containerConfig :
359  raise Exception ("no source container for: " + containerName)
360  return self._containerConfig[containerName].currentName()
361 
362 

◆ readNameAndSelection()

def python.ConfigAccumulator.ConfigAccumulator.readNameAndSelection (   self,
  containerName,
excludeFrom = None 
)
get the name of the "current copy" of the given container, and the
selection string

This is mostly meant for MET and OR for whom the actual object
selection is relevant, and which as such allow to pass in the
working point as "ObjectName.WorkingPoint".

Definition at line 409 of file ConfigAccumulator.py.

409  def readNameAndSelection (self, containerName, *, excludeFrom = None) :
410  """get the name of the "current copy" of the given container, and the
411  selection string
412 
413  This is mostly meant for MET and OR for whom the actual object
414  selection is relevant, and which as such allow to pass in the
415  working point as "ObjectName.WorkingPoint".
416  """
417  split = containerName.split (".")
418  if len(split) == 1 :
419  objectName = split[0]
420  selectionName = ''
421  elif len(split) == 2 :
422  objectName = split[0]
423  selectionName = split[1]
424  else :
425  raise Exception ('invalid object selection name: ' + containerName)
426  return self.readName (objectName), self.getFullSelection (objectName, selectionName, excludeFrom=excludeFrom)
427 
428 

◆ runNumber()

def python.ConfigAccumulator.ConfigAccumulator.runNumber (   self)
the MC runNumber

Definition at line 218 of file ConfigAccumulator.py.

218  def runNumber(self) :
219  """the MC runNumber"""
220  return self._runNumber
221 

◆ setSourceName()

def python.ConfigAccumulator.ConfigAccumulator.setSourceName (   self,
  containerName,
  sourceName,
originalName = None 
)
set the (default) name of the source/original container

This is essentially meant to allow using e.g. the muon
configuration and the user not having to manually specify that
they want to use the Muons/AnalysisMuons container from the
input file.

In addition it allows to set the original name of the
container (which may be different from the source name), which
is mostly/exclusively used for jet containers, so that
subsequent configurations know which jet container they
operate on.

Definition at line 317 of file ConfigAccumulator.py.

317  def setSourceName (self, containerName, sourceName,
318  *, originalName = None) :
319  """set the (default) name of the source/original container
320 
321  This is essentially meant to allow using e.g. the muon
322  configuration and the user not having to manually specify that
323  they want to use the Muons/AnalysisMuons container from the
324  input file.
325 
326  In addition it allows to set the original name of the
327  container (which may be different from the source name), which
328  is mostly/exclusively used for jet containers, so that
329  subsequent configurations know which jet container they
330  operate on.
331  """
332  if containerName not in self._containerConfig :
333  self._containerConfig[containerName] = ContainerConfig (containerName, sourceName, noSysSuffix = self._noSysSuffix, originalName = originalName)
334 
335 

◆ wantCopy()

def python.ConfigAccumulator.ConfigAccumulator.wantCopy (   self,
  containerName 
)
ask whether we want/need a copy of the container

This usually only happens if no copy of the container has been
made yet and the copy is needed to allow modifications, etc.

Definition at line 372 of file ConfigAccumulator.py.

372  def wantCopy (self, containerName) :
373  """ask whether we want/need a copy of the container
374 
375  This usually only happens if no copy of the container has been
376  made yet and the copy is needed to allow modifications, etc.
377  """
378  if containerName not in self._containerConfig :
379  raise Exception ("no source container for: " + containerName)
380  return self._containerConfig[containerName].index == 0
381 
382 

◆ writeName()

def python.ConfigAccumulator.ConfigAccumulator.writeName (   self,
  containerName,
isMet = None 
)
register that the given container will be made and return
its name

Definition at line 336 of file ConfigAccumulator.py.

336  def writeName (self, containerName, *, isMet=None) :
337  """register that the given container will be made and return
338  its name"""
339  if containerName not in self._containerConfig :
340  self._containerConfig[containerName] = ContainerConfig (containerName, sourceName = None, noSysSuffix = self._noSysSuffix)
341  if self._containerConfig[containerName].sourceName is not None :
342  raise Exception ("trying to write container configured for input: " + containerName)
343  if self._containerConfig[containerName].index != 0 :
344  raise Exception ("trying to write container twice: " + containerName)
345  self._containerConfig[containerName].index += 1
346  if isMet is not None :
347  self._containerConfig[containerName].isMet = isMet
348  return self._containerConfig[containerName].currentName()
349 
350 

Member Data Documentation

◆ _algorithms

python.ConfigAccumulator.ConfigAccumulator._algorithms
private

Definition at line 167 of file ConfigAccumulator.py.

◆ _algSeq

python.ConfigAccumulator.ConfigAccumulator._algSeq
private

Definition at line 161 of file ConfigAccumulator.py.

◆ _autoconfigFlags

python.ConfigAccumulator.ConfigAccumulator._autoconfigFlags
private

Definition at line 111 of file ConfigAccumulator.py.

◆ _campaign

python.ConfigAccumulator.ConfigAccumulator._campaign
private

Definition at line 157 of file ConfigAccumulator.py.

◆ _containerConfig

python.ConfigAccumulator.ConfigAccumulator._containerConfig
private

Definition at line 164 of file ConfigAccumulator.py.

◆ _currentAlg

python.ConfigAccumulator.ConfigAccumulator._currentAlg
private

Definition at line 168 of file ConfigAccumulator.py.

◆ _dataType

python.ConfigAccumulator.ConfigAccumulator._dataType
private

Definition at line 153 of file ConfigAccumulator.py.

◆ _dataYear

python.ConfigAccumulator.ConfigAccumulator._dataYear
private

Definition at line 159 of file ConfigAccumulator.py.

◆ _dsid

python.ConfigAccumulator.ConfigAccumulator._dsid
private

Definition at line 156 of file ConfigAccumulator.py.

◆ _eventcutflow

python.ConfigAccumulator.ConfigAccumulator._eventcutflow
private

Definition at line 171 of file ConfigAccumulator.py.

◆ _generatorInfo

python.ConfigAccumulator.ConfigAccumulator._generatorInfo
private

Definition at line 160 of file ConfigAccumulator.py.

◆ _geometry

python.ConfigAccumulator.ConfigAccumulator._geometry
private

Definition at line 155 of file ConfigAccumulator.py.

◆ _hltSummary

python.ConfigAccumulator.ConfigAccumulator._hltSummary
private

Definition at line 173 of file ConfigAccumulator.py.

◆ _isPhyslite

python.ConfigAccumulator.ConfigAccumulator._isPhyslite
private

Definition at line 154 of file ConfigAccumulator.py.

◆ _muonCalibMode

python.ConfigAccumulator.ConfigAccumulator._muonCalibMode
private

Definition at line 172 of file ConfigAccumulator.py.

◆ _noSysSuffix

python.ConfigAccumulator.ConfigAccumulator._noSysSuffix
private

Definition at line 163 of file ConfigAccumulator.py.

◆ _noSystematics

python.ConfigAccumulator.ConfigAccumulator._noSystematics
private

Definition at line 162 of file ConfigAccumulator.py.

◆ _outputContainers

python.ConfigAccumulator.ConfigAccumulator._outputContainers
private

Definition at line 165 of file ConfigAccumulator.py.

◆ _pass

python.ConfigAccumulator.ConfigAccumulator._pass
private

Definition at line 166 of file ConfigAccumulator.py.

◆ _runNumber

python.ConfigAccumulator.ConfigAccumulator._runNumber
private

Definition at line 158 of file ConfigAccumulator.py.

◆ _selectionNameExpr

python.ConfigAccumulator.ConfigAccumulator._selectionNameExpr
private

Definition at line 169 of file ConfigAccumulator.py.

◆ CA

python.ConfigAccumulator.ConfigAccumulator.CA

Definition at line 178 of file ConfigAccumulator.py.


The documentation for this class was generated from the following file:
python.TrigDecisionToolHelpers.getRun3NavigationContainerFromInput_forAnalysisBase
def getRun3NavigationContainerFromInput_forAnalysisBase(flags)
Definition: TrigDecisionToolHelpers.py:22
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.DualUseConfig.createPublicTool
def createPublicTool(typeName, toolName)
Definition: DualUseConfig.py:84
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
python.DualUseConfig.addPrivateTool
def addPrivateTool(alg, toolName, typeName)
Definition: DualUseConfig.py:180
downloadSingle.dataType
string dataType
Definition: downloadSingle.py:18
python.DualUseConfig.createService
def createService(typeName, serviceName, sequence=None)
Definition: DualUseConfig.py:127
python.DualUseConfig.createAlgorithm
def createAlgorithm(typeName, instanceName)
Definition: DualUseConfig.py:56
Generate_dsid_ranseed.dsid
dsid
Definition: Generate_dsid_ranseed.py:6
LArG4GenerateShowerLib.geometry
geometry
Definition: LArG4GenerateShowerLib.py:19
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
dqt_zlumi_pandas.campaign
campaign
Definition: dqt_zlumi_pandas.py:40
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798