CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 13 of file runMETCorrectionsAndUncertainties.py.

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

13 
14 def isValidInputTag(input):
15  input_str = input
16  if isinstance(input, cms.InputTag):
17  input_str = input.value()
18  if input is None or input_str == '""':
19  return False
20  else:
21  return True
22 
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 1968 of file runMETCorrectionsAndUncertainties.py.

References runMetCorAndUncFromMiniAOD().

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

1969  postfix=""):
1970 
1971  runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()
1972 
1973  #MET flavors
1974  runMETCorrectionsAndUncertainties(process, metType=metType,
1975  correctionLevel=["T0","T1","T2","Smear","Txy"],
1976  computeUncertainties=False,
1977  produceIntermediateCorrections=True,
1978  addToPatDefaultSequence=False,
1979  jetCollectionUnskimmed=jetCollUnskimmed,
1980  photonCollection=photonColl,
1981  electronCollection=electronColl,
1982  muonCollection=muonColl,
1983  tauCollection=tauColl,
1984  pfCandCollection =pfCandColl,
1985  autoJetCleaning=jetCleaning,
1986  jecUncertaintyFile=jecUnFile,
1987  jetSelection=jetSelection,
1988  jetFlavor=jetFlavor,
1989  recoMetFromPFCs=recoMetFromPFCs,
1990  postfix=postfix
1991  )
1992 
1993  #MET T1 uncertainties
1994  runMETCorrectionsAndUncertainties(process, metType=metType,
1995  correctionLevel=["T1"],
1996  computeUncertainties=True,
1997  produceIntermediateCorrections=False,
1998  addToPatDefaultSequence=False,
1999  jetCollectionUnskimmed=jetCollUnskimmed,
2000  photonCollection=photonColl,
2001  electronCollection=electronColl,
2002  muonCollection=muonColl,
2003  tauCollection=tauColl,
2004  pfCandCollection =pfCandColl,
2005  autoJetCleaning=jetCleaning,
2006  jecUncertaintyFile=jecUnFile,
2007  jetSelection=jetSelection,
2008  jetFlavor=jetFlavor,
2009  recoMetFromPFCs=recoMetFromPFCs,
2010  postfix=postfix
2011  )
2012 
2013  #MET T1 Smeared JER uncertainties
2014  runMETCorrectionsAndUncertainties(process, metType=metType,
2015  correctionLevel=["T1","Smear"],
2016  computeUncertainties=True,
2017  produceIntermediateCorrections=False,
2018  addToPatDefaultSequence=False,
2019  jetCollectionUnskimmed=jetCollUnskimmed,
2020  photonCollection=photonColl,
2021  electronCollection=electronColl,
2022  muonCollection=muonColl,
2023  tauCollection=tauColl,
2024  pfCandCollection =pfCandColl,
2025  autoJetCleaning=jetCleaning,
2026  jecUncertaintyFile=jecUnFile,
2027  jetSelection=jetSelection,
2028  jetFlavor=jetFlavor,
2029  recoMetFromPFCs=recoMetFromPFCs,
2030  postfix=postfix,
2031  )
2032 
2033 
2034 
2035 
# 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 = None,
  jetSelection = "pt>15 && abs(eta)<9.9",
  recoMetFromPFCs = None,
  jetCorLabelL3 = "ak4PFCHSL1FastL2L3Corrector",
  jetCorLabelRes = "ak4PFCHSL1FastL2L3ResidualCorrector",
  CHS = False,
  reapplyJEC = True,
  jecUncFile = "",
  computeMETSignificance = True,
  fixEE2017 = False,
  fixEE2017Params = None,
  extractDeepMETs = False,
  postfix = "" 
)

Definition at line 2060 of file runMETCorrectionsAndUncertainties.py.

Referenced by corMETFromMuonAndEG.corMETFromMuonAndEG(), nano_cff.nanoAOD_recalibrateMETs(), nano_cff.nanoAOD_runMETfixEE2017(), and runMetCorAndUncForMiniAODProduction().

