30 template<
typename T >
32 const std::vector< T >&
vec ) {
35 for(
size_t i = 0;
i <
vec.size(); ++
i ) {
37 if( i < (
vec.size() - 1 ) ) {
55 "StoreGate keys of the store objects to be wrapped" );
77 return StatusCode::SUCCESS;
89 const std::vector< const SG::DataProxy* > proxies =
96 <<
"\" and CLID " << proxy->clID() );
106 if(
m_keysSet.find( proxy->name() +
"Aux." ) !=
108 std::string typeName;
111 if( typeName.compare( 0, 6,
"xAOD::" ) == 0) {
112 m_clids[ proxy->name() ] = proxy->clID();
121 std::string typeName;
124 if( ( typeName.compare( 0, 6 ,
"xAOD::") == 0) &&
125 ( typeName !=
"xAOD::ByteStreamAuxContainer_v1" ) ) {
126 m_clids[ proxy->name() ] = proxy->clID();
131 if( proxy->name().find(
"Aux." ) !=
132 ( proxy->name().size() - 4 ) ) {
156 if( !
evtStore()->retrieve( original, name ).isSuccess() ) {
158 <<
"with interface SG::IAuxStore" );
184 return StatusCode::SUCCESS;
188 const std::string& name ) {
191 auto aux_clid_itr =
m_clids.find( name );
192 if( aux_clid_itr ==
m_clids.end() ) {
195 return StatusCode::FAILURE;
197 evtStore()->releaseObject( aux_clid_itr->second, name );
199 <<
" and name \"" << name <<
"\"" );
206 "SG::IAuxStore base class of: " << name );
207 return StatusCode::FAILURE;
210 CHECK(
evtStore()->removeProxy( storeProxy,
nullptr,
true ) );
220 << name <<
"\" with an xAOD::AuxContainerBase "
224 const std::string intName = name.substr( 0, name.size() - 4 );
228 auto clid_itr =
m_clids.find( intName );
229 if( clid_itr ==
m_clids.end() ) {
233 return StatusCode::SUCCESS;
235 intId = clid_itr->second;
242 <<
"\" not available" );
243 return StatusCode::SUCCESS;
250 <<
"Couldn't retrieve raw pointer to interface container";
251 return StatusCode::FAILURE;
259 reinterpret_cast<
SG::AuxVectorBase* >( ptr );
263 if( proxy->isConst() ) {
264 interface->setConstStore( holder );
266 interface->setStore( holder );
273 return StatusCode::SUCCESS;
277 const std::string& name ) {
280 auto aux_clid_itr =
m_clids.find( name );
281 if( aux_clid_itr ==
m_clids.end() ) {
284 return StatusCode::FAILURE;
286 evtStore()->releaseObject( aux_clid_itr->second, name );
288 <<
" and name \"" << name <<
"\"" );
298 << name <<
"\" into xAOD::AuxInfoBase "
302 const std::string intName = name.substr( 0, name.size() - 4 );
306 auto clid_itr =
m_clids.find( intName );
307 if( clid_itr ==
m_clids.end() ) {
311 return StatusCode::SUCCESS;
313 intId = clid_itr->second;
320 <<
"\" not available" );
321 return StatusCode::SUCCESS;
328 <<
"Couldn't retrieve raw pointer to interface object";
329 return StatusCode::FAILURE;
337 reinterpret_cast<
SG::AuxElement* >( ptr );
341 if( proxy->isConst() ) {
342 interface->setConstStore( holder );
344 interface->setStore( holder );
351 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Base class for elements of a container that can have aux data.
Handle mappings between names and auxid_t.
Manage index tracking and synchronization of auxiliary data.
std::vector< size_t > vec
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
Helpers for checking error return status codes and reporting errors.
#define REPORT_ERROR(SC)
Report an error.
#define CHECK(...)
Evaluate an expression and check for errors.
uint32_t CLID
The Class ID type.
Interface for non-const operations on an auxiliary store.
Interface for const operations on an auxiliary store.
std::ostream & operator<<(std::ostream &lhs, const TestGaudiProperty &rhs)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
Base class for elements of a container that can have aux data.
Manage index tracking and synchronization of auxiliary data.
Interface for objects taking part in direct ROOT I/O.
@ AST_ObjectStore
The store describes a single object.
virtual AuxStoreType getStoreType() const =0
Return the type of the store object.
Interface for non-const operations on an auxiliary store.
bool m_cachesSet
Flag specifying whether the internal caches were set already.
StatusCode changeContainer(const SG::IAuxStore *store, const std::string &name)
Create a new container store.
AuxStoreWrapper(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
virtual StatusCode initialize()
Function initialising the algorithm.
std::map< std::string, CLID > m_clids
Keys and CLIDs of the interface containers touched.
std::vector< std::string > m_keys
StoreGate keys of the store objects to be wrapped.
virtual StatusCode execute()
Function executing the algorithm.
std::set< std::string > m_keysSet
Keys of the objects to be wrapped, in a set container.
std::set< std::string > m_toConvert
Keys of the auxiliary stores that need to be converted in the end.
StatusCode changeElement(const SG::IAuxStore *store, const std::string &name)
Create a new element store.
ServiceHandle< ::IClassIDSvc > m_clidSvc
Handle to the Class ID service.
Common base class for the auxiliary containers.
virtual void setStore(SG::IAuxStore *store) override
Set a different internal store object.
Common base class for auxiliary info objects.
virtual void setStore(SG::IAuxStore *store) override
Set a different internal store object.
DATA * DataProxy_cast(DataProxy *proxy)
cast the proxy into the concrete data object it proxies