CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
runMETCorrectionsAndUncertainties Namespace Reference

Classes

class  RunMETCorrectionsAndUncertainties
 

Functions

def isValidInputTag
 
def runMetCorAndUncForMiniAODProduction
 
def runMetCorAndUncFromMiniAOD
 

Variables

tuple runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()
 

Function Documentation

def runMETCorrectionsAndUncertainties.isValidInputTag (   input)

Definition at line 8 of file runMETCorrectionsAndUncertainties.py.

Referenced by runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.createMVAMETModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getMETUncertainties(), and runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetCleaning().

8 
9 def isValidInputTag(input):
10  input_str = input
11  if isinstance(input, cms.InputTag):
12  input_str = input.value()
13  if input is None or input_str == '""':
14  return False
15  else:
16  return True
17 
def runMETCorrectionsAndUncertainties.runMetCorAndUncForMiniAODProduction (   process,
  metType = "PF",
  jetCollUnskimmed = "patJets",
  photonColl = "selectedPatPhotons",
  electronColl = "selectedPatElectrons",
  muonColl = "selectedPatMuons",
  tauColl = "selectedPatTaus",
  pfCandColl = "particleFlow",
  jetCleaning = "LepClean",
  jetSelection = "pt>15 && abs(eta)<9.9",
  jecUnFile = "",
  jetFlavor = "AK4PFchs",
  recoMetFromPFCs = False,
  reclusterJets = False,
  postfix = "" 
)

Definition at line 1626 of file runMETCorrectionsAndUncertainties.py.

References runMetCorAndUncFromMiniAOD().

Referenced by extraSlimmedMETs_MuEGFixMoriond2017.addExtraMETCollections(), corMETFromMuonAndEG.corMETFromMuonAndEG(), and miniAOD_tools.miniAOD_customizeCommon().

1627  postfix=""):
1628 
1629  runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()
1630 
1631  #MET flavors
1632  runMETCorrectionsAndUncertainties(process, metType=metType,
1633  correctionLevel=["T0","T1","T2","Smear","Txy"],
1634  computeUncertainties=False,
1635  produceIntermediateCorrections=True,
1636  addToPatDefaultSequence=False,
1637  jetCollectionUnskimmed=jetCollUnskimmed,
1638  photonCollection=photonColl,
1639  electronCollection=electronColl,
1640  muonCollection=muonColl,
1641  tauCollection=tauColl,
1642  pfCandCollection =pfCandColl,
1643  autoJetCleaning=jetCleaning,
1644  jecUncertaintyFile=jecUnFile,
1645  jetSelection=jetSelection,
1646  jetFlavor=jetFlavor,
1647  recoMetFromPFCs=recoMetFromPFCs,
1648  reclusterJets=reclusterJets,
1649  postfix=postfix
1650  )
1651 
1652  #MET T1 uncertainties
1653  runMETCorrectionsAndUncertainties(process, metType=metType,
1654  correctionLevel=["T1"],
1655  computeUncertainties=True,
1656  produceIntermediateCorrections=False,
1657  addToPatDefaultSequence=False,
1658  jetCollectionUnskimmed=jetCollUnskimmed,
1659  photonCollection=photonColl,
1660  electronCollection=electronColl,
1661  muonCollection=muonColl,
1662  tauCollection=tauColl,
1663  pfCandCollection =pfCandColl,
1664  autoJetCleaning=jetCleaning,
1665  jecUncertaintyFile=jecUnFile,
1666  jetSelection=jetSelection,
1667  jetFlavor=jetFlavor,
1668  recoMetFromPFCs=recoMetFromPFCs,
1669  reclusterJets=reclusterJets,
1670  postfix=postfix
1671  )
1672 
1673  #MET T1 Smeared JER uncertainties
1674  runMETCorrectionsAndUncertainties(process, metType=metType,
1675  correctionLevel=["T1","Smear"],
1676  computeUncertainties=True,
1677  produceIntermediateCorrections=False,
1678  addToPatDefaultSequence=False,
1679  jetCollectionUnskimmed=jetCollUnskimmed,
1680  photonCollection=photonColl,
1681  electronCollection=electronColl,
1682  muonCollection=muonColl,
1683  tauCollection=tauColl,
1684  pfCandCollection =pfCandColl,
1685  autoJetCleaning=jetCleaning,
1686  jecUncertaintyFile=jecUnFile,
1687  jetSelection=jetSelection,
1688  jetFlavor=jetFlavor,
1689  recoMetFromPFCs=recoMetFromPFCs,
1690  reclusterJets=reclusterJets,
1691  postfix=postfix,
1692  )
1693 
1694 
1695 
1696 
# miniAOD reproduction ===========================
def runMETCorrectionsAndUncertainties.runMetCorAndUncFromMiniAOD (   process,
  metType = "PF",
  jetCollUnskimmed = "slimmedJets",
  photonColl = "slimmedPhotons",
  electronColl = "slimmedElectrons",
  muonColl = "slimmedMuons",
  tauColl = "slimmedTaus",
  pfCandColl = "packedPFCandidates",
  jetFlavor = "AK4PFchs",
  jetCleaning = "LepClean",
  isData = False,
  manualJetConfig = False,
  reclusterJets = False,
  jetSelection = "pt>15 && abs(eta)<9.9",
  recoMetFromPFCs = False,
  jetCorLabelL3 = "ak4PFCHSL1FastL2L3Corrector",
  jetCorLabelRes = "ak4PFCHSL1FastL2L3ResidualCorrector",
  CHS = False,
  jecUncFile = "",
  postfix = "" 
)

