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

Merge branch 'condStore.AthenaPython-20200618' into 'master'

AthenaPython: Add condStore() methods to python components.

See merge request atlas/athena!33875
parents c1ff4d82 2eae3e97
No related branches found
No related tags found
No related merge requests found
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# @file: PyAthenaComps.py # @file: PyAthenaComps.py
# @purpose: a set of Python classes for PyAthena # @purpose: a set of Python classes for PyAthena
...@@ -77,6 +77,7 @@ class Alg( CfgPyAlgorithm ): ...@@ -77,6 +77,7 @@ class Alg( CfgPyAlgorithm ):
super(Alg, self).__init__(name, **kw) super(Alg, self).__init__(name, **kw)
self._pyath_evtstore = None # handle to the evt store self._pyath_evtstore = None # handle to the evt store
self._pyath_detstore = None # handle to the det store self._pyath_detstore = None # handle to the det store
self._pyath_condstore = None # handle to the cond store
self._ctx = None self._ctx = None
self.__component_type__="Algorithm" self.__component_type__="Algorithm"
self.__cpp_type__=self.__class__.__name__ self.__cpp_type__=self.__class__.__name__
...@@ -97,6 +98,13 @@ class Alg( CfgPyAlgorithm ): ...@@ -97,6 +98,13 @@ class Alg( CfgPyAlgorithm ):
self._pyath_detstore = PyAthena.py_svc('StoreGateSvc/DetectorStore') self._pyath_detstore = PyAthena.py_svc('StoreGateSvc/DetectorStore')
return self._pyath_detstore return self._pyath_detstore
@property
def condStore(self):
if not self._pyath_condstore:
import AthenaPython.PyAthena as PyAthena
self._pyath_condtstore = PyAthena.py_svc('StoreGateSvc/ConditionStore')
return self._pyath_condstore
def sysInitialize(self): def sysInitialize(self):
self.msg.setLevel(_get_prop_value(self,'OutputLevel')) self.msg.setLevel(_get_prop_value(self,'OutputLevel'))
return self.initialize() return self.initialize()
...@@ -225,6 +233,7 @@ class AlgTool( CfgPyAlgTool ): ...@@ -225,6 +233,7 @@ class AlgTool( CfgPyAlgTool ):
self.__dict__['msg'] = logging.getLogger( self.getJobOptName() ) self.__dict__['msg'] = logging.getLogger( self.getJobOptName() )
self._pyath_evtstore = None # handle to the evt store self._pyath_evtstore = None # handle to the evt store
self._pyath_detstore = None # handle to the det store self._pyath_detstore = None # handle to the det store
self._pyath_condstore = None # handle to the cond store
self.__component_type__ = "AlgTool" self.__component_type__ = "AlgTool"
self.__cpp_type__=self.__class__.__name__ self.__cpp_type__=self.__class__.__name__
return return
...@@ -243,6 +252,13 @@ class AlgTool( CfgPyAlgTool ): ...@@ -243,6 +252,13 @@ class AlgTool( CfgPyAlgTool ):
self._pyath_detstore = PyAthena.py_svc('StoreGateSvc/DetectorStore') self._pyath_detstore = PyAthena.py_svc('StoreGateSvc/DetectorStore')
return self._pyath_detstore return self._pyath_detstore
@property
def condStore(self):
if not self._pyath_condstore:
import AthenaPython.PyAthena as PyAthena
self._pyath_condstore = PyAthena.py_svc('StoreGateSvc/ConditionStore')
return self._pyath_condstore
def sysInitialize(self): def sysInitialize(self):
self.msg.setLevel(_get_prop_value(self,'OutputLevel')) self.msg.setLevel(_get_prop_value(self,'OutputLevel'))
return self.initialize() return self.initialize()
......
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