CMS 3D CMS Logo

Classes | Functions | Variables
runMETCorrectionsAndUncertainties Namespace Reference

Classes

class  RunMETCorrectionsAndUncertainties
 

Functions

def isValidInputTag (input)
 
def 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="")
 
def 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, puppiProducerLabel="puppi", puppiProducerForMETLabel="puppiNoLep", reapplyJEC=True, jecUncFile="", computeMETSignificance=True, fixEE2017=False, fixEE2017Params=None, extractDeepMETs=False, campaign="", era="", postfix="")
 

Variables

 runMETCorrectionsAndUncertainties
 

Function Documentation

◆ isValidInputTag()

def runMETCorrectionsAndUncertainties.isValidInputTag (   input)

Definition at line 14 of file runMETCorrectionsAndUncertainties.py.

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

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 
23 # class to manage the (re-)calculation of MET, its corrections, and its uncertainties

◆ runMetCorAndUncForMiniAODProduction()

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

References runMetCorAndUncFromMiniAOD().

Referenced by miniAOD_tools.miniAOD_customizeCommon().

1881  postfix=""):
1882 
1883  runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()
1884 
1885  #MET flavors
1886  runMETCorrectionsAndUncertainties(process, metType=metType,
1887  correctionLevel=["T0","T1","T2","Smear","Txy"],
1888  computeUncertainties=False,
1889  produceIntermediateCorrections=True,
1890  addToPatDefaultSequence=False,
1891  jetCollectionUnskimmed=jetCollUnskimmed,
1892  photonCollection=photonColl,
1893  electronCollection=electronColl,
1894  muonCollection=muonColl,
1895  tauCollection=tauColl,
1896  pfCandCollection =pfCandColl,
1897  autoJetCleaning=jetCleaning,
1898  jecUncertaintyFile=jecUnFile,
1899  jetSelection=jetSelection,
1900  jetFlavor=jetFlavor,
1901  recoMetFromPFCs=recoMetFromPFCs,
1902  postfix=postfix
1903  )
1904 
1905  #MET T1 uncertainties
1906  runMETCorrectionsAndUncertainties(process, metType=metType,
1907  correctionLevel=["T1"],
1908  computeUncertainties=True,
1909  produceIntermediateCorrections=False,
1910  addToPatDefaultSequence=False,
1911  jetCollectionUnskimmed=jetCollUnskimmed,
1912  photonCollection=photonColl,
1913  electronCollection=electronColl,
1914  muonCollection=muonColl,
1915  tauCollection=tauColl,
1916  pfCandCollection =pfCandColl,
1917  autoJetCleaning=jetCleaning,
1918  jecUncertaintyFile=jecUnFile,
1919  jetSelection=jetSelection,
1920  jetFlavor=jetFlavor,
1921  recoMetFromPFCs=recoMetFromPFCs,
1922  postfix=postfix
1923  )
1924 
1925  #MET T1 Smeared JER uncertainties
1926  runMETCorrectionsAndUncertainties(process, metType=metType,
1927  correctionLevel=["T1","Smear"],
1928  computeUncertainties=True,
1929  produceIntermediateCorrections=False,
1930  addToPatDefaultSequence=False,
1931  jetCollectionUnskimmed=jetCollUnskimmed,
1932  photonCollection=photonColl,
1933  electronCollection=electronColl,
1934  muonCollection=muonColl,
1935  tauCollection=tauColl,
1936  pfCandCollection =pfCandColl,
1937  autoJetCleaning=jetCleaning,
1938  jecUncertaintyFile=jecUnFile,
1939  jetSelection=jetSelection,
1940  jetFlavor=jetFlavor,
1941  recoMetFromPFCs=recoMetFromPFCs,
1942  postfix=postfix,
1943  )
1944 
1945 
1946 
1947 
1948 # miniAOD reproduction ===========================

◆ runMetCorAndUncFromMiniAOD()

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,
  puppiProducerLabel = "puppi",
  puppiProducerForMETLabel = "puppiNoLep",
  reapplyJEC = True,
  jecUncFile = "",
  computeMETSignificance = True,
  fixEE2017 = False,
  fixEE2017Params = None,
  extractDeepMETs = False,
  campaign = "",
  era = "",
  postfix = "" 
)

Definition at line 1977 of file runMETCorrectionsAndUncertainties.py.

Referenced by runMetCorAndUncForMiniAODProduction().

