448 case kchar:
return 0;
453 case kBits:
return 0;
475 fMethodBit = methodbit;
477 fPrevious = fTree->fFriendLockStatus & fMethodBit;
478 fTree->fFriendLockStatus |= fMethodBit;
531 fStartEntry = firstEntry;
542 if (fClusterRange == 0) {
544 entryInRange = firstEntry;
547 entryInRange = firstEntry - pedestal;
555 if (autoflush == 0) {
556 autoflush = GetEstimatedClusterSize();
558 fStartEntry = pedestal + entryInRange - entryInRange%autoflush;
562 fNextEntry = fStartEntry;
578 if (cacheSize == 0) {
590 if (clusterEstimate == 0)
593 return clusterEstimate;
603 fStartEntry = fNextEntry;
606 Long64_t clusterEstimate = GetEstimatedClusterSize();
607 fNextEntry = fStartEntry + clusterEstimate;
623 if (clusterSize == 0) {
624 clusterSize = GetEstimatedClusterSize();
626 fNextEntry += clusterSize;
648 fNextEntry = fStartEntry;
651 Long64_t clusterEstimate = GetEstimatedClusterSize();
652 fStartEntry = fNextEntry - clusterEstimate;
662 if (fClusterRange == 0) {
667 if (clusterSize == 0) {
668 clusterSize = GetEstimatedClusterSize();
670 fStartEntry -= clusterSize;
674 if (fStartEntry < 0) {
861 if (strlen(title) > 2) {
862 if (title[0] ==
'/') {
863 Branch(title+1,32000,splitlevel);
989 Error(
"AddBranchToCache",
"Could not load a tree");
998 Error(
"AddBranchToCache",
"No tree is available. Branch was not added to the cache");
1004 Error(
"AddBranchToCache",
"No file is available. Branch was not added to the cache");
1009 Error(
"AddBranchToCache",
"No cache is available, branch not added");
1012 return tc->
AddBranch(bname,subbranches);
1028 Error(
"AddBranchToCache",
"Could not load a tree");
1036 Error(
"AddBranchToCache",
"Error adding branch");
1041 Error(
"AddBranchToCache",
"No tree is available. Branch was not added to the cache");
1047 Error(
"AddBranchToCache",
"No file is available. Branch was not added to the cache");
1052 Error(
"AddBranchToCache",
"No cache is available, branch not added");
1072 Error(
"DropBranchFromCache",
"Could not load a tree");
1081 Error(
"DropBranchFromCache",
"No tree is available. Branch was not dropped from the cache");
1087 Error(
"DropBranchFromCache",
"No file is available. Branch was not dropped from the cache");
1092 Error(
"DropBranchFromCache",
"No cache is available, branch not dropped");
1111 Error(
"DropBranchFromCache",
"Could not load a tree");
1119 Error(
"DropBranchFromCache",
"Error dropping branch");
1124 Error(
"DropBranchFromCache",
"No tree is available. Branch was not dropped from the cache");
1130 Error(
"DropBranchFromCache",
"No file is available. Branch was not dropped from the cache");
1135 Error(
"DropBranchFromCache",
"No cache is available, branch not dropped");
1244 Warning(
"AddFriend",
"FriendElement %s in file %s has less entries %lld than its parent Tree: %lld", treename, filename, t->
GetEntries(),
fEntries);
1247 Warning(
"AddFriend",
"Cannot add FriendElement %s in file %s", treename, filename);
1272 Warning(
"AddFriend",
"FriendElement %s in file %s has less entries %lld than its parent tree: %lld", treename, file->
GetName(), t->
GetEntries(),
fEntries);
1275 Warning(
"AddFriend",
"unknown tree '%s' in file '%s'", treename, file->
GetName());
1299 Warning(
"AddFriend",
"FriendElement '%s' in file '%s' has less entries %lld than its parent tree: %lld",
1394 if (opt.
Contains(
"flushbaskets")) {
1395 if (
gDebug > 0)
Info(
"AutoSave",
"calling FlushBaskets \n");
1407 if (nbytes && key) {
1428 const char* writeStlWithoutProxyMsg =
"The class requested (%s) for the branch \"%s\"" 1429 " is an instance of an stl collection and does not have a compiled CollectionProxy." 1430 " Please generate the dictionary for this collection (%s) to avoid to write corrupted data.";
1444 Error(
"Branch", writeStlWithoutProxyMsg,
1448 return Branch(branchname, classname, (
void*) addobj, bufsize, splitlevel);
1451 void** addr = (
void**) addobj;
1455 if (ptrClass && claim) {
1462 Error(
"Branch",
"The class requested (%s) for \"%s\" is different from the type of the pointer passed (%s)",
1465 }
else if (actualClass && (claim != actualClass) && !actualClass->
InheritsFrom(claim)) {
1470 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s",
1476 Error(
"Branch", writeStlWithoutProxyMsg,
1480 return Branch(branchname, classname, (
void*) addobj, bufsize, splitlevel);
1490 Error(
"Branch",
"The pointer specified for %s is not of a class known to ROOT", branchname);
1494 void** addr = (
void**) addobj;
1495 if (addr && *addr) {
1498 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",
1499 branchname, ptrClass->
GetName());
1500 actualClass = ptrClass;
1501 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1502 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());
1506 actualClass = ptrClass;
1509 Error(
"Branch", writeStlWithoutProxyMsg,
1513 return Branch(branchname, actualClass->
GetName(), (
void*) addobj, bufsize, splitlevel);
1525 Error(
"Branch", writeStlWithoutProxyMsg,
1528 }
else if (claim == 0) {
1529 Error(
"Branch",
"The pointer specified for %s is not of a class known to ROOT and %s is not a known class", branchname, classname);
1536 Error(
"Branch",
"Reference interface requires a valid object (for branch: %s)!", branchname);
1540 if (ptrClass && claim) {
1547 Error(
"Branch",
"The class requested (%s) for \"%s\" is different from the type of the object passed (%s)",
1550 }
else if (actualClass && (claim != actualClass) && !actualClass->
InheritsFrom(claim)) {
1555 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s",
1561 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",
1562 branchname, ptrClass->
GetName());
1563 actualClass = ptrClass;
1564 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1565 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());
1569 Error(
"Branch", writeStlWithoutProxyMsg,
1584 Error(
"Branch",
"The pointer specified for %s is not of a class or type known to ROOT", branchname);
1587 return Branch(branchname,addobj,varname.
Data(),bufsize);
1593 Error(
"Branch",
"Reference interface requires a valid object (for branch: %s)!", branchname);
1598 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",
1599 branchname, ptrClass->
GetName());
1600 actualClass = ptrClass;
1601 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1602 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());
1606 Error(
"Branch", writeStlWithoutProxyMsg,
1709 Error(
"Branch",
"Cannot call this constructor for a TClonesArray");
1712 Int_t nch = strlen(name);
1715 while ((obj = next())) {
1723 Branch(col, bufsize, splitlevel - 1, branchname);
1725 if (nch && (name[nch-1] ==
'_')) {
1734 if (splitlevel > 99) {
1760 char* curname =
new char[1000];
1762 while ((obj = next())) {
1763 snprintf(curname,1000,
"%s/%s", foldername, obj->GetName());
1765 Branch(curname, bufsize, splitlevel - 1);
1768 for (
Int_t i = 0; i < 1000; ++i) {
1769 if (curname[i] == 0) {
1772 if (curname[i] ==
'/') {
1779 strlcat(curname, occur,1000);
1883 return Bronch(
name, classname, addobj, bufsize, splitlevel);
1885 if (splitlevel < 0) {
1888 return BranchOld(
name, classname, addobj, bufsize, splitlevel);
1937 Error(
"BranchOld",
"Cannot find class: '%s'", classname);
1942 Fatal(
"BranchOld",
"The requested class ('%s') does not inherit from TObject.\n" 1943 "\tfgBranchStyle is set to zero requesting by default to use BranchOld.\n" 1944 "\tIf this is intentional use Bronch instead of Branch or BranchOld.", classname);
1946 Fatal(
"BranchOld",
"The requested class ('%s') does not inherit from TObject.\n" 1947 "\tYou can not use BranchOld to store objects of this type.",classname);
1958 const char* rdname = 0;
1959 const char* dname = 0;
1961 char** apointer = (
char**) addobj;
1973 if (
name[lenName-1] ==
'.') {
2012 if (!strcmp(dname,
"fBits")) {
2015 if (!strcmp(dname,
"fUniqueID")) {
2025 branchname = rdname;
2029 branchname.
Form(
"%s%s",
name, &rdname[1]);
2031 branchname.
Form(
"%s%s",
name, &rdname[0]);
2037 char* pointer = ((
char*) obj) + offset;
2046 char* cpointer = (
char*) pointer;
2047 char** ppointer = (
char**) cpointer;
2049 if (splitlevel != 2) {
2051 branch1 =
new TBranchClones(branch,branchname, pointer, bufsize);
2056 blist->
Add(branch1);
2064 blist->
Add(branch1);
2081 blist->
Add(branch1);
2095 aindex.Remove(rdot+1);
2096 aindex.Append(index);
2102 if (!strcmp(rdi->
GetName(), index)) {
2105 if (!strcmp(rdi->
GetName(), aindex)) {
2117 leaflist.
Form(
"%s[%s]/%c", &rdname[0], index, vcode);
2119 Error(
"BranchOld",
"Cannot create branch for rdname: %s code: %d", branchname.
Data(), code);
2126 leaflist.
Form(
"%s/%s", dname,
"C");
2139 branch1 =
new TBranch(branch, bname, *((
void**) pointer), leaflist, bufsize);
2143 blist->
Add(branch1);
2150 leaflist.
Form(
"%s/%c", rdname, vcode);
2152 Error(
"BranchOld",
"Cannot create branch for rdname: %s code: %d", branchname.
Data(), code);
2155 branch1 =
new TBranch(branch, branchname, pointer, leaflist, bufsize);
2157 blist->
Add(branch1);
2166 Warning(
"BranchOld",
"Cannot process member: '%s'", rdname);
2275 Error(
"Bronch",
"Cannot find class:%s", classname);
2286 objptr = (
char*)addr;
2288 objptr = *((
char**) addr);
2294 Error(
"Bronch",
"Pointer to TClonesArray is null");
2298 Error(
"Bronch",
"TClonesArray with no class defined in branch: %s",
name);
2302 Error(
"Bronch",
"TClonesArray with no dictionary defined in branch: %s",
name);
2306 if (splitlevel > 0) {
2307 if (hasCustomStreamer)
2308 Warning(
"Bronch",
"Using split mode on a class: %s with a custom Streamer", clones->
GetClass()->
GetName());
2323 if (!inklass && (collProxy->
GetType() == 0)) {
2324 Error(
"Bronch",
"%s with no class defined in branch: %s", classname,
name);
2331 Error(
"Bronch",
"Container with no dictionary defined in branch: %s",
name);
2335 Warning(
"Bronch",
"Using split mode on a class: %s with a custom Streamer", inklass->
GetName());
2346 branch =
new TBranchSTL(
this,
name, collProxy, bufsize, splitlevel );
2351 branch->SetAddress(addr);
2353 branch->SetObject(addr);
2360 Error(
"Bronch",
"Cannot find dictionary for class: %s", classname);
2366 hasCustomStreamer =
kTRUE;
2369 if (splitlevel < 0 || ((splitlevel == 0) && hasCustomStreamer && cl->
IsTObject())) {
2400 objptr = (
char*) cl->
New();
2408 if ((splitlevel > 0) && !cl->
CanSplit()) {
2409 if (splitlevel != 99) {
2410 Warning(
"Bronch",
"%s cannot be split, resetting splitlevel to 0", cl->
GetName());
2424 Error(
"Bronch",
"Cannot build the StreamerInfo for class: %s", cl->
GetName());
2433 if (splitlevel > 0) {
2444 branch->
Unroll(
name, cl, sinfo, objptr, bufsize, splitlevel);
2588 char* fname =
new char[2000];
2591 for (
Int_t i = 0; i < 10; ++i) {
2599 strlcpy(fname, file->
GetName(),2000);
2602 char* cunder = strrchr(fname,
'_');
2605 const char* cdot = strrchr(file->
GetName(),
'.');
2607 strlcat(fname, cdot,2000);
2612 strlcat(fname, fcount,2000);
2615 char* cdot = strrchr(fname,
'.');
2618 strlcat(fname, strrchr(file->
GetName(),
'.'),2000);
2622 strlcat(fname, fcount,2000);
2629 Warning(
"ChangeFile",
"file %s already exist, trying with %d underscores", fname, nus+1);
2634 Error(
"Fill",
"Failed to open new file %s, continuing as a memory tree.",fname);
2636 Printf(
"Fill: Switching to new file: %s", fname);
2659 while ((branch = (
TBranch*)nextb())) {
2668 if (newfile) newfile->
Append(obj);
2704 TClass* expectedClass = 0;
2710 if (expectedClass && datatype ==
kOther_t && ptrClass == 0) {
2716 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". " 2717 "The class expected (%s) refers to an stl collection and do not have a compiled CollectionProxy. " 2718 "Please generate the dictionary for this class (%s)",
2725 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". " 2726 "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." 2727 "Please generate the dictionary for this class (%s)",
2730 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". " 2731 "This is probably due to a missing dictionary, the original data class for this branch is %s.", branch->
GetName(), expectedClass->
GetName());
2735 if (expectedClass && ptrClass && (branch->
GetMother() == branch)) {
2738 Error(
"SetBranchAddress",
"The address for \"%s\" should be the address of a pointer!", branch->
GetName());
2758 if( expectedClass && ptrClass &&
2759 expectedClass != ptrClass &&
2767 Info(
"SetBranchAddress",
"Matching STL collection (at least according to the SchemaRuleSet when " 2768 "reading a %s into a %s",expectedClass->
GetName(),ptrClass->
GetName());
2775 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());
2786 }
else if (expectedClass && ptrClass && !expectedClass->
InheritsFrom(ptrClass)) {
2808 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());
2818 Error(
"SetBranchAddress",
"The pointer type given \"%s\" (%d) does not correspond to the type needed \"%s\" (%d) by the branch: %s",
2825 if (expectedClass) {
2826 Error(
"SetBranchAddress",
"The pointer type given \"%s\" (%d) does not correspond to the type needed \"%s\" by the branch: %s",
2840 if (rdm->GetThisOffset() == 0) {
2844 if (etype == expectedType) {
2855 if (dm->GetOffset() == 0) {
2859 if (etype == expectedType) {
2871 if (len <= ptrClass->
Size()) {
2875 Error(
"SetBranchAddress",
"The pointer type given \"%s\" does not correspond to the type needed \"%s\" (%d) by the branch: %s",
2881 Error(
"SetBranchAddress", writeStlWithoutProxyMsg,
2995 for (
Int_t i = 0; i < nb; ++i) {
3005 if (thistree !=
this) {
3030 for (
Int_t lndx = 0; lndx < nleaves; ++lndx) {
3036 if (branch && (newcomp > -1)) {
3045 for (
Long64_t i = 0; i < nb; ++i) {
3056 for (
Int_t j = 0; j < nb1; ++j) {
3070 for (
Int_t k = 0; k < nb2; ++k) {
3100 if ( newtree->
CopyEntries(
this, -1, option ) < 0 ) {
3102 Error(
"CloneTTree",
"TTree has not been cloned\n");
3125 for (
Int_t i = 0; i < nbranches; ++i) {
3161 Warning(
"CopyAddresses",
"Could not find branch named '%s' in tree named '%s'", branch->
GetName(), tree->
GetName());
3169 for (
Int_t i = 0; i < ntleaves; ++i) {
3170 TLeaf* tleaf = (
TLeaf*) tleaves->UncheckedAt(i);
3222 Warning(
"CopyAddresses",
"Could not find branch named '%s' in tree named '%s'", branch->
GetName(), tree->
GetName());
3249 switch (onIndexError) {
3273 switch (onIndexError) {
3297 }
else if ( onIndexError == kDrop ) {
3354 onIndexError = kKeep;
3355 }
else if (opt.
Contains(
"buildindex")) {
3356 onIndexError = kBuild;
3357 }
else if (opt.
Contains(
"dropindex")) {
3358 onIndexError = kDrop;
3360 onIndexError = kBuild;
3363 Int_t cacheSize = -1;
3366 Ssiz_t cacheSizeEnd = opt.
Index(
" ",cacheSizeLoc+10) - (cacheSizeLoc+10);
3367 TSubString cacheSizeStr( opt(cacheSizeLoc+10,cacheSizeEnd) );
3370 Warning(
"CopyEntries",
"The cachesize option can not be parsed: %s. The default size will be used.",cacheSizeStr.
String().
Data());
3373 const char *munit =
nullptr;
3376 Warning(
"CopyEntries",
"The cachesize option is too large: %s (%g%s max). The default size will be used.",cacheSizeStr.
String().
Data(),
m,munit);
3379 if (
gDebug > 0 && cacheSize != -1)
Info(
"CopyEntries",
"Using Cache size: %d\n",cacheSize);
3385 }
else if (
nentries > treeEntries) {
3389 if (fastClone && (nentries < 0 || nentries == tree->
GetEntriesFast())) {
3397 withIndex = R__HandleIndex( onIndexError,
this, tree );
3408 if (cloner.IsValid()) {
3410 if (cacheSize != -1) cloner.SetCacheSize(cacheSize);
3414 Warning(
"CopyEntries",
"%s",cloner.GetWarning());
3419 if (cloner.NeedConversion()) {
3422 for (
Long64_t ii = 0; ii < tentries; ii++) {
3423 if (localtree->
GetEntry(ii) <= 0) {
3432 Warning(
"CopyEntries",
"%s",cloner.GetWarning());
3450 }
else if (
nentries > treeEntries) {
3453 Int_t treenumber = -1;
3460 withIndex = R__HandleIndex( onIndexError,
this, tree );
3467 nbytes += this->
Fill();
3544 if (file && !strcmp(option,
"all")) {
3546 Error(
"Delete",
"File : %s is not writable, cannot delete Tree:%s", file->
GetName(),
GetName());
3563 Int_t nbytes,objlen,keylen;
3564 while ((leaf = (
TLeaf*)next())) {
3567 for (
Int_t i=0;i<nbaskets;i++) {
3571 if (!branchFile)
continue;
3573 if (nbytes <= 0)
continue;
3574 branchFile->
MakeFree(pos,pos+nbytes-1);
3588 if (dirsav) dirsav->
cd();
3589 if (
gDebug)
Info(
"TTree::Delete",
"Deleting Tree: %s: %d baskets deleted. Total space freed = %d bytes\n",
GetName(),nbask,ntot);
3623 while((b = (
TBranch*) next())) {
4286 for (
Int_t i = 0; i < nb; ++i) {
4300 for (
Int_t i = 0; i < nleaves; ++i) {
4304 for (
Int_t j = 0; j < nbaskets - 1; ++j) {
4387 for (
Int_t i = 0; i < nbranches; ++i) {
4395 nwrite = branch->
FillImpl(
nullptr);
4401 Error(
"Fill",
"Failed filling branch:%s.%s, nbytes=%d, entry=%lld\n" 4402 " This error is symptomatic of a Tree created as a memory-resident Tree\n" 4403 " Instead of doing:\n" 4404 " TTree *T = new TTree(...)\n" 4405 " TFile *f = new TFile(...)\n" 4407 " TFile *f = new TFile(...)\n" 4408 " TTree *T = new TTree(...)\n\n",
4411 Error(
"Fill",
"Failed filling branch:%s.%s, nbytes=%d, entry=%lld",
GetName(), branch->
GetName(), nwrite,
4443 bool autoFlush =
false;
4444 bool autoSave =
false;
4462 if (autoFlush || autoSave) {
4469 Info(
"TTree::Fill",
"OptimizeBaskets called at entry %lld, fZipBytes=%lld, fFlushedBytes=%lld\n",
4481 if (zipBytes != 0) {
4483 }
else if (totBytes != 0) {
4518 Info(
"TTree::Fill",
"FlushBaskets() called at entry %lld, fZipBytes=%lld, fFlushedBytes=%lld\n",
fEntries,
4526 Info(
"TTree::Fill",
"AutoSave called at entry %lld, fZipBytes=%lld, fSavedBytes=%lld\n",
fEntries,
4539 return nerror == 0 ? nbytes : -1;
4547 if (list==0 || branchname == 0 || branchname[0] ==
'\0')
return 0;
4551 UInt_t brlen = strlen(branchname);
4553 for(
Int_t index = 0; index < nbranches; ++index) {
4557 UInt_t len = strlen(name);
4558 if (len && name[len-1]==
']') {
4559 const char *dim = strchr(name,
'[');
4564 if (brlen == len && strncmp(branchname,name,len)==0) {
4568 if ((brlen >= len) && (branchname[len] ==
'.')
4569 && strncmp(name, branchname, len) == 0) {
4576 if (next)
return next;
4578 const char *dot = strchr((
char*)branchname,
'.');
4580 if (len==(
size_t)(dot-branchname) &&
4581 strncmp(branchname,name,dot-branchname)==0 ) {
4609 if (branch)
return branch;
4613 if (branch)
return branch;
4617 while ((branch = (
TBranch*) next())) {
4620 return nestedbranch;
4637 const char *subbranch = strstr(branchname, fe->
GetName());
4638 if (subbranch != branchname) {
4642 subbranch += strlen(fe->
GetName());
4643 if (*subbranch !=
'.') {
4649 std::ostringstream
name;
4651 name << t->
GetName() <<
"." << subbranch;
4676 char* subsearchname = (
char*) strstr(searchname,
GetName());
4677 if (subsearchname != searchname) {
4680 if (subsearchname) {
4681 subsearchname += strlen(
GetName());
4682 if (*subsearchname !=
'.') {
4686 if (subsearchname[0]==0) {
4700 while ((leaf = (
TLeaf*) next())) {
4703 if (dim >= 0) leafname.
Remove(dim);
4705 if (leafname == searchname) {
4708 if (subsearchname && leafname == subsearchname) {
4714 dim = leaftitle.
First(
'[');
4715 if (dim >= 0) leaftitle.
Remove(dim);
4717 if (leaftitle == searchname) {
4720 if (subsearchname && leaftitle == subsearchname) {
4726 dim = longname.
First(
'[');
4727 if (dim>=0) longname.
Remove(dim);
4728 if (longname == searchname) {
4731 if (subsearchname && longname == subsearchname) {
4735 dim = longtitle.
First(
'[');
4736 if (dim>=0) longtitle.
Remove(dim);
4737 if (longtitle == searchname) {
4740 if (subsearchname && longtitle == subsearchname) {
4748 if (strstr(searchname,
".") && !strcmp(searchname, branch->
GetName())) {
4751 if (subsearchname && strstr(subsearchname,
".") && !strcmp(subsearchname, branch->
GetName())) {
4769 subsearchname = (
char*) strstr(searchname, fe->
GetName());
4770 if (subsearchname != searchname) {
4773 if (subsearchname) {
4774 subsearchname += strlen(fe->
GetName());
4775 if (*subsearchname !=
'.') {
4781 if (subsearchname) {
4782 leafname.
Form(
"%s.%s",t->
GetName(),subsearchname);
4784 leafname = searchname;
4826 return fPlayer->
Fit(funcname, varexp, selection, option, goption, nentries, firstentry);
4832 struct BoolRAIIToggle {
4835 BoolRAIIToggle(
Bool_t &val) : m_val(val) { m_val =
true; }
4836 ~BoolRAIIToggle() { m_val =
false; }
4884 std::atomic<Int_t> nerrpar(0);
4885 std::atomic<Int_t> nbpar(0);
4886 std::atomic<Int_t> pos(0);
4888 auto mapFunction = [&]() {
4894 Int_t j = pos.fetch_add(1);
4900 std::stringstream ss;
4901 ss << std::this_thread::get_id();
4902 Info(
"FlushBaskets",
"[IMT] Thread %s", ss.str().c_str());
4903 Info(
"FlushBaskets",
"[IMT] Running task for branch #%d: %s", j, branch->
GetName());
4908 if (nbtask < 0) { nerrpar++; }
4909 else { nbpar += nbtask; }
4913 pool.
Foreach(mapFunction, nb);
4919 return nerrpar ? -1 : nbpar.load();
4922 for (
Int_t j = 0; j < nb; j++) {
4965 const char* alias = t->
GetAlias(aliasName);
4969 const char* subAliasName = strstr(aliasName, fe->
GetName());
4970 if (subAliasName && (subAliasName[strlen(fe->
GetName())] ==
'.')) {
4986 if (name == 0)
return 0;
4996 for (
Int_t i = 0; i < nb; i++) {
5006 for (
Int_t j = 0; j < nb1; j++) {
5013 for (
Int_t k = 0; k < nb2; k++) {
5025 for (
Int_t i = 0; i < nleaves; i++) {
5059 char* subname = (
char*) strstr(name, fe->
GetName());
5060 if (subname != name) {
5065 if (*subname !=
'.') {
5114 if (!(stcs =
gSystem->
Getenv(
"ROOT_TTREECACHE_SIZE")) || !*stcs) {
5120 if (cacheFactor < 0.0) {
5128 else if (fAutoFlush == 0) cacheSize = 0;
5131 if (cacheSize >= (INT_MAX / 4)) {
5132 cacheSize = INT_MAX / 4;
5135 if (cacheSize < 0) {
5139 if (cacheSize == 0 && withDefault) {
5141 else if (fAutoFlush == 0) cacheSize = 0;
5336 if (entry < 0 || entry >=
fEntries)
return 0;
5347 auto seqprocessing = [&]() {
5349 for (i=0;i<nbranches;i++) {
5351 nb = branch->
GetEntry(entry, getall);
5363 nb = branch->
GetEntry(entry, getall);
5367 if (nb < 0)
return nb;
5373 std::atomic<Int_t> pos(0);
5374 std::atomic<Int_t> nbpar(0);
5376 auto mapFunction = [&]() {
5382 Int_t j = pos.fetch_add(1);
5388 std::stringstream ss;
5389 ss << std::this_thread::get_id();
5390 Info(
"GetEntry",
"[IMT] Thread %s", ss.str().c_str());
5391 Info(
"GetEntry",
"[IMT] Running task for branch #%d: %s", j, branch->
GetName());
5394 std::chrono::time_point<std::chrono::system_clock> start, end;
5396 start = std::chrono::system_clock::now();
5397 nbtask = branch->
GetEntry(entry, getall);
5398 end = std::chrono::system_clock::now();
5400 Long64_t tasktime = (
Long64_t)std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
5403 if (nbtask < 0) errnb = nbtask;
5404 else nbpar += nbtask;
5430 if (nb < 0)
return nb;
5447 if (nb < 0)
return nb;
5473 if (checkLeafCount) {
5474 for (
Int_t i = 0; i < nbranches; i++) {
5478 auto countBranch = leafCount->GetBranch();
5492 for (
Int_t i = 0; i < nbranches; i++) {
5504 [](std::pair<Long64_t,TBranch*>
a, std::pair<Long64_t,TBranch*>
b) {
5505 return a.first > b.first;
5524 [](std::pair<Long64_t,TBranch*>
a, std::pair<Long64_t,TBranch*>
b) {
5525 return a.first > b.first;
5629 for (i = 0; i < nbranches; ++i) {
5632 if (nb < 0)
return nb;
5644 if (serial <0)
return -nbytes;
5646 if (nb < 0)
return nb;
5671 if (strcmp(friendname,fe->
GetName())==0
5715 if ((tree ==
this) || (tree ==
GetTree())) {