Skip to content
Snippets Groups Projects
Commit 5d0d89ce authored by Scott Snyder's avatar Scott Snyder Committed by Adam Edward Barton
Browse files

EventSelectorAthenaPool: Add new configuration fragment for CondProxyProvider.

Add a new-style configuration fragment for CondProxyProvider.
Need to set the semantics of the InputCollections property to allow
for proper merging.
parent dce8f066
No related branches found
No related tags found
No related merge requests found
...@@ -39,3 +39,8 @@ atlas_add_component( EventSelectorAthenaPool ...@@ -39,3 +39,8 @@ atlas_add_component( EventSelectorAthenaPool
atlas_install_python_modules( python/*.py ) atlas_install_python_modules( python/*.py )
atlas_install_joboptions( share/*.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 /** @file CondProxyProvider.cxx
...@@ -33,7 +33,6 @@ CondProxyProvider::CondProxyProvider(const std::string& name, ISvcLocator* pSvcL ...@@ -33,7 +33,6 @@ CondProxyProvider::CondProxyProvider(const std::string& name, ISvcLocator* pSvcL
m_athenaPoolCnvSvc("AthenaPoolCnvSvc", name), m_athenaPoolCnvSvc("AthenaPoolCnvSvc", name),
m_poolCollectionConverter(0), m_poolCollectionConverter(0),
m_headerIterator(0) { m_headerIterator(0) {
declareProperty("InputCollections", m_inputCollectionsProp);
} }
//________________________________________________________________________________ //________________________________________________________________________________
CondProxyProvider::~CondProxyProvider() { 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 #ifndef CONDPROXYPROVIDER_H
...@@ -63,7 +63,8 @@ private: // data ...@@ -63,7 +63,8 @@ private: // data
private: // properties private: // properties
/// InputCollections, vector with names of the input collections. /// 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; mutable std::vector<std::string>::const_iterator m_inputCollectionsIterator;
private: // internal helper functions 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