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 | Static Private Attributes
jmeUncertaintyTools.JetMEtUncertaintyTools Class Reference

MM from PhysicsTools.PatAlgos.patSequences_cff import *. More...

Inheritance diagram for jmeUncertaintyTools.JetMEtUncertaintyTools:

Public Member Functions

def __call__
 
def __init__
 
def getDefaultParameters
 

Private Member Functions

def _addCleanedJets
 
def _addPATMEtProducer
 
def _addPFCandidatesForPFMEtInput
 
def _addShiftedParticleCollections
 
def _getLeptonsForPFMEtInput
 
def _initializeInputTag
 

Static Private Attributes

tuple _defaultParameters = dicttypes.SortedKeysDict()
 
string _label = 'JetMEtUncertaintyTools'
 

Detailed Description

MM from PhysicsTools.PatAlgos.patSequences_cff import *.

Base class for estimating systematic uncertainties on MET 

Definition at line 17 of file jmeUncertaintyTools.py.

Constructor & Destructor Documentation

def jmeUncertaintyTools.JetMEtUncertaintyTools.__init__ (   self)

Definition at line 22 of file jmeUncertaintyTools.py.

References editorTools.UserCodeTool._comment, heavyIonTools.ConfigureHeavyIons._comment, HiCoreTools.RestrictInputToAOD._comment, coreTools.RunOnData._comment, trackTools.MakeAODTrackCandidates._comment, metTools.AddMETCollection._comment, heavyIonTools.ProductionDefaults._comment, editorTools.ChangeSource._comment, ConfigToolBase.ConfigToolBase._comment, HiCoreTools.RemoveMCMatching._comment, coreTools.RemoveMCMatching._comment, cmsswVersionTools.PickRelValInputFiles._comment, trackTools.MakePATTrackCandidates._comment, jetTools.AddJetCollection._comment, trigTools.SwitchOnTrigger._comment, heavyIonTools.SelectionDefaults._comment, HiCoreTools.RemoveAllPATObjectsBut._comment, heavyIonTools.DisbaleMonteCarloDeps._comment, HiCoreTools.RemoveSpecificPATObjects._comment, trigTools.SwitchOnTriggerStandAlone._comment, trackTools.MakeTrackCandidates._comment, tauTools.AddTauCollection._comment, trigTools.SwitchOnTriggerMatching._comment, HiCoreTools.RemoveCleaning._comment, HiCoreTools.AddCleaning._comment, trigTools.SwitchOnTriggerMatchingStandAlone._comment, trigTools.SwitchOnTriggerMatchEmbedding._comment, jetTools.SwitchJetCollection._comment, jetTools.AddJetID._comment, jetTools.SetTagInfos._comment, metTools.AddMETCollection._defaultParameters, editorTools.UserCodeTool._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RunOnData._defaultParameters, jmeUncertaintyTools.JetMEtUncertaintyTools._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, jetTools.AddJetCollection._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, trigTools.SwitchOnTrigger._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, trigTools.SwitchOnTriggerStandAlone._defaultParameters, trackTools.MakeTrackCandidates._defaultParameters, tauTools.AddTauCollection._defaultParameters, trigTools.SwitchOnTriggerMatching._defaultParameters, trigTools.SwitchOnTriggerMatchingStandAlone._defaultParameters, trigTools.SwitchOnTriggerMatchEmbedding._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, editorTools.UserCodeTool._parameters, heavyIonTools.ConfigureHeavyIons._parameters, HiCoreTools.RestrictInputToAOD._parameters, coreTools.RunOnData._parameters, trackTools.MakeAODTrackCandidates._parameters, metTools.AddMETCollection._parameters, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._parameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._parameters, heavyIonTools.ProductionDefaults._parameters, ConfigToolBase.ConfigToolBase._parameters, editorTools.ChangeSource._parameters, TAbsFitConstraint._parameters, HiCoreTools.RemoveMCMatching._parameters, TAbsFitParticle._parameters, coreTools.RemoveMCMatching._parameters, cmsswVersionTools.PickRelValInputFiles._parameters, jetTools.AddJetCollection._parameters, trackTools.MakePATTrackCandidates._parameters, trigTools.SwitchOnTrigger._parameters, heavyIonTools.SelectionDefaults._parameters, HiCoreTools.RemoveAllPATObjectsBut._parameters, heavyIonTools.DisbaleMonteCarloDeps._parameters, HiCoreTools.RemoveSpecificPATObjects._parameters, trigTools.SwitchOnTriggerStandAlone._parameters, trackTools.MakeTrackCandidates._parameters, tauTools.AddTauCollection._parameters, trigTools.SwitchOnTriggerMatching._parameters, HiCoreTools.RemoveCleaning._parameters, HiCoreTools.AddCleaning._parameters, trigTools.SwitchOnTriggerMatchingStandAlone._parameters, trigTools.SwitchOnTriggerMatchEmbedding._parameters, jetTools.SwitchJetCollection._parameters, jetTools.AddJetID._parameters, jetTools.SetTagInfos._parameters, root::helper::RootFunctionAdapter< F, args >.addParameter(), root::helper::RootFunctionHelper< F, args, Tag >.addParameter(), ParameterMgr.addParameter(), fit::RootMinuit< Function >.addParameter(), DropBoxMetadata::Parameters.addParameter(), PythonParameterSet.addParameter(), LutXml.addParameter(), ConfigToolBase.ConfigToolBase.addParameter(), and edm::ParameterSet.addParameter().

