Skip to content

Commit 88aa03c

Browse files
authored
Merge pull request #70 from alefisico/jetToolbox_102X
First commit
2 parents 36bc1aa + eec7371 commit 88aa03c

4 files changed

Lines changed: 30 additions & 34 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Python framework for configuration of jet tools via the jet toolbox.
33

44
## Instructions
55

6-
Check the branch for the correspondent release. This branch is for *CMSSW_9_4_12* and higher. This version is **needed** for DeepDoubleX and DeepBoostedJet. If you are not planning on using those b-discriminators you can use an ealier release.
6+
Check the branch for the correspondent release. This branch is for *CMSSW_10_2_X* and higher.
77
Then for example:
88
```
9-
cmsrel CMSSW_10_2_0/
10-
cd CMSSW_10_2_0/src/
9+
cmsrel CMSSW_10_2_9/
10+
cd CMSSW_10_2_9/src/
1111
git cms-init
1212
git clone git@github.com:cms-jet/JetToolbox.git JMEAnalysis/JetToolbox -b jetToolbox_102X_v1
1313
scram b -j 18

python/jetToolbox_cff.py

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def jetToolbox( proc, jetType, jetSequence, outputFile,
5252
addQGTagger=False, QGjetsLabel='chs',
5353
addEnergyCorrFunc=False, ecfType = "N", ecfBeta = 1.0, ecfN3 = False,
5454
addEnergyCorrFuncSubjets=False, ecfSubjetType = "N", ecfSubjetBeta = 1.0, ecfSubjetN3 = False,
55-
saveJetCollection=False, # set this to true to enable creation of edm root file
5655
verbosity=2, # 0 = no printouts, 1 = warnings only, 2 = warnings & info, 3 = warnings, info, debug
5756
):
5857

@@ -140,12 +139,12 @@ def jetToolbox( proc, jetType, jetSequence, outputFile,
140139

141140
defaultBoostedBTagDiscriminators = [
142141
'pfBoostedDoubleSecondaryVertexAK8BJetTags',
143-
'pfMassIndependentDeepDoubleBvLJetTags:probQCD',
144-
'pfMassIndependentDeepDoubleBvLJetTags:probHbb',
145-
'pfMassIndependentDeepDoubleCvLJetTags:probQCD',
146-
'pfMassIndependentDeepDoubleCvLJetTags:probHcc',
147-
'pfMassIndependentDeepDoubleCvBJetTags:probHbb',
148-
'pfMassIndependentDeepDoubleCvBJetTags:probHcc',
142+
#'pfMassIndependentDeepDoubleBvLJetTags:probQCD',
143+
#'pfMassIndependentDeepDoubleBvLJetTags:probHbb',
144+
#'pfMassIndependentDeepDoubleCvLJetTags:probQCD',
145+
#'pfMassIndependentDeepDoubleCvLJetTags:probHcc',
146+
#'pfMassIndependentDeepDoubleCvBJetTags:probHbb',
147+
#'pfMassIndependentDeepDoubleCvBJetTags:probHcc',
149148
]
150149

151150
if updateCollection and (jetALGO=='AK8'):
@@ -1204,21 +1203,19 @@ def jetToolbox( proc, jetType, jetSequence, outputFile,
12041203
#################################################################################
12051204
###### Adding to outputModule OR creating output file
12061205
setattr(proc, jetSequence, jetSeq)
1207-
if outputFile!='':
1208-
if hasattr(proc, outputFile): getattr(proc, outputFile).outputCommands += elemToKeep
1209-
else: setattr( proc, outputFile,
1210-
cms.OutputModule('PoolOutputModule',
1211-
fileName = cms.untracked.string('jettoolbox.root'),
1212-
outputCommands = cms.untracked.vstring( elemToKeep ) ) )
1213-
1214-
#################################################################################
1215-
##### fix to replace unschedule mode
1216-
if saveJetCollection:
1217-
task = getPatAlgosToolsTask(proc)
1218-
if hasattr(proc, 'endpath'):
1219-
getattr(proc, 'endpath').associate(task)
1220-
else:
1221-
setattr( proc, 'endpath', cms.EndPath(getattr(proc, outputFile), task) )
1206+
if hasattr(proc, outputFile): getattr(proc, outputFile).outputCommands += elemToKeep
1207+
else: setattr( proc, outputFile,
1208+
cms.OutputModule('PoolOutputModule',
1209+
fileName = cms.untracked.string('jettoolbox.root'),
1210+
outputCommands = cms.untracked.vstring( elemToKeep ) ) )
1211+
1212+
task = getPatAlgosToolsTask(proc)
1213+
if hasattr(proc, 'endpath'):
1214+
getattr(proc, 'endpath').associate(task)
1215+
else:
1216+
if outputFile=='noOutput':
1217+
setattr( proc, 'endpath', cms.EndPath(task) )
1218+
else: setattr( proc, 'endpath', cms.EndPath(getattr(proc, outputFile), task) )
12221219

12231220
#################################################################################
12241221
#### removing mc matching for data

test/ClusterWithToolboxAndMakeHistos.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from JMEAnalysis.JetToolbox.jetToolbox_cff import *
4040

4141
# AK R=0.4 jets from CHS inputs with basic grooming, W tagging, and top tagging
42-
jetToolbox( process, 'ak4', 'ak4JetSubs', 'out',
42+
jetToolbox( process, 'ak4', 'ak4JetSubs', 'noOutput',
4343
PUMethod='CHS',
4444
addPruning=True, addSoftDrop=True , # add basic grooming
4545
addTrimming=True, addFiltering=True,
@@ -49,7 +49,7 @@
4949
)
5050

5151
# AK R=0.8 jets from PF inputs with basic grooming, W tagging, and top tagging
52-
#jetToolbox( process, 'ak8', 'ak8JetSubs', 'out',
52+
#jetToolbox( process, 'ak8', 'ak8JetSubs', 'noOutput',
5353
# PUMethod='Plain',
5454
# addPruning=True, addSoftDrop=True , # add basic grooming
5555
# addTrimming=True, addFiltering=True,
@@ -59,7 +59,7 @@
5959
#)
6060

6161
# AK R=0.8 jets from CHS inputs with basic grooming, W tagging, and top tagging
62-
jetToolbox( process, 'ak8', 'ak8JetSubs', 'out',
62+
jetToolbox( process, 'ak8', 'ak8JetSubs', 'noOutput',
6363
PUMethod='CHS',
6464
addPruning=True, addSoftDrop=True , # add basic grooming
6565
addTrimming=True, addFiltering=True,
@@ -69,7 +69,7 @@
6969
)
7070

7171
# AK R=0.8 from PUPPI inputs with basic grooming, W tagging, and top tagging
72-
jetToolbox( process, 'ak8', 'ak8JetSubs', 'out',
72+
jetToolbox( process, 'ak8', 'ak8JetSubs', 'noOutput',
7373
PUMethod='Puppi',
7474
addPruning=True, addSoftDrop=True , # add basic grooming
7575
addTrimming=True, addFiltering=True,
@@ -79,7 +79,7 @@
7979
)
8080

8181
# CA R=0.8 jets from CHS inputs with basic grooming, W tagging, and top tagging
82-
jetToolbox( process, 'ca8', 'ca8JetSubs', 'out',
82+
jetToolbox( process, 'ca8', 'ca8JetSubs', 'noOutput',
8383
PUMethod='CHS',
8484
addPruning=True, addSoftDrop=True , # add basic grooming
8585
addTrimming=True, addFiltering=True,
@@ -89,7 +89,7 @@
8989
)
9090

9191
# KT R=0.8 jets from CHS inputs with basic grooming, W tagging, and top tagging
92-
jetToolbox( process, 'kt8', 'kt8JetSubs', 'out',
92+
jetToolbox( process, 'kt8', 'kt8JetSubs', 'noOutput',
9393
PUMethod='CHS',
9494
addPruning=True, addSoftDrop=True , # add basic grooming
9595
addTrimming=True, addFiltering=True,
@@ -99,7 +99,7 @@
9999
)
100100

101101
# AK R=1.2 jets from CHS inputs with basic grooming, W tagging, and top tagging
102-
jetToolbox( process, 'ak12', 'ak12JetSubs', 'out',
102+
jetToolbox( process, 'ak12', 'ak12JetSubs', 'noOutput',
103103
PUMethod='CHS',
104104
addPruning=True, addSoftDrop=True , # add basic grooming
105105
addTrimming=True, addFiltering=True,
@@ -109,7 +109,7 @@
109109
)
110110

111111
# AK R=1.5 jets from CHS inputs with basic grooming, W tagging, and top tagging
112-
jetToolbox( process, 'ak15', 'ak15JetSubs', 'out',
112+
jetToolbox( process, 'ak15', 'ak15JetSubs', 'noOutput',
113113
PUMethod='CHS',
114114
addPruning=True, addSoftDrop=True , # add basic grooming
115115
addTrimming=True, addFiltering=True,

test/jettoolbox_cfg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@
162162
#addNsubSubjets =True
163163
addSoftDropSubjets = True,
164164
addEnergyCorrFunc = True, ecfN3 = True,
165-
saveJetCollection = True,
166165
)
167166

168167

0 commit comments

Comments
 (0)