CMS 3D CMS Logo

deepMETProducer_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from FWCore.ParameterSet.pfnInPath import pfnInPath
3 import os
4 
5 from RecoMET.METPUSubtraction.deepMETProducer_cfi import deepMETProducer as _deepMETProducer
6 
7 deepMETsResolutionTune = _deepMETProducer.clone()
8 deepMETsResponseTune = _deepMETProducer.clone(
9  graph_path = 'RecoMET/METPUSubtraction/data/models/deepmet/deepmet_resp_v1_2018/model.graphdef',
10 )
11 
12 from Configuration.Eras.Modifier_phase2_common_cff import phase2_common
13 phase2_common.toModify(
14  deepMETsResolutionTune,
15  max_n_pf=12500,
16  graph_path="RecoMET/METPUSubtraction/data/models/deepmet_phase2/deepmet_v1_phase2/model.graphdef"
17 )
18 phase2_common.toModify(
19  deepMETsResponseTune,
20  max_n_pf=12500,
21  graph_path="RecoMET/METPUSubtraction/data/models/deepmet_phase2/deepmet_resp_v1_phase2/model.graphdef"
22 )
23 
24 from Configuration.Eras.Modifier_run2_jme_2016_cff import run2_jme_2016
25 run2_jme_2016.toModify(
26  deepMETsResponseTune,
27  graph_path="RecoMET/METPUSubtraction/data/models/deepmet/deepmet_resp_v1_2016/model.graphdef"
28 )
29 
30 from RecoMET.METPUSubtraction.deepMETSonicProducer_cff import deepMETSonicProducer as _deepMETSonicProducer
31 from Configuration.ProcessModifiers.deepMETSonicTriton_cff import deepMETSonicTriton
32 
33 def split_model_path(path):
34  Client = dict(
35  modelName = path.split('/')[-3],
36  modelConfigPath = '/'.join(path.split('/')[:-2])+'/config.pbtxt',
37  # version "1" is the resolutionTune
38  # version "2" is the responeTune
39  modelVersion = os.path.realpath(pfnInPath(path).split(':')[-1]).split('/')[-2],
40  )
41  return Client
42 
43 # propagate possible parameter updates
44 _deepMETsResolutionTuneSonic = _deepMETSonicProducer.clone(
45  max_n_pf = deepMETsResolutionTune.max_n_pf,
46  Client = split_model_path(deepMETsResolutionTune.graph_path.value()),
47 )
48 deepMETSonicTriton.toReplaceWith(deepMETsResolutionTune, _deepMETsResolutionTuneSonic)
49 
50 _deepMETsResponseTuneSonic = _deepMETSonicProducer.clone(
51  max_n_pf = deepMETsResponseTune.max_n_pf,
52  Client = split_model_path(deepMETsResponseTune.graph_path.value()),
53 )
54 deepMETSonicTriton.toReplaceWith(deepMETsResponseTune, _deepMETsResponseTuneSonic)
55 
static std::string join(char **cmd)
Definition: RemoteFile.cc:19