Skip to content

Commit

Permalink
Merge pull request #58 from alefisico/jetToolbox_94X
Browse files Browse the repository at this point in the history
Jet toolbox 94 x
  • Loading branch information
alefisico authored Apr 27, 2018
2 parents 0f28400 + 5dd9545 commit a92cd36
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 35 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Python framework for configuration of jet tools via the jet toolbox.

## Instructions

Check the branch for the correspondent release. This branch is for *CMSSW_9_1_X*, then for example:
Check the branch for the correspondent release. This branch is for *CMSSW_9_4_X* and higher, then for example:
```
cmsrel CMSSW_9_1_1_patch1/
cd CMSSW_9_1_1_patch1/src/
git clone [email protected]:cms-jet/JetToolbox.git JMEAnalysis/JetToolbox -b jetToolbox_91X_v1
cmsrel CMSSW_9_4_4/
cd CMSSW_9_4_4/src/
git clone [email protected]:cms-jet/JetToolbox.git JMEAnalysis/JetToolbox -b jetToolbox_94X_v1
scram b -j 18
```
To test the toolbox:
Expand Down
6 changes: 4 additions & 2 deletions python/jetToolbox_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#### Python function for easy access of
#### jet substructure tools implemented in CMS
####
#### Alejandro Gomez Espinosa ([email protected])
#### Alejandro Gomez Espinosa ([email protected])
#### with several contributions from others
####
###############################################
import FWCore.ParameterSet.Config as cms
Expand Down Expand Up @@ -47,7 +48,8 @@ def jetToolbox( proc, jetType, jetSequence, outputFile,
addPUJetID=False,
addQJets=False,
addQGTagger=False, QGjetsLabel='chs',
addEnergyCorrFunc=False, addEnergyCorrFuncSubjets=False,
addEnergyCorrFunc=False,
addEnergyCorrFuncSubjets=False,
):

runOnData = not runOnMC
Expand Down
81 changes: 52 additions & 29 deletions test/jettoolbox_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

from JMEAnalysis.JetToolbox.jetToolbox_cff import jetToolbox


'''
jetToolbox( process, 'ak8', 'jetSequence', 'out', PUMethod='CHS', miniAOD=True,
#Cut='pt > 200 && abs(eta) < 2.5', # Tight
runOnMC=False,
Expand All @@ -35,7 +35,6 @@
#addNsubSubjets =True
)
'''
#jetToolbox( process, 'ak4', 'jetSequence', 'out', PUMethod='Puppi', miniAOD=True, runOnMC=True )
#process.load('CommonTools.PileupAlgos.Puppi_cff')
#process.PuppiOnTheFly = process.puppi.clone( candName = cms.InputTag( 'packedPFCandidates' ), vertexName = cms.InputTag( 'offlineSlimmedPrimaryVertices' ), clonePackedCands = cms.bool(True) )
Expand All @@ -48,14 +47,6 @@
#jetToolbox( process, 'ak8', 'ak8JetSubs', 'out', PUMethod='CS', addPruning=True, addSoftDrop=True , addPrunedSubjets=True, addSoftDropSubjets=True, addNsub=True, maxTau=6, addTrimming=True, addFiltering=True )
#jetToolbox( process, 'ak8', 'ak8JetSubs', 'out', PUMethod='CHS', addPruning=True, addSoftDrop=True , addPrunedSubjets=True, addSoftDropSubjets=True, addNsub=True, maxTau=6, addTrimming=True, addFiltering=True, addNsubSubjets=True )
#jetToolbox( process, 'ak8', 'ak8JetSubs', 'out', PUMethod='CHS', addPruning=True, addSoftDrop=True , addSoftDropSubjets=True, addNsub=True, maxTau=6, addTrimming=True, addFiltering=True, addNsubSubjets=True )
listBtagDiscriminatorsAK4 = [
#'pfJetProbabilityBJetTags',
#'pfCombinedInclusiveSecondaryVertexV2BJetTags',
'pfCombinedMVAV2BJetTags',
#'pfCombinedCvsLJetTags',
#'pfCombinedCvsBJetTags',
]
jetToolbox( process, 'ak8', 'ak8JetSubs', 'out',
PUMethod='CHS',
#updateCollection='slimmedJetsAK8',
Expand All @@ -70,28 +61,63 @@
#addTrimming=True,
#addPruning=True
) #, addPrunedSubjets=True, subJETCorrPayload='AK4PFchs' )
listBtagDiscriminatorsAK4 = [
#'pfJetProbabilityBJetTags',
#'pfCombinedInclusiveSecondaryVertexV2BJetTags',
'pfCombinedMVAV2BJetTags',
#'pfCombinedCvsLJetTags',
#'pfCombinedCvsBJetTags',
]
jetToolbox( process, 'ak8', 'ak8JetSubs', 'out',
PUMethod='CHS',
PUMethod='Puppi',
#updateCollection='slimmedJetsAK8',
JETCorrPayload='AK8PFchs',
JETCorrPayload='AK8PFPuppi',
#addEnergyCorrFunc=True,
#updateCollectionSubjets='slimmedJetsAK8PFCHSSoftDropPacked:SubJets',
subJETCorrPayload='AK4PFchs',
subJETCorrPayload='AK4PFPuppi',
bTagDiscriminators=listBtagDiscriminatorsAK4,
addNsubSubjets=True,
addPrunedSubjets=True,
postFix= 'NEWCOLLECTIONOFJETS',
addTrimming=True,
addFiltering=True,
addPruning=True,
addNsub = True,
#addNsubSubjets=True,
#addPrunedSubjets=True,
#postFix= 'NEWCOLLECTIONOFJETS',
#addTrimming=True,
#addFiltering=True,
#addPruning=True,
addSoftDrop=True
) #, addPrunedSubjets=True, subJETCorrPayload='AK4PFchs' )
'''
from JMEAnalysis.JetToolbox.jetToolbox_cff import jetToolbox
listBTagInfos = ['pfInclusiveSecondaryVertexFinderTagInfos','pfImpactParameterTagInfos']
listBtagDiscriminatorsAK8 = [
'pfBoostedDoubleSecondaryVertexAK8BJetTags',
]
jecLevels = ['L1FastJet', 'L2Relative', 'L3Absolute']
#if self.residual: jecLevels.append("L2L3Residual")
jetToolbox(process,
'ak8',
'jetSequence',
'out',
PUMethod = 'Puppi',
miniAOD = True,
#runOnMC = False,
postFix='Clean',
Cut = 'pt>170.',
addPruning = True,
addSoftDropSubjets = True,
addNsub = True,
maxTau = 3,
bTagInfos = listBTagInfos,
bTagDiscriminators = listBtagDiscriminatorsAK8,
JETCorrLevels = jecLevels,
subJETCorrLevels = jecLevels,
addEnergyCorrFunc = True,
)

#jetToolbox( process, 'ak8', 'ak8JetSubs', 'out', PUMethod='CHS', JETCorrPayload = 'AK8PFchs', addEnergyCorrFunc=True, addNsubSubjets=True, addTrimming=True, addFiltering=True, addPruning=True, addSoftDrop=True, addSoftDropSubjets=True ) #PUMethod='CHS', addPrunedSubjets=True, subJETCorrPayload='AK4PFchs' )


#jetToolbox( process, 'ak4', 'ak4JetSubsUpdate', 'out', updateCollection='slimmedJets', JETCorrPayload = 'AK4PFchs', JETCorrLevels=['L2Relative', 'L3Absolute'], addQGTagger=True, addPUJetID=True, bTagDiscriminators=listBtagDiscriminatorsAK4 )
#jetToolbox( process, 'ak4', 'ak4JetSubs', 'out', addQGTagger=True, addPUJetID=True, postFix='New' )
jetToolbox( process, 'ak4', 'ak4JetSubs', 'out', addQGTagger=True, addPUJetID=True, postFix='New' )


#jetToolbox( process, 'ak8', 'ak8JetSubs', 'out', PUMethod='CHS', addPruning=True, addSoftDrop=True , addPrunedSubjets=True, addSoftDropSubjets=True, addNsub=True, maxTau=6, addTrimming=True, addFiltering=True, miniAOD=False )
Expand Down Expand Up @@ -123,23 +149,20 @@
#jetToolbox( process, 'ca12', 'ca12JetSubs', 'out', PUMethod='Puppi', addHEPTopTagger=True, addSoftDrop=True, miniAOD=False )
#jetToolbox( process, 'ca12', 'ca12JetSubs', 'out', PUMethod='SK', addHEPTopTagger=True, addSoftDrop=True, miniAOD=False )
#jetToolbox( process, 'ca12', 'ca12JetSubs', 'out', addHEPTopTagger=True, addSoftDrop=True, miniAOD=False )
'''