22 
23  def __init__(self):
24  ConfigToolBase.__init__(self)
25  self.addParameter(self._defaultParameters, 'electronCollection', cms.InputTag('cleanPatElectrons'),
"Input electron collection", Type=cms.InputTag, acceptNoneValue=True)

Member Function Documentation

def jmeUncertaintyTools.JetMEtUncertaintyTools.__call__ (   self,
  process,
  electronCollection = None,
  photonCollection = None,
  muonCollection = None,
  tauCollection = None,
  jetCollection = None,
  jetCorrLabel = None,
  doSmearJets = None,
  jetSmearFileName = None,
  jetSmearHistogram = None,
  jetCorrPayloadName = None,
  jetCorrLabelUpToL3 = None,
  jetCorrLabelUpToL3Res = None,
  jecUncertaintyFile = None,
  jecUncertaintyTag = None,
  varyByNsigmas = None,
  addToPatDefaultSequence = None,
  outputModule = None,
  postfix = None 
)

Definition at line 308 of file jmeUncertaintyTools.py.

References metTools.AddMETCollection._defaultParameters, editorTools.UserCodeTool._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RunOnData._defaultParameters, jmeUncertaintyTools.JetMEtUncertaintyTools._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, jetTools.AddJetCollection._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, trigTools.SwitchOnTrigger._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, trigTools.SwitchOnTriggerStandAlone._defaultParameters, trackTools.MakeTrackCandidates._defaultParameters, tauTools.AddTauCollection._defaultParameters, trigTools.SwitchOnTriggerMatching._defaultParameters, trigTools.SwitchOnTriggerMatchingStandAlone._defaultParameters, trigTools.SwitchOnTriggerMatchEmbedding._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, jmeUncertaintyTools.JetMEtUncertaintyTools._initializeInputTag(), ora::OraMainTable.setParameter(), ora::IMainTable.setParameter(), ora::PoolMainTable.setParameter(), PedeReader.setParameter(), QIE8Simulator.setParameter(), AbsElectronicODERHS.setParameter(), IntegratedCalibrationBase.setParameter(), SiStripLorentzAngleCalibration.setParameter(), SiPixelLorentzAngleCalibration.setParameter(), SiStripBackplaneCalibration.setParameter(), fit::RootMinuit< Function >.setParameter(), and ConfigToolBase.ConfigToolBase.setParameter().

