ATLAS Offline Software
Loading...
Searching...
No Matches
PoolCollectionConverter.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
9
11#include "PoolSvc/IPoolSvc.h"
13
14// Pool
18#include "StorageSvc/DbType.h"
19
20// Gaudi
21#include "GaudiKernel/StatusCode.h"
22
23#include <exception>
24#include <format>
25
26//______________________________________________________________________________
27PoolCollectionConverter::PoolCollectionConverter(const std::string& collectionType,
28 const std::string& inputCollection,
29 unsigned int contextId,
30 const IPoolSvc* svc) :
31 m_collectionType(collectionType),
32 m_inputCollection(inputCollection),
33 m_contextId(contextId),
34 m_poolSvc(svc),
35 m_poolCollection(nullptr) {
36}
37//______________________________________________________________________________
44//______________________________________________________________________________
46 // Check if already prefixed
47 if (!m_inputCollection.starts_with( "PFN:")
48 && !m_inputCollection.starts_with( "LFN:")
49 && !m_inputCollection.starts_with( "FID:")) {
50 // Prefix with PFN:
51 m_inputCollection = std::format("PFN:{}", m_inputCollection);
52 }
53 try {
54 if (m_collectionType == "RootCollection") {
56 }
57 if (m_poolCollection == nullptr) { // Open as ImplicitCollection if technologies fail, or none was specified
59 }
60 } catch (std::exception &e) {
61 if (m_poolCollection == nullptr) return StatusCode::RECOVERABLE;
62 }
63 return StatusCode::SUCCESS;
64}
65//______________________________________________________________________________
67 if (m_poolCollection == nullptr) {
68 return StatusCode::SUCCESS;
69 }
70 if (m_poolCollection->description().type() == pool::POOL_StorageType.type()) {
71 return m_poolSvc->disconnectDb(m_inputCollection);
72 }
73 return StatusCode::SUCCESS;
74}
75//______________________________________________________________________________
77 return m_poolCollection != nullptr ? StatusCode::SUCCESS : StatusCode::FAILURE;
78}
79//______________________________________________________________________________
This file contains the class definition for the IPoolSvc interface class.
This file contains the class definition for the PoolCollectionConverter class.
This file contains the class definition for the Token class (migrated from POOL).
This class provides the interface to the LCG POOL persistency software.
Definition IPoolSvc.h:36
StatusCode disconnectDb()
Disconnect Database.
pool::ICollection * m_poolCollection
StatusCode isValid() const
Check whether has valid pool::ICollection*.
PoolCollectionConverter(const std::string &collectionType, const std::string &inputCollection, unsigned int contextId, const IPoolSvc *svc)
Constructor.
std::unique_ptr< pool::ICollectionCursor > m_collectionCursor
pool::ICollectionCursor & selectAll()
virtual ~PoolCollectionConverter()
Destructor.
StatusCode initialize()
Required by all Gaudi Services.
An interface used to navigate the result of a query on a collection.
static const DbType ROOT_StorageType
Definition DbType.h:85
static const DbType POOL_StorageType
Definition DbType.h:84