process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(500) )
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) )
process.source = cms.Source("PoolSource",
# fileNames = cms.untracked.vstring(#'file:example.root'
fileNames = cms.untracked.vstring(
# '/store/data/Run2016G/JetHT/MINIAOD/PromptReco-v1/000/280/002/00000/E82E26C7-4375-E611-AE7F-FA163E48F736.root'
# '/store/mc/RunIISpring15DR74/WWTo2L2Nu_13TeV-powheg/MINIAODSIM/Asympt50ns_MCRUN2_74_V9A-v1/60000/0AA28275-5001-E511-8A45-0CC47A4DEDE0.root'
# '/store/relval/CMSSW_7_4_0_pre9_ROOT6/RelValQCD_Pt_600_800_13/MINIAODSIM/MCRUN2_74_V7-v1/00000/281DDBC1-D3D1-E411-8534-0025905AA9F0.root',
# '/store/relval/CMSSW_7_4_0_pre9_ROOT6/RelValQCD_Pt_600_800_13/MINIAODSIM/MCRUN2_74_V7-v1/00000/C01855C8-D3D1-E411-A702-0026189438D7.root'
#'/store/mc/RunIIFall17MiniAOD/VectorDiJet1Jet_madgraph_Mphi50Mchi1_13TeV/MINIAODSIM/94X_mc2017_realistic_v11-v1/00000/64BF8D7C-C310-E811-ACBE-A0369FC5E9A4.root'
'/store/relval/CMSSW_9_4_5_cand1/JetHT/MINIAOD/94X_dataRun2_relval_v11_RelVal_rmaod_jetHT2017B-v1/10000/18B5E95F-992E-E811-9422-0CC47A78A418.root'
#'/store/data/Run2016G/JetHT/MINIAOD/PromptReco-v1/000/280/002/00000/E82E26C7-4375-E611-AE7F-FA163E48F736.root'
'/store/mc/RunIIFall17MiniAOD/QCD_HT1000to1500_TuneCP5_13TeV-madgraph-pythia8/MINIAODSIM/94X_mc2017_realistic_v10-v1/00000/02961665-F9F9-E711-87B5-0026B93F49B0.root'
#'/store/relval/CMSSW_9_4_5_cand1/JetHT/MINIAOD/94X_dataRun2_relval_v11_RelVal_rmaod_jetHT2017B-v1/10000/18B5E95F-992E-E811-9422-0CC47A78A418.root'
),
)

#from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpMINIAODSIM
#process.source.fileNames = filesRelValTTbarPileUpMINIAODSIM

Expand Down

0 comments on commit a92cd36

Please sign in to comment.