CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
corMETFromMuonAndEG Namespace Reference

Functions

def corMETFromMuonAndEG
 

Function Documentation

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

Definition at line 20 of file corMETFromMuonAndEG.py.

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

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