1 #ifndef GAUDIROOT_ROOTDATACONNECTION_H 2 #define GAUDIROOT_ROOTDATACONNECTION_H 12 #include <string_view> 17 #include "TTreePerfStats.h" 70 static StatusCode setCompression( std::string_view compression );
72 static int compression();
154 TTree* m_refs =
nullptr;
206 TTree*
refs()
const {
return c->m_refs; }
218 virtual ~
Tool() =
default;
220 virtual TBranch* getBranch( std::string_view section, std::string_view
n ) = 0;
229 virtual int loadRefs( std::string_view section, std::string_view cnt,
unsigned long entry,
247 bool isWritable()
const {
return m_file && m_file->IsWritable(); }
258 size_t removeClient(
const IInterface* client );
260 bool lookupClient(
const IInterface* client )
const;
263 void badWriteError( std::string_view
msg )
const;
269 void enableStatistics( std::string_view section );
271 void saveStatistics( std::string_view statisticsFile );
274 int loadObj( std::string_view section, std::string_view cnt,
unsigned long entry,
DataObject*& pObj );
277 int loadRefs( std::string_view section, std::string_view cnt,
unsigned long entry,
RootObjectRefs& refs );
281 int buff_siz,
int split_lvl,
bool fill_missing =
false );
284 int buff_siz,
int split_lvl,
bool fill_missing =
false );
289 StatusCode connectWrite( IoType typ )
override;
297 long long int seek(
long long int,
int )
override {
return -1; }
300 TTree* getSection( std::string_view sect,
bool create =
false );
303 TBranch*
getBranch( std::string_view section, std::string_view branch_name ) {
304 return m_tool->getBranch( section, branch_name );
307 TBranch* getBranch( std::string_view section, std::string_view branch_name, TClass* cl,
void* ptr,
int buff_siz,
313 void makeRef( std::string_view
name,
long clid,
int tech, std::string_view db, std::string_view cnt,
int entry,
317 int makeLink( std::string_view p );
336 #endif // GAUDIROOT_ROOTDATACONNECTION_H MergeSections m_mergeSects
Database section map for merged files.
Definition of the MsgStream class used to transmit messages.
TBranch * getBranch(std::string_view section, std::string_view branch_name)
Access data branch by name: Get existing branch in read only mode.
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
Tool * tool() const
Access tool.
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.
IIncidentSvc * incidentSvc() const
Retrieve incident service.
std::vector< std::string > StringVec
Type definition for string maps.
const StringVec & mergeFIDs() const
Access merged FIDs.
int cacheSize
RootCnvSvc Property: Root data cache size.
TYPE * get() const
Get interface pointer.
Persistent reference object containing all leafs and links corresponding to a Gaudi DataObject.
StringVec m_links
Map containing internal links names.
bool isConnected() const override
Check if connected to data source.
MsgStream & msgSvc() const
Allow access to printer service.
ContainerSection()
Default constructor.
ParamMap m_params
Parameter map for file parameters.
std::string loadSection
RootCnvSvc Property: Root data cache size.
StringVec m_mergeFIDs
Map containing merge FIDs.
Persistent reference object.
StatusCode write(const void *, int) override
Write root byte buffer to output stream.
#define STATUSCODE_ENUM_DECL(ENUM)
Declare an enum to be used as StatusCode value.
const std::string & getCont(int which) const
Access container name from saved index.
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.
const std::string & getLink(int which) const
Access link name from saved index.
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.
ContainerSection(int s, int l)
Initializing constructor.
StringVec vetoBranches
Vector of strings with branches to NOT be cached for input files.
MsgStream & msgSvc() const
Retrieve message service.
ContainerSection & operator=(const ContainerSection &s)
Assignment operator to copy objects.
ABC describing basic data connection.
std::shared_ptr< RootConnectionSetup > m_setup
Reference to the setup structure.
LinkSections m_linkSects
Database link sections.
constexpr static const auto FAILURE
ContainerSection(const ContainerSection &s)
Copy constructor.
std::map< std::string, TTree *, std::less<> > Sections
Definition of tree sections.
TFile * file() const
Direct access to TFile structure.
std::unique_ptr< TFile > m_file
Reference to ROOT file.
bool isWritable() const
Is the file writable?
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.
StatusCode read(void *const, size_t) override
Read root byte buffer from input stream.
Header file for std:chrono::duration-based Counters.
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