CMS 3D CMS Logo

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

Public Member Functions

def __call__ (self, process)
 
def __copy__ (self)
 copy(self) returns a copy of the tool More...
 
def __init__ (self)
 
def addParameter (self, dict, parname, parvalue, description, Type=None, allowedValues=None, acceptNoneValue=False)
 use addParameter method in the redefinition of tool constructor in order to add parameters to the tools each tool is defined by its label, default value, description, type and allowedValues (the last two attribute can be ignored if the user gives a valid default values and if there is not a list of allowed values) More...
 
def apply (self, process)
 
def comment (self)
 
def description (self)
 
def dumpPython (self)
 
def errorMessage (self, value, type)
 
def getAllowedValues (self, name)
 
def getParameters (self)
 
def getvalue (self, name)
 
def isAllowed (self, name, value)
 method isAllowed is called by setParameter to check input values for a specific parameter More...
 
def reset (self)
 
def setComment (self, comment)
 
def setParameter (self, name, value, typeNone=False)
 
def setParameters (self, parameters)
 
def toolCode (self, process)
 
def typeError (self, name)
 check about input value type More...
 

Public Attributes

 parAccepted
 

Private Attributes

 _comment
 
 _description
 
 _parameters
 
 _path
 

Detailed Description

Base class for PAT tools

Definition at line 33 of file ConfigToolBase.py.

Constructor & Destructor Documentation

def ConfigToolBase.ConfigToolBase.__init__ (   self)

Definition at line 40 of file ConfigToolBase.py.

40  def __init__(self):
41  self._parameters=dicttypes.SortedKeysDict()
42  self._description=self.__doc__
43  self._comment = ''
44  self.parAccepted=True
45  saveOrigin(self,1)
46  self._path = path.realpath(self._filename)
47  self._path = self._path.split("/src/")
48  self._path = self._path[1].replace("/python","")
49  #self._path = "".join(self._path)
50  self._path = self._path.replace("/",".")
51  self._path = self._path.replace(".py","")
52 
53 
def replace(string, replacements)
def saveOrigin(obj, level)
Definition: Mixins.py:621

Member Function Documentation

def ConfigToolBase.ConfigToolBase.__call__ (   self,
  process 
)
Call the instance 

Definition at line 54 of file ConfigToolBase.py.

54  def __call__(self,process):
55  """ Call the instance
56  """
57  raise NotImplementedError
58 
def __call__(self, process)
def ConfigToolBase.ConfigToolBase.__copy__ (   self)

copy(self) returns a copy of the tool

Definition at line 83 of file ConfigToolBase.py.

References ConfigToolBase.ConfigToolBase._comment, and ConfigToolBase.ConfigToolBase._parameters.

Referenced by ConfigToolBase.ConfigToolBase.apply().

83  def __copy__(self):
84  c=type(self)()
85  c.setParameters(copy.deepcopy(self._parameters))
86  c.setComment(self._comment)
87  return c
def __copy__(self)
copy(self) returns a copy of the tool
def ConfigToolBase.ConfigToolBase.addParameter (   self,
  dict,
  parname,
  parvalue,
  description,
  Type = None,
  allowedValues = None,
  acceptNoneValue = False 
)

use addParameter method in the redefinition of tool constructor in order to add parameters to the tools each tool is defined by its label, default value, description, type and allowedValues (the last two attribute can be ignored if the user gives a valid default values and if there is not a list of allowed values)

Add a parameter with its label, value, description and type to self._parameters

Definition at line 102 of file ConfigToolBase.py.

Referenced by editorTools.UserCodeTool.__init__(), metTools.AddMETCollection.__init__(), trackTools.MakeAODTrackCandidates.__init__(), coreTools.RunOnData.__init__(), HiCoreTools.RestrictInputToAOD.__init__(), runJetUncertainties.RunJetUncertainties.__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__init__(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.__init__(), editorTools.ChangeSource.__init__(), cmsswVersionTools.PickRelValInputFiles.__init__(), HiCoreTools.RemoveMCMatching.__init__(), coreTools.RemoveMCMatching.__init__(), trackTools.MakePATTrackCandidates.__init__(), trigTools.SwitchOnTrigger.__init__(), HiCoreTools.RemoveAllPATObjectsBut.__init__(), HiCoreTools.RemoveSpecificPATObjects.__init__(), trigTools.SwitchOnTriggerStandAlone.__init__(), trackTools.MakeTrackCandidates.__init__(), tauTools.AddTauCollection.__init__(), trigTools.SwitchOnTriggerMatching.__init__(), HiCoreTools.RemoveCleaning.__init__(), HiCoreTools.AddCleaning.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), jetTools.AddJetCollection.__init__(), jetTools.SwitchJetCollection.__init__(), jetTools.UpdateJetCollection.__init__(), jetTools.AddJetID.__init__(), and jetTools.SetTagInfos.__init__().

