CMS 3D CMS Logo

pfParticleNetFromMiniAODAK4_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 from RecoBTag.FeatureTools.pfDeepBoostedJetTagInfos_cfi import pfDeepBoostedJetTagInfos
4 from RecoBTag.ONNXRuntime.boostedJetONNXJetTagsProducer_cfi import boostedJetONNXJetTagsProducer
5 from RecoBTag.FeatureTools.ParticleNetFeatureEvaluator_cfi import ParticleNetFeatureEvaluator
7 from RecoBTag.ONNXRuntime.particleNetSonicJetTagsProducer_cfi import particleNetSonicJetTagsProducer as _particleNetSonicJetTagsProducer
8 from Configuration.ProcessModifiers.particleNetSonicTriton_cff import particleNetSonicTriton
9 
10 pfParticleNetFromMiniAODAK4CHSCentralTagInfos = ParticleNetFeatureEvaluator.clone(
11  jets = "slimmedJets",
12  jet_radius = 0.4,
13  min_jet_pt = 15,
14  min_jet_eta = 0.,
15  max_jet_eta = 2.5,
16 )
17 
18 pfParticleNetFromMiniAODAK4CHSForwardTagInfos = ParticleNetFeatureEvaluator.clone(
19  jets = "slimmedJets",
20  jet_radius = 0.4,
21  min_jet_pt = 15,
22  min_jet_eta = 2.5,
23  max_jet_eta = 4.7,
24 )
25 
26 pfParticleNetFromMiniAODAK4PuppiCentralTagInfos = ParticleNetFeatureEvaluator.clone(
27  jets = "slimmedJetsPuppi",
28  jet_radius = 0.4,
29  min_jet_pt = 0.,
30  min_jet_eta = 0.,
31  max_jet_eta = 2.5,
32 )
33 
34 pfParticleNetFromMiniAODAK4PuppiForwardTagInfos = ParticleNetFeatureEvaluator.clone(
35  jets = "slimmedJetsPuppi",
36  jet_radius = 0.4,
37  min_jet_pt = 0.,
38  min_jet_eta = 2.5,
39  max_jet_eta = 5.0,
40 )
41 
42 
43 pfParticleNetFromMiniAODAK4CHSCentralJetTags = boostedJetONNXJetTagsProducer.clone(
44  src = 'pfParticleNetFromMiniAODAK4CHSCentralTagInfos',
45  preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/CHS/Central/preprocess.json',
46  model_path = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/CHS/Central/modelfile/model.onnx',
47  flav_names = ['probmu','probele','probtaup1h0p','probtaup1h1p','probtaup1h2p','probtaup3h0p','probtaup3h1p','probtaum1h0p','probtaum1h1p','probtaum1h2p','probtaum3h0p','probtaum3h1p','probb','probc','probuds','probg','ptcorr','ptreshigh','ptreslow','ptnu'],
48 )
49 
50 particleNetSonicTriton.toReplaceWith(pfParticleNetFromMiniAODAK4CHSCentralJetTags, _particleNetSonicJetTagsProducer.clone(
51  src = 'pfParticleNetFromMiniAODAK4CHSCentralTagInfos',
52  preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/CHS/Central/preprocess.json',
53  Client = cms.PSet(
54  timeout = cms.untracked.uint32(300),
55  mode = cms.string("Async"),
56  modelName = cms.string("particleNetFromMiniAODAK4CHSCentral"),
57  modelConfigPath = cms.FileInPath("RecoBTag/Combined/data/models/particleNetFromMiniAODAK4CHSCentral/config.pbtxt"),
58  modelVersion = cms.string(""),
59  verbose = cms.untracked.bool(False),
60  allowedTries = cms.untracked.uint32(0),
61  useSharedMemory = cms.untracked.bool(True),
62  compression = cms.untracked.string(""),
63  ),
64  flav_names = pfParticleNetFromMiniAODAK4CHSCentralJetTags.flav_names,
65 ))
66 
67 pfParticleNetFromMiniAODAK4CHSForwardJetTags = boostedJetONNXJetTagsProducer.clone(
68  src = 'pfParticleNetFromMiniAODAK4CHSForwardTagInfos',
69  preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/CHS/Forward/preprocess.json',
70  model_path = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/CHS/Forward/modelfile/model.onnx',
71  flav_names = ['probq','probg','ptcorr','ptreshigh','ptreslow','ptnu'],
72 )
73 
74 particleNetSonicTriton.toReplaceWith(pfParticleNetFromMiniAODAK4CHSForwardJetTags, _particleNetSonicJetTagsProducer.clone(
75  src = 'pfParticleNetFromMiniAODAK4CHSForwardTagInfos',
76  preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/CHS/Central/preprocess.json',
77  Client = cms.PSet(
78  timeout = cms.untracked.uint32(300),
79  mode = cms.string("Async"),
80  modelName = cms.string("particleNetFromMiniAODAK4CHSForward"),
81  modelConfigPath = cms.FileInPath("RecoBTag/Combined/data/models/particleNetFromMiniAODAK4CHSForward/config.pbtxt"),
82  modelVersion = cms.string(""),
83  verbose = cms.untracked.bool(False),
84  allowedTries = cms.untracked.uint32(0),
85  useSharedMemory = cms.untracked.bool(True),
86  compression = cms.untracked.string(""),
87  ),
88  flav_names = pfParticleNetFromMiniAODAK4CHSForwardJetTags.flav_names,
89 ))
90 
91 pfParticleNetFromMiniAODAK4PuppiCentralJetTags = boostedJetONNXJetTagsProducer.clone(
92  src = 'pfParticleNetFromMiniAODAK4PuppiCentralTagInfos',
93  preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/PUPPI/Central/preprocess.json',
94  model_path = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/PUPPI/Central/modelfile/model.onnx',
95  flav_names = ['probmu','probele','probtaup1h0p','probtaup1h1p','probtaup1h2p','probtaup3h0p','probtaup3h1p','probtaum1h0p','probtaum1h1p','probtaum1h2p','probtaum3h0p','probtaum3h1p','probb','probc','probuds','probg','ptcorr','ptreshigh','ptreslow','ptnu'],
96 )
97 
98 particleNetSonicTriton.toReplaceWith(pfParticleNetFromMiniAODAK4PuppiCentralJetTags, _particleNetSonicJetTagsProducer.clone(
99  src = 'pfParticleNetFromMiniAODAK4PuppiCentralTagInfos',
100  preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/PUPPI/Central/preprocess.json',
101  Client = cms.PSet(
102  timeout = cms.untracked.uint32(300),
103  mode = cms.string("Async"),
104  modelName = cms.string("particleNetFromMiniAODAK4PuppiCentral"),
105  modelConfigPath = cms.FileInPath("RecoBTag/Combined/data/models/particleNetFromMiniAODAK4PuppiCentral/config.pbtxt"),
106  modelVersion = cms.string(""),
107  verbose = cms.untracked.bool(False),
108  allowedTries = cms.untracked.uint32(0),
109  useSharedMemory = cms.untracked.bool(True),
110  compression = cms.untracked.string(""),
111  ),
112  flav_names = pfParticleNetFromMiniAODAK4PuppiCentralJetTags.flav_names,
113 ))
114 
115 pfParticleNetFromMiniAODAK4PuppiForwardJetTags = boostedJetONNXJetTagsProducer.clone(
116  src = 'pfParticleNetFromMiniAODAK4PuppiForwardTagInfos',
117  preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/PUPPI/Forward/preprocess.json',
118  model_path = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/PUPPI/Forward/modelfile/model.onnx',
119  flav_names = ['probq','probg','ptcorr','ptreshigh','ptreslow','ptnu'],
120 )
121 
122 particleNetSonicTriton.toReplaceWith(pfParticleNetFromMiniAODAK4PuppiForwardJetTags, _particleNetSonicJetTagsProducer.clone(
123  src = 'pfParticleNetFromMiniAODAK4PuppiForwardTagInfos',
124  preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/PUPPI/Forward/preprocess.json',
125  Client = cms.PSet(
126  timeout = cms.untracked.uint32(300),
127  mode = cms.string("Async"),
128  modelName = cms.string("particleNetFromMiniAODAK4PuppiForward"),
129  modelConfigPath = cms.FileInPath("RecoBTag/Combined/data/models/particleNetFromMiniAODAK4PuppiForward/config.pbtxt"),
130  modelVersion = cms.string(""),
131  verbose = cms.untracked.bool(False),
132  allowedTries = cms.untracked.uint32(0),
133  useSharedMemory = cms.untracked.bool(True),
134  compression = cms.untracked.string(""),
135  ),
136  flav_names = pfParticleNetFromMiniAODAK4PuppiForwardJetTags.flav_names,
137 ))
138 
139 pfParticleNetFromMiniAODAK4CHSTask = cms.Task( pfParticleNetFromMiniAODAK4CHSCentralTagInfos, pfParticleNetFromMiniAODAK4CHSForwardTagInfos, pfParticleNetFromMiniAODAK4CHSCentralJetTags, pfParticleNetFromMiniAODAK4CHSForwardJetTags)
140 pfParticleNetFromMiniAODAK4PuppiTask = cms.Task( pfParticleNetFromMiniAODAK4PuppiCentralTagInfos, pfParticleNetFromMiniAODAK4PuppiForwardTagInfos, pfParticleNetFromMiniAODAK4PuppiCentralJetTags, pfParticleNetFromMiniAODAK4PuppiForwardJetTags)
141 
142 # declare all the discriminators
143 # probs
144 _pfParticleNetFromMiniAODAK4CHSCentralJetTagsProbs = ['pfParticleNetFromMiniAODAK4CHSCentralJetTags:' + flav_name
145  for flav_name in pfParticleNetFromMiniAODAK4CHSCentralJetTags.flav_names]
146 _pfParticleNetFromMiniAODAK4CHSForwardJetTagsProbs = ['pfParticleNetFromMiniAODAK4CHSForwardJetTags:' + flav_name
147  for flav_name in pfParticleNetFromMiniAODAK4CHSForwardJetTags.flav_names]
148 _pfParticleNetFromMiniAODAK4PuppiCentralJetTagsProbs = ['pfParticleNetFromMiniAODAK4PuppiCentralJetTags:' + flav_name
149  for flav_name in pfParticleNetFromMiniAODAK4PuppiCentralJetTags.flav_names]
150 _pfParticleNetFromMiniAODAK4PuppiForwardJetTagsProbs = ['pfParticleNetFromMiniAODAK4PuppiForwardJetTags:' + flav_name
151  for flav_name in pfParticleNetFromMiniAODAK4PuppiForwardJetTags.flav_names]
152 
153 _pfParticleNetFromMiniAODAK4CHSCentralJetTagsMetaDiscr = ['pfParticleNetFromMiniAODAK4CHSCentralDiscriminatorsJetTags:' + disc.name.value()
154  for disc in pfParticleNetFromMiniAODAK4CHSCentralDiscriminatorsJetTags.discriminators]
155 _pfParticleNetFromMiniAODAK4CHSForwardJetTagsMetaDiscr = ['pfParticleNetFromMiniAODAK4CHSForwardDiscriminatorsJetTags:' + disc.name.value()
156  for disc in pfParticleNetFromMiniAODAK4CHSForwardDiscriminatorsJetTags.discriminators]
157 _pfParticleNetFromMiniAODAK4PuppiCentralJetTagsMetaDiscr = ['pfParticleNetFromMiniAODAK4PuppiCentralDiscriminatorsJetTags:' + disc.name.value()
158  for disc in pfParticleNetFromMiniAODAK4PuppiCentralDiscriminatorsJetTags.discriminators]
159 _pfParticleNetFromMiniAODAK4PuppiForwardJetTagsMetaDiscr = ['pfParticleNetFromMiniAODAK4PuppiForwardDiscriminatorsJetTags:' + disc.name.value()
160  for disc in pfParticleNetFromMiniAODAK4PuppiForwardDiscriminatorsJetTags.discriminators]
161 
162 _pfParticleNetFromMiniAODAK4CHSCentralJetTagsAll = _pfParticleNetFromMiniAODAK4CHSCentralJetTagsProbs + _pfParticleNetFromMiniAODAK4CHSCentralJetTagsMetaDiscr
163 _pfParticleNetFromMiniAODAK4CHSForwardJetTagsAll = _pfParticleNetFromMiniAODAK4CHSForwardJetTagsProbs + _pfParticleNetFromMiniAODAK4CHSForwardJetTagsMetaDiscr
164 _pfParticleNetFromMiniAODAK4PuppiCentralJetTagsAll = _pfParticleNetFromMiniAODAK4PuppiCentralJetTagsProbs + _pfParticleNetFromMiniAODAK4PuppiCentralJetTagsMetaDiscr
165 _pfParticleNetFromMiniAODAK4PuppiForwardJetTagsAll = _pfParticleNetFromMiniAODAK4PuppiForwardJetTagsProbs + _pfParticleNetFromMiniAODAK4PuppiForwardJetTagsMetaDiscr
166 
167 
168 # === Negative tags ===
169 pfNegativeParticleNetFromMiniAODAK4CHSCentralTagInfos = pfParticleNetFromMiniAODAK4CHSCentralTagInfos.clone(
170  flip_ip_sign = True,
171  max_sip3dsig_for_flip = 10,
172  secondary_vertices = 'inclusiveCandidateNegativeSecondaryVertices',
173 )
174 pfNegativeParticleNetFromMiniAODAK4PuppiCentralTagInfos = pfParticleNetFromMiniAODAK4PuppiCentralTagInfos.clone(
175  flip_ip_sign = True,
176  max_sip3dsig_for_flip = 10,
177  secondary_vertices = 'inclusiveCandidateNegativeSecondaryVertices',
178 )
179 
180 pfNegativeParticleNetFromMiniAODAK4CHSCentralJetTags = pfParticleNetFromMiniAODAK4CHSCentralJetTags.clone(
181  src = 'pfNegativeParticleNetFromMiniAODAK4CHSCentralTagInfos',
182 )
183 pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags = pfParticleNetFromMiniAODAK4PuppiCentralJetTags.clone(
184  src = 'pfNegativeParticleNetFromMiniAODAK4PuppiCentralTagInfos',
185 )
186 
187 # probs
188 _pfNegativeParticleNetFromMiniAODAK4CHSCentralJetTagsProbs = ['pfNegativeParticleNetFromMiniAODAK4CHSCentralJetTags:' + flav_name
189  for flav_name in pfParticleNetFromMiniAODAK4CHSCentralJetTags.flav_names]
190 _pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTagsProbs = ['pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:' + flav_name
191  for flav_name in pfParticleNetFromMiniAODAK4PuppiCentralJetTags.flav_names]