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