102  def addParameter(self,dict,parname, parvalue, description,Type=None, allowedValues=None, acceptNoneValue=False):
103  """ Add a parameter with its label, value, description and type to self._parameters
104  """
105  par=parameter()
106  par.name=parname
107  par.value=parvalue
108  par.description=description
109  if Type==None:
110  par.type=type(parvalue)
111  else: par.type=Type
112  par.allowedValues=allowedValues
113  par.acceptNoneValue=acceptNoneValue
114  dict[par.name]=par
def addParameter(self, dict, parname, parvalue, description, Type=None, allowedValues=None, acceptNoneValue=False)
use addParameter method in the redefinition of tool constructor in order to add parameters to the too...
def ConfigToolBase.ConfigToolBase.apply (   self,
  process 
)

Definition at line 59 of file ConfigToolBase.py.

References ConfigToolBase.ConfigToolBase.__copy__(), pos::PixelConfigBase.setComment(), L1TUtmTriggerMenu.setComment(), ConfigToolBase.ConfigToolBase.setComment(), Json::Value.setComment(), Json::Value::CommentInfo.setComment(), and ConfigToolBase.ConfigToolBase.toolCode().

Referenced by heavyIonTools.ConfigureHeavyIons.__call__(), editorTools.UserCodeTool.__call__(), HiCoreTools.RestrictInputToAOD.__call__(), coreTools.RunOnData.__call__(), trackTools.MakeAODTrackCandidates.__call__(), runJetUncertainties.RunJetUncertainties.__call__(), metTools.AddMETCollection.__call__(), heavyIonTools.ProductionDefaults.__call__(), editorTools.ChangeSource.__call__(), HiCoreTools.RemoveMCMatching.__call__(), cmsswVersionTools.PickRelValInputFiles.__call__(), coreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), heavyIonTools.SelectionDefaults.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), heavyIonTools.DisbaleMonteCarloDeps.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), trackTools.MakeTrackCandidates.__call__(), tauTools.AddTauCollection.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.RemoveCleaning.__call__(), HiCoreTools.AddCleaning.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.AddJetCollection.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.UpdateJetCollection.__call__(), jetTools.AddJetID.__call__(), and jetTools.SetTagInfos.__call__().

59  def apply(self,process):
60 
61  if hasattr(process, "addAction"):
62  process.disableRecording()
63 
64  try:
65  comment=inspect.stack(2)[2][4][0].rstrip("\n")
66  if comment.startswith("#"):
67  self.setComment(comment.lstrip("#"))
68  except:
69  pass
70 
71  self.toolCode(process)
72 
73  if hasattr(process, "addAction"):
74  process.enableRecording()
75  action=self.__copy__()
76  process.addAction(action)
77 
def __copy__(self)
copy(self) returns a copy of the tool
def toolCode(self, process)
def setComment(self, comment)
def ConfigToolBase.ConfigToolBase.comment (   self)
Return the comment set for this tool

Definition at line 157 of file ConfigToolBase.py.

References ConfigToolBase.ConfigToolBase._comment.

157  def comment(self):
158  """ Return the comment set for this tool
159  """
160  return self._comment
def ConfigToolBase.ConfigToolBase.description (   self)
Return a string with a detailed description of the action.

Definition at line 94 of file ConfigToolBase.py.

References ConfigToolBase.ConfigToolBase._description.

94  def description(self):
95  """ Return a string with a detailed description of the action.
96  """
97  return self._description
98 
def ConfigToolBase.ConfigToolBase.dumpPython (   self)
Return the python code to perform the action

Definition at line 134 of file ConfigToolBase.py.