2061  postfix=""):
2062 
2063  runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()
2064 
2065  #MET T1 uncertainties
2066  runMETCorrectionsAndUncertainties(process, metType=metType,
2067  correctionLevel=["T1"],
2068  computeUncertainties=True,
2069  produceIntermediateCorrections=False,
2070  addToPatDefaultSequence=False,
2071  jetCollectionUnskimmed=jetCollUnskimmed,
2072  electronCollection=electronColl,
2073  muonCollection=muonColl,
2074  tauCollection=tauColl,
2075  photonCollection=photonColl,
2076  pfCandCollection =pfCandColl,
2077  runOnData=isData,
2078  onMiniAOD=True,
2079  reapplyJEC=reapplyJEC,
2080  reclusterJets=reclusterJets,
2081  jetSelection=jetSelection,
2082  recoMetFromPFCs=recoMetFromPFCs,
2083  autoJetCleaning=jetCleaning,
2084  manualJetConfig=manualJetConfig,
2085  jetFlavor=jetFlavor,
2086  jetCorLabelUpToL3=jetCorLabelL3,
2087  jetCorLabelL3Res=jetCorLabelRes,
2088  jecUncertaintyFile=jecUncFile,
2089  computeMETSignificance=computeMETSignificance,
2090  CHS=CHS,
2091  postfix=postfix,
2092  fixEE2017=fixEE2017,
2093  fixEE2017Params=fixEE2017Params,
2094  extractDeepMETs=extractDeepMETs,
2095  )
2096 
2097  #MET T1+Txy / Smear
2098  runMETCorrectionsAndUncertainties(process, metType=metType,
2099  correctionLevel=["T1","Txy"],
2100  computeUncertainties=False,
2101  produceIntermediateCorrections=True,
2102  addToPatDefaultSequence=False,
2103  jetCollectionUnskimmed=jetCollUnskimmed,
2104  electronCollection=electronColl,
2105  muonCollection=muonColl,
2106  tauCollection=tauColl,
2107  photonCollection=photonColl,
2108  pfCandCollection =pfCandColl,
2109  runOnData=isData,
2110  onMiniAOD=True,
2111  reapplyJEC=reapplyJEC,
2112  reclusterJets=reclusterJets,
2113  jetSelection=jetSelection,
2114  recoMetFromPFCs=recoMetFromPFCs,
2115  autoJetCleaning=jetCleaning,
2116  manualJetConfig=manualJetConfig,
2117  jetFlavor=jetFlavor,
2118  jetCorLabelUpToL3=jetCorLabelL3,
2119  jetCorLabelL3Res=jetCorLabelRes,
2120  jecUncertaintyFile=jecUncFile,
2121  computeMETSignificance=computeMETSignificance,
2122  CHS=CHS,
2123  postfix=postfix,
2124  fixEE2017=fixEE2017,
2125  fixEE2017Params=fixEE2017Params,
2126  extractDeepMETs=extractDeepMETs,
2127  )
2128  #MET T1+Smear + uncertainties
2129  runMETCorrectionsAndUncertainties(process, metType=metType,
2130  correctionLevel=["T1","Smear"],
2131  computeUncertainties=True,
2132  produceIntermediateCorrections=False,
2133  addToPatDefaultSequence=False,
2134  jetCollectionUnskimmed=jetCollUnskimmed,
2135  electronCollection=electronColl,
2136  muonCollection=muonColl,
2137  tauCollection=tauColl,
2138  photonCollection=photonColl,
2139  pfCandCollection =pfCandColl,
2140  runOnData=isData,
2141  onMiniAOD=True,
2142  reapplyJEC=reapplyJEC,
2143  reclusterJets=reclusterJets,
2144  jetSelection=jetSelection,
2145  recoMetFromPFCs=recoMetFromPFCs,
2146  autoJetCleaning=jetCleaning,
2147  manualJetConfig=manualJetConfig,
2148  jetFlavor=jetFlavor,
2149  jetCorLabelUpToL3=jetCorLabelL3,
2150  jetCorLabelL3Res=jetCorLabelRes,
2151  jecUncertaintyFile=jecUncFile,
2152  computeMETSignificance=computeMETSignificance,
2153  CHS=CHS,
2154  postfix=postfix,
2155  fixEE2017=fixEE2017,
2156  fixEE2017Params=fixEE2017Params,
2157  extractDeepMETs=extractDeepMETs,
2158  )

Variable Documentation

tuple runMETCorrectionsAndUncertainties.runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()

Definition at line 1950 of file runMETCorrectionsAndUncertainties.py.