Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-07-16 00:28:53

0001 import FWCore.ParameterSet.Config as cms
0002 from FWCore.ParameterSet.pfnInPath import pfnInPath
0003 import os
0004 
0005 from RecoMET.METPUSubtraction.deepMETProducer_cfi import deepMETProducer as _deepMETProducer
0006 
0007 deepMETsResolutionTune = _deepMETProducer.clone()
0008 deepMETsResponseTune = _deepMETProducer.clone(
0009     graph_path = 'RecoMET/METPUSubtraction/data/models/deepmet/deepmet_resp_v1_2018/model.graphdef',
0010 )
0011 
0012 from Configuration.Eras.Modifier_phase2_common_cff import phase2_common
0013 phase2_common.toModify(
0014     deepMETsResolutionTune,
0015     max_n_pf=12500,
0016     graph_path="RecoMET/METPUSubtraction/data/models/deepmet_phase2/deepmet_v1_phase2/model.graphdef"
0017 )
0018 phase2_common.toModify(
0019     deepMETsResponseTune,
0020     max_n_pf=12500,
0021     graph_path="RecoMET/METPUSubtraction/data/models/deepmet_phase2/deepmet_resp_v1_phase2/model.graphdef"
0022 )
0023 
0024 from Configuration.Eras.Modifier_run2_jme_2016_cff import run2_jme_2016
0025 run2_jme_2016.toModify(
0026     deepMETsResponseTune,
0027     graph_path="RecoMET/METPUSubtraction/data/models/deepmet/deepmet_resp_v1_2016/model.graphdef"
0028 )
0029 
0030 from RecoMET.METPUSubtraction.deepMETSonicProducer_cff import deepMETSonicProducer as _deepMETSonicProducer
0031 from Configuration.ProcessModifiers.deepMETSonicTriton_cff import deepMETSonicTriton
0032 
0033 def split_model_path(path):
0034     Client = dict(
0035         modelName = path.split('/')[-3],
0036         modelConfigPath = '/'.join(path.split('/')[:-2])+'/config.pbtxt',
0037         # version "1" is the resolutionTune
0038         # version "2" is the responeTune
0039         modelVersion = os.path.realpath(pfnInPath(path).split(':')[-1]).split('/')[-2],
0040     )
0041     return Client
0042 
0043 # propagate possible parameter updates
0044 _deepMETsResolutionTuneSonic = _deepMETSonicProducer.clone(
0045     max_n_pf = deepMETsResolutionTune.max_n_pf,
0046     Client = split_model_path(deepMETsResolutionTune.graph_path.value()),
0047 )
0048 deepMETSonicTriton.toReplaceWith(deepMETsResolutionTune, _deepMETsResolutionTuneSonic)
0049 
0050 _deepMETsResponseTuneSonic = _deepMETSonicProducer.clone(
0051     max_n_pf = deepMETsResponseTune.max_n_pf,
0052     Client = split_model_path(deepMETsResponseTune.graph_path.value()),
0053 )
0054 deepMETSonicTriton.toReplaceWith(deepMETsResponseTune, _deepMETsResponseTuneSonic)
0055