References ConfigToolBase.ConfigToolBase._comment, heavyIonTools.ConfigureHeavyIons._defaultParameters, metTools.AddMETCollection._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, HiCoreTools.RestrictInputToAOD._defaultParameters, coreTools.RunOnData._defaultParameters, runJetUncertainties.RunJetUncertainties._defaultParameters, runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, HiCoreTools.RemoveMCMatching._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, trigTools.SwitchOnTrigger._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, HiCoreTools.RemoveAllPATObjectsBut._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, HiCoreTools.RemoveSpecificPATObjects._defaultParameters, trigTools.SwitchOnTriggerStandAlone._defaultParameters, trackTools.MakeTrackCandidates._defaultParameters, tauTools.AddTauCollection._defaultParameters, trigTools.SwitchOnTriggerMatching._defaultParameters, HiCoreTools.RemoveCleaning._defaultParameters, HiCoreTools.AddCleaning._defaultParameters, trigTools.SwitchOnTriggerMatchingStandAlone._defaultParameters, trigTools.SwitchOnTriggerMatchEmbedding._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.UpdateJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, metTools.AddMETCollection._label, trackTools.MakeAODTrackCandidates._label, heavyIonTools.ConfigureHeavyIons._label, HiCoreTools.RestrictInputToAOD._label, coreTools.RunOnData._label, MagneticFieldMapESProducer._label, TrackerInteractionGeometryESProducer._label, runJetUncertainties.RunJetUncertainties._label, runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties._label, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._label, heavyIonTools.ProductionDefaults._label, LHECOMWeightProducer._label, cmsswVersionTools.PickRelValInputFiles._label, HiCoreTools.RemoveMCMatching._label, coreTools.RemoveMCMatching._label, trackTools.MakePATTrackCandidates._label, trigTools.SwitchOnTrigger._label, heavyIonTools.SelectionDefaults._label, HiCoreTools.RemoveAllPATObjectsBut._label, heavyIonTools.DisbaleMonteCarloDeps._label, HiCoreTools.RemoveSpecificPATObjects._label, trigTools.SwitchOnTriggerStandAlone._label, trackTools.MakeTrackCandidates._label, tauTools.AddTauCollection._label, trigTools.SwitchOnTriggerMatching._label, HiCoreTools.RemoveCleaning._label, HiCoreTools.AddCleaning._label, trigTools.SwitchOnTriggerMatchingStandAlone._label, trigTools.SwitchOnTriggerMatchEmbedding._label, jetTools.AddJetCollection._label, validation.SimpleSample._label, Vispa.Views.LineDecayView.DecayLine._label, jetTools.SwitchJetCollection._label, jetTools.UpdateJetCollection._label, jetTools.AddJetID._label, jetTools.SetTagInfos._label, ConfigToolBase.ConfigToolBase._parameters, HIPplots._path, CommonAnalyzer._path, ConfigToolBase.ConfigToolBase._path, ConfigToolBase.ConfigToolBase.getvalue(), and str.

Referenced by Mixins._Parameterizable.__addParameter(), Mixins._ParameterTypeBase.__repr__(), Mixins._Parameterizable.__repr__(), Mixins._ValidatingParameterListBase.__repr__(), Types.VPSet.__repr__(), Mixins._Parameterizable.__setattr__(), and SequenceTypes.Schedule.__str__().

134  def dumpPython(self):
135  """ Return the python code to perform the action
136  """
137  dumpPythonImport = "\nfrom "+self._path+" import *\n"
138  dumpPython=''
139  if self._comment!="":
140  dumpPython = '#'+self._comment
141  dumpPython += "\n"+self._label+"(process "
142  for key in self._parameters.keys():
143  if repr(self._parameters[key].value)!=repr(self._defaultParameters[key].value):
144  dumpPython+= ", "+str(key)+" = "
145  if self._parameters[key].type is str:
146  string = "'"+str(self.getvalue(key))+"'"
147  else:
148  string = str(self.getvalue(key))
149  dumpPython+= string
150  dumpPython+=")"+'\n'
151  return (dumpPythonImport,dumpPython)
152 
#define str(s)
def ConfigToolBase.ConfigToolBase.errorMessage (   self,
  value,
  type 
)

Definition at line 161 of file ConfigToolBase.py.

References str.

Referenced by Vispa.Main.Application.Application._loadPlugins(), Vispa.Main.Application.Application.openFile(), and ConfigToolBase.ConfigToolBase.typeError().

161  def errorMessage(self,value,type):
162  return "The type for parameter "+'"'+str(value)+'"'+" is not "+'"'+str(type)+'"'
def errorMessage(self, value, type)
#define str(s)
def ConfigToolBase.ConfigToolBase.getAllowedValues (   self,
  name 
)

