CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
Config.Modifier Class Reference
Inheritance diagram for Config.Modifier:

Public Member Functions

def __init__
 
def isChosen
 
def toModify
 
def toModifyProcess
 

Private Member Functions

def _applyNewProcessModifiers
 
def _setChosen
 

Private Attributes

 __chosen
 
 __processModifiers
 

Detailed Description

This class is used to define standard modifications to a Process.
An instance of this class is declared to denote a specific modification,e.g. era2017 could
reconfigure items in a process to match our expectation of running in 2017. Once declared,
these Modifier instances are imported into a configuration and items which need to be modified
are then associated with the Modifier and with the action to do the modification.
The registered modifications will only occur if the Modifier was passed to 
the cms.Process' constructor.

Definition at line 1053 of file Config.py.

Constructor & Destructor Documentation

def Config.Modifier.__init__ (   self)

Definition at line 1062 of file Config.py.

1063  def __init__(self):
self.__chosen = False

Member Function Documentation

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

Definition at line 1085 of file Config.py.

References Config.Modifier.__processModifiers, list(), and m.

1086  def _applyNewProcessModifiers(self,process):
1087  """Should only be called by cms.Process instances
1088  applies list of accumulated changes to the process"""
1089  for m in self.__processModifiers:
1090  m(process)
self.__processModifiers = list()
def _applyNewProcessModifiers
Definition: Config.py:1085
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def Config.Modifier._setChosen (   self)
private
Should only be called by cms.Process instances

Definition at line 1091 of file Config.py.

References Config.Modifier.__chosen.

1092  def _setChosen(self):
1093  """Should only be called by cms.Process instances"""
self.__chosen = True
def Config.Modifier.isChosen (   self)

Definition at line 1094 of file Config.py.

References Config.Modifier.__chosen.

Referenced by Config.Modifier.toModify().

1095  def isChosen(self):
1096  return self.__chosen
def Config.Modifier.toModify (   self,
  obj,
  func = None,
  kw 
)
This is used to register an action to be performed on the specific object. Two different forms are allowed
Form 1: A callable object (e.g. function) can be passed as the second. This callable object is expected to take one argument
which will be the object passed in as the first argument.
Form 2: A list of parameter name, value pairs can be passed
   mod.toModify(foo, fred=cms.int32(7), barney = cms.double(3.14))

Definition at line 1069 of file Config.py.

References Config.Modifier.isChosen(), and groupFilesInBlocks.temp.

1070  def toModify(self,obj, func=None,**kw):
1071  """This is used to register an action to be performed on the specific object. Two different forms are allowed
1072  Form 1: A callable object (e.g. function) can be passed as the second. This callable object is expected to take one argument
1073  which will be the object passed in as the first argument.
1074  Form 2: A list of parameter name, value pairs can be passed
1075  mod.toModify(foo, fred=cms.int32(7), barney = cms.double(3.14))
1076  """
1077  if func is not None and len(kw) != 0:
1078  raise TypeError("toModify takes either two arguments or one argument and key/value pairs")
1079  if not self.isChosen():
1080  return
1081  if func is not None:
1082  func(obj)
1083  else:
1084  temp =_ParameterModifier(kw)
temp(obj)
def Config.Modifier.toModifyProcess (   self,
  func 
)
This is used to register actions to be performed on the process as a whole.
This takes as argument a callable object (e.g. function) which takes as its sole argument an instance of Process

Definition at line 1065 of file Config.py.

1066  def toModifyProcess(self,func):
1067  """This is used to register actions to be performed on the process as a whole.
1068  This takes as argument a callable object (e.g. function) which takes as its sole argument an instance of Process"""
self.__processModifiers.append(func)
def toModifyProcess
Definition: Config.py:1065

Member Data Documentation

Config.Modifier.__chosen
private

Definition at line 1064 of file Config.py.

Referenced by Config.Modifier._setChosen(), Config.ModifierChain._setChosen(), Config.Modifier.isChosen(), and Config.ModifierChain.isChosen().

Config.Modifier.__processModifiers
private

Definition at line 1063 of file Config.py.

Referenced by Config.Modifier._applyNewProcessModifiers().