Referenced by jmeUncertaintyTools.JetMEtUncertaintyTools._addPATMEtProducer().

309  postfix = None):
310  electronCollection = self._initializeInputTag(electronCollection, 'electronCollection')
311  photonCollection = self._initializeInputTag(photonCollection, 'photonCollection')
312  muonCollection = self._initializeInputTag(muonCollection, 'muonCollection')
313  tauCollection = self._initializeInputTag(tauCollection, 'tauCollection')
314  jetCollection = self._initializeInputTag(jetCollection, 'jetCollection')
315  if jetCorrLabel is None:
316  jetCorrLabel = self._defaultParameters['jetCorrLabel'].value
317  if doSmearJets is None:
318  doSmearJets = self._defaultParameters['doSmearJets'].value
319  if jetSmearFileName is None:
320  jetSmearFileName = self._defaultParameters['jetSmearFileName'].value
321  if jetSmearHistogram is None:
322  jetSmearHistogram = self._defaultParameters['jetSmearHistogram'].value
323  if jetCorrPayloadName is None:
324  jetCorrPayloadName = self._defaultParameters['jetCorrPayloadName'].value
325  if jetCorrLabelUpToL3 is None:
326  jetCorrLabelUpToL3 = self._defaultParameters['jetCorrLabelUpToL3'].value
327  if jetCorrLabelUpToL3Res is None:
328  jetCorrLabelUpToL3Res = self._defaultParameters['jetCorrLabelUpToL3Res'].value
329  if jecUncertaintyFile is None:
330  jecUncertaintyFile = self._defaultParameters['jecUncertaintyFile'].value
331  if jecUncertaintyTag is None:
332  jecUncertaintyTag = self._defaultParameters['jecUncertaintyTag'].value
333  if varyByNsigmas is None:
334  varyByNsigmas = self._defaultParameters['varyByNsigmas'].value
335  if addToPatDefaultSequence is None:
336  addToPatDefaultSequence = self._defaultParameters['addToPatDefaultSequence'].value
337  if outputModule is None:
338  outputModule = self._defaultParameters['outputModule'].value
339  if postfix is None:
340  postfix = self._defaultParameters['postfix'].value
341 
342  self.setParameter('electronCollection', electronCollection)
343  self.setParameter('photonCollection', photonCollection)
344  self.setParameter('muonCollection', muonCollection)
345  self.setParameter('tauCollection', tauCollection)
346  self.setParameter('jetCollection', jetCollection)
347  self.setParameter('jetCorrLabel', jetCorrLabel)
348  self.setParameter('doSmearJets', doSmearJets)
349  self.setParameter('jetSmearFileName', jetSmearFileName)
350  self.setParameter('jetSmearHistogram', jetSmearHistogram)
351  self.setParameter('jetCorrPayloadName', jetCorrPayloadName)
352  self.setParameter('jetCorrLabelUpToL3', jetCorrLabelUpToL3)
353  self.setParameter('jetCorrLabelUpToL3Res', jetCorrLabelUpToL3Res)
354  self.setParameter('jecUncertaintyFile', jecUncertaintyFile)
355  self.setParameter('jecUncertaintyTag', jecUncertaintyTag)
356  self.setParameter('varyByNsigmas', varyByNsigmas)
357  self.setParameter('addToPatDefaultSequence', addToPatDefaultSequence)
358  self.setParameter('outputModule', outputModule)
359  self.setParameter('postfix', postfix)
360 
def jmeUncertaintyTools.JetMEtUncertaintyTools._addCleanedJets (   self,
  process,
  jetCollection,
  electronCollection,
  photonCollection,
  muonCollection,
  tauCollection,
  uncertaintySequence,
  postfix = "" 
)
private

Definition at line 81 of file jmeUncertaintyTools.py.

References jmeUncertaintyTools.JetMEtUncertaintyTools._addShiftedParticleCollections(), objectsUncertaintyTools.addModuleToSequence(), and objectsUncertaintyTools.isValidInputTag().