Definition at line 192 of file ConfigToolBase.py.

References heavyIonTools.ConfigureHeavyIons._defaultParameters, metTools.AddMETCollection._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, coreTools.RunOnData._defaultParameters, HiCoreTools.RestrictInputToAOD._defaultParameters, runJetUncertainties.RunJetUncertainties._defaultParameters, runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, HiCoreTools.RemoveMCMatching._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, trigTools.SwitchOnTrigger._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, HiCoreTools.RemoveAllPATObjectsBut._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, HiCoreTools.RemoveSpecificPATObjects._defaultParameters, trigTools.SwitchOnTriggerStandAlone._defaultParameters, trackTools.MakeTrackCandidates._defaultParameters, tauTools.AddTauCollection._defaultParameters, trigTools.SwitchOnTriggerMatching._defaultParameters, HiCoreTools.RemoveCleaning._defaultParameters, HiCoreTools.AddCleaning._defaultParameters, trigTools.SwitchOnTriggerMatchingStandAlone._defaultParameters, trigTools.SwitchOnTriggerMatchEmbedding._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.UpdateJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, and jetTools.SetTagInfos._defaultParameters.

192  def getAllowedValues(self,name):
193  return self._defaultParameters[name].allowedValues
194 
def ConfigToolBase.ConfigToolBase.getParameters (   self)
Return a copy of the dict of the parameters.

Definition at line 115 of file ConfigToolBase.py.

References ConfigToolBase.ConfigToolBase._parameters.

115  def getParameters(self):
116  """ Return a copy of the dict of the parameters.
117  """
118  return copy.deepcopy(self._parameters)
def ConfigToolBase.ConfigToolBase.getvalue (   self,
  name 
)
Return the value of parameter 'name'

Definition at line 90 of file ConfigToolBase.py.

References ConfigToolBase.ConfigToolBase._parameters.

Referenced by ConfigToolBase.ConfigToolBase.dumpPython().

90  def getvalue(self,name):
91  """ Return the value of parameter 'name'
92  """
93  return self._parameters[name].value
def ConfigToolBase.ConfigToolBase.isAllowed (   self,
  name,
  value 
)

method isAllowed is called by setParameter to check input values for a specific parameter

Definition at line 164 of file ConfigToolBase.py.

References ConfigToolBase.ConfigToolBase._parameters, ConfigToolBase.ConfigToolBase.parAccepted, and str.

Referenced by ConfigToolBase.ConfigToolBase.setParameter().

164  def isAllowed(self,name,value):
165  self.parAccepted=True
166  if value==[]:
167  self.parAccepted=False
168  elif (isinstance(value,dict)) and (isinstance(self._parameters[name].allowedValues,list)):
169  for key in value.keys():
170  if (key not in self._parameters[name].allowedValues):
171  raise ValueError("The input key value "+'"'+str(key)+'"'+" for parameter "+'"'+name+'"'+" is not supported. Supported ones are: "+str(self._parameters[name].allowedValues)[1:-1])
172  elif (isinstance(value,list)) and (isinstance(self._parameters[name].allowedValues,list )):
173  for val in value:
174  if (val not in self._parameters[name].allowedValues) :
175  raise ValueError("The input value "+'"'+str(val)+'"'+" for parameter "+'"'+name+'"'+" is not supported. Supported ones are: "+str(self._parameters[name].allowedValues)[1:-1])
176  elif (not isinstance(value,list))and (isinstance(self._parameters[name].allowedValues,list)) :
177  if (value not in self._parameters[name].allowedValues and value == None) and (not self._parameters[name].acceptNoneValue) :
178  self.parAccepted=False
179  elif not isinstance(self._parameters[name].allowedValues,list):
180  if (value!=self._parameters[name].allowedValues and value == None) and (not self._parameters[name].acceptNoneValue) :
181  self.parAccepted=False
182  if self.parAccepted==False:
183  raise ValueError("The input value "+'"'+str(value)+'"'+" for parameter "+'"'+name+'"'+" is not supported. Supported ones are: "+str(self._parameters[name].allowedValues)[1:-1])
def isAllowed(self, name, value)
method isAllowed is called by setParameter to check input values for a specific parameter ...
#define str(s)
def ConfigToolBase.ConfigToolBase.reset (   self)

