2 #ifndef GAUDIROOT_ROOTDATACONNECTION_H
3 #define GAUDIROOT_ROOTDATACONNECTION_H
76 static long setCompression(
const std::string& compression);
78 static int compression();
102 enum { ROOT_READ_ERROR = 0x2,
103 ROOT_OPEN_ERROR = 0x4
140 typedef std::vector<std::pair<std::string,std::string> >
ParamMap;
187 const std::string& empty()
const;
215 TTree*
refs()
const {
return c->m_refs; }
221 const std::string&
name()
const {
return c->m_name; }
231 virtual TBranch* getBranch(
const std::string& section,
const std::string&
n) = 0;
240 virtual int loadRefs(
const std::string& section,
const std::string& cnt,
unsigned long entry,
RootObjectRefs& refs) = 0;
255 TFile*
file()
const {
return m_file; }
259 bool isWritable()
const {
return m_file != 0 && m_file->IsWritable(); }
271 size_t removeClient(
const IInterface* client);
273 bool lookupClient(
const IInterface* client)
const;
276 void badWriteError(
const std::string&
msg)
const;
279 std::pair<const RootRef*,const ContainerSection*> getMergeSection(
const std::string& container,
int entry)
const;
282 void enableStatistics(
const std::string& section);
284 void saveStatistics(
const std::string& statisticsFile);
287 int loadObj(
const std::string& section,
const std::string& cnt,
unsigned long entry,
DataObject*& pObj);
290 int loadRefs(
const std::string& section,
const std::string& cnt,
unsigned long entry,
RootObjectRefs& refs);
293 std::pair<int,unsigned long> saveObj(
const std::string& section,
const std::string& cnt, TClass* cl,
DataObject* pObj,
int buff_siz,
int split_lvl,
bool fill_missing=
false);
295 std::pair<int,unsigned long> save(
const std::string& section,
const std::string& cnt, TClass* cl,
void* pObj,
int buff_siz,
int split_lvl,
bool fill_missing=
false);
309 virtual long long int seek(
long long int,
int) {
return -1; }
312 TTree* getSection(
const std::string& sect,
bool create=
false);
315 TBranch*
getBranch(
const std::string& section,
const std::string& branch_name)
316 {
return m_tool->getBranch(section,branch_name); }
318 TBranch* getBranch(
const std::string& section,
const std::string& branch_name, TClass* cl,
void* ptr,
int buff_siz,
int split_lvl);
323 void makeRef(
const std::string& name,
long clid,
int tech,
const std::string& db,
const std::string& cnt,
int entry,
RootRef& ref);
326 int makeLink(
const std::string& p);
329 const std::string& getDb(
int which)
const;
333 {
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(); }
340 #endif // GAUDIROOT_ROOTDATACONNECTION_H
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.
virtual long long int seek(long long int, int)
Seek on the file described by ioDesc. Arguments as in ::seek()
std::vector< ContainerSection > ContainerSections
Definition of container sections to handle merged files.
TFile * file() const
Direct access to TFile structure.
TFile * m_file
Reference to ROOT file.
int refCount
Object refrfence count.
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 * m_incidentSvc
Reference to incident service.
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.
StringVec m_mergeFIDs
Map containing merge FIDs.
Persistent reference object.
virtual bool isConnected() const
Check if connected to data source.
int learnEntries
RootCnvSvc Property: ROOT cache learn entries.
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
TBranch * getBranch(const std::string §ion, const std::string &branch_name)
Access data branch by name: Get existing branch in read only mode.
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...
def which
Locates an executable in the executables path ($PATH) and returns the full path to it...
std::vector< RootRef > LinkSections
Link sections definition.
const std::string & getCont(int which) const
Access container name from saved index.
TTreePerfStats * m_statistics
I/O read statistics from TTree.
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.
ContainerSection & operator=(const ContainerSection &s)
Assignment operator to copy objects.
bool isWritable() const
Is the file writable?
virtual StatusCode read(void *const, size_t)
Read root byte buffer from input stream.
ABC describing basic data connection.
std::vector< std::pair< std::string, std::string > > ParamMap
Type definition for the parameter map.
IIncidentSvc * incidentSvc() const
Retrieve incident service.
LinkSections m_linkSects
Database link sections.
MsgStream & msgSvc() const
Allow access to printer service.
RootConnectionSetup * m_setup
Reference to the setup structure.
ContainerSection(const ContainerSection &s)
Copy constructor.
virtual StatusCode write(const void *, int)
Write root byte buffer to output stream.
std::map< std::string, ContainerSections > MergeSections
Definition of database section to handle merged files.
StringVec m_dbs
Map containing external database file names (fids)
This is a number of static methods for bootstrapping the Gaudi framework.
std::map< std::string, TTree * > Sections
Definition of tree sections.
std::string m_empty
Buffer for empty string reference.
A DataObject is the base class of any identifiable object on any data store.
MsgStream * m_msgSvc
Reference to message service.
Concrete implementation of the IDataConnection interface to access ROOT files.
TTree * m_refs
Pointer to the reference tree.
Internal helper class, which described a TBranch section in a ROOT file.
The interface implemented by the IncidentSvc service.