1977  postfix=""):
1978 
1979  runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()
1980 
1981  #MET T1 uncertainties
1982  runMETCorrectionsAndUncertainties(process, metType=metType,
1983  correctionLevel=["T1"],
1984  computeUncertainties=True,
1985  produceIntermediateCorrections=False,
1986  addToPatDefaultSequence=False,
1987  jetCollectionUnskimmed=jetCollUnskimmed,
1988  electronCollection=electronColl,
1989  muonCollection=muonColl,
1990  tauCollection=tauColl,
1991  photonCollection=photonColl,
1992  pfCandCollection =pfCandColl,
1993  runOnData=isData,
1994  onMiniAOD=True,
1995  reapplyJEC=reapplyJEC,
1996  reclusterJets=reclusterJets,
1997  jetSelection=jetSelection,
1998  recoMetFromPFCs=recoMetFromPFCs,
1999  autoJetCleaning=jetCleaning,
2000  manualJetConfig=manualJetConfig,
2001  jetFlavor=jetFlavor,
2002  jetCorLabelUpToL3=jetCorLabelL3,
2003  jetCorLabelL3Res=jetCorLabelRes,
2004  jecUncertaintyFile=jecUncFile,
2005  computeMETSignificance=computeMETSignificance,
2006  CHS=CHS,
2007  puppiProducerLabel=puppiProducerLabel,
2008  puppiProducerForMETLabel=puppiProducerForMETLabel,
2009  postfix=postfix,
2010  fixEE2017=fixEE2017,
2011  fixEE2017Params=fixEE2017Params,
2012  extractDeepMETs=extractDeepMETs,
2013  campaign=campaign,
2014  era=era,
2015  )
2016 
2017  #MET T1+Txy / Smear
2018  runMETCorrectionsAndUncertainties(process, metType=metType,
2019  correctionLevel=["T1","Txy"],
2020  computeUncertainties=False,
2021  produceIntermediateCorrections=True,
2022  addToPatDefaultSequence=False,
2023  jetCollectionUnskimmed=jetCollUnskimmed,
2024  electronCollection=electronColl,
2025  muonCollection=muonColl,
2026  tauCollection=tauColl,
2027  photonCollection=photonColl,
2028  pfCandCollection =pfCandColl,
2029  runOnData=isData,
2030  onMiniAOD=True,
2031  reapplyJEC=reapplyJEC,
2032  reclusterJets=reclusterJets,
2033  jetSelection=jetSelection,
2034  recoMetFromPFCs=recoMetFromPFCs,
2035  autoJetCleaning=jetCleaning,
2036  manualJetConfig=manualJetConfig,
2037  jetFlavor=jetFlavor,
2038  jetCorLabelUpToL3=jetCorLabelL3,
2039  jetCorLabelL3Res=jetCorLabelRes,
2040  jecUncertaintyFile=jecUncFile,
2041  computeMETSignificance=computeMETSignificance,
2042  CHS=CHS,
2043  puppiProducerLabel=puppiProducerLabel,
2044  puppiProducerForMETLabel=puppiProducerForMETLabel,
2045  postfix=postfix,
2046  fixEE2017=fixEE2017,
2047  fixEE2017Params=fixEE2017Params,
2048  extractDeepMETs=extractDeepMETs,
2049  campaign=campaign,
2050  era=era,
2051  )
2052  #MET T1+Smear + uncertainties
2053  runMETCorrectionsAndUncertainties(process, metType=metType,
2054  correctionLevel=["T1","Smear"],
2055  computeUncertainties=True,
2056  produceIntermediateCorrections=False,
2057  addToPatDefaultSequence=False,
2058  jetCollectionUnskimmed=jetCollUnskimmed,
2059  electronCollection=electronColl,
2060  muonCollection=muonColl,
2061  tauCollection=tauColl,
2062  photonCollection=photonColl,
2063  pfCandCollection =pfCandColl,
2064  runOnData=isData,
2065  onMiniAOD=True,
2066  reapplyJEC=reapplyJEC,
2067  reclusterJets=reclusterJets,
2068  jetSelection=jetSelection,
2069  recoMetFromPFCs=recoMetFromPFCs,
2070  autoJetCleaning=jetCleaning,
2071  manualJetConfig=manualJetConfig,
2072  jetFlavor=jetFlavor,
2073  jetCorLabelUpToL3=jetCorLabelL3,
2074  jetCorLabelL3Res=jetCorLabelRes,
2075  jecUncertaintyFile=jecUncFile,
2076  computeMETSignificance=computeMETSignificance,
2077  CHS=CHS,
2078  puppiProducerLabel=puppiProducerLabel,
2079  puppiProducerForMETLabel=puppiProducerForMETLabel,
2080  postfix=postfix,
2081  fixEE2017=fixEE2017,
2082  fixEE2017Params=fixEE2017Params,
2083  extractDeepMETs=extractDeepMETs,
2084  campaign=campaign,
2085  era=era,
2086  )

Variable Documentation

◆ runMETCorrectionsAndUncertainties

runMETCorrectionsAndUncertainties.runMETCorrectionsAndUncertainties

Definition at line 1863 of file runMETCorrectionsAndUncertainties.py.