Referenced by jmeUncertaintyTools.JetMEtUncertaintyTools._initializeInputTag(), runJetUncertainties.RunJetUncertainties.toolCode(), runType1CaloMEtUncertainties.RunType1CaloMEtUncertainties.toolCode(), and runType1PFMEtUncertainties.RunType1PFMEtUncertainties.toolCode().

81 
82  uncertaintySequence, postfix = ""):
83 
84  # produce collection of jets not overlapping with reconstructed
85  # electrons/photons, muons and tau-jet candidates
86  jetsNotOverlappingWithLeptons = cms.EDProducer("PATJetCleaner",
87  src = jetCollection,
88  preselection = cms.string(''),
89  checkOverlaps = cms.PSet(),
90  finalCut = cms.string('')
91  )
92  numOverlapCollections = 0
93  radius = 0.5
94  if "ak4" in jetCollection.moduleLabel.lower(): radius=0.4
95  for collection in [
96  [ 'electrons', electronCollection ],
97  [ 'photons', photonCollection ],
98  [ 'muons', muonCollection ],
99  [ 'taus', tauCollection ] ]:
100  if isValidInputTag(collection[1]):
101  setattr(jetsNotOverlappingWithLeptons.checkOverlaps, collection[0], cms.PSet(
102  src = collection[1],
103  algorithm = cms.string("byDeltaR"),
104  preselection = cms.string(""),
105  deltaR = cms.double(radius),
106  checkRecoComponents = cms.bool(False),
107  pairCut = cms.string(""),
108  requireNoOverlaps = cms.bool(True),
109  ))
110  numOverlapCollections = numOverlapCollections + 1
111  lastJetCollection = jetCollection.value()
112  if numOverlapCollections >= 1:
113  lastJetCollection = \
114  addModuleToSequence(process, jetsNotOverlappingWithLeptons,
115  [ jetCollection.value(), "NotOverlappingWithLeptonsForJetMEtUncertainty" ],
116  uncertaintySequence, postfix)
117  cleanedJetCollection = lastJetCollection
118 
119  return ( lastJetCollection, cleanedJetCollection )
120 
def jmeUncertaintyTools.JetMEtUncertaintyTools._addPATMEtProducer (   self,
  process,
  metUncertaintySequence,
  metCollection,
  patMEtCollection,
  collectionsToKeep,
  postfix 
)
private

Definition at line 277 of file jmeUncertaintyTools.py.

References jmeUncertaintyTools.JetMEtUncertaintyTools.__call__().

Referenced by runMVAMEtUncertainties.RunMVAMEtUncertainties._addPFMVAMEt(), runNoPileUpMEtUncertainties.RunNoPileUpMEtUncertainties._addPFNoPUMEt(), and jmeUncertaintyTools.JetMEtUncertaintyTools._getLeptonsForPFMEtInput().

278  collectionsToKeep, postfix):
279 
280  module = patMETs.clone(
281  metSource = cms.InputTag(metCollection),
282  addMuonCorrections = cms.bool(False),
283  genMETSource = cms.InputTag('genMetTrue')
284  )
285  patMEtCollectionName = patMEtCollection+postfix
286  setattr(process, patMEtCollectionName, module)
287  metUncertaintySequence += module
288  collectionsToKeep.append(patMEtCollectionName)
289 
def jmeUncertaintyTools.JetMEtUncertaintyTools._addPFCandidatesForPFMEtInput (   self,
  process,
  metUncertaintySequence,
  particleCollection,
  particleType,
  shiftType,
  particleCollectionShiftUp,
  particleCollectionShiftDown,
  dRmatch,
  pfCandCollection,
  postfix 
)
private

Definition at line 236 of file jmeUncertaintyTools.py.

