89, fEntryOffsetLen(1000)
92, fExtraBasket(nullptr)
100, fFirstBasketEntry(-1)
101, fNextBasketEntry(-1)
109, fBaskets(fMaxBaskets)
124, fReadLeaves(&
TBranch::ReadLeavesImpl)
125, fFillLeaves(&
TBranch::FillLeavesImpl)
198, fBasketSize((basketsize < 100) ? 100 : basketsize)
202, fExtraBasket(nullptr)
203, fIOFeatures(
tree ?
tree->GetIOFeatures().GetFeatures() : 0)
211, fFirstBasketEntry(-1)
212, fNextBasketEntry(-1)
220, fBaskets(fMaxBaskets)
227, fAddress((char *)address)
228, fDirectory(fTree->GetDirectory())
235, fReadLeaves(&
TBranch::ReadLeavesImpl)
236, fFillLeaves(&
TBranch::FillLeavesImpl)
252, fBasketSize((basketsize < 100) ? 100 : basketsize)
256, fExtraBasket(nullptr)
257, fIOFeatures(parent->fIOFeatures)
265, fFirstBasketEntry(-1)
266, fNextBasketEntry(-1)
274, fBaskets(fMaxBaskets)
278, fTree(parent ? parent->GetTree() : 0)
279, fMother(parent ? parent->GetMother() : 0)
281, fAddress((char *)address)
282, fDirectory(fTree ? fTree->GetDirectory() : 0)
289, fReadLeaves(&
TBranch::ReadLeavesImpl)
290, fFillLeaves(&
TBranch::FillLeavesImpl)
321 char* nameBegin =
const_cast<char*
>(leaflist);
323 auto len = strlen(leaflist);
325 char* leafname =
new char[len + 1];
326 char* leaftype =
new char[320];
328 strlcpy(leaftype,
"F",320);
329 char* pos =
const_cast<char*
>(leaflist);
330 const char* leaflistEnd = leaflist + len;
331 for (; pos <= leaflistEnd; ++pos) {
333 if ((*pos ==
':') || (*pos == 0)) {
335 Int_t lenName = pos - nameBegin;
338 strncpy(leafname, nameBegin, lenName);
339 leafname[lenName] = 0;
340 ctype = strstr(leafname,
"/");
343 strlcpy(leaftype, ctype + 1,320);
346 if (lenName == 0 || ctype == leafname) {
347 Warning(
"TBranch",
"No name was given to the leaf number '%d' in the leaflist of the branch '%s'.",
fNleaves,
name);
351 if (leaftype[1] ==
'[' && !strchr(leaftype,
',')) {
352 Warning(
"TBranch",
"Array size for branch '%s' must be specified after leaf name, not after the type name!",
name);
354 }
else if (leaftype[1] && !strchr(leaftype,
',')) {
355 Warning(
"TBranch",
"Extra characters after type tag '%s' for branch '%s'; must be one character.", leaftype,
name);
358 if (*leaftype ==
'C') {
359 leaf =
new TLeafC(
this, leafname, leaftype);
360 }
else if (*leaftype ==
'O') {
361 leaf =
new TLeafO(
this, leafname, leaftype);
362 }
else if (*leaftype ==
'B') {
363 leaf =
new TLeafB(
this, leafname, leaftype);
364 }
else if (*leaftype ==
'b') {
365 leaf =
new TLeafB(
this, leafname, leaftype);
367 }
else if (*leaftype ==
'S') {
368 leaf =
new TLeafS(
this, leafname, leaftype);
369 }
else if (*leaftype ==
's') {
370 leaf =
new TLeafS(
this, leafname, leaftype);
372 }
else if (*leaftype ==
'I') {
373 leaf =
new TLeafI(
this, leafname, leaftype);
374 }
else if (*leaftype ==
'i') {
375 leaf =
new TLeafI(
this, leafname, leaftype);
377 }
else if (*leaftype ==
'F') {
378 leaf =
new TLeafF(
this, leafname, leaftype);
379 }
else if (*leaftype ==
'f') {
380 leaf =
new TLeafF16(
this, leafname, leaftype);
381 }
else if (*leaftype ==
'L') {
382 leaf =
new TLeafL(
this, leafname, leaftype);
383 }
else if (*leaftype ==
'l') {
384 leaf =
new TLeafL(
this, leafname, leaftype);
386 }
else if (*leaftype ==
'D') {
387 leaf =
new TLeafD(
this, leafname, leaftype);
388 }
else if (*leaftype ==
'd') {
389 leaf =
new TLeafD32(
this, leafname, leaftype);
392 Error(
"TLeaf",
"Illegal data type for %s/%s",
name, leaflist);
401 auto msg =
"Illegal leaf: %s/%s. If this is a variable size C array it's possible that the branch holding the size is not available.";
466 if (lst && lst->
GetLast()!=-1) {
548 Warning(
"AddBasket",
"The assumption that out-of-order basket only comes from disk based ntuple is false.");
559 Error(
"AddBasket",
"An out-of-order basket matches the entry number of an existing basket.");
577 Fatal(
"AddBasket",
"Dropping non-empty 'write' basket in %s %s",
616 Fatal(
"AddBasket",
"The last basket must have the highest entry number (%s/%lld/%d).",
GetName(),startEntry,
fWriteBasket);
673 auto endCluster = cluster.GetNextEntry();
730 for (
Int_t j = 0; j < nb; j++) {
748 if (options && options[0]) {
759 for (
Int_t i=0;i<nbaskets;i++) {
761 if (!basket)
continue;
781 for (
Int_t j = 0; j < nb; j++) {
783 if (!branch)
continue;
853 if (!basket)
return 0;
887 nbytes = lnew - lold;
893 nsize = nevbuf *
sizeof(
Int_t);
914 if (nout < 0)
Error(
"TBranch::Fill",
"Failed to write out basket.\n");
915 return (nout >= 0) ? nbytes : -1;
926 Int_t objectStart = 0;
971 char*
s =
new char[maxsize];
974 while (strlen(
s) == (maxsize - 1)) {
979 s =
new char[maxsize];
994 if (startpos >
UInt_t(objectStart)) {
1014 nbytes = lnew - lold;
1029 if (longnm[longnm.length()-1]==
']') {
1030 std::size_t dim = longnm.find_first_of(
"[");
1031 if (dim != std::string::npos) {
1035 if (longnm[longnm.length()-1] !=
'.') {
1043 for(
Int_t i = 0; i < nbranches; ++i) {
1046 const char *brname = branch->
fName.
Data();
1048 if (brname[brlen-1]==
']') {
1049 const char *dim = strchr(brname,
'[');
1051 brlen = dim - brname;
1054 if (namelen == brlen
1055 && strncmp(
name,brname,brlen) == 0) {
1058 if (brlen == (
size_t)longnm.length()
1059 && strncmp(longnm.c_str(),brname,brlen) == 0) {
1079 while ((leaf = (
TLeaf*) next())) {
1082 if (dim >= 0) leafname.
Remove(dim);
1084 if (leafname == searchname)
return leaf;
1088 dim = leaftitle.
First(
'[');
1089 if (dim >= 0) leaftitle.
Remove(dim);
1091 if (leaftitle == searchname)
return leaf;
1096 dim = longname.
First(
'[');
1097 if (dim>=0) longname.
Remove(dim);
1098 if (longname == searchname)
return leaf;
1101 longname.
Form(
"%s.%s",branch->
GetName(),searchname);
1102 if (longname==leafname)
return leaf;
1105 dim = longtitle.
First(
'[');
1106 if (dim>=0) longtitle.
Remove(dim);
1107 if (longtitle == searchname)
return leaf;
1114 if (strstr(searchname,
".") && !strcmp(searchname, branch->
GetName()))
return leaf;
1135 for(
Int_t i=0; i != maxbasket; ++i) {
1146 for (
Int_t i = 0; i < len; ++i) {
1220 static std::atomic<Int_t> nerrors(0);
1223 if (basketnumber <0 || basketnumber >
fWriteBasket)
return 0;
1225 if (basket)
return basket;
1259 if (nerrors > 10)
return 0;
1260 if (nerrors == 10) {
1261 printf(
" file probably overwritten: stopping reporting error messages\n");
1263 printf(
"===>File is more than 2 Gigabytes\n");
1267 printf(
"===>Your file is may be bigger than the maximum file size allowed on your system\n");
1268 printf(
" Check your AFS maximum file size limit for example\n");
1272 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);
1281 perfStats->
SetUsed(
this, basketnumber);
1292 if (basketnumber <0 || basketnumber >
fWriteBasket)
return 0;
1323 return "TBranchElement-folder";
1325 return "TBranchElement-leaf";
1354 if ((entry <
first) || (entry > last)) {
1358 Error(
"GetBasketAndFirst",
"In the branch %s, no basket contains the entry %lld\n",
GetName(), entry);
1382 clusterIterator.
Next();
1464 Error(
"GetBulkEntries",
"Failed to get a new buffer.\n");
1469 Error(
"GetBulkEntries",
"Basket has displacement.\n");
1479 Error(
"GetBulkEntries",
"Leaf failed to read.\n");
1486 R__ASSERT(
fExtraBasket ==
nullptr &&
"fExtraBasket should have been set to nullptr by GetFreshBasket");
1501 Error(
"GetEntriesSerialized",
"Encountered a branch with destructive deserialization; failing.\n");
1516 Error(
"GetEntriesSerialized",
"Failed to read from full cluster; first entry is %lld; requested entry is %lld.\n",
first, entry);
1525 Error(
"GetEntriesSerialized",
"Failed to get a new buffer.\n");
1530 Error(
"GetEntriesSerialized",
"Basket has displacement.\n");
1541 Error(
"GetEntriesSerialized",
"Leaf failed to read.\n");
1552 Error(
"GetEntriesSerialized",
"Failed to read count leaf.\n");
1558 Int_t entry_count_serialized;
1559 char *tmp_ptr =
reinterpret_cast<char*
>(&entry_count_serialized);
1562 for (
int idx=0; idx<
N; idx++) {
1563 *count_buf << entry_count_serialized;
1610 if (!
file)
return -1;
1626 bufbegin = entryOffset[entry-
first];
1639 return buf->
Length() - bufbegin;
1662 if ((entry <
first) || (entry > last)) {
1666 Error(
"In the branch %s, no basket contains the entry %d\n",
GetName(), entry);
1697 bufbegin = entryOffset[entry-
first];
1709 nbytes = buf->
Length() - bufbegin;
1728 Error(
"GetExpectedType",
"Did not find any leaves in %s",
GetName());
1763 if (!
file)
return 0;
1764 if (
file->IsZombie()) {
delete file;
return 0;}
1787 if (
GetTree()->MemoryFull(0)) {
1809#ifdef R__TRACK_BASKET_ALLOC_TIME
1810 fTree->AddAllocationTime(basket->GetResetAllocationTime());
1863 while (
fBasketEntry[basketToUnload] != entryToUnload) {
1865 if (basketToUnload < 0) {
1906 if (!mother || mother==
this) {
1910 if (motherName.
Length() && (motherName[motherName.
Length()-1] ==
'.')) {
1913 return motherName +
"." +
fName;
1950 bFileName = arc.
GetUrl();
2013 for (
Int_t i = 0; i <
n; ++i) {
2031 if (
this == child) {
2041 for (
Int_t i = 0; i < len; ++i) {
2046 if (branch == child) {
2073 const_cast<TBranch *
>(
this)->TBranch::Streamer(
b);
2077 return totbytes +
b.Length();
2087 if (!option)
return totbytes;
2088 if (option[0] !=
'*')
return totbytes;
2091 for (
Int_t i = 0; i < len; ++i) {
2093 if (branch) totbytes += branch->
GetTotBytes(option);
2105 if (!option)
return zipbytes;
2106 if (option[0] !=
'*')
return zipbytes;
2109 for (
Int_t i = 0; i < len; ++i) {
2111 if (branch) zipbytes += branch->
GetZipBytes(option);
2141 return browsables && browsables->
GetSize();
2156 for (
Int_t i = 0; i < nb; ++i) {
2175 Int_t nimported = 0;
2178 if (!
file)
return 0;
2180 for (
Int_t i=0;i<nbaskets;i++) {
2182 if (basket)
continue;
2189 Error(
"Loadbaskets",
"Error while reading basket buffer %d of branch %s",i,
GetName());
2207 const int kLINEND = 77;
2211 if ( titleContent ==
GetName() ) {
2212 titleContent.
Clear();
2216 if (titleContent.
Length()>=2 && titleContent[titleContent.
Length()-2]==
'/' && isalpha(titleContent[titleContent.
Length()-1])) {
2220 if (titleContent.
Length()) {
2230 aLength += (aLength / 54 + 1) * 80 + 100;
2231 if (aLength < 200) aLength = 200;
2232 char *bline =
new char[aLength];
2238 if (strlen(bline) >
UInt_t(kLINEND)) {
2239 char *tmp =
new char[strlen(bline)+1];
2240 if (titleLength) strlcpy(tmp, titleContent.
Data(),strlen(bline)+1);
2242 int pos = strlen (bline);
2245 while (beg < titleLength) {
2246 for (end=beg+1; end < titleLength-1; end ++)
2247 if (tmp[end] ==
':')
break;
2248 if (npos + end-beg+1 >= 78) {
2249 while (npos < kLINEND) {
2250 bline[pos ++] =
' ';
2253 bline[pos ++] =
'*';
2254 bline[pos ++] =
'\n';
2255 bline[pos ++] =
'*';
2257 for (; npos < 12; npos ++)
2258 bline[pos ++] =
' ';
2261 for (
int n = beg;
n <= end;
n ++)
2262 bline[pos+
n-beg] = tmp[
n];
2267 while (npos < kLINEND) {
2268 bline[pos ++] =
' ';
2271 bline[pos ++] =
'*';
2284 Printf(
"*Entries :%9lld : Total Size=%11lld bytes All baskets in memory *",
fEntries,totBytes);
2286 Printf(
"*Entries :%9lld : Total Size=%11lld bytes One basket in memory *",
fEntries,totBytes);
2292 if (strncmp(option,
"basketsInfo",strlen(
"basketsInfo"))==0) {
2294 for (
Int_t i=0;i<nbaskets;i++) {
2295 Printf(
"*Basket #%4d entry=%6lld pos=%6lld size=%5d",
2300 Printf(
"*............................................................................*");
2401 Int_t nbaskets =
b->fBaskets.GetSize();
2528 for (
Int_t i = 0; i < nbranches; ++i) {
2614 Error(
"TBranch::SetAddress",
"Filling from a TBuffer can only be done with a not split object branch. Request ignored.");
2638 for (
Int_t i=0;i<nb;i++) {
2649 if (level < 0) level = 0;
2650 if (level > 99) level = 99;
2660 for (
Int_t i=0;i<nb;i++) {
2674 for (
Int_t i=0;i<nb;i++) {
2690 if (updateExisting) {
2693 while ( (
b = (
TBranch*)next() ) ) {
2694 b->SetEntryOffsetLen( newdefault,
kTRUE );
2741 while ((basket = (
TBasket*)nextb())) {
2748 while ((branch = (
TBranch*)next())) {
2780 while ((branch = (
TBranch*)next())) {
2805 Warning(
"SetObject",
"is not supported in TBranch objects");
2822 if (
b.IsReading()) {
2848 for (
Int_t i=0;i<nbranches;i++) {
2889 TNamed::Streamer(
b);
2890 if (
v > 7) TAttFill::Streamer(
b);
2920 b.CheckByteCount(R__s, R__c, TBranch::IsA());
2947 b.CheckByteCount(R__s, R__c, TBranch::IsA());
2963 TNamed::Streamer(
b);
3020 b.CheckByteCount(R__s, R__c, TBranch::IsA());
3040 for (
Int_t i = 0; i < lastBasket; ++i) {
3053 for (
Int_t i = 0; i < lastBasket; ++i) {
3054 if (stash[i])
fBaskets[i] = stash[i];
3080 auto doUpdates = [=]() {
3083 Error(
"WriteBasketImpl",
"basket's WriteBuffer failed.");
3092 reusebasket = basket;
3099#ifdef R__TRACK_BASKET_ALLOC_TIME
3100 fTree->AddAllocationTime(reusebasket->GetResetAllocationTime());
3133 imtHelper->
Run(doUpdates);
3177 while ((basket = (
TBasket*)nextb())) {
3185 while ((branch = (
TBranch*)next())) {
void tobuf(char *&buf, Bool_t x)
#define R__unlikely(expr)
const UInt_t kNewClassTag
const UInt_t kByteCountMask
R__EXTERN TVirtualMutex * gROOTMutex
void Printf(const char *fmt,...)
R__EXTERN TSystem * gSystem
#define R__LOCKGUARD_IMT(mutex)
#define R__LOCKGUARD(mutex)
void SetUsed(Int_t basketNumber)
void Print(const char *owner, Long64_t *entries) const
void Run(const FN &lambda)
TIOFeatures provides the end-user with the ability to change the IO behavior of data written via a TT...
Fill Area Attributes class.
Manages buffers for branches of a Tree.
void AdoptBuffer(TBuffer *user_buffer)
Adopt a buffer from an external entity.
Int_t GetNevBufSize() const
Int_t * GetDisplacement() const
void DisownBuffer()
Disown all references to the internal buffer - some other object likely now owns it.
void SetBranch(TBranch *branch)
Int_t ReadBasketBuffers(Long64_t pos, Int_t len, TFile *file)
Read basket buffers in memory and cleanup.
virtual Int_t DropBuffers()
Drop buffers of this basket if it is not the current basket.
virtual void PrepareBasket(Long64_t)
virtual void MoveEntries(Int_t dentries)
Remove the first dentries of this basket, moving entries at dentries to the start of the buffer.
void SetNevBufSize(Int_t n)
Int_t GetBufferSize() const
virtual void AdjustSize(Int_t newsize)
Increase the size of the current fBuffer up to newsize.
virtual void SetReadMode()
Set read mode of basket.
virtual void SetWriteMode()
Set write mode of basket.
Bool_t GetResetAllocationCount() const
Int_t ReadBasketBytes(Long64_t pos, TFile *file)
Read basket buffers in memory and cleanup.
virtual void ReadResetBuffer(Int_t basketnumber)
Reset the read basket TBuffer memory allocation if needed.
virtual Int_t WriteBuffer()
Write buffer of this basket on the current file.
void Update(Int_t newlast)
virtual void WriteReset()
Reset the write basket to the starting state.
A TTree is a list of TBranches.
virtual TLeaf * GetLeaf(const char *name) const
Return pointer to the 1st Leaf named name in thisBranch.
virtual void SetupAddresses()
If the branch address is not set, we set all addresses starting with the top level parent branch.
virtual void ResetAddress()
Reset the address of the branch.
virtual void SetAutoDelete(Bool_t autodel=kTRUE)
Set the automatic delete bit.
TString fFileName
Name of file where buffers are stored ("" if in same file as Tree header)
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
const char * GetIconName() const
Return icon name depending on type of branch.
TBasket * GetFreshBasket(Int_t basketnumber, TBuffer *user_buffer)
Return a fresh basket by either resusing an existing basket that needs to be drop (according to TTree...
TBasket * GetBasketImpl(Int_t basket, TBuffer *user_buffer)
Return pointer to basket basketnumber in this Branch.
Int_t fEntryOffsetLen
Initial Length of fEntryOffset table in the basket buffers.
virtual void DeleteBaskets(Option_t *option="")
Loop on all branch baskets.
virtual Long64_t GetBasketSeek(Int_t basket) const
Return address of basket in the file.
TBranch()
Default constructor. Used for I/O by default.
void SetCompressionSettings(Int_t settings=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault)
Set compression settings.
Int_t BackFill()
Loop on all leaves of this branch to back fill Basket buffer.
Int_t fMaxBaskets
Maximum number of Baskets so far.
Long64_t fTotBytes
Total number of bytes in all leaves before compression.
TBuffer * fTransientBuffer
! Pointer to the current transient buffer.
virtual void ReadBasket(TBuffer &b)
Loop on all leaves of this branch to read Basket buffer.
FillLeaves_t fFillLeaves
! Pointer to the FillLeaves implementation to use.
virtual TString GetFullName() const
Return the 'full' name of the branch.
TObjArray fLeaves
-> List of leaves of this branch
Int_t GetBasketAndFirst(TBasket *&basket, Long64_t &first, TBuffer *user_buffer)
A helper function to locate the correct basket - and its first entry.
char * fAddress
! Address of 1st leaf (variable or object)
virtual void DropBaskets(Option_t *option="")
Loop on all branch baskets.
TObjArray * GetListOfBranches()
virtual TList * GetBrowsables()
Returns (and, if 0, creates) browsable objects for this branch See TVirtualBranchBrowsable::FillListO...
TList * fBrowsables
! List of TVirtualBranchBrowsables used for Browse()
void ReadLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to read Basket buffer.
Int_t fOffset
Offset of this branch.
Long64_t * fBasketEntry
[fMaxBaskets] Table of first entry in each basket
Int_t GetEntriesSerialized(Long64_t N, TBuffer &user_buf)
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...
void ExpandBasketArrays()
Increase BasketEntry buffer of a minimum of 10 locations and a maximum of 50 per cent of current size...
void Init(const char *name, const char *leaflist, Int_t compress)
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
TIOFeatures GetIOFeatures() const
Returns the IO settings currently in use for this branch.
void FillLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to fill Basket buffer.
Long64_t fReadEntry
! Current entry number when reading
virtual void AddBasket(TBasket &b, Bool_t ondisk, Long64_t startEntry)
Add the basket to this branch.
static void ResetCount()
Static function resetting fgCount.
TBranch * GetSubBranch(const TBranch *br) const
Find the parent branch of child.
ReadLeaves_t fReadLeaves
! Pointer to the ReadLeaves implementation to use.
virtual void SetObject(void *objadd)
Set object this branch is pointing to.
Int_t FlushBaskets()
Flush to disk all the baskets of this branch and any of subbranches.
void ReadLeaves2Impl(TBuffer &b)
Read two leaves without the overhead of a loop.
TBasket * GetFreshCluster()
Drops the cluster two behind the current cluster and returns a fresh basket by either reusing or crea...
virtual void SetAddress(void *add)
Set address of this branch.
static Int_t fgCount
! branch counter
virtual void AddLastBasket(Long64_t startEntry)
Add the start entry of the write basket (not yet created)
TBasket * GetBasket(Int_t basket)
Int_t fNBaskets
! Number of baskets in memory
void ReadLeaves1Impl(TBuffer &b)
Read one leaf without the overhead of a loop.
Int_t GetBulkEntries(Long64_t, TBuffer &)
Read as many events as possible into the given buffer, using zero-copy mechanisms.
Bool_t IsFolder() const
Return kTRUE if more than one leaf or browsables, kFALSE otherwise.
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.
Long64_t fZipBytes
Total number of bytes in all leaves after compression.
TIOFeatures fIOFeatures
IO features for newly-created baskets.
void SetCompressionAlgorithm(Int_t algorithm=ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
Set compression algorithm.
Bool_t IsAutoDelete() const
Return kTRUE if an existing object in a TBranchObject must be deleted.
virtual TLeaf * FindLeaf(const char *name)
Find the leaf corresponding to the name 'searchname'.
CacheInfo_t fCacheInfo
! Hold info about which basket are in the cache and if they have been retrieved from the cache.
TObjArray * GetListOfBaskets()
virtual void SetBufferAddress(TBuffer *entryBuffer)
Set address of this branch directly from a TBuffer to avoid streaming.
Long64_t GetEntries() const
Int_t fNleaves
! Number of leaves
Int_t fSplitLevel
Branch split level.
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 UpdateFile()
Refresh the value of fDirectory (i.e.
Int_t * fBasketBytes
[fMaxBaskets] Length of baskets on file
virtual void Print(Option_t *option="") const
Print TBranch parameters.
Long64_t fNextBasketEntry
! Next entry that will requires us to go to the next basket
virtual ~TBranch()
Destructor.
Int_t FillEntryBuffer(TBasket *basket, TBuffer *buf, Int_t &lnew)
Copy the data from fEntryBuffer into the current basket.
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 Browse(TBrowser *b)
Browser interface.
TObjArray fBranches
-> List of Branches of this branch
virtual void KeepCircular(Long64_t maxEntries)
keep a maximum of fMaxEntries in memory
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
void ReadLeaves0Impl(TBuffer &b)
Read zero leaves without the overhead of a loop.
virtual Bool_t GetMakeClass() const
Return whether this branch is in a mode where the object are decomposed or not (Also known as MakeCla...
TString GetRealFileName() const
Get real file name.
virtual TBranch * FindBranch(const char *name)
Find the immediate sub-branch with passed name.
TDirectory * fDirectory
! Pointer to directory where this branch buffers are stored
void PrintCacheInfo() const
Print the information we have about which basket is currently cached and whether they have been 'used...
TObjArray fBaskets
-> List of baskets of this branch
virtual Int_t LoadBaskets()
Baskets associated to this branch are forced to be in memory.
Bool_t fSkipZip
! After being read, the buffer will not be unzipped.
TBranch * fMother
! Pointer to top-level parent branch in the tree.
Long64_t GetTotBytes(Option_t *option="") const
Return total number of bytes in the branch (excluding current buffer) if option ="*" includes all sub...
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 void SetFile(TFile *file=0)
Set file where this branch writes/reads its buffers.
TBranch * fParent
! Pointer to parent branch.
Int_t WriteBasket(TBasket *basket, Int_t where)
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 ...
virtual void SetFirstEntry(Long64_t entry)
set the first entry number (case of TBranchSTL)
Long64_t GetTotalSize(Option_t *option="") const
Return total number of bytes in the branch (including current buffer)
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 void SetBasketSize(Int_t buffsize)
Set the basket size The function makes sure that the basket size is greater than fEntryOffsetlen.
virtual void Refresh(TBranch *b)
Refresh this branch using new information in b This function is called by TTree::Refresh.
Int_t fWriteBasket
Last basket number written.
Long64_t * fBasketSeek
[fMaxBaskets] Addresses of baskets on file
virtual void SetStatus(Bool_t status=1)
Set branch status to Process or DoNotProcess.
TObjArray * GetListOfLeaves()
virtual void SetEntries(Long64_t entries)
Set the number of entries in this branch.
Int_t fReadBasket
! Current basket number when reading
Long64_t fFirstEntry
Number of the first entry in this branch.
TBasket * fExtraBasket
! Allocated basket not currently holding any data.
virtual Int_t GetRow(Int_t row)
Return all elements of one row unpacked in internal array fValues [Actually just returns 1 (?...
Int_t fBasketSize
Initial Size of Basket Buffer.
virtual void Reset(Option_t *option="")
Reset a Branch.
Long64_t fEntryNumber
Current entry number (last one filled in this branch)
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Int_t fCompress
Compression level and algorithm.
TBuffer * GetTransientBuffer(Int_t size)
Returns the transient buffer currently used by this TBranch for reading/writing baskets.
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all leaves of this branch to fill Basket buffer.
TBuffer * fEntryBuffer
! Buffer used to directly pass the content without streaming
TBasket * fCurrentBasket
! Pointer to the current basket.
Long64_t fFirstBasketEntry
! First entry in the current basket.
void SetCompressionLevel(Int_t level=ROOT::RCompressionSetting::ELevel::kUseMin)
Set compression level.
Long64_t fEntries
Number of entries.
Bool_t SupportsBulkRead() const
Returns true if this branch supports bulk IO, false otherwise.
TTree * fTree
! Pointer to Tree header
Using a TBrowser one can browse all ROOT objects.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
Buffer base class used for serializing objects.
void SetWriteMode()
Set buffer in write mode.
char * GetCurrent() const
void Expand(Int_t newsize, Bool_t copy=kTRUE)
Expand (or shrink) the I/O buffer to newsize bytes.
virtual Int_t GetBufferDisplacement() const =0
virtual void ResetMap()=0
void SetBufferOffset(Int_t offset=0)
virtual Int_t GetMapCount() const =0
void SetReadMode()
Set buffer in read mode.
virtual void WriteBuf(const void *buf, Int_t max)=0
virtual void SetBufferDisplacement()=0
virtual char * ReadString(char *s, Int_t max)=0
TClass instances represent classes, structs and namespaces in the ROOT type system.
An array of clone (identical) objects.
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
virtual void RemoveAll(TCollection *col)
Remove all objects in collection col from this collection.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Small helper to keep current directory context.
Describe directory structure in memory.
virtual TFile * GetFile() const
virtual Bool_t IsWritable() const
A cache when reading files over the network.
virtual void SetSkipZip(Bool_t=kTRUE)
virtual Bool_t IsLearning() const
virtual Int_t LearnBranch(TBranch *, Bool_t=kFALSE)
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Int_t GetCompressionSettings() const
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
virtual Long64_t GetSeekKey() const
virtual void SetParent(const TObject *parent)
Set parent in key buffer.
TBuffer * GetBufferRef() const
A TLeaf for an 8 bit Integer data type.
A TLeaf for a variable length string.
A TLeaf for a 24 bit truncated floating point data type.
A TLeaf for a 64 bit floating point data type.
A TLeaf for a 24 bit truncated floating point data type.
A TLeaf for a 32 bit floating point data type.
A TLeaf for an Integer data type.
A TLeaf for a 64 bit Integer data type.
A TLeaf for a bool data type.
A TLeaf for a 16 bit Integer data type.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual bool ReadBasketSerialized(TBuffer &, Long64_t)
virtual Int_t GetLenType() const
virtual const char * GetTypeName() const
virtual Int_t GetLen() const
Return the number of effective elements of this leaf, for the current entry.
virtual TLeaf * GetLeafCount() const
If this leaf stores a variable-sized array or a multi-dimensional array whose last dimension has vari...
virtual DeserializeType GetDeserializeType() const
virtual void ReadBasketExport(TBuffer &, TClonesArray *, Int_t)
virtual void SetAddress(void *add=0)
virtual Int_t GetNdata() const
virtual void FillBasket(TBuffer &b)
Pack leaf elements in Basket output buffer.
TBranch * GetBranch() const
virtual void SetOffset(Int_t offset=0)
virtual bool ReadBasketFast(TBuffer &, Long64_t)
virtual void SetBranch(TBranch *branch)
virtual void SetUnsigned()
virtual Int_t GetOffset() const
virtual void ReadBasket(TBuffer &)
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Int_t GetEntriesFast() const
virtual void Expand(Int_t newSize)
Expand or shrink the array to newSize elements.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
Int_t GetEntries() const
Return the number of objects in array (i.e.
TObject * UncheckedAt(Int_t i) const
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
void SetLast(Int_t last)
Set index of last object in array, effectively truncating the array.
Int_t GetLast() const
Return index of last object in array.
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
virtual TObject * RemoveAt(Int_t idx)
Remove object at index idx.
TObject * At(Int_t idx) const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
R__ALWAYS_INLINE Bool_t IsZombie() const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
static void * ReAlloc(void *vp, size_t size)
Reallocate (i.e.
static Int_t * ReAllocInt(Int_t *vp, size_t size, size_t oldsize)
Reallocate (i.e.
void ToLower()
Change string to lower-case.
void Clear()
Clear string without changing its capacity.
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & Prepend(const char *cs)
TString & Remove(Ssiz_t pos)
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
Helper class to iterate over cluster of baskets.
Long64_t Previous()
Move on to the previous cluster and return the starting entry of this previous cluster.
Long64_t Next()
Move on to the next cluster and return the starting entry of this next cluster.
A TTree represents a columnar dataset.
virtual TVirtualPerfStats * GetPerfStats() const
virtual TClusterIterator GetClusterIterator(Long64_t firstentry)
Return an iterator over the cluster of baskets starting at firstentry.
void AddAllocationCount(UInt_t count)
virtual TObjArray * GetListOfLeaves()
TFile * GetCurrentFile() const
Return pointer to the current file.
virtual void IncrementTotalBuffers(Int_t nbytes)
TDirectory * GetDirectory() const
TTreeCache * GetReadCache(TFile *file) const
Find and return the TTreeCache registered with the file and which may contain branches for us.
virtual TObjArray * GetListOfBranches()
virtual void AddZipBytes(Int_t zip)
virtual TBasket * CreateBasket(TBranch *)
Create a basket for this tree and given branch.
@ kOnlyFlushAtCluster
If set, the branch's buffers will grow until an event cluster boundary is hit, guaranteeing a basket ...
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
virtual Bool_t GetClusterPrefetch() const
virtual void AddTotBytes(Int_t tot)
virtual Long64_t GetAutoFlush() const
virtual Long64_t GetMaxVirtualSize() const
This class represents a WWW compatible URL.
const char * GetAnchor() const
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
void SetAnchor(const char *anchor)
static Int_t FillListOfBrowsables(TList &list, const TBranch *branch, const TVirtualBranchBrowsable *parent=0)
Askes all registered generators to fill their browsables into the list.
virtual void SetUsed(TBranch *b, size_t basketNumber)=0
Type GetType(const std::string &Name)
static constexpr double s
Short_t Max(Short_t a, Short_t b)
Long64_t BinarySearch(Long64_t n, const T *array, T value)
@ kUndefined
Undefined compression algorithm (must be kept the last of the list in case a new algorithm is added).
@ kUseMin
Compression level reserved when we are not sure what to use (1 is for the fastest compression)