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