8 This is a module for reading event objects in AthenaPool.
9 It loads the conversion service shared lib, and the EventInfo converter.
11 When using Explicit Collection, a query can be applied to the collection attributes
12 through the EventSelector for preselecting events. Note only attributes are (run,event) for now.
15 EventSelector.query = 'event > 10 && event < 100';
17 will select events that have event number in the specified range.
21 """ Helper method to configure Athena to read back POOL files """
23 from AthenaCommon.Logging
import logging
24 msg = logging.getLogger(
'configureReadAthenaPool' )
25 msg.debug(
"Configuring Athena for reading POOL files..." )
27 from AthenaCommon
import CfgMgr
28 from AthenaCommon.AppMgr
import ServiceMgr
as svcMgr
29 from AthenaCommon.AppMgr
import theApp
32 import AthenaPoolCnvSvc.AthenaPool
35 svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [
"DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '-1'" ]
38 if not hasattr (svcMgr,
'ProxyProviderSvc'):
39 svcMgr += CfgMgr.ProxyProviderSvc()
42 if not hasattr (svcMgr,
'MetaDataSvc'):
43 svcMgr += CfgMgr.MetaDataSvc (
"MetaDataSvc")
44 svcMgr.ProxyProviderSvc.ProviderNames += [
"MetaDataSvc" ]
47 if not hasattr (svcMgr,
'InputMetaDataStore'):
48 svcMgr += CfgMgr.StoreGateSvc (
"InputMetaDataStore")
49 if not hasattr (svcMgr,
'MetaDataStore'):
50 svcMgr += CfgMgr.StoreGateSvc (
"MetaDataStore")
53 svcMgr.MetaDataSvc.MetaDataContainer =
"MetaDataHdr"
54 svcMgr.MetaDataSvc.MetaDataTools += [
"IOVDbMetaDataTool" ]
55 if not hasattr (svcMgr.ToolSvc,
'IOVDbMetaDataTool'):
56 svcMgr.ToolSvc += CfgMgr.IOVDbMetaDataTool()
59 svcMgr += CfgMgr.EventSelectorAthenaPool (
"EventSelector")
61 from AthenaCommon.AthenaCommonFlags
import jobproperties
as jps
62 svcMgr.EventSelector.InputCollections = jps.AthenaCommonFlags.FilesInput()
64 _n = svcMgr.EventSelector.getFullJobOptName()
70 if "AthAnalysisBase" in os.environ.get(
'CMTEXTRATAGS',
""):
73 if not hasattr(svcMgr, theApp.EventLoop):
74 svcMgr += getattr(CfgMgr, theApp.EventLoop)()
75 evtloop = getattr(svcMgr, theApp.EventLoop)
77 evtloop.EventPrintoutInterval = 10000
79 msg.info(
'failed suppressing event loop heartbeat. performances might be sub-par... sorry.')
83 if not hasattr (svcMgr,
'AthenaPoolAddressProviderSvc'):
84 svcMgr += CfgMgr.AthenaPoolAddressProviderSvc (
"AthenaPoolAddressProviderSvc")
85 svcMgr.ProxyProviderSvc.ProviderNames += [
"AthenaPoolAddressProviderSvc" ]
89 svcMgr += CfgMgr.DataModelCompatSvc()
93 from SGComps.AddressRemappingSvc
import getAddressRemappingSvc
96 msg.debug(
"Configuring Athena for reading POOL files... [DONE]" )
103 del _configureReadAthenaPool