CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
Config.ModifierChain Class Reference
Inheritance diagram for Config.ModifierChain:

Public Member Functions

def __init__ (self, chainedModifiers)
 
def copyAndExclude (self, toExclude)
 

Private Member Functions

def __copyIfExclude (self, toExclude)
 
def _applyNewProcessModifiers (self, process)
 
def _isChosen (self)
 
def _isOrContains (self, other)
 
def _setChosen (self)
 

Private Attributes

 __chain
 
 __chosen
 

Detailed Description

A Modifier made up of a list of Modifiers

Definition at line 1919 of file Config.py.

Constructor & Destructor Documentation

◆ __init__()

def Config.ModifierChain.__init__ (   self,
  chainedModifiers 
)

Definition at line 1922 of file Config.py.

1922  def __init__(self, *chainedModifiers):
1923  self.__chosen = False
1924  self.__chain = chainedModifiers
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ __copyIfExclude()

def Config.ModifierChain.__copyIfExclude (   self,
  toExclude 
)
private

Definition at line 1951 of file Config.py.

References Config.Modifier._isOrContains(), Config.ModifierChain._isOrContains(), and Config.ModifierChain.copyAndExclude().

1951  def __copyIfExclude(self,toExclude):
1952  shouldCopy = False
1953  for m in toExclude:
1954  if self._isOrContains(m):
1955  shouldCopy = True
1956  break
1957  if shouldCopy:
1958  return self.copyAndExclude(toExclude)
1959  return self

◆ _applyNewProcessModifiers()

def Config.ModifierChain._applyNewProcessModifiers (   self,
  process 
)
private
Should only be called by cms.Process instances
applies list of accumulated changes to the process

Definition at line 1925 of file Config.py.

References Config.ModifierChain.__chain.

1925  def _applyNewProcessModifiers(self,process):
1926  """Should only be called by cms.Process instances
1927  applies list of accumulated changes to the process"""
1928  for m in self.__chain:
1929  m._applyNewProcessModifiers(process)

◆ _isChosen()

def Config.ModifierChain._isChosen (   self,
  bool 
)
private

Definition at line 1935 of file Config.py.

References Config.Modifier.__chosen, and Config.ModifierChain.__chosen.

Referenced by Config._BoolModifierBase.toModify(), and Config._BoolModifierBase.toReplaceWith().

1935  def _isChosen(self) -> bool:
1936  return self.__chosen

◆ _isOrContains()

def Config.ModifierChain._isOrContains (   self,
  other 
)
private

Definition at line 1960 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

1960  def _isOrContains(self, other):
1961  if self is other:
1962  return True
1963  for m in self.__chain:
1964  if m._isOrContains(other):
1965  return True
1966  return False
1967 

◆ _setChosen()

def Config.ModifierChain._setChosen (   self)
private
Should only be called by cms.Process instances

Definition at line 1930 of file Config.py.

References Config.ModifierChain.__chain, Config.Modifier.__chosen, and Config.ModifierChain.__chosen.

1930  def _setChosen(self):
1931  """Should only be called by cms.Process instances"""
1932  self.__chosen = True
1933  for m in self.__chain:
1934  m._setChosen()

◆ copyAndExclude()

def Config.ModifierChain.copyAndExclude (   self,
  toExclude 
)
Creates a new ModifierChain which is a copy of
  this ModifierChain but excludes any Modifier or
  ModifierChain in the list toExclude.
  The exclusion is done recursively down the chain.

Definition at line 1937 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

1937  def copyAndExclude(self, toExclude):
1938  """Creates a new ModifierChain which is a copy of
1939  this ModifierChain but excludes any Modifier or
1940  ModifierChain in the list toExclude.
1941  The exclusion is done recursively down the chain.
1942  """
1943  newMods = []
1944  for m in self.__chain:
1945  if m not in toExclude:
1946  s = m
1947  if isinstance(m,ModifierChain):
1948  s = m.__copyIfExclude(toExclude)
1949  newMods.append(s)
1950  return ModifierChain(*newMods)

Member Data Documentation

◆ __chain

Config.ModifierChain.__chain
private

◆ __chosen

Config.ModifierChain.__chosen
private

Definition at line 1923 of file Config.py.

Referenced by Config.ModifierChain._isChosen(), and Config.ModifierChain._setChosen().