Referenced by runMVAMEtUncertainties.RunMVAMEtUncertainties._addPFMVAMEt(), and jmeUncertaintyTools.JetMEtUncertaintyTools._addShiftedParticleCollections().

237  pfCandCollection, postfix):
238 
239  srcUnshiftedObjects = particleCollection
240  if isinstance(srcUnshiftedObjects, cms.InputTag):
241  srcUnshiftedObjects = srcUnshiftedObjects.value()
242  moduleShiftUp = cms.EDProducer("ShiftedPFCandidateProducerByMatchedObject",
243  srcPFCandidates = pfCandCollection,
244  srcUnshiftedObjects = cms.InputTag(srcUnshiftedObjects),
245  srcShiftedObjects = cms.InputTag(particleCollectionShiftUp),
246  dRmatch_PFCandidate = cms.double(dRmatch)
247  )
248  moduleNameShiftUp = "pfCandidates%s%sUp%s" % (particleType, shiftType, postfix)
249  setattr(process, moduleNameShiftUp, moduleShiftUp)
250  metUncertaintySequence += moduleShiftUp
251 
252  moduleShiftDown = moduleShiftUp.clone(
253  srcShiftedObjects = cms.InputTag(particleCollectionShiftDown)
254  )
255  moduleNameShiftDown = "pfCandidates%s%sDown%s" % (particleType, shiftType, postfix)
256  setattr(process, moduleNameShiftDown, moduleShiftDown)
257  metUncertaintySequence += moduleShiftDown
258 
259  moduleNameShifts = { 'Up':moduleNameShiftUp , 'Down':moduleNameShiftDown }
return moduleNameShifts
def jmeUncertaintyTools.JetMEtUncertaintyTools._addShiftedParticleCollections (   self,
  process,
  electronCollection = None,
  photonCollection = None,
  muonCollection = None,
  tauCollection = None,
  jetCollection = None,
  cleanedJetCollection = None,
  lastJetCollection = None,
  addShiftedResJetCollections = False,
  jetCorrLabelUpToL3 = None,
  jetCorrLabelUpToL3Res = None,
  jecUncertaintyFile = None,
  jecUncertaintyTag = None,
  jetSmearFileName = None,
  jetSmearHistogram = None,
  varyByNsigmas = None,
  postfix = "" 
)
private

Definition at line 132 of file jmeUncertaintyTools.py.

References jmeUncertaintyTools.JetMEtUncertaintyTools._addPFCandidatesForPFMEtInput(), objectsUncertaintyTools.addShiftedJetCollections(), objectsUncertaintyTools.addShiftedSingleParticleCollection(), objectsUncertaintyTools.addSmearedJets(), and objectsUncertaintyTools.isValidInputTag().

Referenced by jmeUncertaintyTools.JetMEtUncertaintyTools._addCleanedJets(), runJetUncertainties.RunJetUncertainties.toolCode(), runType1CaloMEtUncertainties.RunType1CaloMEtUncertainties.toolCode(), runMVAMEtUncertainties.RunMVAMEtUncertainties.toolCode(), runType1PFMEtUncertainties.RunType1PFMEtUncertainties.toolCode(), and runNoPileUpMEtUncertainties.RunNoPileUpMEtUncertainties.toolCode().

