CMS 3D CMS Logo

Functions
corMETFromMuonAndEG Namespace Reference

Functions

def corMETFromMuonAndEG (process, pfCandCollection, electronCollection, photonCollection, corElectronCollection, corPhotonCollection, muCorrection, eGCorrection, allMETEGCorrected, runOnMiniAOD, eGPfCandMatching=False, corMetName="slimmedMETsCorMuAndEG", muSelection="", muonCollection="", eGPFix="", postfix="")
 

Function Documentation

◆ corMETFromMuonAndEG()

def corMETFromMuonAndEG.corMETFromMuonAndEG (   process,
  pfCandCollection,
  electronCollection,
  photonCollection,
  corElectronCollection,
  corPhotonCollection,
  muCorrection,
  eGCorrection,
  allMETEGCorrected,
  runOnMiniAOD,
  eGPfCandMatching = False,
  corMetName = "slimmedMETsCorMuAndEG",
  muSelection = "",
  muonCollection = "",
  eGPFix = "",
  postfix = "" 
)

Definition at line 4 of file corMETFromMuonAndEG.py.

4 def corMETFromMuonAndEG(process,
5  pfCandCollection,
6  electronCollection,
7  photonCollection,
8  corElectronCollection,
9  corPhotonCollection,
10  muCorrection,
11  eGCorrection,
12  allMETEGCorrected,
13  runOnMiniAOD,
14  eGPfCandMatching=False,
15  corMetName="slimmedMETsCorMuAndEG",
16  muSelection="",
17  muonCollection="",
18  eGPFix="",
19  postfix=""
20  ):
21 
22  #Muon first =======================================
23  if muCorrection:
24  from PhysicsTools.PatUtils.tools.muonRecoMitigation import muonRecoMitigation
25  from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties import runMetCorAndUncFromMiniAOD, runMetCorAndUncForMiniAODProduction
26 
27  muonRecoMitigation(process,
28  pfCandCollection=pfCandCollection,
29  runOnMiniAOD=runOnMiniAOD,
30  muonCollection=muonCollection,
31  selection=muSelection,
32  cleaningScheme="duplicated",
33  postfix=postfix)
34 
35  if runOnMiniAOD:
37  pfCandColl="cleanMuonsPFCandidates"+postfix,
38  recoMetFromPFCs=True,
39  postfix="MuClean"+postfix
40  )
41  else:
43  pfCandColl="cleanMuonsPFCandidates"+postfix,
44  recoMetFromPFCs=True,
45  postfix="MuClean"+postfix
46  )
47 
48  #EGamma simultaneously ====================================
49  if eGCorrection:
50  from PhysicsTools.PatUtils.tools.eGammaCorrection import eGammaCorrection
51 
52  #no better idea for now, duplicating the full std METs
53  #if we do not correct for the muons
54  pFix="MuClean"+postfix if muCorrection else eGPFix #postfix
55  metCollections=["patPFMetT1"+pFix]
56  if allMETEGCorrected:
57  metCollections.extend([
58  "patPFMetRaw"+pFix,
59  "patPFMetT0pcT1"+pFix,
60  #"patPFMetT0pcT1T2"+pFix,
61  "patPFMetT1Smear"+pFix,
62  "patPFMetT1SmearTxy"+pFix,
63  "patPFMetT0pcT1SmearTxy"+pFix,
64  #"patPFMetT1T2"+pFix,
65  "patPFMetT0pcT1Txy"+pFix,
66  "patPFMetT1Txy"+pFix,
67  "patPFMetTxy"+pFix])
68  if not muCorrection:
69  variations=["Up","Down"]
70  for var in variations:
71  metCollections.extend([
72  "patPFMetT1JetEn"+var+pFix,
73  "patPFMetT1JetRes"+var+pFix,
74  "patPFMetT1SmearJetRes"+var+pFix,
75  "patPFMetT1ElectronEn"+var+pFix,
76  "patPFMetT1PhotonEn"+var+pFix,
77  "patPFMetT1MuonEn"+var+pFix,
78  "patPFMetT1TauEn"+var+pFix,
79  "patPFMetT1UnclusteredEn"+var+pFix,
80  ])
81 
82  eGPfCandCollection= pfCandCollection if not muCorrection else "cleanMuonsPFCandidates"+postfix
83  eGammaCorrection(process,
84  electronCollection=electronCollection,
85  photonCollection=photonCollection,
86  corElectronCollection=corElectronCollection,
87  corPhotonCollection=corPhotonCollection,
88  metCollections=metCollections,
89  pfCandMatching=eGPfCandMatching,
90  pfCandidateCollection=eGPfCandCollection,
91  corMetName=corMetName,
92  postfix=postfix
93  )
94 
95 
96 
97 

References runMETCorrectionsAndUncertainties.runMetCorAndUncForMiniAODProduction(), and runMETCorrectionsAndUncertainties.runMetCorAndUncFromMiniAOD().

runMETCorrectionsAndUncertainties.runMetCorAndUncFromMiniAOD
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, reapplyJEC=True, jecUncFile="", computeMETSignificance=True, fixEE2017=False, fixEE2017Params=None, extractDeepMETs=False, postfix="")
Definition: runMETCorrectionsAndUncertainties.py:2046
muonRecoMitigation
Definition: muonRecoMitigation.py:1
runMETCorrectionsAndUncertainties.runMetCorAndUncForMiniAODProduction
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="")
Definition: runMETCorrectionsAndUncertainties.py:1966
eGammaCorrection
Definition: eGammaCorrection.py:1
corMETFromMuonAndEG.corMETFromMuonAndEG
def corMETFromMuonAndEG(process, pfCandCollection, electronCollection, photonCollection, corElectronCollection, corPhotonCollection, muCorrection, eGCorrection, allMETEGCorrected, runOnMiniAOD, eGPfCandMatching=False, corMetName="slimmedMETsCorMuAndEG", muSelection="", muonCollection="", eGPFix="", postfix="")
Definition: corMETFromMuonAndEG.py:4