ATLAS Offline Software
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
pool::RootCollection::RootCollection Class Reference

Collection (and CollectionProxy) implementation based on ROOT trees. More...

#include <RootCollection.h>

Inheritance diagram for pool::RootCollection::RootCollection:
Collaboration diagram for pool::RootCollection::RootCollection:

Public Types

typedef Gaudi::PluginService::Factory< ICollection *(const ICollectionDescription *, ICollection::OpenMode, ISession *)> Factory
 
enum  OpenMode { CREATE, CREATE_AND_OVERWRITE, UPDATE, READ }
 Enumeration of the possible open modes of the collection. More...
 

Public Member Functions

 RootCollection (const pool::ICollectionDescription *description, pool::ICollection::OpenMode mode, pool::ISession *)
 Constructor. More...
 
 ~RootCollection ()
 Destructor. More...
 
virtual ICollection::OpenMode openMode () const
 Return openMode. More...
 
virtual void open ()
 Explicitly re-opens the collection after it has been closed. More...
 
virtual bool isOpen () const
 Checks if the collection is open. More...
 
virtual void commit (bool restartTransaction=false)
 Commits the last changes made to the collection. More...
 
virtual void close ()
 Explicitly closes the collection. More...
 
virtual const ICollectionDescriptiondescription () const
 Returns an object used to describe the collection properties. More...
 
virtual ICollectionSchemaEditorschemaEditor ()
 Returns an object used to modify the collection schema. More...
 
virtual ICollectionDataEditordataEditor ()
 Returns an object used to add, update or delete rows of the collection. More...
 
virtual ICollectionQuerynewQuery ()
 Returns an object used to query the collection. More...
 

Static Public Attributes

static const unsigned int c_maxLengthOfStrings = 5000
 
static const char *const poolOptToRootOpt []
 
static const Io::IoFlags poolOptToFileMgrOpt []
 
static const char *const c_tokenBranchName
 
static const char *const c_attributeListLayoutName
 

Private Member Functions

 RootCollection (const RootCollection &)
 copying unimplemented in this class. More...
 
RootCollectionoperator= (const RootCollection &)
 copying unimplemented in this class. More...
 
void delayedFileOpen (const std::string &method)
 
TTree * getCollectionTree ()
 
void setupTree () const
 
void readAttributeListSpecification () const
 
void writeAttributeListSpecification ()
 
bool fileCatalogRequired () const
 
std::string retrievePFN () const
 
std::string retrieveFID ()
 
std::string retrieveUniquePFN (const FileCatalog::FileID &fid)
 
std::string retrieveBestPFN (const FileCatalog::FileID &fid) const
 
void retrieveFileCatalog () const
 
void cleanup ()
 

Private Attributes

CollectionDescription m_description
 
std::string m_name
 
std::string m_fileName
 
ICollection::OpenMode m_mode
 
TTree * m_tree
 
TFile * m_file
 
ISessionm_session
 
bool m_open
 
bool m_readOnly
 
std::unique_ptr< pool::IFileCatalogm_fileCatalog
 
coral::MessageStream m_poolOut
 
RootCollectionSchemaEditorm_schemaEditor
 
RootCollectionDataEditorm_dataEditor
 
IFileMgr * m_fileMgr
 

Detailed Description

Collection (and CollectionProxy) implementation based on ROOT trees.

Implementation details:

ROOT documentation can be found at http://root.cern.ch/

Definition at line 69 of file RootCollection.h.

Member Typedef Documentation

◆ Factory

Definition at line 72 of file RootCollection.h.

Member Enumeration Documentation

◆ OpenMode

Enumeration of the possible open modes of the collection.

Enumerator
CREATE 
CREATE_AND_OVERWRITE 
UPDATE 
READ 

Definition at line 27 of file ICollection.h.

Constructor & Destructor Documentation

◆ RootCollection() [1/2]

pool::RootCollection::RootCollection::RootCollection ( const pool::ICollectionDescription description,
pool::ICollection::OpenMode  mode,
pool::ISession  
)

Constructor.