133  postfix = ""):
134 
135  shiftedParticleSequence = cms.Sequence()
136  shiftedParticleCollections = {}
137  collectionsToKeep = []
138 
139  # standard jet collections
140  shiftedParticleCollections[ 'cleanedJetCollection' ] = cleanedJetCollection
141 
142  #--------------------------------------------------------------------------------------------
143  # store collection of jets shifted up/down in energy resolution
144  #--------------------------------------------------------------------------------------------
145  if not isValidInputTag(jetCollection) or jetCollection=="":
146  print "INFO : jet collection %s does not exists, no energy resolution shifting will be performed in MET uncertainty tools" % jetCollection
147  else:
148  if addShiftedResJetCollections:
149  variations = { "ResUp":-1., "ResDown":1. }
150  for var in variations.keys():
151  jetCollectionToKeep = \
152  addSmearedJets(process, cleanedJetCollection,
153  [ "smeared", jetCollection, var ],
154  jetSmearFileName,jetSmearHistogram,jetResolutions,
155  varyByNsigmas, variations[ var ],
156  shiftedParticleSequence, postfix)
157  jetCol={'jetCollection%s'%var:jetCollectionToKeep}
158  shiftedParticleCollections.update( jetCol )
159  collectionsToKeep.append( jetCollectionToKeep )
160 
161  #--------------------------------------------------------------------------------------------
162  # produce collection of jets shifted up/down in energy
163  #--------------------------------------------------------------------------------------------
164  if not isValidInputTag(jetCollection) or jetCollection=="":
165  print "INFO : jet collection %s does not exists, no energy shifting will be performed in MET uncertainty tools" % jetCollection
166  else:
167  shiftedJetsCollections, jetsCollectionsToKeep = addShiftedJetCollections(
168  process,jetCollection,lastJetCollection,
169  jetCorrLabelUpToL3, jetCorrLabelUpToL3Res,
170  jecUncertaintyFile, jecUncertaintyTag,
171  varyByNsigmas, shiftedParticleSequence,
172  postfix)
173  shiftedParticleCollections.update( shiftedJetsCollections )
174  collectionsToKeep.extend( jetsCollectionsToKeep )
175 
176  #--------------------------------------------------------------------------------------------
177  # produce collection of electrons shifted up/down in energy
178  #--------------------------------------------------------------------------------------------
179  if not isValidInputTag(electronCollection) or electronCollection=="":
180  print "INFO : electron collection %s does not exists, no energy shifting will be performed in MET uncertainty tools" % electronCollection
181  else:
182  shiftedElectronsCollections, electronsCollectionsToKeep = addShiftedSingleParticleCollection(
183  process, "electron", electronCollection,
184  varyByNsigmas,shiftedParticleSequence,
185  postfix)
186 
187  shiftedParticleCollections.update( shiftedElectronsCollections )
188  collectionsToKeep.extend( electronsCollectionsToKeep )
189 
190  #--------------------------------------------------------------------------------------------
191  # produce collection of (high Pt) photon candidates shifted up/down in energy
192  #--------------------------------------------------------------------------------------------
193  if not isValidInputTag(photonCollection) or photonCollection=="":
194  print "INFO : photon collection %s does not exists, no energy shifting will be performed in MET uncertainty tools" % photonCollection
195  else:
196  shiftedPhotonsCollections, photonsCollectionsToKeep = addShiftedSingleParticleCollection(
197  process, "photon", photonCollection,
198  varyByNsigmas,shiftedParticleSequence,
199  postfix)
200  shiftedParticleCollections.update( shiftedPhotonsCollections )
201  collectionsToKeep.extend( photonsCollectionsToKeep )
202 
203  #--------------------------------------------------------------------------------------------
204  # produce collection of muons shifted up/down in energy/momentum
205  #--------------------------------------------------------------------------------------------
206  if not isValidInputTag(muonCollection) or muonCollection=="":
207  print "INFO : muon collection %s does not exists, no energy shifting will be performed in MET uncertainty tools" % muonCollection
208  else:
209  shiftedMuonsCollections, muonsCollectionsToKeep = addShiftedSingleParticleCollection(process, "muon", muonCollection,
210  varyByNsigmas,shiftedParticleSequence,
211  postfix)
212  shiftedParticleCollections.update( shiftedMuonsCollections )
213  collectionsToKeep.extend( muonsCollectionsToKeep )
214 
215  #--------------------------------------------------------------------------------------------
216  # produce collection of tau-jets shifted up/down in energy
217  #--------------------------------------------------------------------------------------------
218  if not isValidInputTag(tauCollection) or tauCollection=="":
219  print "INFO : tau collection %s does not exists, no energy shifting will be performed in MET uncertainty tools" % tauCollection
220  else:
221  shiftedTausCollections, tausCollectionsToKeep = addShiftedSingleParticleCollection(process, "tau", tauCollection,
222  varyByNsigmas,shiftedParticleSequence,
223  postfix)
224  shiftedParticleCollections.update( shiftedTausCollections )
225  collectionsToKeep.extend( tausCollectionsToKeep )
226 
227 
228  return ( shiftedParticleSequence, shiftedParticleCollections, collectionsToKeep )
229 
230 
231 
232 
def addShiftedJetCollections
Now, jet variation for corrected METs, the default collection to use.
def addShiftedSingleParticleCollection
Up variation.
def jmeUncertaintyTools.JetMEtUncertaintyTools._getLeptonsForPFMEtInput (   self,
  shiftedParticleCollections,
  substituteKeyUnshifted = None,
  substituteKeyShifted = None,
  postfix = "" 
)
private

