CMS 3D CMS Logo

MassReplace.py
Go to the documentation of this file.
1 from __future__ import print_function
2 import FWCore.ParameterSet.Config as cms
3 
5  """Visitor that travels within a cms.Sequence, looks for a parameter and replace its value
6  It will climb down within PSets, VPSets and VInputTags to find its target"""
7  def __init__(self,paramSearch,paramReplace,verbose=False,moduleLabelOnly=False,skipLabelTest=False):
8  self._paramSearch = self.standardizeInputTagFmt(paramSearch)
9  self._paramReplace = self.standardizeInputTagFmt(paramReplace)
10  self._moduleName = ''
11  self._verbose=verbose
12  self._moduleLabelOnly=moduleLabelOnly
13  self._skipLabelTest=skipLabelTest
14  def doIt(self,pset,base):
15  if isinstance(pset, cms._Parameterizable):
16  for name in pset.parameterNames_():
17  # if I use pset.parameters_().items() I get copies of the parameter values
18  # so I can't modify the nested pset
19  value = getattr(pset,name)
20  if isinstance(value, cms.PSet) or isinstance(value, cms.EDProducer) or isinstance(value, cms.EDAlias):
21  # EDProducer and EDAlias to support SwitchProducer
22  self.doIt(value,base+"."+name)
23  elif isinstance(value, cms.VPSet):
24  for (i,ps) in enumerate(value): self.doIt(ps, "%s.%s[%d]"%(base,name,i) )
25  elif isinstance(value, cms.VInputTag):
26  for (i,n) in enumerate(value):
27  # VInputTag can be declared as a list of strings, so ensure that n is formatted correctly
28  n = self.standardizeInputTagFmt(n)
29  if (n == self._paramSearch):
30  if self._verbose:print("Replace %s.%s[%d] %s ==> %s " % (base, name, i, self._paramSearch, self._paramReplace))
31  if not value.isTracked():
32  value[i] = cms.untracked.InputTag(self._paramReplace.getModuleLabel(),
33  self._paramReplace.getProductInstanceLabel(),
35  else:
36  value[i] = self._paramReplace
37  elif self._moduleLabelOnly and n.moduleLabel == self._paramSearch.moduleLabel:
38  nrep = n; nrep.moduleLabel = self._paramReplace.moduleLabel
39  if self._verbose:print("Replace %s.%s[%d] %s ==> %s " % (base, name, i, n, nrep))
40  value[i] = nrep
41  elif isinstance(value, cms.InputTag):
42  if value == self._paramSearch:
43  if self._verbose:print("Replace %s.%s %s ==> %s " % (base, name, self._paramSearch, self._paramReplace))
44  from copy import deepcopy
45  if not value.isTracked():
46  # the existing value should stay untracked even if the given parameter is tracked
47  setattr(pset, name, cms.untracked.InputTag(self._paramReplace.getModuleLabel(),
48  self._paramReplace.getProductInstanceLabel(),
50  else:
51  setattr(pset, name, deepcopy(self._paramReplace) )
52  elif self._moduleLabelOnly and value.moduleLabel == self._paramSearch.moduleLabel:
53  from copy import deepcopy
54  repl = deepcopy(getattr(pset, name))
55  repl.moduleLabel = self._paramReplace.moduleLabel
56  setattr(pset, name, repl)
57  if self._verbose:print("Replace %s.%s %s ==> %s " % (base, name, value, repl))
58 
59 
60  @staticmethod
61  def standardizeInputTagFmt(inputTag):
62  ''' helper function to ensure that the InputTag is defined as cms.InputTag(str) and not as a plain str '''
63  if not isinstance(inputTag, cms.InputTag):
64  return cms.InputTag(inputTag)
65  return inputTag
66 
67  def enter(self,visitee):
68  label = ''
69  if (not self._skipLabelTest):
70  if hasattr(visitee,"hasLabel_") and visitee.hasLabel_():
71  label = visitee.label_()
72  else: label = '<Module not in a Process>'
73  else:
74  label = '<Module label not tested>'
75  self.doIt(visitee, label)
76  def leave(self,visitee):
77  pass
78 
79 def massSearchReplaceAnyInputTag(sequence, oldInputTag, newInputTag,verbose=False,moduleLabelOnly=False,skipLabelTest=False) :
80  """Replace InputTag oldInputTag with newInputTag, at any level of nesting within PSets, VPSets, VInputTags..."""
81  sequence.visit(MassSearchReplaceAnyInputTagVisitor(oldInputTag,newInputTag,verbose=verbose,moduleLabelOnly=moduleLabelOnly,skipLabelTest=skipLabelTest))
82 
83 def massReplaceInputTag(process,old="rawDataCollector",new="rawDataRepacker",verbose=False,moduleLabelOnly=False,skipLabelTest=False):
84  for s in process.paths_().keys():
85  massSearchReplaceAnyInputTag(getattr(process,s), old, new, verbose, moduleLabelOnly, skipLabelTest)
86  for s in process.endpaths_().keys():
87  massSearchReplaceAnyInputTag(getattr(process,s), old, new, verbose, moduleLabelOnly, skipLabelTest)
88  if process.schedule_() is not None:
89  for task in process.schedule_()._tasks:
90  massSearchReplaceAnyInputTag(task, old, new, verbose, moduleLabelOnly, skipLabelTest)
91  return(process)
92 
94  """Visitor that travels within a cms.Sequence, looks for a parameter and returns a list of modules that have it"""
95  def __init__(self,paramName,paramSearch):
96  self._paramName = paramName
97  self._paramSearch = paramSearch
98  self._modules = []
99  def enter(self,visitee):
100  if (hasattr(visitee,self._paramName)):
101  if getattr(visitee,self._paramName) == self._paramSearch:
102  self._modules.append(visitee)
103  def leave(self,visitee):
104  pass
105  def modules(self):
106  return self._modules
107 
109  """Visitor that travels within a cms.Sequence, looks for a parameter and replaces its value"""
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
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))
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)
126  def leave(self,visitee):
127  pass
128 
129 def massSearchReplaceParam(sequence,paramName,paramOldValue,paramValue,verbose=False):
130  sequence.visit(MassSearchReplaceParamVisitor(paramName,paramOldValue,paramValue,verbose))
131 
132 def massReplaceParameter(process,name="label",old="rawDataCollector",new="rawDataRepacker",verbose=False):
133  for s in process.paths_().keys():
134  massSearchReplaceParam(getattr(process,s),name,old,new,verbose)
135  for s in process.endpaths_().keys():
136  massSearchReplaceParam(getattr(process,s),name,old,new,verbose)
137  if process.schedule_() is not None:
138  for task in process.schedule_()._tasks:
139  massSearchReplaceParam(task, name, old, new, verbose)
140  return(process)
141 
142 if __name__=="__main__":
143  import unittest
144  class SwitchProducerTest(cms.SwitchProducer):
145  def __init__(self, **kargs):
146  super(SwitchProducerTest,self).__init__(
147  dict(
148  test1 = lambda: (True, -10),
149  test2 = lambda: (True, -9),
150  test3 = lambda: (True, -8),
151  test4 = lambda: (True, -7)
152  ), **kargs)
153 
154  class TestModuleCommand(unittest.TestCase):
155 
157  p = cms.Process("test")
158  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
159  p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
160  p.c = cms.EDProducer("ac", src=cms.InputTag("b"), usrc=cms.untracked.InputTag("b"),
161  nested = cms.PSet(src = cms.InputTag("b"), src2 = cms.InputTag("c"), usrc = cms.untracked.InputTag("b")),
162  nestedv = cms.VPSet(cms.PSet(src = cms.InputTag("b")), cms.PSet(src = cms.InputTag("d"))),
163  unestedv = cms.untracked.VPSet(cms.untracked.PSet(src = cms.InputTag("b")), cms.untracked.PSet(src = cms.InputTag("d"))),
164  vec = cms.VInputTag(cms.InputTag("a"), cms.InputTag("b"), cms.InputTag("c"), cms.InputTag("d")),
165  uvec = cms.untracked.VInputTag(cms.untracked.InputTag("a"), cms.untracked.InputTag("b"), cms.untracked.InputTag("c"), cms.untracked.InputTag("d")),
166  )
167  p.sp = SwitchProducerTest(
168  test1 = cms.EDProducer("a", src = cms.InputTag("b"),
169  nested = cms.PSet(src = cms.InputTag("b"), src2 = cms.InputTag("c"), usrc = cms.untracked.InputTag("b"))
170  ),
171  test2 = cms.EDProducer("b", src = cms.InputTag("c"),
172  nested = cms.PSet(src = cms.InputTag("b"), src2 = cms.InputTag("c"), usrc = cms.untracked.InputTag("b"))
173  ),
174  )
175  p.s = cms.Sequence(p.a*p.b*p.c*p.sp)
176  massSearchReplaceAnyInputTag(p.s, cms.InputTag("b"), cms.InputTag("new"))
177  self.assertNotEqual(cms.InputTag("new"), p.b.src)
178  self.assertEqual(cms.InputTag("new"), p.c.src)
179  self.assertEqual(cms.InputTag("new"), p.c.usrc)
180  self.assertEqual(cms.InputTag("new"), p.c.nested.src)
181  self.assertEqual(cms.InputTag("new"), p.c.nested.usrc)
182  self.assertFalse(p.c.nested.usrc.isTracked())
183  self.assertNotEqual(cms.InputTag("new"), p.c.nested.src2)
184  self.assertEqual(cms.InputTag("new"), p.c.nestedv[0].src)
185  self.assertNotEqual(cms.InputTag("new"), p.c.nestedv[1].src)
186  self.assertEqual(cms.InputTag("new"), p.c.unestedv[0].src)
187  self.assertNotEqual(cms.InputTag("new"), p.c.unestedv[1].src)
188  self.assertNotEqual(cms.InputTag("new"), p.c.vec[0])
189  self.assertEqual(cms.InputTag("new"), p.c.vec[1])
190  self.assertNotEqual(cms.InputTag("new"), p.c.vec[2])
191  self.assertNotEqual(cms.InputTag("new"), p.c.vec[3])
192  self.assertNotEqual(cms.InputTag("new"), p.c.uvec[0])
193  self.assertEqual(cms.InputTag("new"), p.c.uvec[1])
194  self.assertNotEqual(cms.InputTag("new"), p.c.uvec[2])
195  self.assertNotEqual(cms.InputTag("new"), p.c.uvec[3])
196  self.assertFalse(p.c.uvec[0].isTracked())
197  self.assertFalse(p.c.uvec[1].isTracked())
198  self.assertFalse(p.c.uvec[2].isTracked())
199  self.assertFalse(p.c.uvec[3].isTracked())
200  self.assertEqual(cms.InputTag("new"), p.sp.test1.src)
201  self.assertEqual(cms.InputTag("new"), p.sp.test1.nested.src)
202  self.assertEqual(cms.InputTag("c"), p.sp.test1.nested.src2)
203  self.assertEqual(cms.untracked.InputTag("new"), p.sp.test1.nested.usrc)
204  self.assertEqual(cms.InputTag("c"), p.sp.test2.src)
205  self.assertEqual(cms.InputTag("new"), p.sp.test2.nested.src)
206  self.assertEqual(cms.InputTag("c"), p.sp.test2.nested.src2)
207  self.assertEqual(cms.untracked.InputTag("new"), p.sp.test2.nested.usrc)
208 
210  process1 = cms.Process("test")
211  massReplaceInputTag(process1, "a", "b", False, False, False)
212  self.assertEqual(process1.dumpPython(), cms.Process('test').dumpPython())
213  p = cms.Process("test")
214  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
215  p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
216  p.c = cms.EDProducer("ac", src=cms.InputTag("b"),
217  nested = cms.PSet(src = cms.InputTag("a"), src2 = cms.InputTag("c"), usrc = cms.untracked.InputTag("a")),
218  nestedv = cms.VPSet(cms.PSet(src = cms.InputTag("a")), cms.PSet(src = cms.InputTag("d"))),
219  unestedv = cms.untracked.VPSet(cms.untracked.PSet(src = cms.InputTag("a")), cms.untracked.PSet(src = cms.InputTag("d"))),
220  vec = cms.VInputTag(cms.InputTag("a"), cms.InputTag("b"), cms.InputTag("c"), cms.InputTag("d")),
221  uvec = cms.untracked.VInputTag(cms.untracked.InputTag("a"), cms.untracked.InputTag("b"), cms.untracked.InputTag("c"), cms.InputTag("d")),
222  )
223  p.d = cms.EDProducer("ab", src=cms.InputTag("a"))
224  p.e = cms.EDProducer("ab", src=cms.InputTag("a"))
225  p.f = cms.EDProducer("ab", src=cms.InputTag("a"))
226  p.g = cms.EDProducer("ab", src=cms.InputTag("a"))
227  p.h = cms.EDProducer("ab", src=cms.InputTag("a"))
228  p.i = cms.EDProducer("ab", src=cms.InputTag("a"))
229  p.sp = SwitchProducerTest(
230  test1 = cms.EDProducer("a", src = cms.InputTag("a"),
231  nested = cms.PSet(src = cms.InputTag("a"), src2 = cms.InputTag("c"), usrc = cms.untracked.InputTag("a"))
232  ),
233  test2 = cms.EDProducer("b", src = cms.InputTag("c"),
234  nested = cms.PSet(src = cms.InputTag("a"), src2 = cms.InputTag("c"), usrc = cms.untracked.InputTag("a"))
235  ),
236  )
237  p.s1 = cms.Sequence(p.a*p.b*p.c*p.sp)
238  p.path1 = cms.Path(p.s1)
239  p.s2 = cms.Sequence(p.d)
240  p.path2 = cms.Path(p.e)
241  p.s3 = cms.Sequence(p.f)
242  p.endpath1 = cms.EndPath(p.s3)
243  p.endpath2 = cms.EndPath(p.g)
244  p.t1 = cms.Task(p.h)
245  p.t2 = cms.Task(p.i)
246  p.schedule = cms.Schedule()
247  p.schedule.associate(p.t1, p.t2)
248  massReplaceInputTag(p, "a", "b", False, False, False)
249  self.assertEqual(cms.InputTag("b"), p.b.src)
250  self.assertEqual(cms.InputTag("b"), p.c.nested.src)
251  self.assertEqual(cms.InputTag("b"), p.c.nested.usrc)
252  self.assertFalse(p.c.nested.usrc.isTracked())
253  self.assertEqual(cms.InputTag("b"), p.c.nestedv[0].src)
254  self.assertEqual(cms.InputTag("b"), p.c.unestedv[0].src)
255  self.assertEqual(cms.InputTag("b"), p.c.vec[0])
256  self.assertEqual(cms.InputTag("c"), p.c.vec[2])
257  self.assertEqual(cms.InputTag("b"), p.c.uvec[0])
258  self.assertEqual(cms.InputTag("c"), p.c.uvec[2])
259  self.assertFalse(p.c.uvec[0].isTracked())
260  self.assertFalse(p.c.uvec[1].isTracked())
261  self.assertFalse(p.c.uvec[2].isTracked())
262  self.assertEqual(cms.InputTag("a"), p.d.src)
263  self.assertEqual(cms.InputTag("b"), p.e.src)
264  self.assertEqual(cms.InputTag("b"), p.f.src)
265  self.assertEqual(cms.InputTag("b"), p.g.src)
266  self.assertEqual(cms.InputTag("b"), p.h.src)
267  self.assertEqual(cms.InputTag("b"), p.i.src)
268  self.assertEqual(cms.InputTag("b"), p.sp.test1.src)
269  self.assertEqual(cms.InputTag("b"), p.sp.test1.nested.src)
270  self.assertEqual(cms.InputTag("c"), p.sp.test1.nested.src2)
271  self.assertEqual(cms.untracked.InputTag("b"), p.sp.test1.nested.usrc)
272  self.assertEqual(cms.InputTag("c"), p.sp.test2.src)
273  self.assertEqual(cms.InputTag("b"), p.sp.test2.nested.src)
274  self.assertEqual(cms.InputTag("c"), p.sp.test2.nested.src2)
275  self.assertEqual(cms.untracked.InputTag("b"), p.sp.test2.nested.usrc)
276 
278  p = cms.Process("test")
279  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
280  p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
281  p.c = cms.EDProducer("ac", src=cms.InputTag("b"),
282  nested = cms.PSet(src = cms.InputTag("c"), src2 = cms.InputTag("b"))
283  )
284  p.d = cms.EDProducer("ac", src=cms.untracked.InputTag("b"),
285  nested = cms.PSet(src = cms.InputTag("c"), src2 = cms.InputTag("b"))
286  )
287  p.sp = SwitchProducerTest(
288  test1 = cms.EDProducer("a", src = cms.InputTag("b"),
289  nested = cms.PSet(src = cms.InputTag("b"))
290  ),
291  test2 = cms.EDProducer("b", src = cms.InputTag("b")),
292  )
293  p.s = cms.Sequence(p.a*p.b*p.c*p.d*p.sp)
294  massSearchReplaceParam(p.s,"src",cms.InputTag("b"),"a")
295  self.assertEqual(cms.InputTag("a"),p.c.src)
296  self.assertEqual(cms.InputTag("c"),p.c.nested.src)
297  self.assertEqual(cms.InputTag("b"),p.c.nested.src2)
298  self.assertEqual(cms.untracked.InputTag("a"),p.d.src)
299  self.assertEqual(cms.InputTag("c"),p.d.nested.src)
300  self.assertEqual(cms.InputTag("b"),p.d.nested.src2)
301  self.assertEqual(cms.InputTag("a"),p.sp.test1.src)
302  self.assertEqual(cms.InputTag("b"),p.sp.test1.nested.src)
303  self.assertEqual(cms.InputTag("a"),p.sp.test2.src)
304 
306  process1 = cms.Process("test")
307  massReplaceParameter(process1, "src", cms.InputTag("a"), "b", False)
308  self.assertEqual(process1.dumpPython(), cms.Process("test").dumpPython())
309  p = cms.Process("test")
310  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
311  p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
312  p.c = cms.EDProducer("ac", src=cms.InputTag("b"),
313  nested = cms.PSet(src = cms.InputTag("a"), src2 = cms.InputTag("c")),
314  nestedv = cms.VPSet(cms.PSet(src = cms.InputTag("a")), cms.PSet(src = cms.InputTag("d"))),
315  vec = cms.VInputTag(cms.InputTag("a"), cms.InputTag("b"), cms.InputTag("c"), cms.InputTag("d"))
316  )
317  p.d = cms.EDProducer("ab", src=cms.InputTag("a"))
318  p.e = cms.EDProducer("ab", src=cms.InputTag("a"))
319  p.f = cms.EDProducer("ab", src=cms.InputTag("a"))
320  p.g = cms.EDProducer("ab", src=cms.InputTag("a"))
321  p.h = cms.EDProducer("ab", src=cms.InputTag("a"))
322  p.i = cms.EDProducer("ab", src=cms.InputTag("a"))
323  p.j = cms.EDProducer("ab", src=cms.untracked.InputTag("a"))
324  p.sp = SwitchProducerTest(
325  test1 = cms.EDProducer("a", src = cms.InputTag("a"),
326  nested = cms.PSet(src = cms.InputTag("a"))
327  ),
328  test2 = cms.EDProducer("b", src = cms.InputTag("a")),
329  )
330  p.s1 = cms.Sequence(p.a*p.b*p.c*p.sp)
331  p.path1 = cms.Path(p.s1)
332  p.s2 = cms.Sequence(p.d)
333  p.path2 = cms.Path(p.e)
334  p.s3 = cms.Sequence(p.f)
335  p.endpath1 = cms.EndPath(p.s3)
336  p.endpath2 = cms.EndPath(p.g)
337  p.t1 = cms.Task(p.h)
338  p.t2 = cms.Task(p.i, p.j)
339  p.schedule = cms.Schedule()
340  p.schedule.associate(p.t1, p.t2)
341  massReplaceParameter(p, "src",cms.InputTag("a"), "b", False)
342  self.assertEqual(cms.InputTag("gen"), p.a.src)
343  self.assertEqual(cms.InputTag("b"), p.b.src)
344  self.assertEqual(cms.InputTag("a"), p.c.vec[0])
345  self.assertEqual(cms.InputTag("c"), p.c.vec[2])
346  self.assertEqual(cms.InputTag("a"), p.d.src)
347  self.assertEqual(cms.InputTag("b"), p.e.src)
348  self.assertEqual(cms.InputTag("b"), p.f.src)
349  self.assertEqual(cms.InputTag("b"), p.g.src)
350  self.assertEqual(cms.InputTag("b"), p.h.src)
351  self.assertEqual(cms.InputTag("b"), p.i.src)
352  self.assertEqual(cms.untracked.InputTag("b"), p.j.src)
353  self.assertEqual(cms.InputTag("b"),p.sp.test1.src)
354  self.assertEqual(cms.InputTag("a"),p.sp.test1.nested.src)
355  self.assertEqual(cms.InputTag("b"),p.sp.test2.src)
356  unittest.main()
MassReplace.massSearchReplaceParam
def massSearchReplaceParam(sequence, paramName, paramOldValue, paramValue, verbose=False)
Definition: MassReplace.py:129
MassReplace.MassSearchReplaceAnyInputTagVisitor._paramSearch
_paramSearch
Definition: MassReplace.py:8
resolutioncreator_cfi.object
object
Definition: resolutioncreator_cfi.py:4
MassReplace.MassSearchReplaceAnyInputTagVisitor.__init__
def __init__(self, paramSearch, paramReplace, verbose=False, moduleLabelOnly=False, skipLabelTest=False)
Definition: MassReplace.py:7
MassReplace.MassSearchReplaceParamVisitor._paramName
_paramName
Definition: MassReplace.py:111
MassReplace.MassSearchReplaceAnyInputTagVisitor
Definition: MassReplace.py:4
MassReplace.MassSearchParamVisitor.leave
def leave(self, visitee)
Definition: MassReplace.py:103
MassReplace.MassSearchReplaceAnyInputTagVisitor._moduleName
_moduleName
Definition: MassReplace.py:10
mathSSE::return
return((rh ^ lh) &mask)
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
MassReplace.TestModuleCommand.testMassSearchReplaceAnyInputTag
def testMassSearchReplaceAnyInputTag(self)
Definition: MassReplace.py:156
MassReplace.SwitchProducerTest
Definition: MassReplace.py:144
MassReplace.MassSearchReplaceAnyInputTagVisitor._moduleLabelOnly
_moduleLabelOnly
Definition: MassReplace.py:12
MassReplace.massReplaceInputTag
def massReplaceInputTag(process, old="rawDataCollector", new="rawDataRepacker", verbose=False, moduleLabelOnly=False, skipLabelTest=False)
Definition: MassReplace.py:83
MassReplace.MassSearchReplaceAnyInputTagVisitor.standardizeInputTagFmt
def standardizeInputTagFmt(inputTag)
Definition: MassReplace.py:61
MassReplace.MassSearchReplaceParamVisitor.enter
def enter(self, visitee)
Definition: MassReplace.py:115
MassReplace.MassSearchParamVisitor.enter
def enter(self, visitee)
Definition: MassReplace.py:99
MassReplace.MassSearchReplaceAnyInputTagVisitor._verbose
_verbose
Definition: MassReplace.py:11
MassReplace.MassSearchReplaceAnyInputTagVisitor._paramReplace
_paramReplace
Definition: MassReplace.py:9
MassReplace.MassSearchReplaceParamVisitor._paramSearch
_paramSearch
Definition: MassReplace.py:113
MassReplace.MassSearchParamVisitor._paramSearch
_paramSearch
Definition: MassReplace.py:97
MassReplace.MassSearchParamVisitor
Definition: MassReplace.py:93
MassReplace.MassSearchReplaceParamVisitor._verbose
_verbose
Definition: MassReplace.py:114
str
#define str(s)
Definition: TestProcessor.cc:48
MassReplace.TestModuleCommand
Definition: MassReplace.py:154
MassReplace.MassSearchReplaceParamVisitor.leave
def leave(self, visitee)
Definition: MassReplace.py:126
MassReplace.MassSearchParamVisitor._paramName
_paramName
Definition: MassReplace.py:96
MassReplace.MassSearchParamVisitor.modules
def modules(self)
Definition: MassReplace.py:105
MassReplace.massReplaceParameter
def massReplaceParameter(process, name="label", old="rawDataCollector", new="rawDataRepacker", verbose=False)
Definition: MassReplace.py:132
MassReplace.MassSearchReplaceAnyInputTagVisitor.leave
def leave(self, visitee)
Definition: MassReplace.py:76
EgammaHLTValidationUtils.getProcessName
def getProcessName(pdgGen, requiredNumberOfGeneratedObjects)
Definition: EgammaHLTValidationUtils.py:21
mps_setup.append
append
Definition: mps_setup.py:85
MassReplace.MassSearchReplaceAnyInputTagVisitor.doIt
def doIt(self, pset, base)
Definition: MassReplace.py:14
MassReplace.MassSearchReplaceAnyInputTagVisitor.enter
def enter(self, visitee)
Definition: MassReplace.py:67
edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
MassReplace.TestModuleCommand.testMassSearchReplaceParam
def testMassSearchReplaceParam(self)
Definition: MassReplace.py:277
MassReplace.MassSearchReplaceParamVisitor.doIt
def doIt(self, mod, name)
Definition: MassReplace.py:121
MassReplace.TestModuleCommand.testMassReplaceInputTag
def testMassReplaceInputTag(self)
Definition: MassReplace.py:209
ConfigBuilder.dumpPython
def dumpPython(process, name)
Definition: ConfigBuilder.py:92
MassReplace.massSearchReplaceAnyInputTag
def massSearchReplaceAnyInputTag(sequence, oldInputTag, newInputTag, verbose=False, moduleLabelOnly=False, skipLabelTest=False)
Definition: MassReplace.py:79
MassReplace.MassSearchParamVisitor._modules
_modules
Definition: MassReplace.py:98
MassReplace.TestModuleCommand.testMassReplaceParam
def testMassReplaceParam(self)
Definition: MassReplace.py:305
MassReplace.MassSearchReplaceParamVisitor._paramValue
_paramValue
Definition: MassReplace.py:112
MassReplace.MassSearchParamVisitor.__init__
def __init__(self, paramName, paramSearch)
Definition: MassReplace.py:95
MassReplace.MassSearchReplaceParamVisitor.__init__
def __init__(self, paramName, paramSearch, paramValue, verbose=False)
Definition: MassReplace.py:110
MassReplace.MassSearchReplaceAnyInputTagVisitor._skipLabelTest
_skipLabelTest
Definition: MassReplace.py:13
MassReplace.MassSearchReplaceParamVisitor
Definition: MassReplace.py:108
MassReplace.SwitchProducerTest.__init__
def __init__(self, **kargs)
Definition: MassReplace.py:145