Parameters
sessionIf you want to access the referenced objects you have to provide an ISession
connectionThe location of the collection file is uniquely defined by the parameters name and connection
nameThe location of the collection file is uniquely defined by the parameters name and connection
modeThe open mode of the collection
  • Without use of FileCatalog:
    • The path to the collection file is simply created by the following concatenation:
      connection+name+".root"
    • name: Name of the collection file
    • connection:
      • It can be a relative or absolute path
      • In case of an empty connection string it is assumed that the file is located in the current directory
      • Remote access via rootd: e.g. "root://pcepsft02.cern.ch:9090//localdisk/
        Further documentation can be found in the class description of TNetFile (http://root.cern.ch/root/html/TNetFile.html)
  • Utilization of FileCatalog:
    • This mode is triggered if the name parameter starts with one of the following prefixes "PFN:", "FID:" or "LFN:".
    • According to the prefix the name is interpreted as Physical File Name, unique File ID or Logical File Name
    • The connection string is interpreted as URI of the FileCatalog. The collection retrieves the FileCatalog defined by the given URI from FileCatalogMap. A default file catalog (empty connection string) can be defined there.
    • This mode works also in the context of MultiCollection. If a collection created by a MultiCollection iterator is a RootCollection using FileCatalog, it will use the same catalog as its multi collection parent. On the other side the connection string defining the FileCatalog of a RootCollection is ignored when a RootCollection using FileCatalogs is added to a MultiCollection

◆ ~RootCollection()

pool::RootCollection::RootCollection::~RootCollection ( )

Destructor.

◆ RootCollection() [2/2]

pool::RootCollection::RootCollection::RootCollection ( const RootCollection )
private

copying unimplemented in this class.

Member Function Documentation

◆ cleanup()

void pool::RootCollection::RootCollection::cleanup ( )
private

◆ close()

virtual void pool::RootCollection::RootCollection::close ( )
virtual

Explicitly closes the collection.

Implements pool::ICollection.

◆ commit()

virtual void pool::RootCollection::RootCollection::commit ( bool  restartTransaction = false)
virtual

Commits the last changes made to the collection.

Implements pool::ICollection.

◆ dataEditor()

virtual ICollectionDataEditor& pool::RootCollection::RootCollection::dataEditor ( )
virtual

Returns an object used to add, update or delete rows of the collection.

Implements pool::ICollection.

◆ delayedFileOpen()

void pool::RootCollection::RootCollection::delayedFileOpen ( const std::string &  method)
private

◆ description()

virtual const ICollectionDescription& pool::RootCollection::RootCollection::description ( ) const
virtual

Returns an object used to describe the collection properties.

Implements pool::ICollection.

◆ fileCatalogRequired()

bool pool::RootCollection::RootCollection::fileCatalogRequired ( ) const
private

◆ getCollectionTree()

TTree* pool::RootCollection::RootCollection::getCollectionTree ( )
private

◆ isOpen()

virtual bool pool::RootCollection::RootCollection::isOpen ( ) const
virtual

Checks if the collection is open.

Implements pool::ICollection.

◆ newQuery()

virtual ICollectionQuery* pool::RootCollection::RootCollection::newQuery ( )
virtual

Returns an object used to query the collection.

Implements pool::ICollection.

◆ open()

virtual void pool::RootCollection::RootCollection::open ( )
virtual

Explicitly re-opens the collection after it has been closed.

Implements pool::ICollection.

◆ openMode()

virtual ICollection::OpenMode pool::RootCollection::RootCollection::openMode ( ) const
virtual

Return openMode.

Implements pool::ICollection.

◆ operator=()

RootCollection& pool::RootCollection::RootCollection::operator= ( const RootCollection )
private

copying unimplemented in this class.

◆ readAttributeListSpecification()

void pool::RootCollection::RootCollection::readAttributeListSpecification ( ) const
private

◆ retrieveBestPFN()

std::string pool::RootCollection::RootCollection::retrieveBestPFN ( const FileCatalog::FileID fid) const
private

◆ retrieveFID()

std::string pool::RootCollection::RootCollection::retrieveFID ( )
private

◆ retrieveFileCatalog()

void pool::RootCollection::RootCollection::retrieveFileCatalog ( ) const
private

◆ retrievePFN()

std::string pool::RootCollection::RootCollection::retrievePFN ( ) const
private

◆ retrieveUniquePFN()

std::string pool::RootCollection::RootCollection::retrieveUniquePFN ( const FileCatalog::FileID fid)
private

◆ schemaEditor()

virtual ICollectionSchemaEditor& pool::RootCollection::RootCollection::schemaEditor ( )
virtual

Returns an object used to modify the collection schema.

Implements pool::ICollection.

◆ setupTree()

void pool::RootCollection::RootCollection::setupTree ( ) const
private

◆ writeAttributeListSpecification()

void pool::RootCollection::RootCollection::writeAttributeListSpecification ( )
private

Member Data Documentation

◆ c_attributeListLayoutName

const char* const pool::RootCollection::RootCollection::c_attributeListLayoutName
static

Definition at line 173 of file RootCollection.h.

◆ c_maxLengthOfStrings

const unsigned int pool::RootCollection::RootCollection::c_maxLengthOfStrings = 5000
static

Definition at line 169 of file RootCollection.h.

◆ c_tokenBranchName

const char* const pool::RootCollection::RootCollection::c_tokenBranchName
static

Definition at line 172 of file RootCollection.h.

◆ m_dataEditor

RootCollectionDataEditor* pool::RootCollection::RootCollection::m_dataEditor
private

Definition at line 192 of file RootCollection.h.

◆ m_description

CollectionDescription pool::RootCollection::RootCollection::m_description
private

Definition at line 177 of file RootCollection.h.

◆ m_file

TFile* pool::RootCollection::RootCollection::m_file
private

Definition at line 183 of file RootCollection.h.

◆ m_fileCatalog

std::unique_ptr<pool::IFileCatalog> pool::RootCollection::RootCollection::m_fileCatalog
private

Definition at line 188 of file RootCollection.h.

◆ m_fileMgr

IFileMgr* pool::RootCollection::RootCollection::m_fileMgr
private

Definition at line 194 of file RootCollection.h.

◆ m_fileName

std::string pool::RootCollection::RootCollection::m_fileName
private

Definition at line 180 of file RootCollection.h.

◆ m_mode

ICollection::OpenMode pool::RootCollection::RootCollection::m_mode
private

Definition at line 181 of file RootCollection.h.

◆ m_name

std::string pool::RootCollection::RootCollection::m_name
private

Definition at line 179 of file RootCollection.h.

◆ m_open

bool pool::RootCollection::RootCollection::m_open
private

Definition at line 185 of file RootCollection.h.

◆ m_poolOut

coral::MessageStream pool::RootCollection::RootCollection::m_poolOut
private

Definition at line 189 of file RootCollection.h.

◆ m_readOnly

bool pool::RootCollection::RootCollection::m_readOnly
private

Definition at line 186 of file RootCollection.h.

◆ m_schemaEditor

RootCollectionSchemaEditor* pool::RootCollection::RootCollection::m_schemaEditor
private

Definition at line 191 of file RootCollection.h.

◆ m_session

ISession* pool::RootCollection::RootCollection::m_session
private

Definition at line 184 of file RootCollection.h.

◆ m_tree

TTree* pool::RootCollection::RootCollection::m_tree
private

Definition at line 182 of file RootCollection.h.

◆ poolOptToFileMgrOpt

const Io::IoFlags pool::RootCollection::RootCollection::poolOptToFileMgrOpt[]
static

Definition at line 171 of file RootCollection.h.

◆ poolOptToRootOpt

const char* const pool::RootCollection::RootCollection::poolOptToRootOpt[]
static

Definition at line 170 of file RootCollection.h.


The documentation for this class was generated from the following file:
pool::ICollection::CREATE
@ CREATE
Definition: ICollection.h:27
pool::ICollection::OpenMode
OpenMode
Enumeration of the possible open modes of the collection.
Definition: ICollection.h:27
pool::ICollection::CREATE_AND_OVERWRITE
@ CREATE_AND_OVERWRITE
Definition: ICollection.h:27
pool::ICollection::READ
@ READ
Definition: ICollection.h:27
pool::ICollection::UPDATE
@ UPDATE
Definition: ICollection.h:27