Skip to content
Snippets Groups Projects
Commit 95a21eda authored by Adam Edward Barton's avatar Adam Edward Barton
Browse files

Merge branch 'config.EventSelectorAthenaPool-20200617' into 'master'

EventSelectorAthenaPool: Add new configuration fragment for CondProxyProvider.

See merge request atlas/athena!33827
parents 605ec05b 5d0d89ce
No related branches found
No related tags found
No related merge requests found
......@@ -39,3 +39,8 @@ atlas_add_component( EventSelectorAthenaPool
atlas_install_python_modules( python/*.py )
atlas_install_joboptions( share/*.py )
atlas_add_test( CondProxyProviderConfig_test
SCRIPT python -m EventSelectorAthenaPool.CondProxyProviderConfig
LOG_SELECT_PATTERN "ComponentAccumulator|^---|^CondProxyProvider" )
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# File: EventSelectorAthenaPool/python/CondProxyProviderConfig.py
# Created: Jun 2020, sss
# Purpose: Configure CondProxyProvider.
from __future__ import print_function
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
def CondProxyProviderCfg (flags, poolFiles):
if not isinstance (poolFiles, list):
poolFiles = [poolFiles]
result = ComponentAccumulator()
ProxyProviderSvc = CompFactory.ProxyProviderSvc # SGComps
pps = ProxyProviderSvc (ProviderNames = ['CondProxyProvider'])
result.addService (pps)
CondProxyProvider = CompFactory.CondProxyProvider # EventSelectorAthenaPool
cpp = CondProxyProvider (InputCollections = poolFiles)
result.addService (cpp)
return result
if __name__ == "__main__":
from AthenaCommon.Configurable import Configurable
Configurable.configurableRun3Behavior=1
from AthenaConfiguration.AllConfigFlags import ConfigFlags
ConfigFlags.loadAllDynamicFlags()
flags1 = ConfigFlags.clone()
flags1.lock()
acc1 = ComponentAccumulator()
acc1.merge (CondProxyProviderCfg (flags1, 'file1'))
acc1.merge (CondProxyProviderCfg (flags1, ['file2', 'file3']))
acc1.printConfig (summariseProps=True)
print ('CondProxyProvider:', acc1.getService('CondProxyProvider'))
acc1.wasMerged()
Py:Athena INFO using release [WorkDir-22.0.15] [x86_64-centos7-gcc8-opt] [config.EventSelectorAthenaPool-20200617/24fa4eb1a41] -- built on [2020-06-17T2014]
Py:ComponentAccumulator INFO Event Inputs
Py:ComponentAccumulator INFO Event Algorithm Sequences
Py:ComponentAccumulator INFO Top sequence 0
Py:ComponentAccumulator INFO \__ AthAlgSeq (seq: SEQ AND)
Py:ComponentAccumulator INFO Condition Algorithms
Py:ComponentAccumulator INFO Services
Py:ComponentAccumulator INFO ['ProxyProviderSvc', 'CondProxyProvider']
Py:ComponentAccumulator INFO Public Tools
Py:ComponentAccumulator INFO [
Py:ComponentAccumulator INFO ]
Py:ComponentAccumulator INFO Private Tools
Py:ComponentAccumulator INFO [
Py:ComponentAccumulator INFO ]
Py:ComponentAccumulator INFO TheApp properties
CondProxyProvider: CondProxyProvider('CondProxyProvider', InputCollections=['file1', 'file2', 'file3'])
/*
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 CondProxyProvider.cxx
......@@ -33,7 +33,6 @@ CondProxyProvider::CondProxyProvider(const std::string& name, ISvcLocator* pSvcL
m_athenaPoolCnvSvc("AthenaPoolCnvSvc", name),
m_poolCollectionConverter(0),
m_headerIterator(0) {
declareProperty("InputCollections", m_inputCollectionsProp);
}
//________________________________________________________________________________
CondProxyProvider::~CondProxyProvider() {
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef CONDPROXYPROVIDER_H
......@@ -63,7 +63,8 @@ private: // data
private: // properties
/// InputCollections, vector with names of the input collections.
StringArrayProperty m_inputCollectionsProp;
StringArrayProperty m_inputCollectionsProp
{ this, "InputCollections", {}, "Files to read", "OrderedSet<std::string>" };
mutable std::vector<std::string>::const_iterator m_inputCollectionsIterator;
private: // internal helper functions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment