CMS 3D CMS Logo

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.MXNet.boostedJetMXNetJetTagsProducer_cfi import boostedJetMXNetJetTagsProducer
5 from RecoBTag.MXNet.Parameters.ParticleNet.V00.pfParticleNetPreprocessParams_cfi import pfParticleNetPreprocessParams, pfMassDecorrelatedParticleNetPreprocessParams
6 from RecoBTag.MXNet.pfParticleNetDiscriminatorsJetTags_cfi import pfParticleNetDiscriminatorsJetTags
7 from RecoBTag.MXNet.pfMassDecorrelatedParticleNetDiscriminatorsJetTags_cfi import pfMassDecorrelatedParticleNetDiscriminatorsJetTags
8 
9 pfParticleNetTagInfos = pfDeepBoostedJetTagInfos.clone(
10  use_puppiP4 = False
11 )
12 
13 pfParticleNetJetTags = boostedJetMXNetJetTagsProducer.clone(
14  preprocessParams = pfParticleNetPreprocessParams,
15  model_path = 'RecoBTag/Combined/data/ParticleNetAK8/General/V00/ParticleNet-symbol.json',
16  param_path = 'RecoBTag/Combined/data/ParticleNetAK8/General/V00/ParticleNet-0000.params',
17  flav_names = ["probTbcq", "probTbqq", "probTbc", "probTbq", "probTbel", "probTbmu", "probTbta",
18  "probWcq", "probWqq", "probZbb", "probZcc", "probZqq", "probHbb", "probHcc",
19  "probHqqqq", "probQCDbb", "probQCDcc", "probQCDb", "probQCDc", "probQCDothers"],
20 )
21 
22 pfMassDecorrelatedParticleNetJetTags = boostedJetMXNetJetTagsProducer.clone(
23  preprocessParams = pfMassDecorrelatedParticleNetPreprocessParams,
24  model_path = 'RecoBTag/Combined/data/ParticleNetAK8/MD-2prong/V00/ParticleNet-symbol.json',
25  param_path = 'RecoBTag/Combined/data/ParticleNetAK8/MD-2prong/V00/ParticleNet-0000.params',
26  flav_names = ["probXbb", "probXcc", "probXqq", "probQCDbb", "probQCDcc",
27  "probQCDb", "probQCDc", "probQCDothers"],
28 )
29 
30 from CommonTools.PileupAlgos.Puppi_cff import puppi
31 from PhysicsTools.PatAlgos.slimming.primaryVertexAssociation_cfi import primaryVertexAssociation
32 
33 # This task is not used, useful only if we run it from RECO jets (RECO/AOD)
34 pfParticleNetTask = cms.Task(puppi, primaryVertexAssociation, pfParticleNetTagInfos,
35  pfParticleNetJetTags, pfMassDecorrelatedParticleNetJetTags, pfParticleNetDiscriminatorsJetTags)
36 
37 # declare all the discriminators
38 # nominal: probs
39 _pfParticleNetJetTagsProbs = ['pfParticleNetJetTags:' + flav_name
40  for flav_name in pfParticleNetJetTags.flav_names]
41 # nominal: meta-taggers
42 _pfParticleNetJetTagsMetaDiscrs = ['pfParticleNetDiscriminatorsJetTags:' + disc.name.value()
43  for disc in pfParticleNetDiscriminatorsJetTags.discriminators]
44 # mass-decorrelated: probs
45 _pfMassDecorrelatedParticleNetJetTagsProbs = ['pfMassDecorrelatedParticleNetJetTags:' + flav_name
46  for flav_name in pfMassDecorrelatedParticleNetJetTags.flav_names]
47 # mass-decorrelated: meta-taggers
48 _pfMassDecorrelatedParticleNetJetTagsMetaDiscrs = ['pfMassDecorrelatedParticleNetDiscriminatorsJetTags:' + disc.name.value()
49  for disc in pfMassDecorrelatedParticleNetDiscriminatorsJetTags.discriminators]
50 
51 _pfParticleNetJetTagsAll = _pfParticleNetJetTagsProbs + _pfParticleNetJetTagsMetaDiscrs + \
52  _pfMassDecorrelatedParticleNetJetTagsProbs + _pfMassDecorrelatedParticleNetJetTagsMetaDiscrs