CMS 3D CMS Logo

pfDeepBoostedJet_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.Parameters.DeepBoostedJet.V02.pfDeepBoostedJetPreprocessParams_cfi import pfDeepBoostedJetPreprocessParams
6 from RecoBTag.ONNXRuntime.Parameters.DeepBoostedJet.V02.pfMassDecorrelatedDeepBoostedJetPreprocessParams_cfi import pfMassDecorrelatedDeepBoostedJetPreprocessParams
7 from RecoBTag.ONNXRuntime.pfDeepBoostedDiscriminatorsJetTags_cfi import pfDeepBoostedDiscriminatorsJetTags
8 from RecoBTag.ONNXRuntime.pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags_cfi import pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags
9 
10 # nominal DeepAK8
11 pfDeepBoostedJetTags = boostedJetONNXJetTagsProducer.clone(
12  preprocessParams = pfDeepBoostedJetPreprocessParams,
13  model_path = 'RecoBTag/Combined/data/DeepBoostedJet/V02/full/resnet.onnx',
14 )
15 
16 # mass-decorrelated DeepAK8
17 pfMassDecorrelatedDeepBoostedJetTags = boostedJetONNXJetTagsProducer.clone(
18  preprocessParams = pfMassDecorrelatedDeepBoostedJetPreprocessParams,
19  model_path = 'RecoBTag/Combined/data/DeepBoostedJet/V02/decorrelated/resnet.onnx',
20 )
21 
22 from CommonTools.PileupAlgos.Puppi_cff import puppi
23 from PhysicsTools.PatAlgos.slimming.primaryVertexAssociation_cfi import primaryVertexAssociation
24 
25 # This task is not used, useful only if we run DeepFlavour from RECO
26 # jets (RECO/AOD)
27 pfDeepBoostedJetTask = cms.Task(puppi, primaryVertexAssociation,
28  pfDeepBoostedJetTagInfos, pfDeepBoostedJetTags, pfMassDecorrelatedDeepBoostedJetTags,
29  pfDeepBoostedDiscriminatorsJetTags, pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags)
30 
31 # declare all the discriminators
32 # nominal: probs
33 _pfDeepBoostedJetTagsProbs = ['pfDeepBoostedJetTags:' + flav_name
34  for flav_name in pfDeepBoostedJetTags.flav_names]
35 # nominal: meta-taggers
36 _pfDeepBoostedJetTagsMetaDiscrs = ['pfDeepBoostedDiscriminatorsJetTags:' + disc.name.value()
37  for disc in pfDeepBoostedDiscriminatorsJetTags.discriminators]
38 
39 # mass-decorrelated: probs
40 _pfMassDecorrelatedDeepBoostedJetTagsProbs = ['pfMassDecorrelatedDeepBoostedJetTags:' + flav_name
41  for flav_name in pfMassDecorrelatedDeepBoostedJetTags.flav_names]
42 # mass-decorrelated: meta-taggers
43 _pfMassDecorrelatedDeepBoostedJetTagsMetaDiscrs = ['pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:' + disc.name.value()
44  for disc in pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags.discriminators]
45 
46 _pfDeepBoostedJetTagsAll = _pfDeepBoostedJetTagsProbs + _pfDeepBoostedJetTagsMetaDiscrs + \
47  _pfMassDecorrelatedDeepBoostedJetTagsProbs + _pfMassDecorrelatedDeepBoostedJetTagsMetaDiscrs