7 Tool to add alternative MET collection(s) to your PAT Tuple 9 _label=
'addMETCollection' 10 _defaultParameters=dicttypes.SortedKeysDict()
14 Initialize elements of the class. Note that the tool needs to be derived from ConfigToolBase 15 to be usable in the configEditor. 18 ConfigToolBase.__init__(self)
20 self.addParameter(self.
_defaultParameters,
'labelName',self._defaultValue,
"Label name of the new patMET collection.", str)
21 self.addParameter(self.
_defaultParameters,
'metSource',self._defaultValue,
"Label of the input collection from which the new patMet collection should be created.", str)
25 self.
_comment =
"Add alternative MET collections as PAT object to your PAT Tuple" 29 Return default parameters of the class 33 def __call__(self,process,labelName=None,metSource=None):
35 Function call wrapper. This will check the parameters and call the actual implementation that 36 can be found in toolCode via the base class function apply. 40 self.setParameter(
'labelName', labelName)
43 self.setParameter(
'metSource', metSource)
48 Tool code implementation 57 addToProcessAndTask(labelName, patMETs.clone(metSource = metSource, addMuonCorrections=
False), process, task)
60 if hasattr(process,
"out"):
61 process.out.outputCommands+=[
"keep *_{LABEL_NAME}_*_*".
format(LABEL_NAME=labelName)]
def addToProcessAndTask(label, module, process, task)
def getPatAlgosToolsTask(process)