From a379953ab22123d508977d29d37345facf45d54a Mon Sep 17 00:00:00 2001 From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> Date: Fri, 25 Sep 2020 15:57:11 +0200 Subject: [PATCH] Made AthenaPoolSnvSvc.ReadAthenaPool work "standalone". Previously the module would only work correctly if somebody upstream already imported the AthenaCommon.AthenaCommonFlags module. With this update it is now possible to import this module from vanilla Python as well. --- .../AthenaPoolCnvSvc/python/ReadAthenaPool.py | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py index 3e5503f4349..26dbaebe095 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ## @file ReadAthena.py ## @brief AthenaPool python module for reading event objects. @@ -59,26 +59,26 @@ def _configureReadAthenaPool(): # Add in EventSelector svcMgr += CfgMgr.EventSelectorAthenaPool ("EventSelector") #default InputCollections to FilesInput value of AthenaCommonFlags - from AthenaCommon.JobProperties import jobproperties as jps + from AthenaCommon.AthenaCommonFlags import jobproperties as jps svcMgr.EventSelector.InputCollections = jps.AthenaCommonFlags.FilesInput() - + _n = svcMgr.EventSelector.getFullJobOptName() theApp.EvtSel = _n del _n # For Analysis release use lower heartbeat - import os - if "AthAnalysisBase" in os.environ.get('CMTEXTRATAGS',""): - # From Will Buttinger to suppress the event loop heartbeat as it is somewhat I/O hungry for - # no real gain in analysis scenarii - if not hasattr(svcMgr, theApp.EventLoop): - svcMgr += getattr(CfgMgr, theApp.EventLoop)() - evtloop = getattr(svcMgr, theApp.EventLoop) - try: - evtloop.EventPrintoutInterval = 10000 + import os + if "AthAnalysisBase" in os.environ.get('CMTEXTRATAGS',""): + # From Will Buttinger to suppress the event loop heartbeat as it is somewhat I/O hungry for + # no real gain in analysis scenarii + if not hasattr(svcMgr, theApp.EventLoop): + svcMgr += getattr(CfgMgr, theApp.EventLoop)() + evtloop = getattr(svcMgr, theApp.EventLoop) + try: + evtloop.EventPrintoutInterval = 10000 except Exception: - msg.info('failed suppressing event loop heartbeat. performances might be sub-par... sorry.') - pass + msg.info('failed suppressing event loop heartbeat. performances might be sub-par... sorry.') + pass # Add in AthenaPoolAddressProviderSvc if not hasattr (svcMgr, 'AthenaPoolAddressProviderSvc'): -- GitLab