CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
pfParticleNet_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.ONNXRuntime.pfParticleNetDiscriminatorsJetTags_cfi import pfParticleNetDiscriminatorsJetTags
6 from RecoBTag.ONNXRuntime.pfMassDecorrelatedParticleNetDiscriminatorsJetTags_cfi import pfMassDecorrelatedParticleNetDiscriminatorsJetTags
7 
8 pfParticleNetTagInfos = pfDeepBoostedJetTagInfos.clone(
9  use_puppiP4 = False
10 )
11 
12 pfParticleNetJetTags = boostedJetONNXJetTagsProducer.clone(
13  src = 'pfParticleNetTagInfos',
14  preprocess_json = 'RecoBTag/Combined/data/ParticleNetAK8/General/V01/preprocess.json',
15  model_path = 'RecoBTag/Combined/data/ParticleNetAK8/General/V01/particle-net.onnx',
16  flav_names = ["probTbcq", "probTbqq", "probTbc", "probTbq", "probTbel", "probTbmu", "probTbta",
17  "probWcq", "probWqq", "probZbb", "probZcc", "probZqq", "probHbb", "probHcc",
18  "probHqqqq", "probQCDbb", "probQCDcc", "probQCDb", "probQCDc", "probQCDothers"],
19 )
20 
21 pfMassDecorrelatedParticleNetJetTags = boostedJetONNXJetTagsProducer.clone(
22  src = 'pfParticleNetTagInfos',
23  preprocess_json = 'RecoBTag/Combined/data/ParticleNetAK8/MD-2prong/V01/preprocess.json',
24  model_path = 'RecoBTag/Combined/data/ParticleNetAK8/MD-2prong/V01/particle-net.onnx',
25  flav_names = ["probXbb", "probXcc", "probXqq", "probQCDbb", "probQCDcc",
26  "probQCDb", "probQCDc", "probQCDothers"],
27 )
28 
29 pfParticleNetMassRegressionJetTags = boostedJetONNXJetTagsProducer.clone(
30  src = 'pfParticleNetTagInfos',
31  preprocess_json = 'RecoBTag/Combined/data/ParticleNetAK8/MassRegression/V01/preprocess.json',
32  model_path = 'RecoBTag/Combined/data/ParticleNetAK8/MassRegression/V01/particle-net.onnx',
33  flav_names = ["mass"],
34 )
35 
36 from CommonTools.PileupAlgos.Puppi_cff import puppi
37 from PhysicsTools.PatAlgos.slimming.primaryVertexAssociation_cfi import primaryVertexAssociation
38 
39 # This task is not used, useful only if we run it from RECO jets (RECO/AOD)
40 pfParticleNetTask = cms.Task(puppi, primaryVertexAssociation, pfParticleNetTagInfos,
41  pfParticleNetJetTags, pfMassDecorrelatedParticleNetJetTags, pfParticleNetMassRegressionJetTags,
42  pfParticleNetDiscriminatorsJetTags, pfMassDecorrelatedParticleNetDiscriminatorsJetTags)
43 
44 # declare all the discriminators
45 # nominal: probs
46 _pfParticleNetJetTagsProbs = ['pfParticleNetJetTags:' + flav_name
47  for flav_name in pfParticleNetJetTags.flav_names]
48 # nominal: meta-taggers
49 _pfParticleNetJetTagsMetaDiscrs = ['pfParticleNetDiscriminatorsJetTags:' + disc.name.value()
50  for disc in pfParticleNetDiscriminatorsJetTags.discriminators]
51 # mass-decorrelated: probs
52 _pfMassDecorrelatedParticleNetJetTagsProbs = ['pfMassDecorrelatedParticleNetJetTags:' + flav_name
53  for flav_name in pfMassDecorrelatedParticleNetJetTags.flav_names]
54 # mass-decorrelated: meta-taggers
55 _pfMassDecorrelatedParticleNetJetTagsMetaDiscrs = ['pfMassDecorrelatedParticleNetDiscriminatorsJetTags:' + disc.name.value()
56  for disc in pfMassDecorrelatedParticleNetDiscriminatorsJetTags.discriminators]
57 
58 _pfParticleNetMassRegressionOutputs = ['pfParticleNetMassRegressionJetTags:' + flav_name
59  for flav_name in pfParticleNetMassRegressionJetTags.flav_names]
60 
61 _pfParticleNetJetTagsAll = _pfParticleNetJetTagsProbs + _pfParticleNetJetTagsMetaDiscrs + \
62  _pfMassDecorrelatedParticleNetJetTagsProbs + _pfMassDecorrelatedParticleNetJetTagsMetaDiscrs
Puppi_cff
primaryVertexAssociation_cfi