test
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,
  postfix = "" 
)

Definition at line 1662 of file runMETCorrectionsAndUncertainties.py.

References runMetCorAndUncFromMiniAOD().

Referenced by miniAOD_tools.miniAOD_customizeCommon().

1663  postfix=""):
1664 
1665  runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()
1666 
1667  #MET flavors
1668  runMETCorrectionsAndUncertainties(process, metType=metType,
1669  correctionLevel=["T0","T1","T2","Smear","Txy"],
1670  computeUncertainties=False,
1671  produceIntermediateCorrections=True,
1672  addToPatDefaultSequence=False,
1673  jetCollectionUnskimmed=jetCollUnskimmed,
1674  photonCollection=photonColl,
1675  electronCollection=electronColl,
1676  muonCollection=muonColl,
1677  tauCollection=tauColl,
1678  pfCandCollection =pfCandColl,
1679  autoJetCleaning=jetCleaning,
1680  jecUncertaintyFile=jecUnFile,
1681  jetSelection=jetSelection,
1682  jetFlavor=jetFlavor,
1683  recoMetFromPFCs=recoMetFromPFCs,
1684  postfix=postfix
1685  )
1686 
1687  #MET T1 uncertainties
1688  runMETCorrectionsAndUncertainties(process, metType=metType,
1689  correctionLevel=["T1"],
1690  computeUncertainties=True,
1691  produceIntermediateCorrections=False,
1692  addToPatDefaultSequence=False,
1693  jetCollectionUnskimmed=jetCollUnskimmed,
1694  photonCollection=photonColl,
1695  electronCollection=electronColl,
1696  muonCollection=muonColl,
1697  tauCollection=tauColl,
1698  pfCandCollection =pfCandColl,
1699  autoJetCleaning=jetCleaning,
1700  jecUncertaintyFile=jecUnFile,
1701  jetSelection=jetSelection,
1702  jetFlavor=jetFlavor,
1703  recoMetFromPFCs=recoMetFromPFCs,
1704  postfix=postfix
1705  )
1706 
1707  #MET T1 Smeared JER uncertainties
1708  runMETCorrectionsAndUncertainties(process, metType=metType,
1709  correctionLevel=["T1","Smear"],
1710  computeUncertainties=True,
1711  produceIntermediateCorrections=False,
1712  addToPatDefaultSequence=False,
1713  jetCollectionUnskimmed=jetCollUnskimmed,
1714  photonCollection=photonColl,
1715  electronCollection=electronColl,
1716  muonCollection=muonColl,
1717  tauCollection=tauColl,
1718  pfCandCollection =pfCandColl,
1719  autoJetCleaning=jetCleaning,
1720  jecUncertaintyFile=jecUnFile,
1721  jetSelection=jetSelection,
1722  jetFlavor=jetFlavor,
1723  recoMetFromPFCs=recoMetFromPFCs,
1724  postfix=postfix,
1725  )
1726 
1727 
1728 
1729 
# 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,
  reapplyJEC = True,
  jecUncFile = "",
  postfix = "" 
)

Definition at line 1750 of file runMETCorrectionsAndUncertainties.py.

Referenced by runMetCorAndUncForMiniAODProduction().

1751  postfix=""):
1752 
1753  runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()
1754 
1755  #MET T1 uncertainties
1756  runMETCorrectionsAndUncertainties(process, metType=metType,
1757  correctionLevel=["T1"],
1758  computeUncertainties=True,
1759  produceIntermediateCorrections=False,
1760  addToPatDefaultSequence=False,
1761  jetCollectionUnskimmed=jetCollUnskimmed,
1762  electronCollection=electronColl,
1763  muonCollection=muonColl,
1764  tauCollection=tauColl,
1765  photonCollection=photonColl,
1766  pfCandCollection =pfCandColl,
1767  runOnData=isData,
1768  onMiniAOD=True,
1769  reapplyJEC=reapplyJEC,
1770  reclusterJets=reclusterJets,
1771  jetSelection=jetSelection,
1772  recoMetFromPFCs=recoMetFromPFCs,
1773  autoJetCleaning=jetCleaning,
1774  manualJetConfig=manualJetConfig,
1775  jetFlavor=jetFlavor,
1776  jetCorLabelUpToL3=jetCorLabelL3,
1777  jetCorLabelL3Res=jetCorLabelRes,
1778  jecUncertaintyFile=jecUncFile,
1779  CHS=CHS,
1780  postfix=postfix,
1781  )
1782 
1783  #MET T1+Txy / Smear
1784  runMETCorrectionsAndUncertainties(process, metType=metType,
1785  correctionLevel=["T1","Txy"],
1786  computeUncertainties=False,
1787  produceIntermediateCorrections=True,
1788  addToPatDefaultSequence=False,
1789  jetCollectionUnskimmed=jetCollUnskimmed,
1790  electronCollection=electronColl,
1791  muonCollection=muonColl,
1792  tauCollection=tauColl,
1793  photonCollection=photonColl,
1794  pfCandCollection =pfCandColl,
1795  runOnData=isData,
1796  onMiniAOD=True,
1797  reapplyJEC=reapplyJEC,
1798  reclusterJets=reclusterJets,
1799  jetSelection=jetSelection,
1800  recoMetFromPFCs=recoMetFromPFCs,
1801  autoJetCleaning=jetCleaning,
1802  manualJetConfig=manualJetConfig,
1803  jetFlavor=jetFlavor,
1804  jetCorLabelUpToL3=jetCorLabelL3,
1805  jetCorLabelL3Res=jetCorLabelRes,
1806  jecUncertaintyFile=jecUncFile,
1807  CHS=CHS,
1808  postfix=postfix,
1809  )
1810  #MET T1+Smear + uncertainties
1811  runMETCorrectionsAndUncertainties(process, metType=metType,
1812  correctionLevel=["T1","Smear"],
1813  computeUncertainties=True,
1814  produceIntermediateCorrections=False,
1815  addToPatDefaultSequence=False,
1816  jetCollectionUnskimmed=jetCollUnskimmed,
1817  electronCollection=electronColl,
1818  muonCollection=muonColl,
1819  tauCollection=tauColl,
1820  photonCollection=photonColl,
1821  pfCandCollection =pfCandColl,
1822  runOnData=isData,
1823  onMiniAOD=True,
1824  reapplyJEC=reapplyJEC,
1825  reclusterJets=reclusterJets,
1826  jetSelection=jetSelection,
1827  recoMetFromPFCs=recoMetFromPFCs,
1828  autoJetCleaning=jetCleaning,
1829  manualJetConfig=manualJetConfig,
1830  jetFlavor=jetFlavor,
1831  jetCorLabelUpToL3=jetCorLabelL3,
1832  jetCorLabelL3Res=jetCorLabelRes,
1833  jecUncertaintyFile=jecUncFile,
1834  CHS=CHS,
1835  postfix=postfix,
1836  )

Variable Documentation

tuple runMETCorrectionsAndUncertainties.runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()

Definition at line 1644 of file runMETCorrectionsAndUncertainties.py.