Definition at line 88 of file ConfigToolBase.py.

References heavyIonTools.ConfigureHeavyIons._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, metTools.AddMETCollection._defaultParameters, coreTools.RunOnData._defaultParameters, HiCoreTools.RestrictInputToAOD._defaultParameters, runJetUncertainties.RunJetUncertainties._defaultParameters, runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, HiCoreTools.RemoveMCMatching._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, trigTools.SwitchOnTrigger._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, HiCoreTools.RemoveAllPATObjectsBut._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, HiCoreTools.RemoveSpecificPATObjects._defaultParameters, trigTools.SwitchOnTriggerStandAlone._defaultParameters, trackTools.MakeTrackCandidates._defaultParameters, tauTools.AddTauCollection._defaultParameters, trigTools.SwitchOnTriggerMatching._defaultParameters, HiCoreTools.RemoveCleaning._defaultParameters, HiCoreTools.AddCleaning._defaultParameters, trigTools.SwitchOnTriggerMatchingStandAlone._defaultParameters, trigTools.SwitchOnTriggerMatchEmbedding._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.UpdateJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, and ConfigToolBase.ConfigToolBase._parameters.

88  def reset(self):
89  self._parameters=copy.deepcopy(self._defaultParameters)
def ConfigToolBase.ConfigToolBase.setComment (   self,
  comment 
)
Write a comment in the configuration file

Definition at line 153 of file ConfigToolBase.py.

References ConfigToolBase.ConfigToolBase._comment, and str.

Referenced by ConfigToolBase.ConfigToolBase.apply().

153  def setComment(self, comment):
154  """ Write a comment in the configuration file
155  """
156  self._comment = str(comment)
def setComment(self, comment)
#define str(s)
def ConfigToolBase.ConfigToolBase.setParameter (   self,
  name,
  value,
  typeNone = False 
)
Change parameter 'name' to a new value

Definition at line 119 of file ConfigToolBase.py.

References heavyIonTools.ConfigureHeavyIons._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, metTools.AddMETCollection._defaultParameters, HiCoreTools.RestrictInputToAOD._defaultParameters, coreTools.RunOnData._defaultParameters, runJetUncertainties.RunJetUncertainties._defaultParameters, runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, HiCoreTools.RemoveMCMatching._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, trigTools.SwitchOnTrigger._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, HiCoreTools.RemoveAllPATObjectsBut._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, HiCoreTools.RemoveSpecificPATObjects._defaultParameters, trigTools.SwitchOnTriggerStandAlone._defaultParameters, trackTools.MakeTrackCandidates._defaultParameters, tauTools.AddTauCollection._defaultParameters, trigTools.SwitchOnTriggerMatching._defaultParameters, HiCoreTools.RemoveCleaning._defaultParameters, HiCoreTools.AddCleaning._defaultParameters, trigTools.SwitchOnTriggerMatchingStandAlone._defaultParameters, trigTools.SwitchOnTriggerMatchEmbedding._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.UpdateJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, ConfigToolBase.ConfigToolBase._parameters, ConfigToolBase.ConfigToolBase.isAllowed(), and ConfigToolBase.ConfigToolBase.typeError().

Referenced by editorTools.UserCodeTool.__call__(), HiCoreTools.RestrictInputToAOD.__call__(), coreTools.RunOnData.__call__(), trackTools.MakeAODTrackCandidates.__call__(), runJetUncertainties.RunJetUncertainties.__call__(), metTools.AddMETCollection.__call__(), editorTools.ChangeSource.__call__(), HiCoreTools.RemoveMCMatching.__call__(), cmsswVersionTools.PickRelValInputFiles.__call__(), coreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), trackTools.MakeTrackCandidates.__call__(), tauTools.AddTauCollection.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.RemoveCleaning.__call__(), HiCoreTools.AddCleaning.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.AddJetCollection.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.UpdateJetCollection.__call__(), jetTools.AddJetID.__call__(), jetTools.SetTagInfos.__call__(), and runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetConfiguration().

119  def setParameter(self, name, value, typeNone=False):
120  """ Change parameter 'name' to a new value
121  """
122  self._parameters[name].value=value
123  ### check about input value type
124  self.typeError(name)
125  ### check about input value (it works if allowedValues for the specific parameter is set)
126  if self._defaultParameters[name].allowedValues is not None: self.isAllowed(name,value )
def typeError(self, name)
check about input value type
def isAllowed(self, name, value)
method isAllowed is called by setParameter to check input values for a specific parameter ...
def setParameter(self, name, value, typeNone=False)
def ConfigToolBase.ConfigToolBase.setParameters (   self,
  parameters 
)