Definition at line 262 of file jmeUncertaintyTools.py.

References jmeUncertaintyTools.JetMEtUncertaintyTools._addPATMEtProducer(), and objectsUncertaintyTools.isValidInputTag().

Referenced by runMVAMEtUncertainties.RunMVAMEtUncertainties._addPFMVAMEt().

263  def _getLeptonsForPFMEtInput(self, shiftedParticleCollections, substituteKeyUnshifted = None, substituteKeyShifted = None, postfix=""):
264  retVal = []
265  for particleCol in shiftedParticleCollections.keys():
266  if not (particleCol.find("Jet") or particleCol.find("jet") ) and isValidInputTag(shiftedParticleCollections[collectionName]):
267  print collectionName,"==>:"+shiftedParticleCollections[collectionName]
268  if substituteKeyUnshifted is not None and substituteKeyUnshifted in shiftedParticleCollections.keys() and \
269  substituteKeyShifted is not None and substituteKeyShifted in shiftedParticleCollections.keys() and \
270  shiftedParticleCollections[collectionName] == shiftedParticleCollections[substituteKeyUnshifted]:
271  retVal.append(cms.InputTag(shiftedParticleCollections[substituteKeyShifted]))
272  else:
273  retVal.append(shiftedParticleCollections[collectionName])
274  return retVal
def jmeUncertaintyTools.JetMEtUncertaintyTools._initializeInputTag (   self,
  input,
  default 
)
private

Definition at line 67 of file jmeUncertaintyTools.py.

References jmeUncertaintyTools.JetMEtUncertaintyTools._addCleanedJets(), metTools.AddMETCollection._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, editorTools.UserCodeTool._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RunOnData._defaultParameters, jmeUncertaintyTools.JetMEtUncertaintyTools._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, jetTools.AddJetCollection._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, trigTools.SwitchOnTrigger._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, trigTools.SwitchOnTriggerStandAlone._defaultParameters, trackTools.MakeTrackCandidates._defaultParameters, tauTools.AddTauCollection._defaultParameters, trigTools.SwitchOnTriggerMatching._defaultParameters, trigTools.SwitchOnTriggerMatchingStandAlone._defaultParameters, trigTools.SwitchOnTriggerMatchEmbedding._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, and jetTools.SetTagInfos._defaultParameters.

Referenced by runType1CaloMEtUncertainties.RunType1CaloMEtUncertainties.__call__(), runMVAMEtUncertainties.RunMVAMEtUncertainties.__call__(), jmeUncertaintyTools.JetMEtUncertaintyTools.__call__(), runType1PFMEtUncertainties.RunType1PFMEtUncertainties.__call__(), and runNoPileUpMEtUncertainties.RunNoPileUpMEtUncertainties.__call__().

67 
68  def _initializeInputTag(self, input, default):
69  retVal = None
70  if input is None:
71  retVal = self._defaultParameters[default].value
72  elif type(input) == str:
73  retVal = cms.InputTag(input)
74  else:
75  retVal = input
76  return retVal
77 
def jmeUncertaintyTools.JetMEtUncertaintyTools.getDefaultParameters (   self)