Definition at line 1716 of file runMETCorrectionsAndUncertainties.py.

Referenced by corMETFromMuonAndEG.corMETFromMuonAndEG(), and runMetCorAndUncForMiniAODProduction().

1717  postfix=""):
1718 
1719  runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()
1720 
1721  #MET T1 uncertainties
1722  runMETCorrectionsAndUncertainties(process, metType=metType,
1723  correctionLevel=["T1"],
1724  computeUncertainties=True,
1725  produceIntermediateCorrections=False,
1726  addToPatDefaultSequence=False,
1727  jetCollectionUnskimmed=jetCollUnskimmed,
1728  electronCollection=electronColl,
1729  muonCollection=muonColl,
1730  tauCollection=tauColl,
1731  photonCollection=photonColl,
1732  pfCandCollection =pfCandColl,
1733  runOnData=isData,
1734  onMiniAOD=True,
1735  reclusterJets=reclusterJets,
1736  jetSelection=jetSelection,
1737  recoMetFromPFCs=recoMetFromPFCs,
1738  autoJetCleaning=jetCleaning,
1739  manualJetConfig=manualJetConfig,
1740  jetFlavor=jetFlavor,
1741  jetCorLabelUpToL3=jetCorLabelL3,
1742  jetCorLabelL3Res=jetCorLabelRes,
1743  jecUncertaintyFile=jecUncFile,
1744  CHS=CHS,
1745  postfix=postfix,
1746  )
1747 
1748  #MET T1+Txy / Smear
1749  runMETCorrectionsAndUncertainties(process, metType=metType,
1750  correctionLevel=["T1","Txy"],
1751  computeUncertainties=False,
1752  produceIntermediateCorrections=True,
1753  addToPatDefaultSequence=False,
1754  jetCollectionUnskimmed=jetCollUnskimmed,
1755  electronCollection=electronColl,
1756  muonCollection=muonColl,
1757  tauCollection=tauColl,
1758  photonCollection=photonColl,
1759  pfCandCollection =pfCandColl,
1760  runOnData=isData,
1761  onMiniAOD=True,
1762  reclusterJets=reclusterJets,
1763  jetSelection=jetSelection,
1764  recoMetFromPFCs=recoMetFromPFCs,
1765  autoJetCleaning=jetCleaning,
1766  manualJetConfig=manualJetConfig,
1767  jetFlavor=jetFlavor,
1768  jetCorLabelUpToL3=jetCorLabelL3,
1769  jetCorLabelL3Res=jetCorLabelRes,
1770  jecUncertaintyFile=jecUncFile,
1771  CHS=CHS,
1772  postfix=postfix,
1773  )
1774  #MET T1+Smear + uncertainties
1775  runMETCorrectionsAndUncertainties(process, metType=metType,
1776  correctionLevel=["T1","Smear"],
1777  computeUncertainties=True,
1778  produceIntermediateCorrections=False,
1779  addToPatDefaultSequence=False,
1780  jetCollectionUnskimmed=jetCollUnskimmed,
1781  electronCollection=electronColl,
1782  muonCollection=muonColl,
1783  tauCollection=tauColl,
1784  photonCollection=photonColl,
1785  pfCandCollection =pfCandColl,
1786  runOnData=isData,
1787  onMiniAOD=True,
1788  reclusterJets=reclusterJets,
1789  jetSelection=jetSelection,
1790  recoMetFromPFCs=recoMetFromPFCs,
1791  autoJetCleaning=jetCleaning,
1792  manualJetConfig=manualJetConfig,
1793  jetFlavor=jetFlavor,
1794  jetCorLabelUpToL3=jetCorLabelL3,
1795  jetCorLabelL3Res=jetCorLabelRes,
1796  jecUncertaintyFile=jecUncFile,
1797  CHS=CHS,
1798  postfix=postfix,
1799  )

Variable Documentation

tuple runMETCorrectionsAndUncertainties.runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()

Definition at line 1607 of file runMETCorrectionsAndUncertainties.py.