import AthenaPoolCnvSvc.ReadAthenaPool
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
from AthenaCommon.AppMgr import ServiceMgr
from AthenaCommon import CfgMgr

filelist = ["myAOD.pool.root"]
ServiceMgr.EventSelector.InputCollections = filelist

# Set up default configurations
#import METReconstruction.METConfig_RefFinal
#import METReconstruction.METConfig_Truth
import METReconstruction.METConfig_PFlow

#from METReconstruction.METRecoFlags import metFlags
from METReconstruction.METRecoConfig import getMETRecoAlg

# Get the configuration directly from METRecoFlags
# Can also provide a dict of configurations or list of RecoTools or both
metAlg = getMETRecoAlg('METReconstruction')

from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
topSequence += metAlg
topSequence += CfgMgr.met__METReaderAlg("METReader")

# The tools are accessible via the configurations in metFlags
topSequence.METReconstruction.OutputLevel = DEBUG
from AthenaCommon.AppMgr import ToolSvc
ToolSvc.MET_RecoTool_PFlow.OutputLevel = VERBOSE
ToolSvc.MET_SoftPFlowTool_PFlow.OutputLevel = VERBOSE

#from Valkyrie.JobOptCfg import ValgrindSvc
#svcMgr += ValgrindSvc( OutputLevel = DEBUG,
#                       ProfiledAlgs = ["METReconstruction"],
#                       ProfiledIntervals = ["METReconstruction.execute"])
#
#from PerfMonComps.PerfMonFlags import jobproperties as pmon_properties
#pmon_properties.PerfMonFlags.doSemiDetailedMonitoring=True

write_xAOD = True
if write_xAOD:

    # The list of output containers/maps is autogenerated and stored in metFlags
    # This jO extracts them with the appropriate formatting
    from AthenaCommon.Resilience import protectedInclude
    protectedInclude("METReconstruction/METReconstructionOutputAODList_jobOptions.py")

    from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
    xaodStream = MSMgr.NewPoolStream( "StreamAOD", "xAOD.pool.root" )
    xaodStream.AddItem('xAOD::MissingETContainer_v1#MET_PFlow')
    xaodStream.AddItem('xAOD::MissingETAuxContainer_v1#MET_PFlowAux.')

    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [
        "DEFAULT_SPLITLEVEL='99'" ]

    # Force POOL to just simply use the StoreGate keys as branch names:
    ServiceMgr.AthenaPoolCnvSvc.SubLevelBranchName = "<key>"

theApp.EvtMax = -1
ServiceMgr.EventSelector.SkipEvents = 0

fe7ed13a1b939b39b916e9948b1e890c377b1afe
<mask token>

<mask token>
topSequence += metAlg
topSequence += CfgMgr.met__METReaderAlg('METReader')
<mask token>
if write_xAOD:
    from AthenaCommon.Resilience import protectedInclude
    protectedInclude(
        'METReconstruction/METReconstructionOutputAODList_jobOptions.py')
    from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
    xaodStream = MSMgr.NewPoolStream('StreamAOD', 'xAOD.pool.root')
    xaodStream.AddItem('xAOD::MissingETContainer_v1#MET_PFlow')
    xaodStream.AddItem('xAOD::MissingETAuxContainer_v1#MET_PFlowAux.')
    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += ["DEFAULT_SPLITLEVEL='99'"]
    ServiceMgr.AthenaPoolCnvSvc.SubLevelBranchName = '<key>'
<mask token>

<mask token>
filelist = ['myAOD.pool.root']
ServiceMgr.EventSelector.InputCollections = filelist
<mask token>
metAlg = getMETRecoAlg('METReconstruction')
<mask token>
topSequence = AlgSequence()
topSequence += metAlg
topSequence += CfgMgr.met__METReaderAlg('METReader')
topSequence.METReconstruction.OutputLevel = DEBUG
<mask token>
ToolSvc.MET_RecoTool_PFlow.OutputLevel = VERBOSE
ToolSvc.MET_SoftPFlowTool_PFlow.OutputLevel = VERBOSE
write_xAOD = True
if write_xAOD:
    from AthenaCommon.Resilience import protectedInclude
    protectedInclude(
        'METReconstruction/METReconstructionOutputAODList_jobOptions.py')
    from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
    xaodStream = MSMgr.NewPoolStream('StreamAOD', 'xAOD.pool.root')
    xaodStream.AddItem('xAOD::MissingETContainer_v1#MET_PFlow')
    xaodStream.AddItem('xAOD::MissingETAuxContainer_v1#MET_PFlowAux.')
    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += ["DEFAULT_SPLITLEVEL='99'"]
    ServiceMgr.AthenaPoolCnvSvc.SubLevelBranchName = '<key>'
