CMS 3D CMS Logo

pfParticleNetAK4_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.pfParticleNetAK4DiscriminatorsJetTags_cfi import pfParticleNetAK4DiscriminatorsJetTags
6 
7 pfParticleNetAK4TagInfos = pfDeepBoostedJetTagInfos.clone(
8  jet_radius = 0.4,
9  min_jet_pt = 15,
10  min_puppi_wgt = -1,
11  use_puppiP4 = False,
12 )
13 
14 pfParticleNetAK4JetTags = boostedJetONNXJetTagsProducer.clone(
15  src = 'pfParticleNetAK4TagInfos',
16  preprocess_json = 'RecoBTag/Combined/data/ParticleNetAK4/CHS/V00/preprocess.json',
17  model_path = 'RecoBTag/Combined/data/ParticleNetAK4/CHS/V00/particle-net.onnx',
18  flav_names = ["probb", "probbb", "probc", "probcc", "probuds", "probg", "probundef", "probpu"],
19 )
20 
21 from CommonTools.PileupAlgos.Puppi_cff import puppi
22 from PhysicsTools.PatAlgos.slimming.primaryVertexAssociation_cfi import primaryVertexAssociation
23 
24 # This task is not used, useful only if we run it from RECO jets (RECO/AOD)
25 pfParticleNetAK4Task = cms.Task(puppi, primaryVertexAssociation, pfParticleNetAK4TagInfos,
26  pfParticleNetAK4JetTags, pfParticleNetAK4DiscriminatorsJetTags)
27 
28 # declare all the discriminators
29 # probs
30 _pfParticleNetAK4JetTagsProbs = ['pfParticleNetAK4JetTags:' + flav_name
31  for flav_name in pfParticleNetAK4JetTags.flav_names]
32 # meta-taggers
33 _pfParticleNetAK4JetTagsMetaDiscrs = ['pfParticleNetAK4DiscriminatorsJetTags:' + disc.name.value()
34  for disc in pfParticleNetAK4DiscriminatorsJetTags.discriminators]
35 
36 _pfParticleNetAK4JetTagsAll = _pfParticleNetAK4JetTagsProbs + _pfParticleNetAK4JetTagsMetaDiscrs
37 
38 
39 # === Negative tags ===
40 pfNegativeParticleNetAK4TagInfos = pfParticleNetAK4TagInfos.clone(
41  flip_ip_sign = True,
42  sip3dSigMax = 10,
43  secondary_vertices = 'inclusiveCandidateNegativeSecondaryVertices',
44 )
45 
46 pfNegativeParticleNetAK4JetTags = pfParticleNetAK4JetTags.clone(
47  src = 'pfNegativeParticleNetAK4TagInfos',
48 )
49 
50 # probs
51 _pfNegativeParticleNetAK4JetTagsProbs = ['pfNegativeParticleNetAK4JetTags:' + flav_name
52  for flav_name in pfNegativeParticleNetAK4JetTags.flav_names]