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

References runMetCorAndUncFromMiniAOD().

Referenced by miniAOD_tools.miniAOD_customizeCommon().

1487  postfix=""):
1488 
1489  runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()
1490 
1491  #MET flavors
1492  runMETCorrectionsAndUncertainties(process, metType="PF",
1493  correctionLevel=["T0","T1","T2","Smear","Txy"],
1494  computeUncertainties=False,
1495  produceIntermediateCorrections=True,
1496  addToPatDefaultSequence=False,
1497  jetCollectionUnskimmed=jetCollUnskimmed,
1498  photonCollection=photonColl,
1499  electronCollection=electronColl,
1500  muonCollection=muonColl,
1501  tauCollection=tauColl,
1502  pfCandCollection =pfCandColl,
1503  autoJetCleaning=jetCleaning,
1504  jecUncertaintyFile=jecUnFile,
1505  jetSelection=jetSelection,
1506  jetFlavor=jetFlavor,
1507  recoMetFromPFCs=recoMetFromPFCs,
1508  postfix=postfix
1509  )
1510 
1511  #MET T1 uncertainties
1512  runMETCorrectionsAndUncertainties(process, metType="PF",
1513  correctionLevel=["T1"],
1514  computeUncertainties=True,
1515  produceIntermediateCorrections=False,
1516  addToPatDefaultSequence=False,
1517  jetCollectionUnskimmed=jetCollUnskimmed,
1518  photonCollection=photonColl,
1519  electronCollection=electronColl,
1520  muonCollection=muonColl,
1521  tauCollection=tauColl,
1522  pfCandCollection =pfCandColl,
1523  autoJetCleaning=jetCleaning,
1524  jecUncertaintyFile=jecUnFile,
1525  jetSelection=jetSelection,
1526  jetFlavor=jetFlavor,
1527  recoMetFromPFCs=recoMetFromPFCs,
1528  postfix=postfix
1529  )
1530 
1531  #MET T1 Smeared JER uncertainties
1532  runMETCorrectionsAndUncertainties(process, metType="PF",
1533  correctionLevel=["T1","Smear"],
1534  computeUncertainties=True,
1535  produceIntermediateCorrections=False,
1536  addToPatDefaultSequence=False,
1537  jetCollectionUnskimmed=jetCollUnskimmed,
1538  photonCollection=photonColl,
1539  electronCollection=electronColl,
1540  muonCollection=muonColl,
1541  tauCollection=tauColl,
1542  pfCandCollection =pfCandColl,
1543  autoJetCleaning=jetCleaning,
1544  jecUncertaintyFile=jecUnFile,
1545  jetSelection=jetSelection,
1546  jetFlavor=jetFlavor,
1547  recoMetFromPFCs=recoMetFromPFCs,
1548  postfix=postfix,
1549  )
1550 
1551 
1552 
1553 
# 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 1573 of file runMETCorrectionsAndUncertainties.py.

Referenced by runMetCorAndUncForMiniAODProduction().

1574  postfix=""):
1575 
1576  runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()
1577 
1578  #MET T1 uncertainties
1579  runMETCorrectionsAndUncertainties(process, metType="PF",
1580  correctionLevel=["T1"],
1581  computeUncertainties=True,
1582  produceIntermediateCorrections=False,
1583  addToPatDefaultSequence=False,
1584  jetCollectionUnskimmed=jetCollUnskimmed,
1585  electronCollection=electronColl,
1586  muonCollection=muonColl,
1587  tauCollection=tauColl,
1588  photonCollection=photonColl,
1589  pfCandCollection =pfCandColl,
1590  runOnData=isData,
1591  onMiniAOD=True,
1592  reclusterJets=reclusterJets,
1593  jetSelection=jetSelection,
1594  recoMetFromPFCs=recoMetFromPFCs,
1595  autoJetCleaning=jetCleaning,
1596  manualJetConfig=manualJetConfig,
1597  jetFlavor=jetFlavor,
1598  jetCorLabelUpToL3=jetCorLabelL3,
1599  jetCorLabelL3Res=jetCorLabelRes,
1600  jecUncertaintyFile=jecUncFile,
1601  CHS=CHS,
1602  postfix=postfix,
1603  )
1604 
1605  #MET T1+Txy / Smear
1606  runMETCorrectionsAndUncertainties(process, metType="PF",
1607  correctionLevel=["T1","Txy"],
1608  computeUncertainties=False,
1609  produceIntermediateCorrections=True,
1610  addToPatDefaultSequence=False,
1611  jetCollectionUnskimmed=jetCollUnskimmed,
1612  electronCollection=electronColl,
1613  muonCollection=muonColl,
1614  tauCollection=tauColl,
1615  photonCollection=photonColl,
1616  pfCandCollection =pfCandColl,
1617  runOnData=isData,
1618  onMiniAOD=True,
1619  reclusterJets=reclusterJets,
1620  jetSelection=jetSelection,
1621  recoMetFromPFCs=recoMetFromPFCs,
1622  autoJetCleaning=jetCleaning,
1623  manualJetConfig=manualJetConfig,
1624  jetFlavor=jetFlavor,
1625  jetCorLabelUpToL3=jetCorLabelL3,
1626  jetCorLabelL3Res=jetCorLabelRes,
1627  jecUncertaintyFile=jecUncFile,
1628  CHS=CHS,
1629  postfix=postfix,
1630  )
1631  #MET T1+Smear + uncertainties
1632  runMETCorrectionsAndUncertainties(process, metType="PF",
1633  correctionLevel=["T1","Smear"],
1634  computeUncertainties=True,
1635  produceIntermediateCorrections=False,
1636  addToPatDefaultSequence=False,
1637  jetCollectionUnskimmed=jetCollUnskimmed,
1638  electronCollection=electronColl,
1639  muonCollection=muonColl,
1640  tauCollection=tauColl,
1641  photonCollection=photonColl,
1642  pfCandCollection =pfCandColl,
1643  runOnData=isData,
1644  onMiniAOD=True,
1645  reclusterJets=reclusterJets,
1646  jetSelection=jetSelection,
1647  recoMetFromPFCs=recoMetFromPFCs,
1648  autoJetCleaning=jetCleaning,
1649  manualJetConfig=manualJetConfig,
1650  jetFlavor=jetFlavor,
1651  jetCorLabelUpToL3=jetCorLabelL3,
1652  jetCorLabelL3Res=jetCorLabelRes,
1653  jecUncertaintyFile=jecUncFile,
1654  CHS=CHS,
1655  postfix=postfix,
1656  )

Variable Documentation

tuple runMETCorrectionsAndUncertainties.runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()

Definition at line 1468 of file runMETCorrectionsAndUncertainties.py.