theApp.EvtMax = -1
ServiceMgr.EventSelector.SkipEvents = 0

import AthenaPoolCnvSvc.ReadAthenaPool
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
from AthenaCommon.AppMgr import ServiceMgr
from AthenaCommon import CfgMgr
filelist = ['myAOD.pool.root']
ServiceMgr.EventSelector.InputCollections = filelist
import METReconstruction.METConfig_PFlow
from METReconstruction.METRecoConfig import getMETRecoAlg
metAlg = getMETRecoAlg('METReconstruction')
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
topSequence += metAlg
topSequence += CfgMgr.met__METReaderAlg('METReader')
topSequence.METReconstruction.OutputLevel = DEBUG
from AthenaCommon.AppMgr import ToolSvc
ToolSvc.MET_RecoTool_PFlow.OutputLevel = VERBOSE
ToolSvc.MET_SoftPFlowTool_PFlow.OutputLevel = VERBOSE
write_xAOD = True
if write_xAOD:
    from AthenaCommon.Resilience import protectedInclude
    protectedInclude(
        'METReconstruction/METReconstructionOutputAODList_jobOptions.py')
    from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
    xaodStream = MSMgr.NewPoolStream('StreamAOD', 'xAOD.pool.root')
    xaodStream.AddItem('xAOD::MissingETContainer_v1#MET_PFlow')
    xaodStream.AddItem('xAOD::MissingETAuxContainer_v1#MET_PFlowAux.')
    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += ["DEFAULT_SPLITLEVEL='99'"]
    ServiceMgr.AthenaPoolCnvSvc.SubLevelBranchName = '<key>'
theApp.EvtMax = -1
ServiceMgr.EventSelector.SkipEvents = 0

import AthenaPoolCnvSvc.ReadAthenaPool
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
from AthenaCommon.AppMgr import ServiceMgr
from AthenaCommon import CfgMgr

filelist = ["myAOD.pool.root"]
ServiceMgr.EventSelector.InputCollections = filelist

# Set up default configurations
#import METReconstruction.METConfig_RefFinal
#import METReconstruction.METConfig_Truth
import METReconstruction.METConfig_PFlow

#from METReconstruction.METRecoFlags import metFlags
from METReconstruction.METRecoConfig import getMETRecoAlg

# Get the configuration directly from METRecoFlags
# Can also provide a dict of configurations or list of RecoTools or both
metAlg = getMETRecoAlg('METReconstruction')

from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
topSequence += metAlg
topSequence += CfgMgr.met__METReaderAlg("METReader")

# The tools are accessible via the configurations in metFlags
topSequence.METReconstruction.OutputLevel = DEBUG
from AthenaCommon.AppMgr import ToolSvc
ToolSvc.MET_RecoTool_PFlow.OutputLevel = VERBOSE
ToolSvc.MET_SoftPFlowTool_PFlow.OutputLevel = VERBOSE

#from Valkyrie.JobOptCfg import ValgrindSvc
#svcMgr += ValgrindSvc( OutputLevel = DEBUG,
#                       ProfiledAlgs = ["METReconstruction"],
#                       ProfiledIntervals = ["METReconstruction.execute"])
#
#from PerfMonComps.PerfMonFlags import jobproperties as pmon_properties
#pmon_properties.PerfMonFlags.doSemiDetailedMonitoring=True

write_xAOD = True
if write_xAOD:

    # The list of output containers/maps is autogenerated and stored in metFlags
    # This jO extracts them with the appropriate formatting
    from AthenaCommon.Resilience import protectedInclude
    protectedInclude("METReconstruction/METReconstructionOutputAODList_jobOptions.py")

    from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
    xaodStream = MSMgr.NewPoolStream( "StreamAOD", "xAOD.pool.root" )
    xaodStream.AddItem('xAOD::MissingETContainer_v1#MET_PFlow')
    xaodStream.AddItem('xAOD::MissingETAuxContainer_v1#MET_PFlowAux.')

    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [
        "DEFAULT_SPLITLEVEL='99'" ]

    # Force POOL to just simply use the StoreGate keys as branch names:
    ServiceMgr.AthenaPoolCnvSvc.SubLevelBranchName = "<key>"

theApp.EvtMax = -1
ServiceMgr.EventSelector.SkipEvents = 0
