Go to the documentation of this file.
22 #include <string_view>
27 #include <TTreePerfStats.h>
74 int learnEntries{ 0 };
77 "configure output files to be more reproducible" };
80 "ROOT630ForwardCompatibility",
false,
81 "When opening a file for CREATE or RECREATE, enable ROOT 6.30 forward compatibility "
82 "(i.e. write a file that is readable with ROOT 6.24). Requires ROOT >= 6.30.06, see "
83 "<https://github.com/root-project/root/issues/14793>." };
89 static StatusCode setCompression( std::string_view compression );
91 static int compression();
174 TTree* m_refs =
nullptr;
226 TTree*
refs()
const {
return c->m_refs; }
241 virtual TBranch*
getBranch( std::string_view section, std::string_view
n ) = 0;
250 virtual int loadRefs( std::string_view section, std::string_view cnt,
unsigned long entry,
268 bool isWritable()
const {
return m_file && m_file->IsWritable(); }
279 size_t removeClient(
const IInterface* client );
281 bool lookupClient(
const IInterface* client )
const;
284 void badWriteError( std::string_view
msg )
const;
290 void enableStatistics( std::string_view section );
292 void saveStatistics( std::string_view statisticsFile );
295 int loadObj( std::string_view section, std::string_view cnt,
unsigned long entry,
DataObject*& pObj );
298 int loadRefs( std::string_view section, std::string_view cnt,
unsigned long entry,
RootObjectRefs& refs );
302 int minBufferSize,
int maxBufferSize,
int approxEventsPerBasket,
303 int split_lvl,
bool fill_missing =
false );
306 int minBufferSize,
int maxBufferSize,
int approxEventsPerBasket,
int split_lvl,
307 bool fill_missing =
false );
312 StatusCode connectWrite( IoType typ )
override;
320 long long int seek(
long long int,
int )
override {
return -1; }
323 TTree* getSection( std::string_view sect,
bool create =
false );
326 TBranch*
getBranch( std::string_view section, std::string_view branch_name ) {
327 return m_tool->getBranch( section, branch_name );
330 TBranch* getBranch( std::string_view section, std::string_view branch_name, TClass* cl,
void* ptr,
int buff_siz,
336 void makeRef( std::string_view
name,
long clid,
int tech, std::string_view db, std::string_view cnt,
int entry,
340 int makeLink( std::string_view p );
ContainerSection()
Default constructor.
const StringVec & mergeFIDs() const
Access merged FIDs.
bool isConnected() const override
Check if connected to data source.
int length
The length of the section.
Clients m_clients
Client list.
StringVec cacheBranches
Vector of strings with branches to be cached for input files.
std::map< std::string, TTree *, std::less<> > Sections
Definition of tree sections.
const std::string & getLink(int which) const
Access link name from saved index.
StatusCode read(void *const, size_t) override
Read root byte buffer from input stream.
std::unique_ptr< TFile > m_file
Reference to ROOT file.
bool isWritable() const
Is the file writable?
Tool * tool() const
Access tool.
ParamMap m_params
Parameter map for file parameters.
ContainerSection & operator=(const ContainerSection &s)
Assignment operator to copy objects.
unsigned long code_t
type of StatusCode value
MsgStream & msgSvc() const
Retrieve message service.
StringVec m_dbs
Map containing external database file names (fids)
StatusCode saveRefs()
Internal helper to save/update reference tables.
std::vector< std::string > StringVec
Type definition for string maps.
std::vector< std::pair< std::string, std::string > > ParamMap
Type definition for the parameter map.
LinkSections m_linkSects
Database link sections.
std::vector< ContainerSection > ContainerSections
Definition of container sections to handle merged files.
StringVec m_mergeFIDs
Map containing merge FIDs.
std::shared_ptr< RootConnectionSetup > m_setup
Reference to the setup structure.
MergeSections m_mergeSects
Database section map for merged files.
const std::string & getCont(int which) const
Access container name from saved index.
std::vector< RootRef > LinkSections
Link sections definition.
std::unique_ptr< MsgStream > m_msgSvc
Reference to message service.
std::unique_ptr< TTreePerfStats > m_statistics
I/O read statistics from TTree.
int start
The start entry of the section.
StatusCode write(const void *, int) override
Write root byte buffer to output stream.
TFile * file() const
Direct access to TFile structure.
std::unique_ptr< Tool > m_tool
StringVec m_conts
Map containing external container names.
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
IIncidentSvc * incidentSvc() const
long long int seek(long long int, int) override
Seek on the file described by ioDesc. Arguments as in ::seek()
#define STATUSCODE_ENUM_DECL(ENUM)
Declare an enum to be used as StatusCode value.
TYPE * get() const
Get interface pointer.
ContainerSection(const ContainerSection &s)
Copy constructor.
RootConnectionSetup()=default
Standard constructor.
const MergeSections & mergeSections() const
Access merged data section inventory.
StringVec m_links
Map containing internal links names.
std::vector< std::string > StringVec
Type definition for string maps.
std::map< std::string, ContainerSections, std::less<> > MergeSections
Definition of database section to handle merged files.
constexpr static const auto FAILURE
IIncidentSvc * incidentSvc() const
Retrieve incident service.
std::string loadSection
RootCnvSvc Property: Root data cache size.
ContainerSection(int s, int l)
Initializing constructor.
Sections m_sections
Tree sections in TFile.
TBranch * getBranch(std::string_view section, std::string_view branch_name)
Access data branch by name: Get existing branch in read only mode.
std::set< const IInterface * > Clients
Client set.
MsgStream & msgSvc() const
Allow access to printer service.
StringVec vetoBranches
Vector of strings with branches to NOT be cached for input files.
std::string m_empty
Buffer for empty string reference.