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.boostedJetMXNetJetTagsProducer_cfi import boostedJetMXNetJetTagsProducer
5 from RecoBTag.MXNet.Parameters.V01.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 = boostedJetMXNetJetTagsProducer.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 = boostedJetMXNetJetTagsProducer.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 Configuration.Eras.Modifier_run2_miniAOD_devel_cff import run2_miniAOD_devel
26 from RecoBTag.MXNet.Parameters.V02.pfDeepBoostedJetPreprocessParams_cfi import pfDeepBoostedJetPreprocessParams as pfDeepBoostedJetPreprocessParamsV02
27 from RecoBTag.MXNet.Parameters.V02.pfMassDecorrelatedDeepBoostedJetPreprocessParams_cfi import pfMassDecorrelatedDeepBoostedJetPreprocessParams as pfMassDecorrelatedDeepBoostedJetPreprocessParamsV02
28 
29 run2_miniAOD_devel.toModify(pfDeepBoostedJetTags,
30  preprocessParams = pfDeepBoostedJetPreprocessParamsV02,
31  model_path = 'RecoBTag/Combined/data/DeepBoostedJet/V02/full/resnet-symbol.json',
32  param_path = 'RecoBTag/Combined/data/DeepBoostedJet/V02/full/resnet-0000.params',
33 )
34 run2_miniAOD_devel.toModify(pfMassDecorrelatedDeepBoostedJetTags,
35  preprocessParams = pfMassDecorrelatedDeepBoostedJetPreprocessParamsV02,
36  model_path = 'RecoBTag/Combined/data/DeepBoostedJet/V02/decorrelated/resnet-symbol.json',
37  param_path = 'RecoBTag/Combined/data/DeepBoostedJet/V02/decorrelated/resnet-0000.params',
38 )
39 
40 from CommonTools.PileupAlgos.Puppi_cff import puppi
41 from PhysicsTools.PatAlgos.slimming.primaryVertexAssociation_cfi import primaryVertexAssociation
42 
43 # This task is not used, useful only if we run DeepFlavour from RECO
44 # jets (RECO/AOD)
45 pfDeepBoostedJetTask = cms.Task(puppi, primaryVertexAssociation,
46  pfDeepBoostedJetTagInfos, pfDeepBoostedJetTags, pfMassDecorrelatedDeepBoostedJetTags,
47  pfDeepBoostedDiscriminatorsJetTags, pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags)
48 
49 # declare all the discriminators
50 # nominal: probs
51 _pfDeepBoostedJetTagsProbs = ['pfDeepBoostedJetTags:' + flav_name
52  for flav_name in pfDeepBoostedJetTags.flav_names]
53 # nominal: meta-taggers
54 _pfDeepBoostedJetTagsMetaDiscrs = ['pfDeepBoostedDiscriminatorsJetTags:' + disc.name.value()
55  for disc in pfDeepBoostedDiscriminatorsJetTags.discriminators]
56 
57 # mass-decorrelated: probs
58 _pfMassDecorrelatedDeepBoostedJetTagsProbs = ['pfMassDecorrelatedDeepBoostedJetTags:' + flav_name
59  for flav_name in pfMassDecorrelatedDeepBoostedJetTags.flav_names]
60 # mass-decorrelated: meta-taggers
61 _pfMassDecorrelatedDeepBoostedJetTagsMetaDiscrs = ['pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:' + disc.name.value()
62  for disc in pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags.discriminators]
63 
64 _pfDeepBoostedJetTagsAll = _pfDeepBoostedJetTagsProbs + _pfDeepBoostedJetTagsMetaDiscrs + \
65  _pfMassDecorrelatedDeepBoostedJetTagsProbs + _pfMassDecorrelatedDeepBoostedJetTagsMetaDiscrs