CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self, paramName, paramSearch, paramValue, verbose=False)
 
def doIt (self, mod, name)
 
def enter (self, visitee)
 
def leave (self, visitee)
 

Private Attributes

 _paramName
 
 _paramSearch
 
 _paramValue
 
 _verbose
 

Detailed Description

Visitor that travels within a cms.Sequence, looks for a parameter and replaces its value

Definition at line 108 of file MassReplace.py.

Constructor & Destructor Documentation

◆ __init__()

def MassReplace.MassSearchReplaceParamVisitor.__init__ (   self,
  paramName,
  paramSearch,
  paramValue,
  verbose = False 
)

Definition at line 110 of file MassReplace.py.

110  def __init__(self,paramName,paramSearch,paramValue,verbose=False):
111  self._paramName = paramName
112  self._paramValue = paramValue
113  self._paramSearch = paramSearch
114  self._verbose = verbose
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

◆ doIt()

def MassReplace.MassSearchReplaceParamVisitor.doIt (   self,
  mod,
  name 
)

Definition at line 121 of file MassReplace.py.

References MassReplace.MassSearchParamVisitor._paramName, MassReplace.MassSearchReplaceParamVisitor._paramName, MassReplace.MassSearchReplaceAnyInputTagVisitor._paramSearch, MassReplace.MassSearchParamVisitor._paramSearch, MassReplace.MassSearchReplaceParamVisitor._paramSearch, ConfigBuilder.ConfigBuilder.MassSearchReplaceProcessNameVisitor._paramSearch, MassReplace.MassSearchReplaceParamVisitor._paramValue, MassReplace.MassSearchReplaceAnyInputTagVisitor._verbose, uploads.output._verbose, uploads.uploader._verbose, MassReplace.MassSearchReplaceParamVisitor._verbose, ConfigBuilder.ConfigBuilder.MassSearchReplaceProcessNameVisitor._verbose, and print().

Referenced by MassReplace.MassSearchReplaceParamVisitor.enter().

121  def doIt(self, mod, name):
122  if (hasattr(mod,self._paramName)):
123  if getattr(mod,self._paramName) == self._paramSearch:
124  if self._verbose:print("Replaced %s.%s: %s => %s" % (name,self._paramName,getattr(mod,self._paramName),self._paramValue))
125  setattr(mod,self._paramName,self._paramValue)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ enter()

def MassReplace.MassSearchReplaceParamVisitor.enter (   self,
  visitee 
)

Definition at line 115 of file MassReplace.py.

References TkCommonModeCalculator.doIt(), MassReplace.MassSearchReplaceAnyInputTagVisitor.doIt(), MedianCommonModeCalculator.doIt(), TT6CommonModeCalculator.doIt(), MassReplace.MassSearchReplaceParamVisitor.doIt(), ConfigBuilder.ConfigBuilder.MassSearchReplaceProcessNameVisitor.doIt(), and str.

115  def enter(self,visitee):
116  if isinstance(visitee, cms.SwitchProducer):
117  for modName in visitee.parameterNames_():
118  self.doIt(getattr(visitee, modName), "%s.%s"%(str(visitee), modName))
119  else:
120  self.doIt(visitee, str(visitee))
#define str(s)

◆ leave()

def MassReplace.MassSearchReplaceParamVisitor.leave (   self,
  visitee 
)

Definition at line 126 of file MassReplace.py.

126  def leave(self,visitee):
127  pass
128 

Member Data Documentation

◆ _paramName

MassReplace.MassSearchReplaceParamVisitor._paramName
private

Definition at line 111 of file MassReplace.py.

Referenced by MassReplace.MassSearchReplaceParamVisitor.doIt().

◆ _paramSearch

MassReplace.MassSearchReplaceParamVisitor._paramSearch
private

Definition at line 113 of file MassReplace.py.

Referenced by MassReplace.MassSearchReplaceParamVisitor.doIt().

◆ _paramValue

MassReplace.MassSearchReplaceParamVisitor._paramValue
private

Definition at line 112 of file MassReplace.py.

Referenced by MassReplace.MassSearchReplaceParamVisitor.doIt().

◆ _verbose

MassReplace.MassSearchReplaceParamVisitor._verbose
private

Definition at line 114 of file MassReplace.py.

Referenced by MassReplace.MassSearchReplaceParamVisitor.doIt().