Definition at line 127 of file ConfigToolBase.py.

References ConfigToolBase.ConfigToolBase._parameters.

127  def setParameters(self, parameters):
128  self._parameters=copy.deepcopy(parameters)
def setParameters(self, parameters)
def ConfigToolBase.ConfigToolBase.toolCode (   self,
  process 
)

Definition at line 78 of file ConfigToolBase.py.

Referenced by ConfigToolBase.ConfigToolBase.apply().

78  def toolCode(self, process):
79  raise NotImplementedError
80 
81 
def toolCode(self, process)
def ConfigToolBase.ConfigToolBase.typeError (   self,
  name 
)

check about input value type

Definition at line 185 of file ConfigToolBase.py.

References ConfigToolBase.ConfigToolBase._parameters, CTPPSPixelDataError.errorMessage(), FWEventItem.errorMessage(), and ConfigToolBase.ConfigToolBase.errorMessage().

Referenced by ConfigToolBase.ConfigToolBase.setParameter().

185  def typeError(self,name):
186  if self._parameters[name].acceptNoneValue is False:
187  if not isinstance(self._parameters[name].value,self._parameters[name].type):
188  raise TypeError(self.errorMessage(self._parameters[name].value,self._parameters[name].type))
189  else:
190  if not (isinstance(self._parameters[name].value,self._parameters[name].type) or self._parameters[name].value is None):
191  raise TypeError(self.errorMessage(self._parameters[name].value,self._parameters[name].type))
def typeError(self, name)
check about input value type
def errorMessage(self, value, type)

Member Data Documentation

ConfigToolBase.ConfigToolBase._description
private
ConfigToolBase.ConfigToolBase._parameters
private

Definition at line 41 of file ConfigToolBase.py.

Referenced by runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), ConfigToolBase.ConfigToolBase.__copy__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.ak4JetReclustering(), cmsswVersionTools.PickRelValInputFiles.apply(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.createMVAMETModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.createSmearedJetModule(), editorTools.UserCodeTool.dumpPython(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.dumpPython(), ConfigToolBase.ConfigToolBase.dumpPython(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.extractMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getCorrectedMET(), ConfigToolBase.ConfigToolBase.getParameters(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getUnclusteredVariationsForMVAMET(), ConfigToolBase.ConfigToolBase.getvalue(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getVariations(), ConfigToolBase.ConfigToolBase.isAllowed(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetCleaning(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfigurationPost(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder.parameters_(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.produceMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.recomputeRawMetFromPfcs(), ConfigToolBase.ConfigToolBase.reset(), ConfigToolBase.ConfigToolBase.setParameter(), ConfigToolBase.ConfigToolBase.setParameters(), editorTools.UserCodeTool.toolCode(), HiCoreTools.RestrictInputToAOD.toolCode(), coreTools.RunOnData.toolCode(), trackTools.MakeAODTrackCandidates.toolCode(), metTools.AddMETCollection.toolCode(), editorTools.ChangeSource.toolCode(), runJetUncertainties.RunJetUncertainties.toolCode(), HiCoreTools.RemoveMCMatching.toolCode(), coreTools.RemoveMCMatching.toolCode(), trigTools.SwitchOnTrigger.toolCode(), trackTools.MakePATTrackCandidates.toolCode(), HiCoreTools.RemoveAllPATObjectsBut.toolCode(), HiCoreTools.RemoveSpecificPATObjects.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.toolCode(), trackTools.MakeTrackCandidates.toolCode(), tauTools.AddTauCollection.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), HiCoreTools.AddCleaning.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), jetTools.AddJetCollection.toolCode(), jetTools.SwitchJetCollection.toolCode(), jetTools.UpdateJetCollection.toolCode(), jetTools.AddJetID.toolCode(), jetTools.SetTagInfos.toolCode(), ConfigToolBase.ConfigToolBase.typeError(), and runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.updateJECs().

ConfigToolBase.ConfigToolBase.parAccepted

Definition at line 44 of file ConfigToolBase.py.

Referenced by ConfigToolBase.ConfigToolBase.isAllowed().