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

References runMetCorAndUncFromMiniAOD().

Referenced by miniAOD_tools.miniAOD_customizeCommon().

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

Referenced by runMetCorAndUncForMiniAODProduction().

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

Variable Documentation

tuple runMETCorrectionsAndUncertainties.runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()

Definition at line 1470 of file runMETCorrectionsAndUncertainties.py.