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 1623 of file runMETCorrectionsAndUncertainties.py.

References runMetCorAndUncFromMiniAOD().

Referenced by miniAOD_tools.miniAOD_customizeCommon().

1624  postfix=""):
1625 
1626  runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()
1627 
1628  #MET flavors
1629  runMETCorrectionsAndUncertainties(process, metType=metType,
1630  correctionLevel=["T0","T1","T2","Smear","Txy"],
1631  computeUncertainties=False,
1632  produceIntermediateCorrections=True,
1633  addToPatDefaultSequence=False,
1634  jetCollectionUnskimmed=jetCollUnskimmed,
1635  photonCollection=photonColl,
1636  electronCollection=electronColl,
1637  muonCollection=muonColl,
1638  tauCollection=tauColl,
1639  pfCandCollection =pfCandColl,
1640  autoJetCleaning=jetCleaning,
1641  jecUncertaintyFile=jecUnFile,
1642  jetSelection=jetSelection,
1643  jetFlavor=jetFlavor,
1644  recoMetFromPFCs=recoMetFromPFCs,
1645  postfix=postfix
1646  )
1647 
1648  #MET T1 uncertainties
1649  runMETCorrectionsAndUncertainties(process, metType=metType,
1650  correctionLevel=["T1"],
1651  computeUncertainties=True,
1652  produceIntermediateCorrections=False,
1653  addToPatDefaultSequence=False,
1654  jetCollectionUnskimmed=jetCollUnskimmed,
1655  photonCollection=photonColl,
1656  electronCollection=electronColl,
1657  muonCollection=muonColl,
1658  tauCollection=tauColl,
1659  pfCandCollection =pfCandColl,
1660  autoJetCleaning=jetCleaning,
1661  jecUncertaintyFile=jecUnFile,
1662  jetSelection=jetSelection,
1663  jetFlavor=jetFlavor,
1664  recoMetFromPFCs=recoMetFromPFCs,
1665  postfix=postfix
1666  )
1667 
1668  #MET T1 Smeared JER uncertainties
1669  runMETCorrectionsAndUncertainties(process, metType=metType,
1670  correctionLevel=["T1","Smear"],
1671  computeUncertainties=True,
1672  produceIntermediateCorrections=False,
1673  addToPatDefaultSequence=False,
1674  jetCollectionUnskimmed=jetCollUnskimmed,
1675  photonCollection=photonColl,
1676  electronCollection=electronColl,
1677  muonCollection=muonColl,
1678  tauCollection=tauColl,
1679  pfCandCollection =pfCandColl,
1680  autoJetCleaning=jetCleaning,
1681  jecUncertaintyFile=jecUnFile,
1682  jetSelection=jetSelection,
1683  jetFlavor=jetFlavor,
1684  recoMetFromPFCs=recoMetFromPFCs,
1685  postfix=postfix,
1686  )
1687 
1688 
1689 
1690 
# 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 1710 of file runMETCorrectionsAndUncertainties.py.

Referenced by runMetCorAndUncForMiniAODProduction().

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

Variable Documentation

tuple runMETCorrectionsAndUncertainties.runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()

Definition at line 1605 of file runMETCorrectionsAndUncertainties.py.