CMS 3D CMS Logo

pfParticleTransformerAK4_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 from RecoBTag.FeatureTools.pfParticleTransformerAK4TagInfos_cfi import pfParticleTransformerAK4TagInfos
4 
5 from RecoBTag.ONNXRuntime.pfParticleTransformerAK4JetTags_cfi import pfParticleTransformerAK4JetTags
6 from RecoBTag.ONNXRuntime.pfParticleTransformerAK4DiscriminatorsJetTags_cfi import pfParticleTransformerAK4DiscriminatorsJetTags
7 from RecoBTag.ONNXRuntime.pfParticleTransformerAK4SonicJetTags_cfi import pfParticleTransformerAK4SonicJetTags as _pfParticleTransformerAK4SonicJetTags
8 from CommonTools.PileupAlgos.Puppi_cff import puppi
9 from CommonTools.RecoAlgos.primaryVertexAssociation_cfi import primaryVertexAssociation
10 from Configuration.ProcessModifiers.particleTransformerAK4SonicTriton_cff import particleTransformerAK4SonicTriton
11 
12 
13 particleTransformerAK4SonicTriton.toReplaceWith(pfParticleTransformerAK4JetTags, _pfParticleTransformerAK4SonicJetTags.clone(
14  Client = cms.PSet(
15  timeout = cms.untracked.uint32(300),
16  mode = cms.string("Async"),
17  modelName = cms.string("particletransformer_AK4"),
18  modelConfigPath = cms.FileInPath("RecoBTag/Combined/data/models/particletransformer_AK4/config.pbtxt"),
19  modelVersion = cms.string(""),
20  verbose = cms.untracked.bool(False),
21  allowedTries = cms.untracked.uint32(0),
22  useSharedMemory = cms.untracked.bool(True),
23  compression = cms.untracked.string(""),
24  ),
25  flav_names = pfParticleTransformerAK4JetTags.flav_names,
26 ))
27 
28 # declare all the discriminators
29 # probs
30 _pfParticleTransformerAK4JetTagsProbs = ['pfParticleTransformerAK4JetTags:' + flav_name
31  for flav_name in pfParticleTransformerAK4JetTags.flav_names]
32 # meta-taggers
33 _pfParticleTransformerAK4JetTagsMetaDiscrs = ['pfParticleTransformerAK4DiscriminatorsJetTags:' + disc.name.value()
34  for disc in pfParticleTransformerAK4DiscriminatorsJetTags.discriminators]
35 _pfParticleTransformerAK4JetTagsAll = _pfParticleTransformerAK4JetTagsProbs + _pfParticleTransformerAK4JetTagsMetaDiscrs
36 
37 
38 
39 # ==
40 # This task is not used, useful only if we run it from RECO jets (RECO/AOD)
41 pfParticleTransformerAK4Task = cms.Task(puppi, primaryVertexAssociation,
42  pfParticleTransformerAK4TagInfos, pfParticleTransformerAK4JetTags,
43  pfParticleTransformerAK4DiscriminatorsJetTags)
44 # run from MiniAOD instead
45 pfParticleTransformerAK4FromMiniAODTask = cms.Task(pfParticleTransformerAK4TagInfos,
46  pfParticleTransformerAK4JetTags,
47  pfParticleTransformerAK4DiscriminatorsJetTags)
48 
49 # === Negative tags ===
50 pfNegativeParticleTransformerAK4TagInfos = pfParticleTransformerAK4TagInfos.clone(
51  flip = True,
52  secondary_vertices = 'inclusiveCandidateNegativeSecondaryVertices',
53 )
54 pfNegativeParticleTransformerAK4JetTags = pfParticleTransformerAK4JetTags.clone(
55  src = 'pfNegativeParticleTransformerAK4TagInfos',
56 )
57 
58 # probs
59 _pfNegativeParticleTransformerAK4JetTagsProbs = ['pfNegativeParticleTransformerAK4JetTags:' + flav_name
60  for flav_name in pfParticleTransformerAK4JetTags.flav_names]