diff --git a/Reconstruction/MET/METReconstruction/python/LegacyRunII/METAssocConfig.py b/Reconstruction/MET/METReconstruction/python/LegacyRunII/METAssocConfig.py index 5dc91c5fb16a796938e7f6f73b0b7ab36287e247..6f2972858f92f1534b1ce2b0f9911e4a3d50f75d 100644 --- a/Reconstruction/MET/METReconstruction/python/LegacyRunII/METAssocConfig.py +++ b/Reconstruction/MET/METReconstruction/python/LegacyRunII/METAssocConfig.py @@ -15,11 +15,13 @@ defaultInputKey = { 'LCJet' :'AntiKt4LCTopoJets', 'EMJet' :'AntiKt4EMTopoJets', 'PFlowJet' :'AntiKt4EMPFlowJets', + 'PFlowFEJet':'AntiKt4EMPFlowFEJets', 'Muon' :'Muons', 'Soft' :'', 'Clusters' :'CaloCalTopoClusters', 'Tracks' :'InDetTrackParticles', 'PFlowObj' :'CHSParticleFlowObjects', + 'PFlowObjFE':'CHSFlowElements', 'PrimVxColl':'PrimaryVertices', 'Truth' :'TruthEvents', } @@ -63,6 +65,8 @@ def getAssociator(config,suffix,doPFlow=False, tool = CfgMgr.met__METJetAssocTool('MET_EMJetAssocTool_'+suffix) if config.objType == 'PFlowJet': tool = CfgMgr.met__METJetAssocTool('MET_PFlowJetAssocTool_'+suffix) + if config.objType == 'PFlowFEJet': + tool = CfgMgr.met__METJetAssocTool('MET_PFlowFEJetAssocTool_'+suffix) if config.objType == 'Muon': tool = CfgMgr.met__METMuonAssociator('MET_MuonAssociator_'+suffix) if config.objType == 'Soft': @@ -74,9 +78,14 @@ def getAssociator(config,suffix,doPFlow=False, if config.objType == 'Truth': tool = CfgMgr.met__METTruthAssociator('MET_TruthAssociator_'+suffix) tool.RecoJetKey = config.inputKey + + from METReconstruction.METRecoFlags import metFlags if doPFlow: tool.PFlow = True - tool.PFlowColl = modConstKey if modConstKey!="" else defaultInputKey["PFlowObj"] + if metFlags.UseFlowElements() : + tool.FlowElementCollection = modConstKey if modConstKey!="" else defaultInputKey["PFlowObjFE"] + else: + tool.PFlowColl = modConstKey if modConstKey!="" else defaultInputKey["PFlowObj"] else: tool.UseModifiedClus = doModClus # set input/output key names @@ -146,7 +155,11 @@ class METAssocConfig: modConstKey_tmp = modConstKey modClusColls_tmp = modClusColls if doPFlow: - if modConstKey_tmp == "": modConstKey_tmp = "CHSParticleFlowObjects" + from METReconstruction.METRecoFlags import metFlags + if metFlags.UseFlowElements(): + if modConstKey_tmp == "": modConstKey_tmp = "CHSFlowElements" + else: + if modConstKey_tmp == "": modConstKey_tmp = "CHSParticleFlowObjects" else: if modConstKey_tmp == "": modConstKey_tmp = "OriginCorr" if modClusColls_tmp == {}: modClusColls_tmp = {'LCOriginCorrClusters':'LCOriginTopoClusters', diff --git a/Reconstruction/MET/METReconstruction/python/LegacyRunII/METAssocConfig_readAOD.py b/Reconstruction/MET/METReconstruction/python/LegacyRunII/METAssocConfig_readAOD.py index 0257b283e2ee31f1c069067be3046c8872dc3ca0..61b3897355cc0e8d590bad07fb7b25c82bb0e378 100644 --- a/Reconstruction/MET/METReconstruction/python/LegacyRunII/METAssocConfig_readAOD.py +++ b/Reconstruction/MET/METReconstruction/python/LegacyRunII/METAssocConfig_readAOD.py @@ -21,6 +21,7 @@ defaultInputKey = { 'LCJet' :'AntiKt4LCTopoJets', 'EMJet' :'AntiKt4EMTopoJets', 'PFlowJet' :'AntiKt4EMPFlowJets', + 'PFlowFEJet':'AntiKt4EMPFlowFEJets', 'Muon' :'Muons', 'Soft' :'', 'ClusColl' :'CaloCalTopoClusters', @@ -82,6 +83,8 @@ def getAssociator(config,suffix,doPFlow=False, tool = CfgMgr.met__METJetAssocTool('MET_EMJetAssocTool_'+suffix) if config.objType == 'PFlowJet': tool = CfgMgr.met__METJetAssocTool('MET_PFlowJetAssocTool_'+suffix) + if config.objType == 'PFlowFEJet': + tool = CfgMgr.met__METJetAssocTool('MET_PFlowFEJetAssocTool_'+suffix) if config.objType == 'Muon': tool = CfgMgr.met__METMuonAssociator('MET_MuonAssociator_'+suffix,DoClusterMatch=False) if config.objType == 'Soft': @@ -94,9 +97,6 @@ def getAssociator(config,suffix,doPFlow=False, ToolSvc == tool tool.RecoJetKey = config.inputKey if doPFlow: - pfotool = CfgMgr.CP__RetrievePFOTool('MET_PFOTool_'+suffix) - ToolSvc += pfotool - tool.PFOTool = pfotool tool.PFlow = True else: tool.UseModifiedClus = doOriginCorrClus diff --git a/Reconstruction/MET/METReconstruction/python/LegacyRunII/METConfig_Associator.py b/Reconstruction/MET/METReconstruction/python/LegacyRunII/METConfig_Associator.py index 600e5e9b69102bbb6298a3d0fe4fa5c7403df9cb..de6c00f8784d0b986e836194e497096bee7197b4 100644 --- a/Reconstruction/MET/METReconstruction/python/LegacyRunII/METConfig_Associator.py +++ b/Reconstruction/MET/METReconstruction/python/LegacyRunII/METConfig_Associator.py @@ -70,3 +70,23 @@ if metFlags.DoPFlow() and metFlags.UseTracks(): metFlags.METAssocConfigs()[cfg_akt4pf.suffix] = cfg_akt4pf metFlags.METAssocOutputList().append(cfg_akt4pf.suffix) + + +############################################################################ +# PFlow (FlowElement) +if metFlags.DoPFlow() and metFlags.UseTracks() and metFlags.UseFlowElements(): + JetType = 'PFlowFEJet' + + associators = [AssocConfig(JetType), + AssocConfig('Muon'), + AssocConfig('Ele'), + AssocConfig('Gamma'), + AssocConfig('Tau'), + AssocConfig('Soft')] + cfg_akt4pffe = METAssocConfig('AntiKt4EMPFlowFE', + associators, + doPFlow=True + ) + + metFlags.METAssocConfigs()[cfg_akt4pffe.suffix] = cfg_akt4pffe + metFlags.METAssocOutputList().append(cfg_akt4pffe.suffix) \ No newline at end of file diff --git a/Reconstruction/MET/METReconstruction/python/LegacyRunII/METRecoConfig.py b/Reconstruction/MET/METReconstruction/python/LegacyRunII/METRecoConfig.py index 01a0c21dc61f775bb5af306a809f5e43e4c3079d..a689ef77774f9aac7a59c829c99a9aba7eb11f7f 100644 --- a/Reconstruction/MET/METReconstruction/python/LegacyRunII/METRecoConfig.py +++ b/Reconstruction/MET/METReconstruction/python/LegacyRunII/METRecoConfig.py @@ -26,7 +26,6 @@ defaultInputKey = { 'Muon' :'Muons', 'SoftTrk' :'InDetTrackParticles', 'SoftClus' :'CaloCalTopoClusters', - 'SoftPFlow':'JetETMissNeutralParticleFlowObjects', 'PrimaryVx':'PrimaryVertices', 'Truth' :'TruthEvents', 'Calo' :'AllCalo', @@ -42,7 +41,6 @@ defaultOutputKey = { 'Muon' :'Muons', 'SoftTrk' :'SoftTrk', 'SoftClus' :'SoftClus', - 'SoftPFlow':'SoftPFlow', 'Total' :'Final', 'Truth' :'Truth', 'Calo' :'Calo' @@ -86,11 +84,6 @@ def getBuilder(config,suffix,doTracks,doCells,doTriggerMET,doOriginCorrClus): if config.objType.endswith('SoftClus'): tool = CfgMgr.met__METSoftTermsTool('MET_SoftClusTool_'+suffix) tool.InputComposition = 'Clusters' - if config.objType == 'SoftPFlow': - tool = CfgMgr.met__METSoftTermsTool('MET_SoftPFlowTool_'+suffix) - tool.InputComposition = 'PFlow' - pfotool = CfgMgr.CP__RetrievePFOTool('MET_PFOTool_'+suffix) - tool.PFOTool = pfotool if suffix == 'Truth': tool = CfgMgr.met__METTruthTool('MET_TruthTool_'+config.objType) tool.InputComposition = config.objType diff --git a/Reconstruction/MET/METReconstruction/python/LegacyRunII/METRecoFlags.py b/Reconstruction/MET/METReconstruction/python/LegacyRunII/METRecoFlags.py index 462fb16051c5e1daa444e94edd93d0634e07cf1e..99b0482d4042531a1c7f1e61341f2d525ecb9e5d 100644 --- a/Reconstruction/MET/METReconstruction/python/LegacyRunII/METRecoFlags.py +++ b/Reconstruction/MET/METReconstruction/python/LegacyRunII/METRecoFlags.py @@ -16,6 +16,11 @@ class DoPFlow(JobProperty): allowedTypes = ['bool'] StoredValue = True +class UseFlowElements(JobProperty): + statusOn = True + allowedTypes = ['bool'] + StoredValue = False + class UseTracks(JobProperty): statusOn = True allowedTypes = ['bool'] @@ -65,6 +70,7 @@ jobproperties.add_Container(METRecoFlags) jobproperties.METRecoFlags.add_JobProperty(DoRegions) jobproperties.METRecoFlags.add_JobProperty(DoPFlow) +jobproperties.METRecoFlags.add_JobProperty(UseFlowElements) jobproperties.METRecoFlags.add_JobProperty(UseTracks) jobproperties.METRecoFlags.add_JobProperty(DecorateSoftConst) jobproperties.METRecoFlags.add_JobProperty(AllowOverwrite)