86 , fEntryOffsetLen(1000)
96 , fFirstBasketEntry(-1)
97 , fNextBasketEntry(-1)
105 , fBaskets(fMaxBaskets)
116 , fTransientBuffer(0)
119 , fReadLeaves(&
TBranch::ReadLeavesImpl)
120 , fFillLeaves(&
TBranch::FillLeavesImpl)
188 ,
fBasketSize((basketsize < 100) ? 100 : basketsize)
226 Init(name,leaflist,compress);
240 ,
fBasketSize((basketsize < 100) ? 100 : basketsize)
278 Init(name,leaflist,compress);
307 char* nameBegin =
const_cast<char*
>(leaflist);
309 auto len = strlen(leaflist);
311 char* leafname =
new char[len + 1];
312 char* leaftype =
new char[320];
314 strlcpy(leaftype,
"F",320);
315 char* pos =
const_cast<char*
>(leaflist);
316 const char* leaflistEnd = leaflist + len;
317 for (; pos <= leaflistEnd; ++pos) {
319 if ((*pos ==
':') || (*pos == 0)) {
321 Int_t lenName = pos - nameBegin;
324 strncpy(leafname, nameBegin, lenName);
325 leafname[lenName] = 0;
326 ctype = strstr(leafname,
"/");
329 strlcpy(leaftype, ctype + 1,320);
332 if (lenName == 0 || ctype == leafname) {
333 Warning(
"TBranch",
"No name was given to the leaf number '%d' in the leaflist of the branch '%s'.",
fNleaves,name);
337 if (leaftype[1] ==
'[') {
338 Warning(
"TBranch",
"Array size for branch '%s' must be specified after leaf name, not after the type name!", name);
340 }
else if (leaftype[1]) {
341 Warning(
"TBranch",
"Extra characters after type tag '%s' for branch '%s'; must be one character.", leaftype, name);
344 if (*leaftype ==
'C') {
345 leaf =
new TLeafC(
this, leafname, leaftype);
346 }
else if (*leaftype ==
'O') {
347 leaf =
new TLeafO(
this, leafname, leaftype);
348 }
else if (*leaftype ==
'B') {
349 leaf =
new TLeafB(
this, leafname, leaftype);
350 }
else if (*leaftype ==
'b') {
351 leaf =
new TLeafB(
this, leafname, leaftype);
353 }
else if (*leaftype ==
'S') {
354 leaf =
new TLeafS(
this, leafname, leaftype);
355 }
else if (*leaftype ==
's') {
356 leaf =
new TLeafS(
this, leafname, leaftype);
358 }
else if (*leaftype ==
'I') {
359 leaf =
new TLeafI(
this, leafname, leaftype);
360 }
else if (*leaftype ==
'i') {
361 leaf =
new TLeafI(
this, leafname, leaftype);
363 }
else if (*leaftype ==
'F') {
364 leaf =
new TLeafF(
this, leafname, leaftype);
365 }
else if (*leaftype ==
'f') {
366 leaf =
new TLeafF(
this, leafname, leaftype);
367 }
else if (*leaftype ==
'L') {
368 leaf =
new TLeafL(
this, leafname, leaftype);
369 }
else if (*leaftype ==
'l') {
370 leaf =
new TLeafL(
this, leafname, leaftype);
372 }
else if (*leaftype ==
'D') {
373 leaf =
new TLeafD(
this, leafname, leaftype);
374 }
else if (*leaftype ==
'd') {
375 leaf =
new TLeafD(
this, leafname, leaftype);
378 Error(
"TLeaf",
"Illegal data type for %s/%s", name, leaflist);
387 Error(
"TBranch",
"Illegal leaf: %s/%s", name, leaflist);
451 if (lst && lst->
GetLast()!=-1) {
533 Warning(
"AddBasket",
"The assumption that out-of-order basket only comes from disk based ntuple is false.");
544 Error(
"AddBasket",
"An out-of-order basket matches the entry number of an existing basket.");
594 Fatal(
"AddBasket",
"The last basket must have the highest entry number (%s/%lld/%d).",
GetName(),startEntry,
fWriteBasket);
647 auto endCluster = cluster.GetNextEntry();
704 for (
Int_t j = 0; j < nb; j++) {
722 if (options && options[0]) {
733 for (
Int_t i=0;i<nbaskets;i++) {
735 if (!basket)
continue;
755 for (
Int_t j = 0; j < nb; j++) {
757 if (!branch)
continue;
827 if (!basket)
return 0;
859 nbytes = lnew - lold;
865 nsize = nevbuf *
sizeof(
Int_t);
881 if (nout < 0)
Error(
"TBranch::Fill",
"Failed to write out basket.\n");
882 return (nout >= 0) ? nbytes : -1;
893 Int_t objectStart = 0;
933 if (tag & kByteCountMask) {
936 if (tag == kNewClassTag) {
938 char*
s =
new char[maxsize];
941 while (strlen(s) == (maxsize - 1)) {
946 s =
new char[maxsize];
960 if (startpos >
UInt_t(objectStart)) {
980 nbytes = lnew - lold;
995 if (longnm[longnm.length()-1]==
']') {
996 std::size_t dim = longnm.find_first_of(
"[");
997 if (dim != std::string::npos) {
1001 if (longnm[longnm.length()-1] !=
'.') {
1005 UInt_t namelen = strlen(name);
1009 for(
Int_t i = 0; i < nbranches; ++i) {
1012 const char *brname = branch->
fName.
Data();
1014 if (brname[brlen-1]==
']') {
1015 const char *dim = strchr(brname,
'[');
1017 brlen = dim - brname;
1020 if (namelen == brlen
1021 && strncmp(name,brname,brlen) == 0) {
1024 if (brlen == (
size_t)longnm.length()
1025 && strncmp(longnm.c_str(),brname,brlen) == 0) {
1045 while ((leaf = (
TLeaf*) next())) {
1048 if (dim >= 0) leafname.
Remove(dim);
1050 if (leafname == searchname)
return leaf;
1054 dim = leaftitle.
First(
'[');
1055 if (dim >= 0) leaftitle.
Remove(dim);
1057 if (leaftitle == searchname)
return leaf;
1062 dim = longname.
First(
'[');
1063 if (dim>=0) longname.
Remove(dim);
1064 if (longname == searchname)
return leaf;
1067 longname.
Form(
"%s.%s",branch->
GetName(),searchname);
1068 if (longname==leafname)
return leaf;
1071 dim = longtitle.
First(
'[');
1072 if (dim>=0) longtitle.
Remove(dim);
1073 if (longtitle == searchname)
return leaf;
1080 if (strstr(searchname,
".") && !strcmp(searchname, branch->
GetName()))
return leaf;
1101 for(
Int_t i=0; i != maxbasket; ++i) {
1112 for (
Int_t i = 0; i < len; ++i) {
1183 static std::atomic<Int_t> nerrors(0);
1186 if (basketnumber <0 || basketnumber >
fWriteBasket)
return 0;
1188 if (basket)
return basket;
1189 if (basketnumber == fWriteBasket)
return 0;
1222 if (nerrors > 10)
return 0;
1223 if (nerrors == 10) {
1224 printf(
" file probably overwritten: stopping reporting error messages\n");
1226 printf(
"===>File is more than 2 Gigabytes\n");
1230 printf(
"===>Your file is may be bigger than the maximum file size allowed on your system\n");
1231 printf(
" Check your AFS maximum file size limit for example\n");
1235 Error(
"GetBasket",
"File: %s at byte:%lld, branch:%s, entry:%lld, badread=%d, nerrors=%d, basketnumber=%d",file->
GetName(),basket->
GetSeekKey(),
GetName(),
fReadEntry,badread,nerrors.load(),basketnumber);
1244 perfStats->
SetUsed(
this, basketnumber);
1255 if (basketnumber <0 || basketnumber >
fWriteBasket)
return 0;
1286 return "TBranchElement-folder";
1288 return "TBranchElement-leaf";
1333 if ((entry < first) || (entry > last)) {
1337 Error(
"In the branch %s, no basket contains the entry %d\n",
GetName(), entry);
1360 clusterIterator.
Next();
1375 if (!file)
return -1;
1389 bufbegin = entryOffset[entry-first];
1402 return buf->
Length() - bufbegin;
1425 if ((entry < first) || (entry > last)) {
1429 Error(
"In the branch %s, no basket contains the entry %d\n",
GetName(), entry);
1460 bufbegin = entryOffset[entry-first];
1472 nbytes = buf->
Length() - bufbegin;
1491 Error(
"GetExpectedType",
"Did not find any leaves in %s",
GetName());
1523 if (mode) file =
TFile::Open(bFileName,
"recreate");
1526 if (!file)
return 0;
1527 if (file->
IsZombie()) {
delete file;
return 0;}
1539 if (
GetTree()->MemoryFull(0)) {
1605 while (
fBasketEntry[basketToUnload] != entryToUnload) {
1607 if (basketToUnload < 0) {
1677 bFileName = arc.
GetUrl();
1724 for (
Int_t i = 0; i <
n; ++i) {
1742 if (
this == child) {
1752 for (
Int_t i = 0; i < len; ++i) {
1757 if (branch == child) {
1785 const_cast<TBranch *
>(
this)->TBranch::Streamer(b);
1789 return totbytes + b.
Length();
1799 if (!option)
return totbytes;
1800 if (option[0] !=
'*')
return totbytes;
1803 for (
Int_t i = 0; i < len; ++i) {
1817 if (!option)
return zipbytes;
1818 if (option[0] !=
'*')
return zipbytes;
1821 for (
Int_t i = 0; i < len; ++i) {
1853 return browsables && browsables->
GetSize();
1868 for (
Int_t i = 0; i < nb; ++i) {
1887 Int_t nimported = 0;
1890 if (!file)
return 0;
1892 for (
Int_t i=0;i<nbaskets;i++) {
1894 if (basket)
continue;
1901 Error(
"Loadbaskets",
"Error while reading basket buffer %d of branch %s",i,
GetName());
1919 const int kLINEND = 77;
1923 if ( titleContent ==
GetName() ) {
1924 titleContent.
Clear();
1928 if (titleContent.
Length()>=2 && titleContent[titleContent.
Length()-2]==
'/' && isalpha(titleContent[titleContent.
Length()-1])) {
1932 if (titleContent.
Length()) {
1942 aLength += (aLength / 54 + 1) * 80 + 100;
1943 if (aLength < 200) aLength = 200;
1944 char *bline =
new char[aLength];
1950 if (strlen(bline) >
UInt_t(kLINEND)) {
1951 char *tmp =
new char[strlen(bline)+1];
1952 if (titleLength) strlcpy(tmp, titleContent.
Data(),strlen(bline)+1);
1954 int pos = strlen (bline);
1957 while (beg < titleLength) {
1958 for (end=beg+1; end < titleLength-1; end ++)
1959 if (tmp[end] ==
':')
break;
1960 if (npos + end-beg+1 >= 78) {
1961 while (npos < kLINEND) {
1962 bline[pos ++] =
' ';
1965 bline[pos ++] =
'*';
1966 bline[pos ++] =
'\n';
1967 bline[pos ++] =
'*';
1969 for (; npos < 12; npos ++)
1970 bline[pos ++] =
' ';
1973 for (
int n = beg;
n <= end;
n ++)
1974 bline[pos+
n-beg] = tmp[
n];
1979 while (npos < kLINEND) {
1980 bline[pos ++] =
' ';
1983 bline[pos ++] =
'*';
1996 Printf(
"*Entries :%9lld : Total Size=%11lld bytes All baskets in memory *",
fEntries,totBytes);
1998 Printf(
"*Entries :%9lld : Total Size=%11lld bytes One basket in memory *",
fEntries,totBytes);
2004 if (strncmp(option,
"basketsInfo",strlen(
"basketsInfo"))==0) {
2006 for (
Int_t i=0;i<nbaskets;i++) {
2007 Printf(
"*Basket #%4d entry=%6lld pos=%6lld size=%5d",
2012 Printf(
"*............................................................................*");
2217 reusebasket->
Reset();
2240 for (
Int_t i = 0; i < nbranches; ++i) {
2326 Error(
"TBranch::SetAddress",
"Filling from a TBuffer can only be done with a not split object branch. Request ignored.");
2350 for (
Int_t i=0;i<nb;i++) {
2361 if (level < 0) level = 0;
2362 if (level > 99) level = 99;
2372 for (
Int_t i=0;i<nb;i++) {
2386 for (
Int_t i=0;i<nb;i++) {
2402 if (updateExisting) {
2405 while ( ( b = (
TBranch*)next() ) ) {
2453 while ((basket = (
TBasket*)nextb())) {
2460 while ((branch = (
TBranch*)next())) {
2492 while ((branch = (
TBranch*)next())) {
2517 Warning(
"SetObject",
"is not supported in TBranch objects");
2580 if (fNleaves == 0) {
2582 }
else if (fNleaves == 1) {
2584 }
else if (fNleaves == 2) {
2596 TNamed::Streamer(b);
2597 if (v > 7) TAttFill::Streamer(b);
2624 else {
Int_t bsize; b >> bsize; fBasketSeek[i] = (
Long64_t)bsize;};
2635 for (j=fWriteBasket,n=0;j>=0 && n<
fNBaskets;--j) {
2643 if (fWriteBasket >= fMaxBaskets) {
2656 if (fNleaves == 0) {
2658 }
else if (fNleaves == 1) {
2660 }
else if (fNleaves == 2) {
2670 TNamed::Streamer(b);
2690 for (j=fWriteBasket,n=0;j>0 && n<nbaskets;--j) {
2732 if (fNleaves == 0) {
2734 }
else if (fNleaves == 1) {
2736 }
else if (fNleaves == 2) {
2749 for (
Int_t i = 0; i < lastBasket; ++i) {
2762 for (
Int_t i = 0; i < lastBasket; ++i) {
2763 if (stash[i])
fBaskets[i] = stash[i];
2789 auto doUpdates = [=]() {
2791 if (nout < 0)
Error(
"TBranch::WriteBasketImpl",
"basket's WriteBuffer failed.\n");
2800 reusebasket = basket;
2801 reusebasket->
Reset();
2837 imtHelper->
Run(doUpdates);
2881 while ((basket = (
TBasket*)nextb())) {
2889 while ((branch = (
TBranch*)next())) {
void Run(const FN &lambda)
void Init(const char *name, const char *leaflist, Int_t compress)
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Int_t ReadBasketBytes(Long64_t pos, TFile *file)
Read basket buffers in memory and cleanup.
virtual const char * GetName() const
Returns name of object.
Int_t fNBaskets
! Number of baskets in memory
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
void SetBufferOffset(Int_t offset=0)
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Long64_t Previous()
Move on to the previous cluster and return the starting entry of this previous cluster.
TTreeCache * GetReadCache(TFile *file) const
Find and return the TTreeCache registered with the file and which may contain branches for us...
virtual void AddTotBytes(Int_t tot)
A TLeaf for an 8 bit Integer data type.
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
virtual void SetBufferAddress(TBuffer *entryBuffer)
Set address of this branch directly from a TBuffer to avoid streaming.
virtual void SetReadMode()
Set read mode of basket.
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all leaves of this branch to fill Basket buffer.
A TLeaf for a 64 bit floating point data type.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
void Update(Int_t newlast)
virtual void UpdateFile()
Refresh the value of fDirectory (i.e.
virtual void SetUsed(TBranch *b, size_t basketNumber)=0
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
virtual void SetAddress(void *add)
Set address of this branch.
Int_t ReadBasketBuffers(Long64_t pos, Int_t len, TFile *file)
Read basket buffers in memory and cleanup.
Int_t fOffset
Offset of this branch.
virtual void IncrementTotalBuffers(Int_t nbytes)
#define R__unlikely(expr)
TObjArray * GetListOfBaskets()
virtual ~TBranch()
Destructor.
Int_t GetNevBufSize() const
virtual void AddZipBytes(Int_t zip)
Long64_t fEntries
Number of entries.
Int_t FlushOneBasket(UInt_t which)
If we have a write basket in memory and it contains some entries and has not yet been written to disk...
virtual Int_t GetExpectedType(TClass *&clptr, EDataType &type)
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
A cache when reading files over the network.
virtual Bool_t IsLearning() const
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
Long64_t GetZipBytes(Option_t *option="") const
Return total number of zip bytes in the branch if option ="*" includes all sub-branches of this branc...
virtual Bool_t GetClusterPrefetch() const
Long64_t fZipBytes
Total number of bytes in all leaves after compression.
This class represents a WWW compatible URL.
const UInt_t kByteCountMask
ReadLeaves_t fReadLeaves
! Pointer to the ReadLeaves implementation to use.
Int_t FillEntryBuffer(TBasket *basket, TBuffer *buf, Int_t &lnew)
Copy the data from fEntryBuffer into the current basket.
TBranch * GetSubBranch(const TBranch *br) const
Find the parent branch of child.
void SetCompressionAlgorithm(Int_t algorithm=0)
Set compression algorithm.
virtual void DropBaskets(Option_t *option="")
Loop on all branch baskets.
virtual void SetStatus(Bool_t status=1)
Set branch status to Process or DoNotProcess.
virtual const char * GetTypeName() const
void ReadLeaves2Impl(TBuffer &b)
Read two leaves without the overhead of a loop.
virtual void SetFirstEntry(Long64_t entry)
set the first entry number (case of TBranchSTL)
virtual Int_t AddBranch(TBranch *, Bool_t=kFALSE)
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
void SetCompressionLevel(Int_t level=1)
Set compression level.
virtual TLeaf * FindLeaf(const char *name)
Find the leaf corresponding to the name 'searchname'.
Buffer base class used for serializing objects.
Bool_t IsFolder() const
Return kTRUE if more than one leaf or browsables, kFALSE otherwise.
TBasket * fCurrentBasket
! Pointer to the current basket.
TDirectory * GetDirectory() const
virtual TBasket * CreateBasket(TBranch *)
Create a basket for this tree and given branch.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual Int_t GetOffset() const
TObjArray fBaskets
-> List of baskets of this branch
void ToLower()
Change string to lower-case.
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
A TLeaf for a bool data type.
R__EXTERN TVirtualMutex * gROOTMutex
TBasket * GetFreshCluster()
Drops the cluster two behind the current cluster and returns a fresh basket by either reusing or crea...
Int_t fNleaves
! Number of leaves
TIOFeatures provides the end-user with the ability to change the IO behavior of data written via a TT...
const UInt_t kNewClassTag
TString GetRealFileName() const
Get real file name.
Type GetType(const std::string &Name)
TObjArray fLeaves
-> List of leaves of this branch
TString & Prepend(const char *cs)
Long64_t * fBasketSeek
[fMaxBaskets] Addresses of baskets on file
TObject * At(Int_t idx) const
virtual void DeleteBaskets(Option_t *option="")
Loop on all branch baskets.
A TLeaf for a variable length string.
virtual Int_t GetRow(Int_t row)
Return all elements of one row unpacked in internal array fValues [Actually just returns 1 (...
TBuffer * GetBufferRef() const
TBasket * GetFreshBasket()
Return a fresh basket by either resusing an existing basket that needs to be drop (according to TTree...
virtual void SetupAddresses()
If the branch address is not set, we set all addresses starting with the top level parent branch...
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Long64_t fFirstBasketEntry
! First entry in the current basket.
void SetBranch(TBranch *branch)
Int_t * fBasketBytes
[fMaxBaskets] Length of baskets on file
virtual TList * GetBrowsables()
Returns (and, if 0, creates) browsable objects for this branch See TVirtualBranchBrowsable::FillListO...
Long64_t fEntryNumber
Current entry number (last one filled in this branch)
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
#define R__LOCKGUARD_IMT(mutex)
static Int_t FillListOfBrowsables(TList &list, const TBranch *branch, const TVirtualBranchBrowsable *parent=0)
Askes all registered generators to fill their browsables into the list.
Long64_t GetTotBytes(Option_t *option="") const
Return total number of bytes in the branch (excluding current buffer) if option ="*" includes all sub...
Int_t fWriteBasket
Last basket number written.
virtual TObjArray * GetListOfBranches()
Helper class to iterate over cluster of baskets.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Long64_t fTotBytes
Total number of bytes in all leaves before compression.
Fill Area Attributes class.
void SetLast(Int_t last)
Set index of last object in array, effectively truncating the array.
virtual Bool_t IsWritable() const
The TNamed class is the base class for all named ROOT classes.
virtual void Browse(TBrowser *b)
Browser interface.
virtual TLeaf * GetLeaf(const char *name) const
Return pointer to the 1st Leaf named name in thisBranch.
void ReadLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to read Basket buffer.
virtual Bool_t SetMakeClass(Bool_t decomposeObj=kTRUE)
Set the branch in a mode where the object are decomposed (Also known as MakeClass mode)...
virtual TVirtualPerfStats * GetPerfStats() const
void Clear()
Clear string without changing its capacity.
virtual TBranch * FindBranch(const char *name)
Find the immediate sub-branch with passed name.
virtual void Reset()
Reset the basket to the starting state.
virtual TClusterIterator GetClusterIterator(Long64_t firstentry)
Return an iterator over the cluster of baskets starting at firstentry.
virtual Int_t WriteBuffer()
Write buffer of this basket on the current file.
Bool_t IsAutoDelete() const
Return kTRUE if an existing object in a TBranchObject must be deleted.
virtual Int_t GetLenType() const
TObjArray * GetListOfBranches()
const char * GetAnchor() const
Ssiz_t First(char c) const
Find first occurrence of a character c.
virtual void SetBranch(TBranch *branch)
TBasket * GetBasket(Int_t basket)
Return pointer to basket basketnumber in this Branch.
Int_t fMaxBaskets
Maximum number of Baskets so far.
virtual void SetAddress(void *add=0)
virtual void FillBasket(TBuffer &b)
Pack leaf elements in Basket output buffer.
virtual TFile * GetFile() const
Int_t fSplitLevel
Branch split level.
R__ALWAYS_INLINE Bool_t IsZombie() const
TBranch()
Default constructor. Used for I/O by default.
void Expand(Int_t newsize, Bool_t copy=kTRUE)
Expand (or shrink) the I/O buffer to newsize bytes.
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
const char * GetIconName() const
Return icon name depending on type of branch.
void PrintCacheInfo() const
Print the information we have about which basket is currently cached and whether they have been 'used...
Using a TBrowser one can browse all ROOT objects.
Int_t GetLast() const
Return index of last object in array.
virtual void AddLastBasket(Long64_t startEntry)
Add the start entry of the write basket (not yet created)
virtual Int_t GetLen() const
Return the number of effective elements of this leaf, for the current entry.
Int_t * GetDisplacement() const
Int_t WriteBasket(TBasket *basket, Int_t where)
TBuffer * fEntryBuffer
! Buffer used to directly pass the content without streaming
virtual char * ReadString(char *s, Int_t max)=0
static Int_t fgCount
! branch counter
void FillLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to fill Basket buffer.
virtual Int_t GetEntryExport(Long64_t entry, Int_t getall, TClonesArray *list, Int_t n)
Read all leaves of an entry and export buffers to real objects in a TClonesArray list.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
Int_t fBasketSize
Initial Size of Basket Buffer.
CacheInfo_t fCacheInfo
! Hold info about which basket are in the cache and if they have been retrieved from the cache...
void SetCompressionSettings(Int_t settings=1)
Set compression settings.
R__EXTERN TSystem * gSystem
virtual void SetEntries(Long64_t entries)
Set the number of entries in this branch.
TList * fBrowsables
! List of TVirtualBranchBrowsables used for Browse()
virtual void AdjustSize(Int_t newsize)
Increase the size of the current fBuffer up to newsize.
virtual TObject * RemoveAt(Int_t idx)
Remove object at index idx.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
FillLeaves_t fFillLeaves
! Pointer to the FillLeaves implementation to use.
Int_t GetEntriesFast() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TFile * GetCurrentFile() const
Return pointer to the current file.
virtual void MakeFree(Long64_t first, Long64_t last)
Mark unused bytes on the file.
virtual TLeaf * GetLeafCount() const
If this leaf stores a variable-sized array or a multi-dimensional array whose last dimension has vari...
Long64_t fNextBasketEntry
! Next entry that will requires us to go to the next basket
Manages buffers for branches of a Tree.
void SetReadMode()
Set buffer in read mode.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
The ROOT global object gROOT contains a list of all defined classes.
A TLeaf for a 32 bit floating point data type.
TBuffer * GetTransientBuffer(Int_t size)
Returns the transient buffer currently used by this TBranch for reading/writing baskets.
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
virtual void KeepCircular(Long64_t maxEntries)
keep a maximum of fMaxEntries in memory
virtual Long64_t GetBasketSeek(Int_t basket) const
Return address of basket in the file.
virtual void SetParent(const TObject *parent)
Set parent in key buffer.
virtual void SetOffset(Int_t offset=0)
virtual void SetBasketSize(Int_t buffsize)
Set the basket size The function makes sure that the basket size is greater than fEntryOffsetlen.
void SetUsed(Int_t basketNumber)
TString & Remove(Ssiz_t pos)
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
void SetAnchor(const char *anchor)
Long64_t Next()
Move on to the next cluster and return the starting entry of this next cluster.
TObject * UncheckedAt(Int_t i) const
Bool_t fSkipZip
! After being read, the buffer will not be unzipped.
Int_t fReadBasket
! Current basket number when reading
virtual void ResetAddress()
Reset the address of the branch.
virtual Long64_t GetSeekKey() const
Describe directory structure in memory.
TDirectory * GetDirectory() const
Int_t WriteBasketImpl(TBasket *basket, Int_t where, ROOT::Internal::TBranchIMTHelper *)
Write the current basket to disk and return the number of bytes written to the file.
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
virtual void Expand(Int_t newSize)
Expand or shrink the array to newSize elements.
TIOFeatures GetIOFeatures() const
Returns the IO settings currently in use for this branch.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
static constexpr double s
#define R__LOCKGUARD(mutex)
TTree * fTree
! Pointer to Tree header
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
TObjArray * GetListOfLeaves()
TDirectory * fDirectory
! Pointer to directory where this branch buffers are stored
virtual void ReadBasket(TBuffer &)
Int_t BackFill()
Loop on all leaves of this branch to back fill Basket buffer.
virtual void SetUnsigned()
Long64_t GetTotalSize(Option_t *option="") const
Return total number of bytes in the branch (including current buffer)
virtual void ReadBasketExport(TBuffer &, TClonesArray *, Int_t)
static void * ReAlloc(void *vp, size_t size)
Reallocate (i.e.
virtual void SetEntryOffsetLen(Int_t len, Bool_t updateSubBranches=kFALSE)
Update the default value for the branch's fEntryOffsetLen if and only if it was already non zero (and...
virtual void SetFile(TFile *file=0)
Set file where this branch writes/reads its buffers.
A TLeaf for a 16 bit Integer data type.
virtual void Refresh(TBranch *b)
Refresh this branch using new information in b This function is called by TTree::Refresh.
Long64_t GetEntries() const
An array of clone (identical) objects.
void ReadLeaves0Impl(TBuffer &b)
Read zero leaves without the overhead of a loop.
Long64_t * fBasketEntry
[fMaxBaskets] Table of first entry in each basket
virtual Int_t DropBuffers()
Drop buffers of this basket if it is not the current basket.
virtual void SetSkipZip(Bool_t=kTRUE)
virtual void PrepareBasket(Long64_t)
virtual void RemoveAll(TCollection *col)
Remove all objects in collection col from this collection.
Short_t Max(Short_t a, Short_t b)
virtual void Reset(Option_t *option="")
Reset a Branch.
TIOFeatures fIOFeatures
IO features for newly-created baskets.
Long64_t fReadEntry
! Current entry number when reading
void Print(const char *owner, Long64_t *entries) const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual void AddBasket(TBasket &b, Bool_t ondisk, Long64_t startEntry)
Add the basket to this branch.
TBranch * fMother
! Pointer to top-level parent branch in the tree.
virtual Int_t LoadBaskets()
Baskets associated to this branch are forced to be in memory.
virtual Bool_t GetMakeClass() const
Return whether this branch is in a mode where the object are decomposed or not (Also known as MakeCla...
virtual void WriteBuf(const void *buf, Int_t max)=0
A TLeaf for a 64 bit Integer data type.
Int_t GetEntries() const
Return the number of objects in array (i.e.
Int_t GetBufferSize() const
virtual Int_t GetMapCount() const =0
A TTree object has a header with a name and a title.
Int_t fEntryOffsetLen
Initial Length of fEntryOffset table in the basket buffers.
virtual void ResetMap()=0
Undefined compression algorithm (must be kept the last of the list in case a new algorithm is added)...
virtual void ReadBasket(TBuffer &b)
Loop on all leaves of this branch to read Basket buffer.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Int_t FlushBaskets()
Flush to disk all the baskets of this branch and any of subbranches.
TObjArray fBranches
-> List of Branches of this branch
Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
void SetNevBufSize(Int_t n)
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual TFile * GetFile(Int_t mode=0)
Return pointer to the file where branch buffers reside, returns 0 in case branch buffers reside in th...
virtual void SetBufferDisplacement()=0
TBranch * GetBranch() const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
A TTree is a list of TBranches.
TBuffer * fTransientBuffer
! Pointer to the current transient buffer.
Int_t fCompress
Compression level and algorithm.
virtual void Print(Option_t *option="") const
Print TBranch parameters.
TString fFileName
Name of file where buffers are stored ("" if in same file as Tree header)
virtual Int_t GetBufferDisplacement() const =0
TBranch * fParent
! Pointer to parent branch.
Int_t GetCompressionLevel() const
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.
Long64_t fFirstEntry
Number of the first entry in this branch.
virtual void SetWriteMode()
Set write mode of basket.
TBranch * GetMother() const
Get our top-level parent branch in the tree.
void ExpandBasketArrays()
Increase BasketEntry buffer of a minimum of 10 locations and a maximum of 50 per cent of current size...
A TLeaf for an Integer data type.
virtual void SetObject(void *objadd)
Set object this branch is pointing to.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
static Int_t * ReAllocInt(Int_t *vp, size_t size, size_t oldsize)
Reallocate (i.e.
void SetWriteMode()
Set buffer in write mode.
Int_t GetCompressionSettings() const
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual const char * GetTitle() const
Returns title of object.
virtual Int_t ReadArray(Bool_t *&b)=0
virtual TObjArray * GetListOfLeaves()
void ReadLeaves1Impl(TBuffer &b)
Read one leaf without the overhead of a loop.
virtual void Close(Option_t *option="")
Close a file.
static void ResetCount()
Static function resetting fgCount.
virtual Long64_t GetMaxVirtualSize() const
virtual void MoveEntries(Int_t dentries)
Remove the first dentries of this basket, moving entries at dentries to the start of the buffer...
const char * Data() const
virtual void SetAutoDelete(Bool_t autodel=kTRUE)
Set the automatic delete bit.
char * fAddress
! Address of 1st leaf (variable or object)