Definition at line 63 of file jmeUncertaintyTools.py.

References metTools.AddMETCollection._defaultParameters, trackTools.MakeAODTrackCandidates._defaultParameters, editorTools.UserCodeTool._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RunOnData._defaultParameters, jmeUncertaintyTools.JetMEtUncertaintyTools._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, jetTools.AddJetCollection._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, trackTools.MakePATTrackCandidates._defaultParameters, trigTools.SwitchOnTrigger._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, trigTools.SwitchOnTriggerStandAlone._defaultParameters, trackTools.MakeTrackCandidates._defaultParameters, tauTools.AddTauCollection._defaultParameters, trigTools.SwitchOnTriggerMatching._defaultParameters, trigTools.SwitchOnTriggerMatchingStandAlone._defaultParameters, trigTools.SwitchOnTriggerMatchEmbedding._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, and jetTools.SetTagInfos._defaultParameters.

63 
64  def getDefaultParameters(self):
65  return self._defaultParameters
66 

Member Data Documentation

tuple jmeUncertaintyTools.JetMEtUncertaintyTools._defaultParameters = dicttypes.SortedKeysDict()
staticprivate

Definition at line 21 of file jmeUncertaintyTools.py.

Referenced by HiCoreTools.RestrictInputToAOD.__call__(), runJetUncertainties.RunJetUncertainties.__call__(), HiCoreTools.RemoveMCMatching.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), runType1CaloMEtUncertainties.RunType1CaloMEtUncertainties.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), jmeUncertaintyTools.JetMEtUncertaintyTools.__call__(), HiCoreTools.RemoveCleaning.__call__(), runType1PFMEtUncertainties.RunType1PFMEtUncertainties.__call__(), HiCoreTools.AddCleaning.__call__(), runNoPileUpMEtUncertainties.RunNoPileUpMEtUncertainties.__call__(), HiCoreTools.RestrictInputToAOD.__init__(), runJetUncertainties.RunJetUncertainties.__init__(), runType1CaloMEtUncertainties.RunType1CaloMEtUncertainties.__init__(), jmeUncertaintyTools.JetMEtUncertaintyTools.__init__(), runType1PFMEtUncertainties.RunType1PFMEtUncertainties.__init__(), runMVAMEtUncertainties.RunMVAMEtUncertainties.__init__(), runNoPileUpMEtUncertainties.RunNoPileUpMEtUncertainties.__init__(), HiCoreTools.RemoveMCMatching.__init__(), HiCoreTools.RemoveAllPATObjectsBut.__init__(), HiCoreTools.RemoveSpecificPATObjects.__init__(), HiCoreTools.RemoveCleaning.__init__(), HiCoreTools.AddCleaning.__init__(), jmeUncertaintyTools.JetMEtUncertaintyTools._initializeInputTag(), ConfigToolBase.ConfigToolBase.dumpPython(), ConfigToolBase.ConfigToolBase.getAllowedValues(), HiCoreTools.RestrictInputToAOD.getDefaultParameters(), jmeUncertaintyTools.JetMEtUncertaintyTools.getDefaultParameters(), HiCoreTools.RemoveMCMatching.getDefaultParameters(), HiCoreTools.RemoveAllPATObjectsBut.getDefaultParameters(), HiCoreTools.RemoveSpecificPATObjects.getDefaultParameters(), HiCoreTools.RemoveCleaning.getDefaultParameters(), HiCoreTools.AddCleaning.getDefaultParameters(), ConfigToolBase.ConfigToolBase.reset(), and ConfigToolBase.ConfigToolBase.setParameter().

string jmeUncertaintyTools.JetMEtUncertaintyTools._label = 'JetMEtUncertaintyTools'
staticprivate

Definition at line 20 of file jmeUncertaintyTools.py.