481 case kchar:
return 0;
486 case kBits:
return 0;
522 fMethodBit(tfl.fMethodBit),
523 fPrevious(tfl.fPrevious)
547 fTree->fFriendLockStatus &= ~(fMethodBit &
kBitMask);
574 entryInRange = firstEntry;
577 entryInRange = firstEntry - pedestal;
585 if (autoflush <= 0) {
588 fStartEntry = pedestal + entryInRange - entryInRange%autoflush;
613 auto autoFlush = fTree->GetAutoFlush();
614 if (autoFlush > 0)
return autoFlush;
615 if (fEstimatedSize > 0)
return fEstimatedSize;
617 Long64_t zipBytes = fTree->GetZipBytes();
619 fEstimatedSize = fTree->GetEntries() - 1;
620 if (fEstimatedSize <= 0)
624 Long64_t cacheSize = fTree->GetCacheSize();
625 if (cacheSize == 0) {
636 if (cacheSize <= 0) {
637 cacheSize = 30000000;
639 clusterEstimate = fTree->GetEntries() * cacheSize / zipBytes;
641 fEstimatedSize = clusterEstimate ? clusterEstimate : 1;
643 return fEstimatedSize;
652 fStartEntry = fNextEntry;
653 if (fTree->fNClusterRange || fTree->GetAutoFlush() > 0) {
654 if (fClusterRange == fTree->fNClusterRange) {
657 fNextEntry += GetEstimatedClusterSize();
659 if (fStartEntry > fTree->fClusterRangeEnd[fClusterRange]) {
662 if (fClusterRange == fTree->fNClusterRange) {
665 fNextEntry += GetEstimatedClusterSize();
667 Long64_t clusterSize = fTree->fClusterSize[fClusterRange];
668 if (clusterSize == 0) {
669 clusterSize = GetEstimatedClusterSize();
671 fNextEntry += clusterSize;
672 if (fNextEntry > fTree->fClusterRangeEnd[fClusterRange]) {
676 fNextEntry = fTree->fClusterRangeEnd[fClusterRange] + 1;
682 fNextEntry = fStartEntry + GetEstimatedClusterSize();
684 if (fNextEntry > fTree->GetEntries()) {
685 fNextEntry = fTree->GetEntries();
696 fNextEntry = fStartEntry;
697 if (fTree->fNClusterRange || fTree->GetAutoFlush() > 0) {
698 if (fClusterRange == 0 || fTree->fNClusterRange == 0) {
701 fStartEntry -= GetEstimatedClusterSize();
706 if (fClusterRange == 0) {
710 Long64_t clusterSize = fTree->fClusterSize[fClusterRange];
711 if (clusterSize == 0) {
712 clusterSize = GetEstimatedClusterSize();
714 fStartEntry -= clusterSize;
719 fStartEntry = fNextEntry - GetEstimatedClusterSize();
721 if (fStartEntry < 0) {
832, fDefaultEntryOffsetLen(1000)
838, fAutoSave( -300000000)
839, fAutoFlush(-30000000)
871, fFriendLockStatus(0)
873, fCacheDoAutoInit(
kTRUE)
874, fCacheDoClusterPrefetch(
kFALSE)
876, fIMTEnabled(
ROOT::IsImplicitMTEnabled())
877, fNEntriesSinceSorting(0)
910 if (strlen(title) > 2) {
911 if (title[0] ==
'/') {
912 Branch(title+1,32000,splitlevel);
927#ifdef R__TRACK_BASKET_ALLOC_TIME
928 Info(
"TTree::~TTree",
"For tree %s, allocation time is %lluus.",
GetName(), fAllocationTime.load());
1063 Error(
"AddBranchToCache",
"Could not load a tree");
1072 Error(
"AddBranchToCache",
"No tree is available. Branch was not added to the cache");
1078 Error(
"AddBranchToCache",
"No file is available. Branch was not added to the cache");
1083 Error(
"AddBranchToCache",
"No cache is available, branch not added");
1086 return tc->
AddBranch(bname,subbranches);
1102 Error(
"AddBranchToCache",
"Could not load a tree");
1110 Error(
"AddBranchToCache",
"Error adding branch");
1115 Error(
"AddBranchToCache",
"No tree is available. Branch was not added to the cache");
1121 Error(
"AddBranchToCache",
"No file is available. Branch was not added to the cache");
1126 Error(
"AddBranchToCache",
"No cache is available, branch not added");
1146 Error(
"DropBranchFromCache",
"Could not load a tree");
1155 Error(
"DropBranchFromCache",
"No tree is available. Branch was not dropped from the cache");
1161 Error(
"DropBranchFromCache",
"No file is available. Branch was not dropped from the cache");
1166 Error(
"DropBranchFromCache",
"No cache is available, branch not dropped");
1185 Error(
"DropBranchFromCache",
"Could not load a tree");
1193 Error(
"DropBranchFromCache",
"Error dropping branch");
1198 Error(
"DropBranchFromCache",
"No tree is available. Branch was not dropped from the cache");
1204 Error(
"DropBranchFromCache",
"No file is available. Branch was not dropped from the cache");
1209 Error(
"DropBranchFromCache",
"No cache is available, branch not dropped");
1244 const auto friendHasValidIndex = [&] {
1249 if ((isMainReshuffled || isFriendReshuffled) && !friendHasValidIndex) {
1250 const auto reshuffledTreeName = isMainReshuffled ? mainTree.
GetName() : friendTree.
GetName();
1251 const auto msg =
"Tree '%s' has the kEntriesReshuffled bit set, and cannot be used as friend nor can be added as "
1252 "a friend unless the main tree has a TTreeIndex on the friend tree '%s'. You can also unset the "
1253 "bit manually if you know what you are doing.";
1254 Error(
"AddFriend", msg, reshuffledTreeName, friendTree.
GetName());
1339 bool canAddFriend =
true;
1343 Warning(
"AddFriend",
"FriendElement %s in file %s has less entries %lld than its parent Tree: %lld", treename,
1347 Error(
"AddFriend",
"Cannot find tree '%s' in file '%s', friend not added", treename, filename);
1348 canAddFriend =
false;
1373 bool canAddFriend =
true;
1377 Warning(
"AddFriend",
"FriendElement %s in file %s has less entries %lld than its parent tree: %lld", treename,
1381 Error(
"AddFriend",
"Cannot find tree '%s' in file '%s', friend not added", treename,
file->GetName());
1382 canAddFriend =
false;
1408 Warning(
"AddFriend",
"FriendElement '%s' in file '%s' has less entries %lld than its parent tree: %lld",
1415 tree->RemoveExternalFriend(fe);
1508 if (opt.
Contains(
"flushbaskets")) {
1509 if (
gDebug > 0)
Info(
"AutoSave",
"calling FlushBaskets \n");
1528 if (
file)
file->WriteStreamerInfo();
1542 const char* writeStlWithoutProxyMsg =
"The class requested (%s) for the branch \"%s\""
1543 " is an instance of an stl collection and does not have a compiled CollectionProxy."
1544 " Please generate the dictionary for this collection (%s) to avoid to write corrupted data.";
1558 Error(
"Branch", writeStlWithoutProxyMsg,
1562 return Branch(branchname, classname, (
void*) addobj, bufsize, splitlevel);
1565 void** addr = (
void**) addobj;
1569 if (ptrClass && claim) {
1576 Error(
"Branch",
"The class requested (%s) for \"%s\" is different from the type of the pointer passed (%s)",
1579 }
else if (actualClass && (claim != actualClass) && !actualClass->
InheritsFrom(claim)) {
1584 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s",
1590 Error(
"Branch", writeStlWithoutProxyMsg,
1594 return Branch(branchname, classname, (
void*) addobj, bufsize, splitlevel);
1604 Error(
"Branch",
"The pointer specified for %s is not of a class known to ROOT", branchname);
1608 void** addr = (
void**) addobj;
1609 if (addr && *addr) {
1612 Warning(
"Branch",
"The actual TClass corresponding to the object provided for the definition of the branch \"%s\" is missing.\n\tThe object will be truncated down to its %s part",
1613 branchname, ptrClass->
GetName());
1614 actualClass = ptrClass;
1615 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1616 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s", actualClass->
GetName(), branchname, ptrClass->
GetName());
1620 actualClass = ptrClass;
1623 Error(
"Branch", writeStlWithoutProxyMsg,
1627 return Branch(branchname, actualClass->
GetName(), (
void*) addobj, bufsize, splitlevel);
1639 Error(
"Branch", writeStlWithoutProxyMsg,
1642 }
else if (claim == 0) {
1643 Error(
"Branch",
"The pointer specified for %s is not of a class known to ROOT and %s is not a known class", branchname, classname);
1650 Error(
"Branch",
"Reference interface requires a valid object (for branch: %s)!", branchname);
1654 if (ptrClass && claim) {
1661 Error(
"Branch",
"The class requested (%s) for \"%s\" is different from the type of the object passed (%s)",
1664 }
else if (actualClass && (claim != actualClass) && !actualClass->
InheritsFrom(claim)) {
1669 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s",
1675 Warning(
"Branch",
"The actual TClass corresponding to the object provided for the definition of the branch \"%s\" is missing.\n\tThe object will be truncated down to its %s part",
1676 branchname, ptrClass->
GetName());
1677 actualClass = ptrClass;
1678 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1679 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s", actualClass->
GetName(), branchname, ptrClass->
GetName());
1683 Error(
"Branch", writeStlWithoutProxyMsg,
1698 Error(
"Branch",
"The pointer specified for %s is not of a class or type known to ROOT", branchname);
1701 return Branch(branchname,addobj,varname.
Data(),bufsize);
1707 Error(
"Branch",
"Reference interface requires a valid object (for branch: %s)!", branchname);
1712 Warning(
"Branch",
"The actual TClass corresponding to the object provided for the definition of the branch \"%s\" is missing.\n\tThe object will be truncated down to its %s part",
1713 branchname, ptrClass->
GetName());
1714 actualClass = ptrClass;
1715 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1716 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s", actualClass->
GetName(), branchname, ptrClass->
GetName());
1720 Error(
"Branch", writeStlWithoutProxyMsg,
1735 "The inner type of the std::array passed specified for %s is not of a class or type known to ROOT",
1740 return Branch(branchname, addobj, varname.
Data(), bufsize);
1841 Error(
"Branch",
"Cannot call this constructor for a TClonesArray");
1847 while ((obj = next())) {
1855 Branch(col, bufsize, splitlevel - 1, branchname);
1857 if (nch && (
name[nch-1] ==
'_')) {
1866 if (splitlevel > 99) {
1885 if (ob->IsA() != TFolder::Class()) {
1892 char* curname =
new char[1000];
1894 while ((obj = next())) {
1896 if (obj->IsA() == TFolder::Class()) {
1897 Branch(curname, bufsize, splitlevel - 1);
1900 for (
Int_t i = 0; i < 1000; ++i) {
1901 if (curname[i] == 0) {
1904 if (curname[i] ==
'/') {
1911 strlcat(curname, occur,1000);
2022 return Bronch(
name, classname, addobj, bufsize, splitlevel);
2024 if (splitlevel < 0) {
2027 return BranchOld(
name, classname, addobj, bufsize, splitlevel);
2076 Error(
"BranchOld",
"Cannot find class: '%s'", classname);
2081 Fatal(
"BranchOld",
"The requested class ('%s') does not inherit from TObject.\n"
2082 "\tfgBranchStyle is set to zero requesting by default to use BranchOld.\n"
2083 "\tIf this is intentional use Bronch instead of Branch or BranchOld.", classname);
2085 Fatal(
"BranchOld",
"The requested class ('%s') does not inherit from TObject.\n"
2086 "\tYou can not use BranchOld to store objects of this type.",classname);
2097 const char* rdname = 0;
2098 const char* dname = 0;
2100 char** apointer = (
char**) addobj;
2112 if (
name[lenName-1] ==
'.') {
2151 if (!strcmp(dname,
"fBits")) {
2154 if (!strcmp(dname,
"fUniqueID")) {
2164 branchname = rdname;
2168 branchname.
Form(
"%s%s",
name, &rdname[1]);
2170 branchname.
Form(
"%s%s",
name, &rdname[0]);
2176 char* pointer = ((
char*) obj) + offset;
2183 if (clobj && clobj->
InheritsFrom(TClonesArray::Class())) {
2185 char* cpointer = (
char*) pointer;
2186 char** ppointer = (
char**) cpointer;
2188 if (splitlevel != 2) {
2190 branch1 =
new TBranchClones(branch,branchname, pointer, bufsize);
2195 blist->
Add(branch1);
2203 blist->
Add(branch1);
2220 blist->
Add(branch1);
2241 if (!strcmp(rdi->
GetName(), index)) {
2244 if (!strcmp(rdi->
GetName(), aindex)) {
2256 leaflist.
Form(
"%s[%s]/%c", &rdname[0], index, vcode);
2258 Error(
"BranchOld",
"Cannot create branch for rdname: %s code: %d", branchname.
Data(), code);
2265 leaflist.
Form(
"%s/%s", dname,
"C");
2278 branch1 =
new TBranch(branch, bname, *((
void**) pointer), leaflist, bufsize);
2282 blist->
Add(branch1);
2289 leaflist.
Form(
"%s/%c", rdname, vcode);
2291 Error(
"BranchOld",
"Cannot create branch for rdname: %s code: %d", branchname.
Data(), code);
2294 branch1 =
new TBranch(branch, branchname, pointer, leaflist, bufsize);
2296 blist->
Add(branch1);
2305 Warning(
"BranchOld",
"Cannot process member: '%s'", rdname);
2414 Error(
"Bronch",
"Cannot find class:%s", classname);
2425 objptr = (
char*)addr;
2427 objptr = *((
char**) addr);
2430 if (cl == TClonesArray::Class()) {
2433 Error(
"Bronch",
"Pointer to TClonesArray is null");
2437 Error(
"Bronch",
"TClonesArray with no class defined in branch: %s",
name);
2441 Error(
"Bronch",
"TClonesArray with no dictionary defined in branch: %s",
name);
2445 if (splitlevel > 0) {
2446 if (hasCustomStreamer)
2447 Warning(
"Bronch",
"Using split mode on a class: %s with a custom Streamer", clones->
GetClass()->
GetName());
2462 if (!inklass && (collProxy->
GetType() == 0)) {
2463 Error(
"Bronch",
"%s with no class defined in branch: %s", classname,
name);
2470 Error(
"Bronch",
"Container with no dictionary defined in branch: %s",
name);
2474 Warning(
"Bronch",
"Using split mode on a class: %s with a custom Streamer", inklass->
GetName());
2485 branch =
new TBranchSTL(
this,
name, collProxy, bufsize, splitlevel );
2499 Error(
"Bronch",
"Cannot find dictionary for class: %s", classname);
2505 hasCustomStreamer =
kTRUE;
2508 if (splitlevel < 0 || ((splitlevel == 0) && hasCustomStreamer && cl->
IsTObject())) {
2514 if (cl == TClonesArray::Class()) {
2539 objptr = (
char*) cl->
New();
2547 if ((splitlevel > 0) && !cl->
CanSplit()) {
2548 if (splitlevel != 99) {
2549 Warning(
"Bronch",
"%s cannot be split, resetting splitlevel to 0", cl->
GetName());
2563 Error(
"Bronch",
"Cannot build the StreamerInfo for class: %s", cl->
GetName());
2572 if (splitlevel > 0) {
2583 branch->
Unroll(
name, cl, sinfo, objptr, bufsize, splitlevel);
2752 constexpr auto kBufSize = 2000;
2753 char* fname =
new char[kBufSize];
2756 for (
Int_t i = 0; i < 10; ++i) {
2764 strlcpy(fname,
file->GetName(), kBufSize);
2767 char* cunder = strrchr(fname,
'_');
2770 const char* cdot = strrchr(
file->GetName(),
'.');
2772 strlcat(fname, cdot, kBufSize);
2777 strlcat(fname, fcount, kBufSize);
2780 char* cdot = strrchr(fname,
'.');
2783 strlcat(fname, strrchr(
file->GetName(),
'.'), kBufSize);
2787 strlcat(fname, fcount, kBufSize);
2794 Warning(
"ChangeFile",
"file %s already exist, trying with %d underscores", fname, nus+1);
2796 Int_t compress =
file->GetCompressionSettings();
2799 Error(
"Fill",
"Failed to open new file %s, continuing as a memory tree.",fname);
2801 Printf(
"Fill: Switching to new file: %s", fname);
2807 while ((obj =
file->GetList()->First())) {
2824 while ((branch = (
TBranch*)nextb())) {
2833 if (newfile) newfile->
Append(obj);
2836 file->TObject::Delete();
2873 TClass* expectedClass = 0;
2879 bool isBranchElement = branch->
InheritsFrom( TBranchElement::Class() );
2880 if (expectedClass && datatype ==
kOther_t && ptrClass == 0) {
2881 if (isBranchElement) {
2886 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". "
2887 "The class expected (%s) refers to an stl collection and do not have a compiled CollectionProxy. "
2888 "Please generate the dictionary for this class (%s)",
2895 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". "
2896 "The class expected (%s) does not have a dictionary and needs to be emulated for I/O purposes but is being passed a compiled object."
2897 "Please generate the dictionary for this class (%s)",
2900 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". "
2901 "This is probably due to a missing dictionary, the original data class for this branch is %s.", branch->
GetName(), expectedClass->
GetName());
2905 if (expectedClass && ptrClass && (branch->
GetMother() == branch)) {
2908 Error(
"SetBranchAddress",
"The address for \"%s\" should be the address of a pointer!", branch->
GetName());
2928 if( expectedClass && ptrClass &&
2929 expectedClass != ptrClass &&
2937 Info(
"SetBranchAddress",
"Matching STL collection (at least according to the SchemaRuleSet when "
2938 "reading a %s into a %s",expectedClass->
GetName(),ptrClass->
GetName());
2945 Error(
"SetBranchAddress",
"The pointer type given \"%s\" does not correspond to the type needed \"%s\" by the branch: %s", ptrClass->
GetName(), bEl->
GetClassName(), branch->
GetName());
2956 }
else if (expectedClass && ptrClass && !expectedClass->
InheritsFrom(ptrClass)) {
2978 Error(
"SetBranchAddress",
"The pointer type given (%s) does not correspond to the class needed (%s) by the branch: %s", ptrClass->
GetName(), expectedClass->
GetName(), branch->
GetName());
2979 if (isBranchElement) {
2988 Error(
"SetBranchAddress",
"The pointer type given \"%s\" (%d) does not correspond to the type needed \"%s\" (%d) by the branch: %s",
2995 if (expectedClass) {
2996 Error(
"SetBranchAddress",
"The pointer type given \"%s\" (%d) does not correspond to the type needed \"%s\" by the branch: %s",
2998 if (isBranchElement) {
3014 if (etype == expectedType) {
3029 if (etype == expectedType) {
3041 if (len <= ptrClass->Size()) {
3045 Error(
"SetBranchAddress",
"The pointer type given \"%s\" does not correspond to the type needed \"%s\" (%d) by the branch: %s",
3051 Error(
"SetBranchAddress", writeStlWithoutProxyMsg,
3053 if (isBranchElement) {
3059 if (isBranchElement) {
3060 if (expectedClass) {
3169 for (
Int_t i = 0; i < nb; ++i) {
3179 if (thistree !=
this) {
3204 for (
Int_t lndx = 0; lndx < nleaves; ++lndx) {
3210 if (branch && (newcomp > -1)) {
3219 for (
Long64_t i = 0; i < nb; ++i) {
3230 for (
Int_t j = 0; j < nb1; ++j) {
3244 for (
Int_t k = 0; k < nb2; ++k) {
3276 Error(
"CloneTTree",
"TTree has not been cloned\n");
3299 for (
Int_t i = 0; i < nbranches; ++i) {
3306 tree->ResetBranchAddress(br);
3310 if (branch->IsA() == TBranch::Class()) {
3335 Warning(
"CopyAddresses",
"Could not find branch named '%s' in tree named '%s'", branch->
GetName(),
tree->GetName());
3343 std::set<TLeaf*> updatedLeafCount;
3344 for (
Int_t i = 0; i < ntleaves; ++i) {
3360 tree->ResetBranchAddress(tbranch);
3363 bool needAddressReset =
false;
3371 needAddressReset =
true;
3373 needAddressReset = (updatedLeafCount.find(leaf->
GetLeafCount()) != updatedLeafCount.end());
3377 if (leaf->IsA() == TLeafElement::Class() && mother)
3396 if (br->IsA() != branch->IsA()) {
3399 "Branch kind mismatch between input tree '%s' and output tree '%s' for branch '%s': '%s' vs '%s'",
3409 Warning(
"CopyAddresses",
"Could not find branch named '%s' in tree named '%s'", branch->
GetName(),
tree->GetName());
3418 (
tree->IsA()->InheritsFrom(
"TNtuple") ||
tree->IsA()->InheritsFrom(
"TNtupleD") )
3420 tree->ResetBranchAddresses();
3426 enum EOnIndexError { kDrop, kKeep, kBuild };
3428 static Bool_t R__HandleIndex(EOnIndexError onIndexError,
TTree *newtree,
TTree *oldtree)
3436 switch (onIndexError) {
3460 switch (onIndexError) {
3484 }
else if ( onIndexError == kDrop ) {
3539 EOnIndexError onIndexError;
3541 onIndexError = kKeep;
3542 }
else if (opt.
Contains(
"buildindex")) {
3543 onIndexError = kBuild;
3544 }
else if (opt.
Contains(
"dropindex")) {
3545 onIndexError = kDrop;
3547 onIndexError = kBuild;
3550 Int_t cacheSize = -1;
3553 Ssiz_t cacheSizeEnd = opt.
Index(
" ",cacheSizeLoc+10) - (cacheSizeLoc+10);
3554 TSubString cacheSizeStr( opt(cacheSizeLoc+10,cacheSizeEnd) );
3557 Warning(
"CopyEntries",
"The cachesize option can not be parsed: %s. The default size will be used.",cacheSizeStr.
String().
Data());
3560 const char *munit =
nullptr;
3563 Warning(
"CopyEntries",
"The cachesize option is too large: %s (%g%s max). The default size will be used.",cacheSizeStr.
String().
Data(),
m,munit);
3566 if (
gDebug > 0 && cacheSize != -1)
Info(
"CopyEntries",
"Using Cache size: %d\n",cacheSize);
3572 }
else if (
nentries > treeEntries) {
3576 if (fastClone && (nentries < 0 || nentries == tree->
GetEntriesFast())) {
3580 if (
tree->LoadTree(i) < 0) {
3584 withIndex = R__HandleIndex( onIndexError,
this,
tree );
3609 if (needCopyAddresses) {
3615 for (
Long64_t ii = 0; ii < tentries; ii++) {
3616 if (localtree->
GetEntry(ii) <= 0) {
3621 if (needCopyAddresses)
3622 tree->ResetBranchAddresses();
3628 if (
tree->GetDirectory() &&
tree->GetDirectory()->GetFile()) {
3629 Warning(
"CopyEntries",
"Skipped file %s\n",
tree->GetDirectory()->GetFile()->GetName());
3631 Warning(
"CopyEntries",
"Skipped file number %d\n",
tree->GetTreeNumber());
3645 }
else if (
nentries > treeEntries) {
3648 if (needCopyAddresses) {
3654 Int_t treenumber = -1;
3656 if (
tree->LoadTree(i) < 0) {
3659 if (treenumber !=
tree->GetTreeNumber()) {
3661 withIndex = R__HandleIndex( onIndexError,
this,
tree );
3663 treenumber =
tree->GetTreeNumber();
3665 if (
tree->GetEntry(i) <= 0) {
3668 nbytes += this->
Fill();
3670 if (needCopyAddresses)
3671 tree->ResetBranchAddresses();
3747 if (
file && !strcmp(option,
"all")) {
3748 if (!
file->IsWritable()) {
3749 Error(
"Delete",
"File : %s is not writable, cannot delete Tree:%s",
file->GetName(),
GetName());
3766 Int_t nbytes,objlen,keylen;
3767 while ((leaf = (
TLeaf*)next())) {
3770 for (
Int_t i=0;i<nbaskets;i++) {
3774 if (!branchFile)
continue;
3776 if (nbytes <= 0)
continue;
3777 branchFile->
MakeFree(pos,pos+nbytes-1);
3791 if (dirsav) dirsav->
cd();
3792 if (
gDebug)
Info(
"TTree::Delete",
"Deleting Tree: %s: %d baskets deleted. Total space freed = %d bytes\n",
GetName(),nbask,ntot);
4514 for (
Int_t i = 0; i < nb; ++i) {
4527 for (
Int_t i = 0; i < nleaves; ++i) {
4531 for (
Int_t j = 0; j < nbaskets - 1; ++j) {
4620 for (
Int_t i = 0; i < nbranches; ++i) {
4628 nwrite = branch->
FillImpl(
nullptr);
4630 nwrite = branch->
FillImpl(useIMT ? &imtHelper :
nullptr);
4634 Error(
"Fill",
"Failed filling branch:%s.%s, nbytes=%d, entry=%lld\n"
4635 " This error is symptomatic of a Tree created as a memory-resident Tree\n"
4636 " Instead of doing:\n"
4637 " TTree *T = new TTree(...)\n"
4638 " TFile *f = new TFile(...)\n"
4640 " TFile *f = new TFile(...)\n"
4641 " TTree *T = new TTree(...)\n\n",
4644 Error(
"Fill",
"Failed filling branch:%s.%s, nbytes=%d, entry=%lld",
GetName(), branch->
GetName(), nwrite,
4676 bool autoFlush =
false;
4677 bool autoSave =
false;
4695 if (autoFlush || autoSave) {
4706 Info(
"TTree::Fill",
"OptimizeBaskets called at entry %lld, fZipBytes=%lld, fFlushedBytes=%lld\n",
4718 if (zipBytes != 0) {
4720 }
else if (totBytes != 0) {
4724 TTree::Class()->WriteBuffer(
b, (
TTree *)
this);
4755 Info(
"TTree::Fill",
"FlushBaskets() called at entry %lld, fZipBytes=%lld, fFlushedBytes=%lld\n",
fEntries,
4763 Info(
"TTree::Fill",
"AutoSave called at entry %lld, fZipBytes=%lld, fSavedBytes=%lld\n",
fEntries,
4778 return nerror == 0 ? nbytes : -1;
4786 if (list==0 || branchname == 0 || branchname[0] ==
'\0')
return 0;
4790 UInt_t brlen = strlen(branchname);
4792 for(
Int_t index = 0; index < nbranches; ++index) {
4797 if (len &&
name[len-1]==
']') {
4798 const char *dim = strchr(
name,
'[');
4803 if (brlen == len && strncmp(branchname,
name,len)==0) {
4807 if ((brlen >= len) && (branchname[len] ==
'.')
4808 && strncmp(
name, branchname, len) == 0) {
4815 if (next)
return next;
4817 const char *dot = strchr((
char*)branchname,
'.');
4819 if (len==(
size_t)(dot-branchname) &&
4820 strncmp(branchname,
name,dot-branchname)==0 ) {
4848 if (branch)
return branch;
4852 if (branch)
return branch;
4856 while ((branch = (
TBranch*) next())) {
4859 return nestedbranch;
4876 const char *subbranch = strstr(branchname, fe->
GetName());
4877 if (subbranch != branchname) {
4881 subbranch += strlen(fe->
GetName());
4882 if (*subbranch !=
'.') {
4888 std::ostringstream
name;
4915 char* subsearchname = (
char*) strstr(searchname,
GetName());
4916 if (subsearchname != searchname) {
4919 if (subsearchname) {
4920 subsearchname += strlen(
GetName());
4921 if (*subsearchname !=
'.') {
4925 if (subsearchname[0]==0) {
4936 const bool searchnameHasDot = strchr(searchname,
'.') !=
nullptr;
4941 while ((leaf = (
TLeaf*) next())) {
4944 if (dim >= 0) leafname.
Remove(dim);
4946 if (leafname == searchname) {
4949 if (subsearchname && leafname == subsearchname) {
4955 dim = leaftitle.
First(
'[');
4956 if (dim >= 0) leaftitle.
Remove(dim);
4958 if (leaftitle == searchname) {
4961 if (subsearchname && leaftitle == subsearchname) {
4964 if (!searchnameHasDot)
4969 dim = longname.
First(
'[');
4970 if (dim>=0) longname.
Remove(dim);
4971 if (longname == searchname) {
4974 if (subsearchname && longname == subsearchname) {
4978 dim = longtitle.
First(
'[');
4979 if (dim>=0) longtitle.
Remove(dim);
4980 if (longtitle == searchname) {
4983 if (subsearchname && longtitle == subsearchname) {
4991 if (strstr(searchname,
".") && !strcmp(searchname, branch->
GetName())) {
4994 if (subsearchname && strstr(subsearchname,
".") && !strcmp(subsearchname, branch->
GetName())) {
5012 subsearchname = (
char*) strstr(searchname, fe->
GetName());
5013 if (subsearchname != searchname) {
5016 if (subsearchname) {
5017 subsearchname += strlen(fe->
GetName());
5018 if (*subsearchname !=
'.') {
5024 if (subsearchname) {
5025 leafname.
Form(
"%s.%s",t->
GetName(),subsearchname);
5027 leafname = searchname;
5069 return fPlayer->
Fit(funcname, varexp, selection, option, goption,
nentries, firstentry);
5075struct BoolRAIIToggle {
5078 BoolRAIIToggle(
Bool_t &val) : m_val(val) { m_val =
true; }
5079 ~BoolRAIIToggle() { m_val =
false; }
5118 if (retval == -1)
return retval;
5153 std::atomic<Int_t> nerrpar(0);
5154 std::atomic<Int_t> nbpar(0);
5155 std::atomic<Int_t> pos(0);
5157 auto mapFunction = [&]() {
5163 Int_t j = pos.fetch_add(1);
5169 std::stringstream ss;
5170 ss << std::this_thread::get_id();
5171 Info(
"FlushBaskets",
"[IMT] Thread %s", ss.str().c_str());
5172 Info(
"FlushBaskets",
"[IMT] Running task for branch #%d: %s", j, branch->GetName());
5175 Int_t nbtask = branch->FlushBaskets();
5177 if (nbtask < 0) { nerrpar++; }
5178 else { nbpar += nbtask; }
5182 pool.
Foreach(mapFunction, nb);
5188 return nerrpar ? -1 : nbpar.load();
5191 for (
Int_t j = 0; j < nb; j++) {
5234 const char* alias = t->
GetAlias(aliasName);
5238 const char* subAliasName = strstr(aliasName, fe->
GetName());
5239 if (subAliasName && (subAliasName[strlen(fe->
GetName())] ==
'.')) {
5259 for (
Int_t i = 0; i < nb; i++) {
5263 if (!strcmp(
b->GetName(),
name)) {
5266 if (!strcmp(
b->GetFullName(),
name)) {
5270 result = R__GetBranch(*(
b->GetListOfBranches()),
name);
5282 if (
name == 0)
return 0;
5304 for (
Int_t i = 0; i < nleaves; i++) {
5341 char* subname = (
char*) strstr(
name, fe->
GetName());
5342 if (subname !=
name) {
5347 if (*subname !=
'.') {
5394 auto calculateCacheSize = [=](
Double_t cacheFactor)
5401 if (medianClusterSize > 0)
5404 cacheSize =
Long64_t(cacheFactor * 1.5 * 30000000);
5408 if (cacheSize >= (INT_MAX / 4)) {
5409 cacheSize = INT_MAX / 4;
5416 if (!(stcs =
gSystem->
Getenv(
"ROOT_TTREECACHE_SIZE")) || !*stcs) {
5422 if (cacheFactor < 0.0) {
5427 Long64_t cacheSize = calculateCacheSize(cacheFactor);
5429 if (cacheSize < 0) {
5433 if (cacheSize == 0 && withDefault) {
5434 cacheSize = calculateCacheSize(1.0);
5629 if (entry < 0 || entry >=
fEntries)
return 0;
5641 auto seqprocessing = [&]() {
5643 for (i=0;i<nbranches;i++) {
5645 nb = branch->
GetEntry(entry, getall);
5658 nb = branch->GetEntry(entry, getall);
5662 if (nb < 0)
return nb;
5668 std::atomic<Int_t> pos(0);
5669 std::atomic<Int_t> nbpar(0);
5671 auto mapFunction = [&]() {
5677 Int_t j = pos.fetch_add(1);
5683 std::stringstream ss;
5684 ss << std::this_thread::get_id();
5685 Info(
"GetEntry",
"[IMT] Thread %s", ss.str().c_str());
5686 Info(
"GetEntry",
"[IMT] Running task for branch #%d: %s", j, branch->GetName());
5689 std::chrono::time_point<std::chrono::system_clock> start, end;
5691 start = std::chrono::system_clock::now();
5692 nbtask = branch->GetEntry(entry, getall);
5693 end = std::chrono::system_clock::now();
5695 Long64_t tasktime = (
Long64_t)std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
5698 if (nbtask < 0) errnb = nbtask;
5699 else nbpar += nbtask;
5725 if (nb < 0)
return nb;
5742 if (nb < 0)
return nb;
5777 if (checkLeafCount) {
5778 for (
Int_t i = 0; i < nbranches; i++) {
5782 auto countBranch = leafCount->GetBranch();
5792 if (!checkLeafCount) {
5795 for (
Int_t i = 0; i < nbranches; i++) {
5807 [](std::pair<Long64_t,TBranch*>
a, std::pair<Long64_t,TBranch*>
b) {
5808 return a.first > b.first;
5827 [](std::pair<Long64_t,TBranch*>
a, std::pair<Long64_t,TBranch*>
b) {
5828 return a.first > b.first;
5933 for (i = 0; i < nbranches; ++i) {
5936 if (nb < 0)
return nb;
5948 if (serial <0)
return -nbytes;
5950 if (nb < 0)
return nb;
5975 if (strcmp(friendname,fe->
GetName())==0
6089 leaf = branch->
GetLeaf(leafname);
6096 while ((leaf = (
TLeaf*)nextl())) {
6097 if (strcmp(leaf->
GetFullName(), leafname) != 0 && strcmp(leaf->
GetName(), leafname) != 0)
6105 UInt_t nbch = strlen(branchname);
6106 const char* brname = br->
GetName();
6108 if (strncmp(brname,branchname,nbch)) {
6110 const char *mothername = mother->
GetName();
6111 UInt_t motherlen = strlen(mothername);
6112 if (!strcmp(mothername, branchname)) {
6114 }
else if (nbch > motherlen && strncmp(mothername,branchname,motherlen)==0 && (mothername[motherlen-1]==
'.' || branchname[motherlen]==
'.')) {
6116 if (strncmp(brname,branchname+motherlen+1,nbch-motherlen-1)) {
6132 if ((strlen(brname) > nbch) && (brname[nbch] !=
'.') && (brname[nbch] !=
'[')) {
6145 leaf = t->
GetLeaf(branchname, leafname);
6146 if (leaf)
return leaf;
6157 char *subname = (
char*)strstr(leafname,fe->
GetName());
6158 if (subname != leafname)
continue;
6161 if (*subname !=
'.')
continue;
6163 strippedArg += subname;
6164 leaf = t->
GetLeaf(branchname,subname);
6165 if (leaf)
return leaf;
6182 if (leafname == 0)
return 0;
6207 std::string path(
name);
6208 const auto sep = path.find_last_of(
"/");
6209 if (sep != std::string::npos)
6235 if (entryNumber < 0)
break;
6275 if (entryNumber < 0)
break;
6319 if (create && !pe) {
6392 if (autoflush > 0 && autosave > 0) {
6404 for (
Int_t i = 0; i < nb; ++i) {
6411 for(
Int_t i = 0, j = 0; j < oldsize; ++j) {
6442 Int_t nimported = 0;
6443 while ((leaf=(
TLeaf*)next())) {
6500 friendHasEntry =
kTRUE;
6627 Warning(
"MakeCode",
"MakeCode is obsolete. Use MakeClass or MakeSelector instead");
6753Int_t TTree::MakeProxy(
const char* proxyClassname,
const char* macrofilename,
const char* cutfilename,
const char* option,
Int_t maxUnrolling)
6757 return fPlayer->
MakeProxy(proxyClassname,macrofilename,cutfilename,option,maxUnrolling);
6843 while ((obj=next())) {
6849 newtree = (
TTree*)
tree->CloneTree(-1, options);
6850 if (!newtree)
continue;
6856 tree->GetListOfClones()->Remove(newtree);
6857 tree->ResetBranchAddresses();
6887 if (
tree==
this)
continue;
6888 if (!
tree->InheritsFrom(TTree::Class())) {
6889 Error(
"Add",
"Attempt to add object of class: %s to a %s",
tree->ClassName(),
ClassName());
6914 const char *options = info ? info->
fOptions.
Data() :
"";
6950 if (
tree==
this)
continue;
6951 if (!
tree->InheritsFrom(TTree::Class())) {
6952 Error(
"Add",
"Attempt to add object of class: %s to a %s",
tree->ClassName(),
ClassName());
6972 if (src == dst)
return;
6999 if (!newdirectory) {
7010 return cloner.
Exec();
7022 while ((leaf = (
TLeaf*) next())) {
7054 if (nleaves == 0 || treeSize == 0) {
7058 Double_t aveSize = treeSize/nleaves;
7062 Int_t i, oldMemsize,newMemsize,oldBaskets,newBaskets;
7063 i = oldMemsize = newMemsize = oldBaskets = newBaskets = 0;
7068 for (
Int_t pass =0;pass<2;pass++) {
7073 for (i=0;i<nleaves;i++) {
7077 Double_t idealFactor = totBytes/aveSize;
7081 sizeOfOneEntry = aveSize;
7086 oldMemsize += oldBsize;
7087 oldBaskets += 1+
Int_t(totBytes/oldBsize);
7090 newBaskets += 1+
Int_t(totBytes/oldBsize);
7093 Double_t bsize = oldBsize*idealFactor*memFactor;
7094 if (bsize < 0) bsize = bmax;
7095 if (bsize > bmax) bsize = bmax;
7104 newBsize = newBsize + (clusterSize *
sizeof(
Int_t) * 2);
7113 newBsize = newBsize - newBsize%512 + 512;
7115 if (newBsize < sizeOfOneEntry) newBsize = sizeOfOneEntry;
7116 if (newBsize < bmin) newBsize = bmin;
7117 if (newBsize > 10000000) newBsize = bmax;
7119 if (pDebug)
Info(
"OptimizeBaskets",
"Changing buffer size from %6d to %6d bytes for %s\n",oldBsize,newBsize,branch->
GetName());
7122 newMemsize += newBsize;
7126 newBaskets += 1+
Int_t(totBytes/newBsize);
7127 if (pass == 0)
continue;
7131 if (comp > 1 && comp < minComp) {
7132 if (pDebug)
Info(
"OptimizeBaskets",
"Disabling compression for branch : %s\n",branch->
GetName());
7138 if (memFactor > 100) memFactor = 100;
7139 Double_t bmin_new = bmin*memFactor;
7140 Double_t bmax_new = bmax*memFactor;
7141 static const UInt_t hardmax = 1*1024*1024*1024;
7148 static const UInt_t hardmin = 8;
7149 bmin = (bmin_new > hardmax) ? hardmax : ( bmin_new < hardmin ? hardmin : (
UInt_t)bmin_new );
7150 bmax = (bmax_new > hardmax) ? bmin : (
UInt_t)bmax_new;
7153 Info(
"OptimizeBaskets",
"oldMemsize = %d, newMemsize = %d\n",oldMemsize, newMemsize);
7154 Info(
"OptimizeBaskets",
"oldBaskets = %d, newBaskets = %d\n",oldBaskets, newBaskets);
7226 TTree::Class()->WriteBuffer(
b, (
TTree*)
this);
7233 Printf(
"******************************************************************************");
7236 Printf(
"* : : Tree compression factor = %6.2f *", cx);
7237 Printf(
"******************************************************************************");
7240 if (option ==
nullptr)
7243 if (strncmp(option,
"clusters",strlen(
"clusters"))==0) {
7244 Printf(
"%-16s %-16s %-16s %8s %20s",
7245 "Cluster Range #",
"Entry Start",
"Last Entry",
"Size",
"Number of clusters");
7249 bool estimated =
false;
7250 bool unknown =
false;
7253 if (recordedSize > 0) {
7254 nclusters = (1 + end - start) / recordedSize;
7255 Printf(
"%-16d %-16lld %-16lld %8lld %10lld",
7256 ind, start, end, recordedSize, nclusters);
7262 if (estimated_size > 0) {
7263 nclusters = (1 + end - start) / estimated_size;
7264 Printf(
"%-16d %-16lld %-16lld %8lld %10lld (estimated)",
7265 ind, start, end, recordedSize, nclusters);
7268 Printf(
"%-16d %-16lld %-16lld %8lld (unknown)",
7269 ind, start, end, recordedSize);
7274 totalClusters += nclusters;
7284 Printf(
"Total number of clusters: (unknown)");
7286 Printf(
"Total number of clusters: %lld %s", totalClusters, estimated ?
"(estimated)" :
"");
7295 if (strstr(option,
"toponly")) {
7298 for (
l=0;
l<nl;
l++) {
7301 if (strchr(br->
GetName(),
'.')) {
7309 for (
l=0;
l<nl;
l++) {
7310 if (count[
l] < 0)
continue;
7318 if (strlen(option) && strchr(option,
'*')) reg = option;
7322 while ((br= (
TBranch*)next())) {
7334 if (!
fFriends || !strstr(option,
"all"))
return;
7340 if (t) t->
Print(option);
7360 if (tc) tc->
Print(option);
7486 var.
Form(
"%s>>%s", varexp, hname);
7489 opt.
Form(
"%sgoff", option);
7554 Error(
"ReadFile",
"Cannot open file: %s",filename);
7557 const char* ext = strrchr(filename,
'.');
7558 if(ext != NULL && ((strcmp(ext,
".csv") == 0) || (strcmp(ext,
".CSV") == 0)) && delimiter ==
' ') {
7561 return ReadStream(in, branchDescriptor, delimiter);
7570 Long_t inPos = inputStream.tellg();
7571 char newline =
'\n';
7575 if(!inputStream.good()) {
7576 Error(
"ReadStream",
"Error reading stream: no newline found.");
7579 if(
c == newline)
break;
7585 inputStream.clear();
7586 inputStream.seekg(inPos);
7598 std::stringstream ss;
7599 std::istream *inTemp;
7600 Long_t inPos = inputStream.tellg();
7601 if (!inputStream.good()) {
7602 Error(
"ReadStream",
"Error reading stream");
7606 ss << std::cin.rdbuf();
7611 inTemp = &inputStream;
7613 std::istream& in = *inTemp;
7618 if (nbranches == 0) {
7619 char *bdname =
new char[4000];
7620 char *bd =
new char[100000];
7622 if (branchDescriptor) nch = strlen(branchDescriptor);
7626 in.getline(bd, 100000, newline);
7630 Error(
"ReadStream",
"Error reading stream");
7634 while( isspace(*cursor) && *cursor !=
'\n' && *cursor !=
'\0') {
7637 if (*cursor !=
'#' && *cursor !=
'\n' && *cursor !=
'\0') {
7644 strlcpy(bd,branchDescriptor,100000);
7649 void *address = &bd[90000];
7653 if(delimiter !=
' ') {
7655 if (strchr(bdcur,bdelim)==0 && strchr(bdcur,
':') != 0) {
7661 char *colon = strchr(bdcur,bdelim);
7662 if (colon) *colon = 0;
7663 strlcpy(bdname,bdcur,4000);
7664 char *
slash = strchr(bdname,
'/');
7670 desc.
Form(
"%s/%s",bdname,olddesc.Data());
7672 char *bracket = strchr(bdname,
'[');
7676 branch =
new TBranch(
this,bdname,address,desc.
Data(),32000);
7679 Warning(
"ReadStream",
"Illegal branch definition: %s",bdcur);
7694 Info(
"ReadStream",
"Will use branches:");
7695 for (
int i = 0 ; i < nbranches; ++i) {
7701 Info(
"ReadStream",
"Dumping read tokens, format:");
7702 Info(
"ReadStream",
"LLLLL:BBB:gfbe:GFBE:T");
7703 Info(
"ReadStream",
" L: line number");
7704 Info(
"ReadStream",
" B: branch number");
7705 Info(
"ReadStream",
" gfbe: good / fail / bad / eof of token");
7706 Info(
"ReadStream",
" GFBE: good / fail / bad / eof of file");
7707 Info(
"ReadStream",
" T: Token being read");
7714 const char sDelimBuf[2] = { delimiter, 0 };
7715 const char* sDelim = sDelimBuf;
7716 if (delimiter ==
' ') {
7721 if (newline ==
'\r' && in.peek() ==
'\n') {
7725 std::getline(in,
line, newline);
7732 Info(
"ReadStream",
"Skipping empty line number %lld", nlines);
7736 if (sLine[0] ==
'#') {
7738 Info(
"ReadStream",
"Skipping comment line number %lld: '%s'",
7739 nlines,
line.c_str());
7744 Info(
"ReadStream",
"Parsing line number %lld: '%s'",
7745 nlines,
line.c_str());
7752 std::stringstream sToken;
7756 Int_t remainingLeafLen = 0;
7757 while (goodLine && iBranch < nbranches
7758 && sLine.
Tokenize(tok, pos, sDelim)) {
7760 if (tok.
IsNull() && delimiter ==
' ') {
7766 if (!remainingLeafLen) {
7771 if (!remainingLeafLen) {
7772 remainingLeafLen = leaf->
GetLen();
7776 remainingLeafLen = 1;
7786 if (remainingLeafLen) {
7794 sToken.seekp(0, std::ios_base::beg);
7795 sToken.str(leafData.
Data());
7796 sToken.seekg(0, std::ios_base::beg);
7799 Info(
"ReadStream",
"%5lld:%3d:%d%d%d%d:%d%d%d%d:%s",
7801 (
int)sToken.good(), (
int)sToken.fail(),
7802 (
int)sToken.bad(), (
int)sToken.eof(),
7803 (
int)in.good(), (
int)in.fail(),
7804 (
int)in.bad(), (
int)in.eof(),
7805 sToken.str().c_str());
7812 "Buffer error while reading data for branch %s on line %lld",
7814 }
else if (!sToken.eof()) {
7815 if (sToken.fail()) {
7817 "Couldn't read formatted data in \"%s\" for branch %s on line %lld; ignoring line",
7821 std::string remainder;
7822 std::getline(sToken, remainder, newline);
7823 if (!remainder.empty()) {
7825 "Ignoring trailing \"%s\" while reading data for branch %s on line %lld",
7826 remainder.c_str(), branch->
GetName(), nlines);
7832 if (iBranch < nbranches) {
7834 "Read too few columns (%d < %d) in line %lld; ignoring line",
7835 iBranch, nbranches, nlines);
7837 }
else if (pos !=
kNPOS) {
7839 if (pos < sLine.
Length()) {
7841 "Ignoring trailing \"%s\" while reading line %lld",
7842 sLine.
Data() + pos - 1 ,
7921 for (
Int_t i = 0; i < nleaves; i++) {
7972 if (friend_t == oldFriend) {
8000 for (
Int_t i = 0; i < nb; ++i) {
8002 branch->
Reset(option);
8030 for (
Int_t i = 0; i < nb; ++i) {
8059 for (
Int_t i = 0; i < nbranches; ++i) {
8118 if (!aliasName || !aliasFormula) {
8121 if (!aliasName[0] || !aliasFormula[0]) {
8274 std::vector<Long64_t> clusterSizesPerRange;
8282 std::vector<double> nClustersInRange;
8283 nClustersInRange.reserve(clusterSizesPerRange.size());
8285 auto clusterRangeStart = 0ll;
8292 nClustersInRange.emplace_back(nClusters);
8296 R__ASSERT(nClustersInRange.size() == clusterSizesPerRange.size());
8297 const auto medianClusterSize =
8298 TMath::Median(nClustersInRange.size(), clusterSizesPerRange.data(), nClustersInRange.data());
8299 return medianClusterSize;
8335 for (
Int_t i = 0; i < nleaves; i++) {
8346 Error(
"SetBasketSize",
"unknown branch -> '%s'", bname);
8362 Error(
"SetBranchAddress",
"unknown branch -> %s", bname);
8392 Error(
"SetBranchAddress",
"unknown branch -> %s", bname);
8426 const char *bname = branch->
GetName();
8427 while ((clone = (
TTree*) next())) {
8429 if (cloneBr && (cloneBr->
GetAddress() == oldAddr)) {
8514 if (0 == strcmp(bname,
"")) {
8515 Error(
"SetBranchStatus",
"Input regexp is an empty string: no match against branch names will be attempted.");
8519 TBranch *branch, *bcount, *bson;
8520 TLeaf *leaf, *leafcount;
8529 for (i=0;i<nleaves;i++) {
8533 if (strcmp(bname,
"*")) {
8536 if (strcmp(bname,branch->
GetName())
8537 && longname != bname
8550 if (nb==0 && strchr(bname,
'*')==0) {
8560 UInt_t foundInFriend = 0;
8571 char *subbranch = (
char*)strstr(bname,fe->
GetName());
8572 if (subbranch!=bname) subbranch = 0;
8574 subbranch += strlen(fe->
GetName());
8575 if ( *subbranch !=
'.' ) subbranch = 0;
8586 if (!nb && !foundInFriend) {
8589 if (strchr(bname,
'*') != 0)
8590 Error(
"SetBranchStatus",
"No branch name is matching wildcard -> %s", bname);
8592 Error(
"SetBranchStatus",
"unknown branch -> %s", bname);
8594 if (strchr(bname,
'*') != 0)
8595 Warning(
"SetBranchStatus",
"No branch name is matching wildcard -> %s", bname);
8597 Warning(
"SetBranchStatus",
"unknown branch -> %s", bname);
8602 if (found) *found = nb + foundInFriend;
8606 for (i = 0; i < nleaves; i++) {
8618 for (j=0;j<nbranches;j++) {
8620 if (!bson)
continue;
8688 if (cacheSize < 0) {
8692 if (cacheSize == 0) {
8694 }
else if (cacheSize < 0) {
8709 if (!autocache && cacheSize>0) {
8710 Warning(
"SetCacheSizeAux",
"A TTreeCache could not be created because the TTree has no file");
8745 if (cacheSize == 0) {
8748 file->SetCacheRead(0,
this);
8767 Error(
"SetCacheSizeAux",
"Not setting up an automatically sized TTreeCache because of missing cache previously set");
8775 if (cacheSize == 0 || pf) {
8802 Error(
"SetCacheEntryRange",
"Could not load a tree");
8811 Error(
"SetCacheEntryRange",
"No tree is available. Could not set cache entry range");
8817 Error(
"SetCacheEntryRange",
"No file is available. Could not set cache entry range");
8822 Error(
"SetCacheEntryRange",
"No cache is available. Could not set entry range");
8861 if (maxEntries <= 0) {
8876 for (
Int_t i = 0; i < nb; i++) {
8909 if (newdefault < 10) {
8913 if (updateExisting) {
8916 while ( (
b = (
TBranch*)next() ) ) {
8987 TBranch*
b(
nullptr), *bMin(
nullptr), *bMax(
nullptr);
8993 if (!bMin || n2 < nMin) {
8997 if (!bMax || n2 > nMax) {
9002 if (bMin && nMin != nMax) {
9003 Warning(
"SetEntries",
"Tree branches have different numbers of entries, eg %s has %lld entries while %s has %lld entries.",
9004 bMin->GetName(), nMin, bMax->
GetName(), nMax);
9056 char enlistname[100];
9063 for (
Int_t i=0; i<nsel; i++){
9104 UChar_t newFeatures = ~curFeatures & featuresRequested;
9105 curFeatures |= newFeatures;
9123 Warning(
"SetFileNumber",
"file number must be positive. Set to 0");
9149 for (
Int_t i = 0; i < nb; ++i) {
9249 if (pf && !( opt ^ (
nullptr !=
dynamic_cast<TTreeCacheUnzip*
>(pf)))) {
9257 unzip->SetUnzipBufferSize(
Long64_t(cacheSize * RelSize) );
9331 Error(
"Show()",
"Cannot read entry %lld (entry does not exist)", entry);
9333 }
else if (ret == -1) {
9334 Error(
"Show()",
"Cannot read entry %lld (I/O error)", entry);
9339 Error(
"Show()",
"Cannot read entry %lld (I/O error)", entry);
9341 }
else if (ret == 0) {
9342 Error(
"Show()",
"Cannot read entry %lld (no data read)", entry);
9350 for (
Int_t i = 0; i < nleaves; i++) {
9361 if (leaf->IsA() == TLeafElement::Class()) {
9369 if (leaf->IsA() == TLeafF::Class()) {
9372 if (leaf->IsA() == TLeafD::Class()) {
9375 if (leaf->IsA() == TLeafC::Class()) {
9379 printf(
" %-15s = ", leaf->
GetName());
9382 if (
l == (len - 1)) {
9387 if ((
l % ltype) == 0) {
9419 Error(
"StopCacheLearningPhase",
"Could not load a tree");
9428 Error(
"StopCacheLearningPhase",
"No tree is available. Could not stop cache learning phase");
9434 Error(
"StopCacheLearningPhase",
"No file is available. Could not stop cache learning phase");
9439 Error(
"StopCacheLearningPhase",
"No cache is available. Could not stop learning phase");
9452 for (
Int_t i = 0; i < nb; ++i) {
9457 for (
Int_t j = writeBasket; j >= 0; --j) {
9488 if (
b.IsReading()) {
9499 Version_t R__v =
b.ReadVersion(&R__s, &R__c);
9501 b.ReadClassBuffer(TTree::Class(),
this, R__v, R__s, R__c);
9513 Warning(
"Streamer",
"Old style index in this tree is deleted. Rebuild the index via TTree::BuildIndex");
9539 TNamed::Streamer(
b);
9540 TAttLine::Streamer(
b);
9541 TAttFill::Streamer(
b);
9542 TAttMarker::Streamer(
b);
9558 if (R__v > 2)
fIndex.Streamer(
b);
9561 OldInfoList.Streamer(
b);
9567 b.CheckByteCount(R__s, R__c, TTree::IsA());
9576 b.WriteClassBuffer(TTree::Class(),
this);
9696 return ((
const TTree*)
this)->Write(
name, option, bufsize);
9726, fDirection(iter.fDirection)
9735 if (
this != &rhs && rhs.IsA() == TTreeFriendLeafIter::Class()) {
9758 if (!
fTree)
return 0;
9765 if (!list)
return 0;
9774 if (!list)
return next;
9782 if (!nextTree)
return Next();
typedef void(GLAPIENTRYP _GLUfuncptr)(void)
#define R__unlikely(expr)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
unsigned long long ULong64_t
const Int_t kDoNotProcess
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
static unsigned int total
R__EXTERN TInterpreter * gCling
R__EXTERN TVirtualMutex * gROOTMutex
void Printf(const char *fmt,...)
R__EXTERN TStyle * gStyle
R__EXTERN TSystem * gSystem
constexpr Int_t kNEntriesResort
static TBranch * R__FindBranchHelper(TObjArray *list, const char *branchname)
Search in the array for a branch matching the branch name, with the branch possibly expressed as a 'f...
static char DataTypeToChar(EDataType datatype)
void TFriendElement__SetTree(TTree *tree, TList *frlist)
Set the fTree member for all friend elements.
bool CheckReshuffling(TTree &mainTree, TTree &friendTree)
static void TBranch__SetTree(TTree *tree, TObjArray &branches)
Set the fTree member for all branches and sub branches.
constexpr Float_t kNEntriesResortInv
#define R__LOCKGUARD(mutex)
Bool_t HasRuleWithSourceClass(const TString &source) const
Return True if we have any rule whose source class is 'source'.
A helper class for managing IMT work during TTree:Fill operations.
TIOFeatures provides the end-user with the ability to change the IO behavior of data written via a TT...
UChar_t GetFeatures() const
bool Set(EIOFeatures bits)
Set a specific IO feature.
This class provides a simple interface to execute the same task multiple times in parallel threads,...
void Foreach(F func, unsigned nTimes, unsigned nChunks=0)
Execute a function without arguments several times in parallel, dividing the execution in nChunks.
void Set(Int_t n)
Set size of this array to n doubles.
void Set(Int_t n)
Set size of this array to n ints.
Fill Area Attributes class.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual Size_t GetMarkerSize() const
Return the marker size.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Each class (see TClass) has a linked list of its base class(es).
ROOT::ESTLType IsSTLContainer()
Return which type (if any) of STL container the data member is.
Manages buffers for branches of a Tree.
virtual Int_t DropBuffers()
Drop buffers of this basket if it is not the current basket.
Int_t GetBufferSize() const
A Branch for the case of an array of clone objects.
A Branch for the case of an object.
virtual void ResetAddress()
Set branch address to zero and free all allocated memory.
virtual void SetBranchFolder()
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
virtual Bool_t IsObjectOwner() const
virtual void SetObject(void *objadd)
Set object this branch is pointing to.
virtual void SetAddress(void *addobj)
Point this branch at an object.
Int_t Unroll(const char *name, TClass *cltop, TClass *cl, char *ptr, Int_t basketsize, Int_t splitlevel, Int_t btype)
Split class cl into sub-branches of this branch.
virtual void SetTargetClass(const char *name)
Set the name of the class of the in-memory object into which the data will loaded.
A Branch for the case of an object.
A branch containing and managing a TRefTable for TRef autoloading.
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch after a Merge operation (drop data but keep customizations) TRefTable is cleared.
virtual void Reset(Option_t *option="")
virtual void Clear(Option_t *option="")
Clear entries in the TRefTable.
virtual void Print(Option_t *option="") const
Print the TRefTable branch.
A Branch handling STL collection of pointers (vectors, lists, queues, sets and multisets) while stori...
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 Long64_t GetBasketSeek(Int_t basket) const
Return address of basket in the file.
virtual char * GetAddress() const
void SetCompressionSettings(Int_t settings=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault)
Set compression settings.
virtual TString GetFullName() const
Return the 'full' name of the branch.
Int_t GetWriteBasket() const
virtual void DropBaskets(Option_t *option="")
Loop on all branch baskets.
TObjArray * GetListOfBranches()
virtual void SetTree(TTree *tree)
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 Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
static void ResetCount()
Static function resetting fgCount.
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.
virtual void SetAddress(void *add)
Set address of this branch.
TObjArray * GetListOfBaskets()
Long64_t GetEntries() const
virtual void UpdateFile()
Refresh the value of fDirectory (i.e.
Int_t GetReadBasket() const
virtual void Print(Option_t *option="") const
Print TBranch parameters.
Int_t GetMaxBaskets() const
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 KeepCircular(Long64_t maxEntries)
keep a maximum of fMaxEntries in memory
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
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 TBranch * FindBranch(const char *name)
Find the immediate sub-branch with passed name.
virtual Int_t LoadBaskets()
Baskets associated to this branch are forced to be in memory.
void SetIOFeatures(TIOFeatures &features)
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.
virtual void SetOffset(Int_t offset=0)
virtual Int_t GetExpectedType(TClass *&clptr, EDataType &type)
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
virtual Int_t GetBasketSize() const
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.
TObjArray * GetListOfLeaves()
virtual void Reset(Option_t *option="")
Reset a Branch.
TBranch * GetMother() const
Get our top-level parent branch in the tree.
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all leaves of this branch to fill Basket buffer.
Int_t GetEntryOffsetLen() const
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 Expand(Int_t newsize, Bool_t copy=kTRUE)
Expand (or shrink) the I/O buffer to newsize bytes.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
ROOT::ESTLType GetCollectionType() const
Return the 'type' of the STL the TClass is representing.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
Bool_t HasDataMemberInfo() const
void BuildRealData(void *pointer=0, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
const std::type_info * GetTypeInfo() const
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
TList * GetListOfRealData() const
Bool_t CanIgnoreTObjectStreamer()
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
TVirtualStreamerInfo * GetConversionStreamerInfo(const char *onfile_classname, Int_t version) const
Return a Conversion StreamerInfo from the class 'classname' for version number 'version' to this clas...
TVirtualStreamerInfo * FindConversionStreamerInfo(const char *onfile_classname, UInt_t checksum) const
Return a Conversion StreamerInfo from the class 'classname' for the layout represented by 'checksum' ...
Version_t GetClassVersion() const
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
TClass * GetActualClass(const void *object) const
Return a pointer the the real class of the object.
@ kHasCustomStreamerMember
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
An array of clone (identical) objects.
void BypassStreamer(Bool_t bypass=kTRUE)
When the kBypassStreamer bit is set, the automatically generated Streamer can call directly TClass::W...
TClass * GetClass() const
Collection abstract base class.
virtual TObject ** GetObjectRef(const TObject *obj) const =0
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const =0
virtual const char * GetName() const
Return name of this collection.
void SetName(const char *name)
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
virtual Int_t GetEntries() const
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
A specialized string object used for TTree selections.
All ROOT classes may have RTTI (run time type identification) support added.
Bool_t IsPersistent() const
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
Bool_t IsaPointer() const
Return true if data member is a pointer.
TDataType * GetDataType() const
Longptr_t GetOffset() const
Get offset from "this".
const char * GetTypeName() const
Get type of data member, e,g.: "class TDirectory*" -> "TDirectory".
const char * GetArrayIndex() const
If the data member is pointer and has a valid array size in its comments GetArrayIndex returns a stri...
const char * GetFullTypeName() const
Get full type description of data member, e,g.: "class TDirectory*".
Basic data type descriptor (datatype information is obtained from CINT).
TString GetTypeName()
Get basic type of typedef, e,g.: "class TDirectory*" -> "TDirectory".
void Append(TObject *obj, Bool_t replace=kFALSE) override
Append object to this directory.
TDirectory::TContext keeps track and restore the current directory.
Describe directory structure in memory.
virtual TList * GetList() const
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
virtual Int_t WriteTObject(const TObject *obj, const char *name=nullptr, Option_t *="", Int_t=0)
virtual TFile * GetFile() const
virtual Bool_t cd()
Change current directory to "this" directory.
virtual Int_t ReadKeys(Bool_t=kTRUE)
virtual Bool_t IsWritable() const
virtual TKey * GetKey(const char *, Short_t=9999) const
virtual Int_t ReadTObject(TObject *, const char *)
virtual void SaveSelf(Bool_t=kFALSE)
virtual TList * GetListOfKeys() const
void GetObject(const char *namecycle, T *&ptr)
Get an object with proper type checking.
virtual TObject * Remove(TObject *)
Remove an object from the in-memory list.
Streamer around an arbitrary STL like container, which implements basic container functionality.
A List of entry numbers in a TTree or TChain.
virtual void SetReapplyCut(Bool_t apply=kFALSE)
virtual void SetTree(const TTree *tree)
If a list for a tree with such name and filename exists, sets it as the current sublist If not,...
virtual TDirectory * GetDirectory() const
virtual void SetDirectory(TDirectory *dir)
Add reference to directory dir. dir can be 0.
virtual Bool_t Enter(Long64_t entry, TTree *tree=0)
Add entry #entry to the list.
virtual Long64_t GetEntry(Long64_t index)
Return the number of the entry #index of this TEntryList in the TTree or TChain See also Next().
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
A TEventList object is a list of selected events (entries) in a TTree.
virtual Long64_t GetEntry(Int_t index) const
Return value of entry at index in the list.
virtual Int_t GetN() const
virtual Bool_t GetReapplyCut() const
A cache when reading files over the network.
virtual void WaitFinishPrefetch()
virtual Int_t GetBufferSize() const
TIOFeatures * fIOFeatures
TDirectory * fOutputDirectory
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Int_t GetCompressionSettings() const
virtual Long64_t GetEND() const
virtual void Flush()
Synchronize a file's in-memory and on-disk states.
virtual void MakeFree(Long64_t first, Long64_t last)
Mark unused bytes on the file.
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 void SetCacheRead(TFileCacheRead *cache, TObject *tree=0, ECacheAction action=kDisconnect)
Set a pointer to the read cache.
Int_t GetRecordHeader(char *buf, Long64_t first, Int_t maxbytes, Int_t &nbytes, Int_t &objlen, Int_t &keylen)
Read the logical record header starting at a certain postion.
A TFolder object is a collection of objects and folders.
TCollection * GetListOfFolders() const
virtual Int_t Occurence(const TObject *obj) const
Return occurence number of object in the list of objects of this folder.
A TFriendElement TF describes a TTree object TF in a file.
virtual const char * GetTreeName() const
Get the actual TTree name of the friend.
virtual TTree * GetTree()
Return pointer to friend TTree.
virtual TFile * GetFile()
Return pointer to TFile containing this friend TTree.
TTree * fParentTree
! pointer to the parent TTree
virtual Int_t DeleteGlobal(void *obj)=0
Iterator abstract base class.
virtual TObject * Next()=0
virtual Option_t * GetOption() const
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual void Delete(Option_t *option="")
Delete an object from the file.
virtual const char * GetClassName() const
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual Double_t GetValue(Int_t i=0) const
virtual void * GetValuePointer() const
virtual Int_t GetLenType() const
virtual void ReadValue(std::istream &, Char_t=' ')
virtual Int_t GetMaximum() 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 Bool_t IncludeRange(TLeaf *)
virtual void SetAddress(void *add=0)
TBranch * GetBranch() const
@ kNewValue
Set if we own the value buffer and so must delete it ourselves.
@ kIndirectAddress
Data member is a pointer to an array of basic types.
virtual TString GetFullName() const
Return the full name (including the parent's branch names) of the leaf.
virtual Int_t GetOffset() const
virtual void PrintValue(Int_t i=0) const
virtual void Add(TObject *obj)
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual TObjLink * FirstLink() const
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
A TMemFile is like a normal TFile except that it reads and writes only from memory.
The TNamed class is the base class for all named ROOT classes.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
virtual const char * GetName() const
Returns name of object.
Int_t GetEntriesFast() const
Int_t GetEntriesUnsafe() const
Return the number of objects in array (i.e.
TObject * Last() const
Return the object in the last filled slot. Returns 0 if no entries.
virtual void Compress()
Remove empty slots from array.
Int_t GetEntries() const
Return the number of objects in array (i.e.
virtual void Clear(Option_t *option="")
Remove all objects from the array.
TObject * UncheckedAt(Int_t i) const
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Returns an array iterator.
virtual TObject * RemoveAt(Int_t idx)
Remove object at index idx.
TObject * At(Int_t idx) const
Wrapper around a TObject so it can be stored in a TList.
TObject * GetObject() const
Mother of all ROOT objects.
virtual Bool_t Notify()
This method must be overridden to handle object notification.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual const char * GetName() const
Returns name of object.
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
@ kOnlyPrepStep
Used to request that the class specific implementation of TObject::Write just prepare the objects to ...
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.
virtual const char * GetTitle() const
Returns title of object.
@ kCanDelete
if object in a list can be deleted
@ kMustCleanup
if object destructor must call RecursiveRemove()
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Principal Components Analysis (PCA)
The TRealData class manages the effective list of all data members for a given class.
TDataMember * GetDataMember() const
virtual const char * GetName() const
Returns name of object.
Long_t GetThisOffset() const
A TRefTable maintains the association between a referenced object and the parent object supporting th...
static void SetRefTable(TRefTable *table)
Static function setting the current TRefTable.
static TRefTable * GetRefTable()
Static function returning the current TRefTable.
Regular expression class.
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
static void * ReAlloc(void *vp, size_t size)
Reallocate (i.e.
Describes a persistent version of a class.
void ForceWriteInfo(TFile *file, Bool_t force=kFALSE)
Recursively mark streamer infos for writing to a file.
void ToLower()
Change string to lower-case.
static const Ssiz_t kNPOS
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Double_t Atof() const
Return floating-point value contained in string.
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
Bool_t EqualTo(const char *cs, ECaseCompare cmp=kExact) const
TString & ReplaceAll(const TString &s1, const TString &s2)
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
TString & Remove(Ssiz_t pos)
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
void SetHistFillColor(Color_t color=1)
Color_t GetHistLineColor() const
void SetHistLineStyle(Style_t styl=0)
Style_t GetHistFillStyle() const
Color_t GetHistFillColor() const
void SetHistLineColor(Color_t color=1)
Style_t GetHistLineStyle() const
void SetHistFillStyle(Style_t styl=0)
Width_t GetHistLineWidth() const
void SetHistLineWidth(Width_t width=1)
A zero length substring is legal.
virtual const char * Getenv(const char *env)
Get environment variable.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
A TTreeCache which exploits parallelized decompression of its own content.
static Bool_t IsParallelUnzip()
Static function that tells wether the multithreading unzipping is activated.
A cache to speed-up the reading of ROOT datasets.
virtual Int_t AddBranch(TBranch *b, Bool_t subgbranches=kFALSE)
Add a branch to the list of branches to be stored in the cache this function is called by the user vi...
virtual Int_t SetBufferSize(Int_t buffersize)
Change the underlying buffer size of the cache.
static void SetLearnEntries(Int_t n=10)
Static function to set the number of entries to be used in learning mode The default value for n is 1...
virtual void SetEntryRange(Long64_t emin, Long64_t emax)
Set the minimum and maximum entry number to be processed this information helps to optimize the numbe...
Bool_t IsAutoCreated() const
void SetAutoCreated(Bool_t val)
virtual Int_t DropBranch(TBranch *b, Bool_t subbranches=kFALSE)
Remove a branch to the list of branches to be stored in the cache this function is called by TBranch:...
virtual void StopLearningPhase()
This is the counterpart of StartLearningPhase() and can be used to stop the learning phase.
virtual void Print(Option_t *option="") const
Print cache statistics.
Class implementing or helping the various TTree cloning method.
Bool_t Exec()
Execute the cloning.
const char * GetWarning() const
void SetCacheSize(Int_t size)
Set the TFile cache size to be used.
Iterator on all the leaves in a TTree and its friend.
TObject * Next()
Go the next friend element.
TTree * fTree
tree being iterated
Option_t * GetOption() const
Returns the object option stored in the list.
TIterator & operator=(const TIterator &rhs)
Overridden assignment operator. Does NOT copy the 'cursor' location!
TIterator * fLeafIter
current leaf sub-iterator.
TIterator * fTreeIter
current tree sub-iterator.
Bool_t fDirection
iteration direction
Helper class to iterate over cluster of baskets.
Long64_t GetEstimatedClusterSize()
Estimate the cluster size.
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.
TClusterIterator(TTree *tree, Long64_t firstEntry)
Regular constructor.
Helper class to prevent infinite recursion in the usage of TTree Friends.
TFriendLock & operator=(const TFriendLock &)
Assignment operator.
TFriendLock(const TFriendLock &)
Copy constructor.
~TFriendLock()
Restore the state of tree the same as before we set the lock.
A TTree represents a columnar dataset.
virtual Int_t Fill()
Fill all branches.
virtual TFriendElement * AddFriend(const char *treename, const char *filename="")
Add a TFriendElement to the list of friends.
TBranchRef * fBranchRef
Branch supporting the TRefTable (if any)
virtual Int_t AddBranchToCache(const char *bname, Bool_t subbranches=kFALSE)
Add branch with name bname to the Tree cache.
virtual TBranch * FindBranch(const char *name)
Return the branch that correspond to the path 'branchname', which can include the name of the tree or...
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
static Int_t GetBranchStyle()
Static function returning the current branch style.
TList * fFriends
pointer to list of friend elements
UInt_t fFriendLockStatus
! Record which method is locking the friend recursion
virtual TLeaf * GetLeafImpl(const char *branchname, const char *leafname)
Return pointer to the 1st Leaf named name in any Branch of this Tree or any branch in the list of fri...
Long64_t fTotBytes
Total number of bytes in all branches before compression.
Int_t fMaxClusterRange
! Memory allocated for the cluster range.
virtual void Show(Long64_t entry=-1, Int_t lenmax=20)
Print values of all active leaves for entry.
TEventList * fEventList
! Pointer to event selection list (if one)
virtual Long64_t GetAutoSave() const
Long64_t GetCacheAutoSize(Bool_t withDefault=kFALSE)
Used for automatic sizing of the cache.
virtual Int_t StopCacheLearningPhase()
Stop the cache learning phase.
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
std::vector< std::pair< Long64_t, TBranch * > > fSortedBranches
! Branches to be processed in parallel when IMT is on, sorted by average task time
virtual void SetCircular(Long64_t maxEntries)
Enable/Disable circularity for this tree.
Long64_t fSavedBytes
Number of autosaved bytes.
Long64_t GetMedianClusterSize()
Estimate the median cluster size for the TTree.
virtual TClusterIterator GetClusterIterator(Long64_t firstentry)
Return an iterator over the cluster of baskets starting at firstentry.
virtual void ResetBranchAddress(TBranch *)
Tell all of our branches to set their addresses to zero.
char GetNewlineValue(std::istream &inputStream)
Determine which newline this file is using.
virtual Int_t CheckBranchAddressType(TBranch *branch, TClass *ptrClass, EDataType datatype, Bool_t ptr)
Check whether or not the address described by the last 3 parameters matches the content of the branch...
TIOFeatures fIOFeatures
IO features to define for newly-written baskets and branches.
virtual Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor=0) const
Return entry number corresponding to major and minor number.
Long64_t fDebugMin
! First entry number to debug
@ kSplitCollectionOfPointers
virtual Long64_t SetEntries(Long64_t n=-1)
Change number of entries in the tree.
virtual TObjArray * GetListOfLeaves()
Bool_t fCacheDoClusterPrefetch
! true if cache is prefetching whole clusters
virtual TBranch * BranchOld(const char *name, const char *classname, void *addobj, Int_t bufsize=32000, Int_t splitlevel=1)
Create a new TTree BranchObject.
virtual TBranch * BranchRef()
Build the optional branch supporting the TRefTable.
virtual Bool_t InPlaceClone(TDirectory *newdirectory, const char *options="")
Copy the content to a new new file, update this TTree with the new location information and attach th...
TFile * GetCurrentFile() const
Return pointer to the current file.
TList * fAliases
List of aliases for expressions based on the tree branches.
virtual TTree * CopyTree(const char *selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Copy a tree with selection.
virtual Int_t FlushBaskets(Bool_t create_cluster=true) const
Write to disk all the basket that have not yet been individually written and create an event cluster ...
virtual Int_t Fit(const char *funcname, const char *varexp, const char *selection="", Option_t *option="", Option_t *goption="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Fit a projected item(s) from a tree.
Int_t SetCacheSizeAux(Bool_t autocache=kTRUE, Long64_t cacheSize=0)
Set the size of the file cache and create it if possible.
Long64_t * fClusterRangeEnd
[fNClusterRange] Last entry of a cluster range.
std::atomic< Long64_t > fIMTZipBytes
! Zip bytes for the IMT flush baskets.
void UseCurrentStyle()
Replace current attributes by current style.
TVirtualTreePlayer * GetPlayer()
Load the TTreePlayer (if not already done).
virtual Long64_t ReadStream(std::istream &inputStream, const char *branchDescriptor="", char delimiter=' ')
Create or simply read branches from an input stream.
virtual void SetDebug(Int_t level=1, Long64_t min=0, Long64_t max=9999999)
Set the debug level and the debug range.
Int_t fScanField
Number of runs before prompting in Scan.
virtual ~TTree()
Destructor.
virtual TTree * GetFriend(const char *) const
Return a pointer to the TTree friend whose name or alias is friendname.
virtual Long64_t CopyEntries(TTree *tree, Long64_t nentries=-1, Option_t *option="", Bool_t needCopyAddresses=false)
Copy nentries from given tree to this tree.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
virtual Double_t GetMaximum(const char *columname)
Return maximum of column with name columname.
virtual Long64_t GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor=0) const
Return entry number corresponding to major and minor number.
static void SetMaxTreeSize(Long64_t maxsize=100000000000LL)
Set the maximum size in bytes of a Tree file (static function).
virtual TBranch * BronchExec(const char *name, const char *classname, void *addobj, Bool_t isptrptr, Int_t bufsize, Int_t splitlevel)
Helper function implementing TTree::Bronch and TTree::Branch(const char *name, T &obj);.
virtual Int_t UnbinnedFit(const char *funcname, const char *varexp, const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Unbinned fit of one or more variable(s) from a tree.
Int_t fNClusterRange
Number of Cluster range in addition to the one defined by 'AutoFlush'.
virtual void PrintCacheStats(Option_t *option="") const
Print statistics about the TreeCache for this tree.
virtual Int_t BuildIndex(const char *majorname, const char *minorname="0")
Build a Tree Index (default is TTreeIndex).
TVirtualTreePlayer * fPlayer
! Pointer to current Tree player
virtual void SetMakeClass(Int_t make)
Set all the branches in this TTree to be in decomposed object mode (also known as MakeClass mode).
TObjArray fBranches
List of Branches.
TDirectory * GetDirectory() const
TTreeCache * GetReadCache(TFile *file) const
Find and return the TTreeCache registered with the file and which may contain branches for us.
Bool_t fCacheUserSet
! true if the cache setting was explicitly given by user
Long64_t fEntries
Number of entries.
virtual TFile * ChangeFile(TFile *file)
Called by TTree::Fill() when file has reached its maximum fgMaxTreeSize.
virtual Bool_t GetBranchStatus(const char *branchname) const
Return status of branch with name branchname.
virtual TEntryList * GetEntryList()
Returns the entry list assigned to this tree.
virtual void SetWeight(Double_t w=1, Option_t *option="")
Set tree weight.
void InitializeBranchLists(bool checkLeafCount)
Divides the top-level branches into two vectors: (i) branches to be processed sequentially and (ii) b...
Long64_t * fClusterSize
[fNClusterRange] Number of entries in each cluster for a given range.
Long64_t fFlushedBytes
Number of auto-flushed bytes.
virtual void SetPerfStats(TVirtualPerfStats *perf)
Set perf stats.
std::atomic< Long64_t > fIMTTotBytes
! Total bytes for the IMT flush baskets
virtual void SetCacheLearnEntries(Int_t n=10)
Interface to TTreeCache to set the number of entries for the learning phase.
TEntryList * fEntryList
! Pointer to event selection list (if one)
virtual TVirtualIndex * GetTreeIndex() const
TList * fExternalFriends
! List of TFriendsElement pointing to us and need to be notified of LoadTree. Content not owned.
virtual Long64_t Merge(TCollection *list, Option_t *option="")
Merge the trees in the TList into this tree.
virtual void SetMaxVirtualSize(Long64_t size=0)
virtual void DropBaskets()
Remove some baskets from memory.
virtual void SetAutoSave(Long64_t autos=-300000000)
This function may be called at the start of a program to change the default value for fAutoSave (and ...
Long64_t fMaxEntryLoop
Maximum number of entries to process.
virtual void SetDirectory(TDirectory *dir)
Change the tree's directory.
void SortBranchesByTime()
Sorts top-level branches by the last average task time recorded per branch.
virtual TBranchRef * GetBranchRef() const
virtual Long64_t Process(const char *filename, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Process this tree executing the TSelector code in the specified filename.
virtual TBranch * BranchImpRef(const char *branchname, const char *classname, TClass *ptrClass, void *addobj, Int_t bufsize, Int_t splitlevel)
Same as TTree::Branch but automatic detection of the class name.
virtual void SetEventList(TEventList *list)
This function transfroms the given TEventList into a TEntryList The new TEntryList is owned by the TT...
void MoveReadCache(TFile *src, TDirectory *dir)
Move a cache from a file to the current file in dir.
Long64_t fAutoFlush
Auto-flush tree when fAutoFlush entries written or -fAutoFlush (compressed) bytes produced.
Int_t fUpdate
Update frequency for EntryLoop.
virtual void ResetAfterMerge(TFileMergeInfo *)
Resets the state of this TTree after a merge (keep the customization but forget the data).
virtual void CopyAddresses(TTree *, Bool_t undo=kFALSE)
Set branch addresses of passed tree equal to ours.
virtual Long64_t GetEntries() const
virtual void SetEstimate(Long64_t nentries=1000000)
Set number of entries to estimate variable limits.
virtual TIterator * GetIteratorOnAllLeaves(Bool_t dir=kIterForward)
Creates a new iterator that will go through all the leaves on the tree itself and its friend.
Int_t fTimerInterval
Timer interval in milliseconds.
Int_t fDebug
! Debug level
virtual Long64_t AutoSave(Option_t *option="")
AutoSave tree header every fAutoSave bytes.
virtual Long64_t GetEntryNumber(Long64_t entry) const
Return entry number corresponding to entry.
virtual TTree * CloneTree(Long64_t nentries=-1, Option_t *option="")
Create a clone of this tree and copy nentries.
Int_t fFileNumber
! current file number (if file extensions)
virtual TLeaf * GetLeaf(const char *branchname, const char *leafname)
Return pointer to the 1st Leaf named name in any Branch of this Tree or any branch in the list of fri...
virtual Long64_t GetZipBytes() const
TObjArray fLeaves
Direct pointers to individual branch leaves.
virtual void Reset(Option_t *option="")
Reset baskets, buffers and entries count in all branches and leaves.
virtual void Print(Option_t *option="") const
Print a summary of the tree contents.
virtual void KeepCircular()
Keep a maximum of fMaxEntries in memory.
virtual void DirectoryAutoAdd(TDirectory *)
Called by TKey and TObject::Clone to automatically add us to a directory when we are read from a file...
virtual Bool_t SetAlias(const char *aliasName, const char *aliasFormula)
Set a tree variable alias.
Long64_t fMaxVirtualSize
Maximum total size of buffers kept in memory.
virtual Long64_t GetTotBytes() const
virtual void SetObject(const char *name, const char *title)
Change the name and title of this tree.
TVirtualPerfStats * fPerfStats
! pointer to the current perf stats object
Double_t fWeight
Tree weight (see TTree::SetWeight)
std::vector< TBranch * > fSeqBranches
! Branches to be processed sequentially when IMT is on
Bool_t EnableCache()
Enable the TTreeCache unless explicitly disabled for this TTree by a prior call to SetCacheSize(0).
Long64_t fDebugMax
! Last entry number to debug
Int_t fDefaultEntryOffsetLen
Initial Length of fEntryOffset table in the basket buffers.
TTree()
Default constructor and I/O constructor.
Long64_t fAutoSave
Autosave tree when fAutoSave entries written or -fAutoSave (compressed) bytes produced.
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the type of obj being passed.
virtual void SetDefaultEntryOffsetLen(Int_t newdefault, Bool_t updateExisting=kFALSE)
Update the default value for the branch's fEntryOffsetLen.
std::atomic< UInt_t > fAllocationCount
indicates basket should be resized to exact memory usage, but causes significant
virtual Int_t GetEntryWithIndex(Int_t major, Int_t minor=0)
Read entry corresponding to major and minor number.
static TTree * MergeTrees(TList *list, Option_t *option="")
Static function merging the trees in the TList into a new tree.
virtual Long64_t GetReadEntry() const
virtual TObjArray * GetListOfBranches()
virtual void SetParallelUnzip(Bool_t opt=kTRUE, Float_t RelSize=-1)
Enable or disable parallel unzipping of Tree buffers.
Long64_t fZipBytes
Total number of bytes in all branches after compression.
virtual void RecursiveRemove(TObject *obj)
Make sure that obj (which is being deleted or will soon be) is no longer referenced by this TTree.
virtual TTree * GetTree() const
TBuffer * fTransientBuffer
! Pointer to the current transient buffer.
Bool_t fIMTEnabled
! true if implicit multi-threading is enabled for this tree
virtual void SetEntryList(TEntryList *list, Option_t *opt="")
Set an EntryList.
virtual Int_t DropBranchFromCache(const char *bname, Bool_t subbranches=kFALSE)
Remove the branch with name 'bname' from the Tree cache.
virtual void AddZipBytes(Int_t zip)
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.
virtual Long64_t ReadFile(const char *filename, const char *branchDescriptor="", char delimiter=' ')
Create or simply read branches from filename.
virtual const char * GetAlias(const char *aliasName) const
Returns the expanded value of the alias. Search in the friends if any.
ROOT::TIOFeatures SetIOFeatures(const ROOT::TIOFeatures &)
Provide the end-user with the ability to enable/disable various experimental IO features for this TTr...
virtual TBasket * CreateBasket(TBranch *)
Create a basket for this tree and given branch.
TList * fUserInfo
pointer to a list of user objects associated to this Tree
virtual Double_t GetMinimum(const char *columname)
Return minimum of column with name columname.
virtual void RemoveFriend(TTree *)
Remove a friend from the list of friends.
virtual Long64_t GetEntriesFast() const
virtual TList * GetUserInfo()
Return a pointer to the list containing user objects associated to this tree.
Long64_t fChainOffset
! Offset of 1st entry of this Tree in a TChain
@ kOnlyFlushAtCluster
If set, the branch's buffers will grow until an event cluster boundary is hit, guaranteeing a basket ...
@ kEntriesReshuffled
If set, signals that this TTree is the output of the processing of another TTree, and the entries are...
virtual Long64_t GetEntriesFriend() const
Return pointer to the 1st Leaf named name in any Branch of this Tree or any branch in the list of fri...
virtual TSQLResult * Query(const char *varexp="", const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Loop over entries and return a TSQLResult object containing entries following selection.
virtual TBranch * Bronch(const char *name, const char *classname, void *addobj, Int_t bufsize=32000, Int_t splitlevel=99)
Create a new TTree BranchElement.
virtual void SetBasketSize(const char *bname, Int_t buffsize=16000)
Set a branch's basket size.
static void SetBranchStyle(Int_t style=1)
Set the current branch style.
void ImportClusterRanges(TTree *fromtree)
Appends the cluster range information stored in 'fromtree' to this tree, including the value of fAuto...
Long64_t fEstimate
Number of entries to estimate histogram limits.
Int_t FlushBasketsImpl() const
Internal implementation of the FlushBaskets algorithm.
virtual Long64_t LoadTreeFriend(Long64_t entry, TTree *T)
Load entry on behalf of our master tree, we may use an index.
TVirtualIndex * fTreeIndex
Pointer to the tree Index (if any)
virtual void Browse(TBrowser *)
Browse content of the TTree.
TObject * fNotify
! Object to be notified when loading a Tree
virtual TBranch * BranchImp(const char *branchname, const char *classname, TClass *ptrClass, void *addobj, Int_t bufsize, Int_t splitlevel)
Same as TTree::Branch() with added check that addobj matches className.
Long64_t fCacheSize
! Maximum size of file buffers
TList * fClones
! List of cloned trees which share our addresses
std::atomic< Long64_t > fTotalBuffers
! Total number of bytes in branch buffers
Bool_t fCacheDoAutoInit
! true if cache auto creation or resize check is needed
virtual Int_t MakeSelector(const char *selector=0, Option_t *option="")
Generate skeleton selector class for this tree.
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
virtual Int_t MakeClass(const char *classname=0, Option_t *option="")
Generate a skeleton analysis class for this tree.
virtual void SetTreeIndex(TVirtualIndex *index)
The current TreeIndex is replaced by the new index.
virtual void OptimizeBaskets(ULong64_t maxMemory=10000000, Float_t minComp=1.1, Option_t *option="")
This function may be called after having filled some entries in a Tree.
virtual Long64_t Project(const char *hname, const char *varexp, const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Make a projection of a tree using selections.
virtual Int_t SetCacheEntryRange(Long64_t first, Long64_t last)
interface to TTreeCache to set the cache entry range
static Long64_t GetMaxTreeSize()
Static function which returns the tree file size limit in bytes.
Int_t SetBranchAddressImp(TBranch *branch, void *addr, TBranch **ptr)
Change branch address, dealing with clone trees properly.
Long64_t fMaxEntries
Maximum number of entries in case of circular buffers.
virtual void DropBuffers(Int_t nbytes)
Drop branch buffers to accommodate nbytes below MaxVirtualsize.
virtual void SetName(const char *name)
Change the name of this tree.
virtual void Delete(Option_t *option="")
Delete this tree from memory or/and disk.
virtual TList * GetListOfFriends() const
virtual void Refresh()
Refresh contents of this tree and its branches from the current status on disk.
virtual void SetAutoFlush(Long64_t autof=-30000000)
This function may be called at the start of a program to change the default value for fAutoFlush.
static Long64_t fgMaxTreeSize
Maximum size of a file containing a Tree.
Long64_t fReadEntry
! Number of the entry being processed
TArrayD fIndexValues
Sorted index values.
void MarkEventCluster()
Mark the previous event as being at the end of the event cluster.
virtual Int_t MakeCode(const char *filename=0)
Generate a skeleton function for this tree.
UInt_t fNEntriesSinceSorting
! Number of entries processed since the last re-sorting of branches
virtual Int_t MakeProxy(const char *classname, const char *macrofilename=0, const char *cutfilename=0, const char *option=0, Int_t maxUnrolling=3)
Generate a skeleton analysis class for this Tree using TBranchProxy.
virtual void SetFileNumber(Int_t number=0)
Set fFileNumber to number.
virtual TLeaf * FindLeaf(const char *name)
Find leaf..
virtual void StartViewer()
Start the TTreeViewer on this tree.
Int_t GetMakeClass() const
TDirectory * fDirectory
! Pointer to directory holding this tree
@ kNeedEnableDecomposedObj
@ kMatchConversionCollection
@ kMissingCompiledCollectionProxy
static Int_t fgBranchStyle
Old/New branch style.
virtual void ResetBranchAddresses()
Tell all of our branches to drop their current objects and allocate new ones.
Int_t fNfill
! Local for EntryLoop
virtual void RegisterExternalFriend(TFriendElement *)
Record a TFriendElement that we need to warn when the chain switches to a new file (typically this is...
TArrayI fIndex
Index of sorted values.
virtual Int_t SetCacheSize(Long64_t cachesize=-1)
Set maximum size of the file cache .
void AddClone(TTree *)
Add a cloned tree to our list of trees to be notified whenever we change our branch addresses or when...
virtual void SetBranchStatus(const char *bname, Bool_t status=1, UInt_t *found=0)
Set branch status to Process or DoNotProcess.
TBuffer * GetTransientBuffer(Int_t size)
Returns the transient buffer currently used by this TTree for reading/writing baskets.
ROOT::TIOFeatures GetIOFeatures() const
Returns the current set of IO settings.
virtual const char * GetFriendAlias(TTree *) const
If the 'tree' is a friend, this method returns its alias name.
virtual Bool_t Notify()
Function called when loading a new class library.
virtual void RemoveExternalFriend(TFriendElement *)
Removes external friend.
Bool_t MemoryFull(Int_t nbytes)
Check if adding nbytes to memory we are still below MaxVirtualsize.
Int_t fPacketSize
! Number of entries in one packet for parallel root
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
TStreamerInfo * BuildStreamerInfo(TClass *cl, void *pointer=0, Bool_t canOptimize=kTRUE)
Build StreamerInfo for class cl.
virtual TBranch * BranchImpArr(const char *branchname, EDataType datatype, std::size_t N, void *addobj, Int_t bufsize, Int_t splitlevel)
virtual Long64_t Scan(const char *varexp="", const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Loop over tree entries and print entries passing selection.
Bool_t fIMTFlush
! True if we are doing a multithreaded flush.
virtual void AddTotBytes(Int_t tot)
Int_t fMakeClass
! not zero when processing code generated by MakeClass
virtual Int_t LoadBaskets(Long64_t maxmemory=2000000000)
Read in memory all baskets from all branches up to the limit of maxmemory bytes.
static constexpr Long64_t kMaxEntries
TPrincipal * Principal(const char *varexp="", const char *selection="", Option_t *option="np", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Interface to the Principal Components Analysis class.
virtual Long64_t GetAutoFlush() const
virtual EDataType GetType() const =0
virtual TClass * GetValueClass() const =0
virtual Bool_t HasPointers() const =0
Abstract interface for Tree Index.
virtual void Append(const TVirtualIndex *, Bool_t delaySort=kFALSE)=0
virtual const char * GetMajorName() const =0
virtual Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor) const =0
virtual Long64_t GetEntryNumberFriend(const TTree *)=0
virtual const char * GetMinorName() const =0
virtual void SetTree(const TTree *T)=0
virtual Long64_t GetN() const =0
virtual Long64_t GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor) const =0
virtual Bool_t IsValidFor(const TTree *parent)=0
Provides the interface for the PROOF internal performance measurement and event tracing.
Abstract base class defining the interface for the plugins that implement Draw, Scan,...
virtual Int_t MakeProxy(const char *classname, const char *macrofilename=0, const char *cutfilename=0, const char *option=0, Int_t maxUnrolling=3)=0
virtual Long64_t Scan(const char *varexp, const char *selection, Option_t *option, Long64_t nentries, Long64_t firstentry)=0
virtual void UpdateFormulaLeaves()=0
virtual Long64_t DrawSelect(const char *varexp, const char *selection, Option_t *option, Long64_t nentries, Long64_t firstentry)=0
virtual Int_t MakeCode(const char *filename)=0
virtual Int_t UnbinnedFit(const char *formula, const char *varexp, const char *selection, Option_t *option, Long64_t nentries, Long64_t firstentry)=0
virtual Long64_t GetEntries(const char *)=0
virtual TSQLResult * Query(const char *varexp, const char *selection, Option_t *option, Long64_t nentries, Long64_t firstentry)=0
virtual TPrincipal * Principal(const char *varexp="", const char *selection="", Option_t *option="np", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)=0
virtual void StartViewer(Int_t ww, Int_t wh)=0
virtual Int_t MakeReader(const char *classname, Option_t *option)=0
virtual TVirtualIndex * BuildIndex(const TTree *T, const char *majorname, const char *minorname)=0
virtual TTree * CopyTree(const char *selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)=0
virtual Long64_t Process(const char *filename, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)=0
virtual void SetEstimate(Long64_t n)=0
static TVirtualTreePlayer * TreePlayer(TTree *obj)
Static function returning a pointer to a Tree player.
virtual Int_t MakeClass(const char *classname, const char *option)=0
virtual Int_t Fit(const char *formula, const char *varexp, const char *selection, Option_t *option, Option_t *goption, Long64_t nentries, Long64_t firstentry)=0
Special implementation of ROOT::RRangeCast for TCollection, including a check that the cast target ty...
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.
void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
void ToHumanReadableSize(value_type bytes, Bool_t si, Double_t *coeff, const char **units)
Return the size expressed in 'human readable' format.
EFromHumanReadableSize FromHumanReadableSize(std::string_view str, T &value)
Convert strings like the following into byte counts 5MB, 5 MB, 5M, 3.7GB, 123b, 456kB,...
Short_t Max(Short_t a, Short_t b)
Short_t Min(Short_t a, Short_t b)
Double_t Median(Long64_t n, const T *a, const Double_t *w=0, Long64_t *work=0)
Return the median of the array a where each entry i has weight w[i] .
Long64_t BinarySearch(Long64_t n, const T *array, T value)
@ kUseGlobal
Use the global compression algorithm.
@ kInherit
Some objects use this value to denote that the compression algorithm should be inherited from the par...
@ kUseCompiledDefault
Use the compile-time default setting.