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  jets = "ak4PFJetsCHS",
9  jet_radius = 0.4,
10  min_jet_pt = 15,
11  min_puppi_wgt = -1,
12  use_puppiP4 = False,
13 )
14 
15 pfParticleNetAK4TagInfosForRECO = pfParticleNetAK4TagInfos.clone(
16  min_jet_pt = 25,
17  max_jet_eta = 2.5,
18 )
19 
20 pfParticleNetAK4JetTags = boostedJetONNXJetTagsProducer.clone(
21  src = 'pfParticleNetAK4TagInfos',
22  preprocess_json = 'RecoBTag/Combined/data/ParticleNetAK4/CHS/V00/preprocess.json',
23  model_path = 'RecoBTag/Combined/data/ParticleNetAK4/CHS/V00/particle-net.onnx',
24  flav_names = ["probb", "probbb", "probc", "probcc", "probuds", "probg", "probundef", "probpu"],
25 )
26 
27 pfParticleNetAK4JetTagsForRECO = pfParticleNetAK4JetTags.clone(
28  src = 'pfParticleNetAK4TagInfosForRECO',
29 )
30 
31 pfParticleNetAK4DiscriminatorsJetTagsForRECO = pfParticleNetAK4DiscriminatorsJetTags.clone()
32 for discriminator in pfParticleNetAK4DiscriminatorsJetTagsForRECO.discriminators:
33  for num in discriminator.numerator:
34  num.setModuleLabel("pfParticleNetAK4JetTagsForRECO");
35  for den in discriminator.denominator:
36  den.setModuleLabel("pfParticleNetAK4JetTagsForRECO");
37 
38 from CommonTools.PileupAlgos.Puppi_cff import puppi
39 from CommonTools.RecoAlgos.primaryVertexAssociation_cfi import primaryVertexAssociation
40 
41 # This task is not used, useful only if we run it from RECO jets (RECO/AOD)
42 pfParticleNetAK4Task = cms.Task(puppi, primaryVertexAssociation, pfParticleNetAK4TagInfos,
43  pfParticleNetAK4JetTags, pfParticleNetAK4DiscriminatorsJetTags)
44 
45 pfParticleNetAK4TaskForRECO = cms.Task(puppi, primaryVertexAssociation, pfParticleNetAK4TagInfosForRECO,
46  pfParticleNetAK4JetTagsForRECO, pfParticleNetAK4DiscriminatorsJetTagsForRECO)
47 
48 # declare all the discriminators
49 # probs
50 _pfParticleNetAK4JetTagsProbs = ['pfParticleNetAK4JetTags:' + flav_name
51  for flav_name in pfParticleNetAK4JetTags.flav_names]
52 # meta-taggers
53 _pfParticleNetAK4JetTagsMetaDiscrs = ['pfParticleNetAK4DiscriminatorsJetTags:' + disc.name.value()
54  for disc in pfParticleNetAK4DiscriminatorsJetTags.discriminators]
55 
56 _pfParticleNetAK4JetTagsAll = _pfParticleNetAK4JetTagsProbs + _pfParticleNetAK4JetTagsMetaDiscrs
57 
58 
59 # === Negative tags ===
60 pfNegativeParticleNetAK4TagInfos = pfParticleNetAK4TagInfos.clone(
61  flip_ip_sign = True,
62  sip3dSigMax = 10,
63  secondary_vertices = 'inclusiveCandidateNegativeSecondaryVertices',
64 )
65 
66 pfNegativeParticleNetAK4JetTags = pfParticleNetAK4JetTags.clone(
67  src = 'pfNegativeParticleNetAK4TagInfos',
68 )
69 
70 # probs
71 _pfNegativeParticleNetAK4JetTagsProbs = ['pfNegativeParticleNetAK4JetTags:' + flav_name
72  for flav_name in pfNegativeParticleNetAK4JetTags.flav_names]