1 #ifndef GAUDIROOT_ROOTDATACONNECTION_H 2 #define GAUDIROOT_ROOTDATACONNECTION_H 9 #include "boost/utility/string_ref.hpp" 17 #include "TTreePerfStats.h" 72 static StatusCode setCompression( boost::string_ref compression );
74 static int compression();
158 TTree* m_refs =
nullptr;
223 virtual ~
Tool() =
default;
225 virtual TBranch* getBranch( boost::string_ref section, boost::string_ref
n ) = 0;
234 virtual int loadRefs( boost::string_ref section, boost::string_ref cnt,
unsigned long entry,
252 bool isWritable()
const {
return m_file && m_file->IsWritable(); }
258 const StringVec&
mergeFIDs()
const {
return m_mergeFIDs; }
263 size_t removeClient(
const IInterface* client );
265 bool lookupClient(
const IInterface* client )
const;
268 void badWriteError( boost::string_ref
msg )
const;
274 void enableStatistics( boost::string_ref section );
276 void saveStatistics( boost::string_ref statisticsFile );
279 int loadObj( boost::string_ref section, boost::string_ref cnt,
unsigned long entry,
DataObject*& pObj );
282 int loadRefs( boost::string_ref section, boost::string_ref cnt,
unsigned long entry,
RootObjectRefs& refs );
286 DataObject* pObj,
int buff_siz,
int split_lvl,
bool fill_missing =
false );
289 int buff_siz,
int split_lvl,
bool fill_missing =
false );
302 long long int seek(
long long int,
int )
override {
return -1; }
305 TTree* getSection( boost::string_ref sect,
bool create =
false );
308 TBranch*
getBranch( boost::string_ref section, boost::string_ref branch_name )
310 return m_tool->getBranch( section, branch_name );
313 TBranch* getBranch( boost::string_ref section, boost::string_ref branch_name, TClass* cl,
void* ptr,
int buff_siz,
319 void makeRef( boost::string_ref
name,
long clid,
int tech, boost::string_ref db, boost::string_ref cnt,
int entry,
323 int makeLink( boost::string_ref p );
331 return ( which >= 0 ) && ( size_t( which ) < m_conts.
size() ) ? *( m_conts.
begin() +
which ) : empty();
337 return ( which >= 0 ) && ( size_t( which ) < m_links.
size() ) ? *( m_links.
begin() +
which ) : empty();
344 #endif // GAUDIROOT_ROOTDATACONNECTION_H constexpr static const auto FAILURE
MergeSections m_mergeSects
Database section map for merged files.
Definition of the MsgStream class used to transmit messages.
const MergeSections & mergeSections() const
Access merged data section inventory.
std::vector< ContainerSection > ContainerSections
Definition of container sections to handle merged files.
std::unique_ptr< Tool > m_tool
std::string m_name
Connection name/identifier.
IoType
I/O Connection types.
TFile * file() const
Direct access to TFile structure.
bool isConnected() const override
Check if connected to data source.
long long int seek(long long int, int) override
Seek on the file described by ioDesc. Arguments as in ::seek()
std::unique_ptr< TTreePerfStats > m_statistics
I/O read statistics from TTree.
std::map< std::string, ContainerSections, std::less<> > MergeSections
Definition of database section to handle merged files.
Clients m_clients
Client list.
int length
The length of the section.
int start
The start entry of the section.
std::set< const IInterface * > Clients
Client set.
#define STATUSCODE_ENUM_DECL(ENUM)
Declare an enum to be used as StatusCode value.
MsgStream & msgSvc() const
Retrieve message service.
const std::string & getLink(int which) const
Access link name from saved index.
std::vector< std::string > StringVec
Type definition for string maps.
int cacheSize
RootCnvSvc Property: Root data cache size.
Persistent reference object containing all leafs and links corresponding to a Gaudi DataObject...
StringVec m_links
Map containing internal links names.
ContainerSection()
Default constructor.
ParamMap m_params
Parameter map for file parameters.
std::string loadSection
RootCnvSvc Property: Root data cache size.
TYPE * get() const
Get interface pointer.
StringVec m_mergeFIDs
Map containing merge FIDs.
Persistent reference object.
StatusCode write(const void *, int) override
Write root byte buffer to output stream.
int learnEntries
RootCnvSvc Property: ROOT cache learn entries.
This class is used for returning status codes from appropriate routines.
std::unique_ptr< MsgStream > m_msgSvc
Reference to message service.
Definition of the basic interface.
std::vector< std::pair< std::string, std::string > > ParamMap
Type definition for the parameter map.
StringVec m_conts
Map containing external container names.
Sections m_sections
Tree sections in TFile.
StringVec cacheBranches
Vector of strings with branches to be cached for input files.
std::vector< std::string > StringVec
Type definition for string maps.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
std::vector< RootRef > LinkSections
Link sections definition.
const std::string & getCont(int which) const
Access container name from saved index.
Tool * tool() const
Access tool.
ContainerSection(int s, int l)
Initializing constructor.
StringVec vetoBranches
Vector of strings with branches to NOT be cached for input files.
const StringVec & mergeFIDs() const
Access merged FIDs.
TBranch * getBranch(boost::string_ref section, boost::string_ref branch_name)
Access data branch by name: Get existing branch in read only mode.
ContainerSection & operator=(const ContainerSection &s)
Assignment operator to copy objects.
bool isWritable() const
Is the file writable?
ABC describing basic data connection.
IIncidentSvc * incidentSvc() const
Retrieve incident service.
std::shared_ptr< RootConnectionSetup > m_setup
Reference to the setup structure.
LinkSections m_linkSects
Database link sections.
MsgStream & msgSvc() const
Allow access to printer service.
ContainerSection(const ContainerSection &s)
Copy constructor.
std::map< std::string, TTree *, std::less<> > Sections
Definition of tree sections.
std::unique_ptr< TFile > m_file
Reference to ROOT file.
StringVec m_dbs
Map containing external database file names (fids)
std::string m_empty
Buffer for empty string reference.
A DataObject is the base class of any identifiable object on any data store.
Concrete implementation of the IDataConnection interface to access ROOT files.
TTree * m_refs
Pointer to the reference tree.
StatusCode read(void *const, size_t) override
Read root byte buffer from input stream.
Helper functions to set/get the application return code.
Internal helper class, which described a TBranch section in a ROOT file.
The interface implemented by the IncidentSvc service.
unsigned long code_t
type of StatusCode value