Skip to content

Commit

Permalink
cleaning and cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu committed Sep 25, 2015
1 parent 43e813e commit 28db46c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def miniAOD_customizeCommon(process):
)
runMetCorAndUncForMiniAODProduction(process,
pfCandColl=cms.InputTag("noHFCands"),
recomputeMET=True, #needed for HF removal
recoMetFromPFCs=True, #needed for HF removal
postfix="NoHF"
)
process.load('PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi')
Expand Down
11 changes: 7 additions & 4 deletions PhysicsTools/PatAlgos/test/corMETFromMiniAOD.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#configurable options =======================================================================
runOnData=False #data/MC switch
usePrivateSQlite=True #use external JECs (sqlite file)
usePrivateSQlite=False #use external JECs (sqlite file)
useHFCandidates=False #create an additionnal NoHF slimmed MET collection if the option is set to false
applyResiduals=True #application of residual corrections. Have to be set to True once the 13 TeV residual corrections are available. False to be kept meanwhile. Can be kept to False later for private tests or for analysis checks and developments (not the official recommendation!).
#===================================================================
Expand All @@ -45,8 +45,8 @@
process.GlobalTag.globaltag = autoCond['run2_data']
#process.GlobalTag.globaltag = '75X_dataRun1_v2' #'74X_dataRun2_Prompt_v1'
else:
#process.GlobalTag.globaltag = 'MCRUN2_74_v9'
process.GlobalTag.globaltag = autoCond['run2_mc']
process.GlobalTag.globaltag = 'MCRUN2_75_V5'
# process.GlobalTag.globaltag = autoCond['run2_mc']
# process.GlobalTag = GlobaTag(GlobalTag, 'auto:run2_mc', '')

if usePrivateSQlite:
Expand Down Expand Up @@ -85,7 +85,8 @@
else:
#75X file : root://eoscms.cern.ch//store/relval/CMSSW_7_5_0/RelValTTbar_13/MINIAODSIM/75X_mcRun2_asymptotic_v1-v1/00000/92A928E7-842A-E511-87CC-0025905A60E0.root
#74X file : root://eoscms.cern.ch//store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v2/60000/001C7571-0511-E511-9B8E-549F35AE4FAF.root
fname = 'root://eoscms.cern.ch//store/mc/RunIISpring15DR74/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v2/60000/001C7571-0511-E511-9B8E-549F35AE4FAF.root'
fname = 'root://eoscms.cern.ch//store/relval/CMSSW_7_5_3/RelValZEE_13/MINIAODSIM/75X_mcRun2_asymptotic_v5-v1/00000/F8C5D3F4-A861-E511-BA41-002618943906.root'

# Define the input source
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring([ fname ])
Expand Down Expand Up @@ -117,6 +118,8 @@
runMetCorAndUncFromMiniAOD(process,
isData=runOnData,
pfCandColl=cms.InputTag("noHFCands"),
reclusterJets=True, #needed for NoHF
recoMetFromPFCs=True, #needed for NoHF
postfix="NoHF"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ def __call__(self, process,
if recoMetFromPFCs:
self.setParameter('reclusterJets',True)

#miniAOD
#if onMiniAOD:
# self.setParameter('reclusterJets',True)
# self.setParameter('recoMetFromPFCs',True)
#jet collection overloading for automatic jet reclustering
if reclusterJets:
self.setParameter('jetCollection',cms.InputTag('selectedPatJets'))
self.setParameter('jetCollectionUnSkimmed',cms.InputTag('patJets'))

self.apply(process)

Expand Down Expand Up @@ -296,7 +296,6 @@ def toolCode(self, process):
)

#jet ES configuration and jet cleaning
#self.jetConfiguration()
self.jetCleaning(process, autoJetCleaning, postfix)


Expand Down Expand Up @@ -1431,7 +1430,7 @@ def runMetCorAndUncForMiniAODProduction(process, metType="PF",
pfCandColl = "particleFlow",
jetCleaning="LepClean",
jecUnFile="CondFormats/JetMETObjects/data/Summer15_50nsV5_DATA_UncertaintySources_AK4PFchs.txt",
recomputeMET=False,
recoMetFromPFCs=False,
postfix=""):

runMETCorrectionsAndUncertainties = RunMETCorrectionsAndUncertainties()
Expand All @@ -1451,7 +1450,7 @@ def runMetCorAndUncForMiniAODProduction(process, metType="PF",
pfCandCollection =pfCandColl,
autoJetCleaning=jetCleaning,
jecUncertaintyFile=jecUnFile,
recoMetFromPFCs=recomputeMET,
recoMetFromPFCs=recoMetFromPFCs,
postfix=postfix
)

Expand All @@ -1470,7 +1469,7 @@ def runMetCorAndUncForMiniAODProduction(process, metType="PF",
pfCandCollection =pfCandColl,
autoJetCleaning=jetCleaning,
jecUncertaintyFile=jecUnFile,
recoMetFromPFCs=recomputeMET,
recoMetFromPFCs=recoMetFromPFCs,
postfix=postfix
)

Expand All @@ -1489,7 +1488,7 @@ def runMetCorAndUncForMiniAODProduction(process, metType="PF",
pfCandCollection =pfCandColl,
autoJetCleaning=jetCleaning,
jecUncertaintyFile=jecUnFile,
recoMetFromPFCs=recomputeMET,
recoMetFromPFCs=recoMetFromPFCs,
postfix=postfix,
)

Expand All @@ -1509,6 +1508,8 @@ def runMetCorAndUncFromMiniAOD(process, metType="PF",
jetCleaning="LepClean",
isData=False,
jetConfig=False,
reclusterJets=False,
recoMetFromPFCs=False,
jetCorLabelL3=cms.InputTag('ak4PFCHSL1FastL2L3Corrector'),
jetCorLabelRes=cms.InputTag('ak4PFCHSL1FastL2L3ResidualCorrector'),
jecUncFile="CondFormats/JetMETObjects/data/Summer15_50nsV5_DATA_UncertaintySources_AK4PFchs.txt",
Expand All @@ -1531,6 +1532,8 @@ def runMetCorAndUncFromMiniAOD(process, metType="PF",
pfCandCollection =pfCandColl,
runOnData=isData,
onMiniAOD=True,
reclusterJets=reclusterJets,
recoMetFromPFCs=recoMetFromPFCs,
autoJetCleaning=jetCleaning,
manualJetConfig=jetConfig,
jetFlavor=jetFlav,
Expand All @@ -1555,6 +1558,8 @@ def runMetCorAndUncFromMiniAOD(process, metType="PF",
pfCandCollection =pfCandColl,
runOnData=isData,
onMiniAOD=True,
reclusterJets=reclusterJets,
recoMetFromPFCs=recoMetFromPFCs,
autoJetCleaning=jetCleaning,
manualJetConfig=jetConfig,
jetFlavor=jetFlav,
Expand Down

0 comments on commit 28db46c

Please sign in to comment.