448 case kchar:
return 0;
453 case kBits:
return 0;
541 entryInRange = firstEntry;
544 entryInRange = firstEntry - pedestal;
552 if (autoflush <= 0) {
555 fStartEntry = pedestal + entryInRange - entryInRange%autoflush;
581 if (autoFlush > 0)
return autoFlush;
590 if (cacheSize == 0) {
601 if (cacheSize <= 0) {
602 cacheSize = 30000000;
633 if (clusterSize == 0) {
671 if (fClusterRange == 0) {
676 if (clusterSize == 0) {
873 if (strlen(title) > 2) {
874 if (title[0] ==
'/') {
875 Branch(title+1,32000,splitlevel);
1001 Error(
"AddBranchToCache",
"Could not load a tree");
1010 Error(
"AddBranchToCache",
"No tree is available. Branch was not added to the cache");
1016 Error(
"AddBranchToCache",
"No file is available. Branch was not added to the cache");
1021 Error(
"AddBranchToCache",
"No cache is available, branch not added");
1024 return tc->
AddBranch(bname,subbranches);
1040 Error(
"AddBranchToCache",
"Could not load a tree");
1048 Error(
"AddBranchToCache",
"Error adding branch");
1053 Error(
"AddBranchToCache",
"No tree is available. Branch was not added to the cache");
1059 Error(
"AddBranchToCache",
"No file is available. Branch was not added to the cache");
1064 Error(
"AddBranchToCache",
"No cache is available, branch not added");
1084 Error(
"DropBranchFromCache",
"Could not load a tree");
1093 Error(
"DropBranchFromCache",
"No tree is available. Branch was not dropped from the cache");
1099 Error(
"DropBranchFromCache",
"No file is available. Branch was not dropped from the cache");
1104 Error(
"DropBranchFromCache",
"No cache is available, branch not dropped");
1123 Error(
"DropBranchFromCache",
"Could not load a tree");
1131 Error(
"DropBranchFromCache",
"Error dropping branch");
1136 Error(
"DropBranchFromCache",
"No tree is available. Branch was not dropped from the cache");
1142 Error(
"DropBranchFromCache",
"No file is available. Branch was not dropped from the cache");
1147 Error(
"DropBranchFromCache",
"No cache is available, branch not dropped");
1256 Warning(
"AddFriend",
"FriendElement %s in file %s has less entries %lld than its parent Tree: %lld", treename, filename, t->
GetEntries(),
fEntries);
1259 Warning(
"AddFriend",
"Cannot add FriendElement %s in file %s", treename, filename);
1284 Warning(
"AddFriend",
"FriendElement %s in file %s has less entries %lld than its parent tree: %lld", treename, file->
GetName(), t->
GetEntries(),
fEntries);
1287 Warning(
"AddFriend",
"unknown tree '%s' in file '%s'", treename, file->
GetName());
1311 Warning(
"AddFriend",
"FriendElement '%s' in file '%s' has less entries %lld than its parent tree: %lld",
1406 if (opt.
Contains(
"flushbaskets")) {
1407 if (
gDebug > 0)
Info(
"AutoSave",
"calling FlushBaskets \n");
1419 if (nbytes && key) {
1440 const char* writeStlWithoutProxyMsg =
"The class requested (%s) for the branch \"%s\"" 1441 " is an instance of an stl collection and does not have a compiled CollectionProxy." 1442 " Please generate the dictionary for this collection (%s) to avoid to write corrupted data.";
1456 Error(
"Branch", writeStlWithoutProxyMsg,
1460 return Branch(branchname, classname, (
void*) addobj, bufsize, splitlevel);
1463 void** addr = (
void**) addobj;
1467 if (ptrClass && claim) {
1474 Error(
"Branch",
"The class requested (%s) for \"%s\" is different from the type of the pointer passed (%s)",
1477 }
else if (actualClass && (claim != actualClass) && !actualClass->
InheritsFrom(claim)) {
1482 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s",
1488 Error(
"Branch", writeStlWithoutProxyMsg,
1492 return Branch(branchname, classname, (
void*) addobj, bufsize, splitlevel);
1502 Error(
"Branch",
"The pointer specified for %s is not of a class known to ROOT", branchname);
1506 void** addr = (
void**) addobj;
1507 if (addr && *addr) {
1510 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",
1511 branchname, ptrClass->
GetName());
1512 actualClass = ptrClass;
1513 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1514 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());
1518 actualClass = ptrClass;
1521 Error(
"Branch", writeStlWithoutProxyMsg,
1525 return Branch(branchname, actualClass->
GetName(), (
void*) addobj, bufsize, splitlevel);
1537 Error(
"Branch", writeStlWithoutProxyMsg,
1540 }
else if (claim == 0) {
1541 Error(
"Branch",
"The pointer specified for %s is not of a class known to ROOT and %s is not a known class", branchname, classname);
1548 Error(
"Branch",
"Reference interface requires a valid object (for branch: %s)!", branchname);
1552 if (ptrClass && claim) {
1559 Error(
"Branch",
"The class requested (%s) for \"%s\" is different from the type of the object passed (%s)",
1562 }
else if (actualClass && (claim != actualClass) && !actualClass->
InheritsFrom(claim)) {
1567 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s",
1573 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",
1574 branchname, ptrClass->
GetName());
1575 actualClass = ptrClass;
1576 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1577 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());
1581 Error(
"Branch", writeStlWithoutProxyMsg,
1596 Error(
"Branch",
"The pointer specified for %s is not of a class or type known to ROOT", branchname);
1599 return Branch(branchname,addobj,varname.
Data(),bufsize);
1605 Error(
"Branch",
"Reference interface requires a valid object (for branch: %s)!", branchname);
1610 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",
1611 branchname, ptrClass->
GetName());
1612 actualClass = ptrClass;
1613 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1614 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());
1618 Error(
"Branch", writeStlWithoutProxyMsg,
1721 Error(
"Branch",
"Cannot call this constructor for a TClonesArray");
1724 Int_t nch = strlen(name);
1727 while ((obj = next())) {
1735 Branch(col, bufsize, splitlevel - 1, branchname);
1737 if (nch && (name[nch-1] ==
'_')) {
1746 if (splitlevel > 99) {
1772 char* curname =
new char[1000];
1774 while ((obj = next())) {
1775 snprintf(curname,1000,
"%s/%s", foldername, obj->GetName());
1777 Branch(curname, bufsize, splitlevel - 1);
1780 for (
Int_t i = 0; i < 1000; ++i) {
1781 if (curname[i] == 0) {
1784 if (curname[i] ==
'/') {
1791 strlcat(curname, occur,1000);
1859 TBranch* branch =
new TBranch(
this, name, address, leaflist, bufsize);
1895 return Bronch(name, classname, addobj, bufsize, splitlevel);
1897 if (splitlevel < 0) {
1900 return BranchOld(name, classname, addobj, bufsize, splitlevel);
1949 Error(
"BranchOld",
"Cannot find class: '%s'", classname);
1954 Fatal(
"BranchOld",
"The requested class ('%s') does not inherit from TObject.\n" 1955 "\tfgBranchStyle is set to zero requesting by default to use BranchOld.\n" 1956 "\tIf this is intentional use Bronch instead of Branch or BranchOld.", classname);
1958 Fatal(
"BranchOld",
"The requested class ('%s') does not inherit from TObject.\n" 1959 "\tYou can not use BranchOld to store objects of this type.",classname);
1970 const char* rdname = 0;
1971 const char* dname = 0;
1973 char** apointer = (
char**) addobj;
1983 Int_t lenName = strlen(name);
1985 if (name[lenName-1] ==
'.') {
2024 if (!strcmp(dname,
"fBits")) {
2027 if (!strcmp(dname,
"fUniqueID")) {
2037 branchname = rdname;
2041 branchname.
Form(
"%s%s", name, &rdname[1]);
2043 branchname.
Form(
"%s%s", name, &rdname[0]);
2049 char* pointer = ((
char*) obj) + offset;
2058 char* cpointer = (
char*) pointer;
2059 char** ppointer = (
char**) cpointer;
2061 if (splitlevel != 2) {
2063 branch1 =
new TBranchClones(branch,branchname, pointer, bufsize);
2068 blist->
Add(branch1);
2076 blist->
Add(branch1);
2093 blist->
Add(branch1);
2107 aindex.Remove(rdot+1);
2108 aindex.Append(index);
2114 if (!strcmp(rdi->
GetName(), index)) {
2117 if (!strcmp(rdi->
GetName(), aindex)) {
2129 leaflist.
Form(
"%s[%s]/%c", &rdname[0], index, vcode);
2131 Error(
"BranchOld",
"Cannot create branch for rdname: %s code: %d", branchname.
Data(), code);
2138 leaflist.
Form(
"%s/%s", dname,
"C");
2151 branch1 =
new TBranch(branch, bname, *((
void**) pointer), leaflist, bufsize);
2155 blist->
Add(branch1);
2162 leaflist.
Form(
"%s/%c", rdname, vcode);
2164 Error(
"BranchOld",
"Cannot create branch for rdname: %s code: %d", branchname.
Data(), code);
2167 branch1 =
new TBranch(branch, branchname, pointer, leaflist, bufsize);
2169 blist->
Add(branch1);
2178 Warning(
"BranchOld",
"Cannot process member: '%s'", rdname);
2287 Error(
"Bronch",
"Cannot find class:%s", classname);
2298 objptr = (
char*)addr;
2300 objptr = *((
char**) addr);
2306 Error(
"Bronch",
"Pointer to TClonesArray is null");
2310 Error(
"Bronch",
"TClonesArray with no class defined in branch: %s", name);
2314 Error(
"Bronch",
"TClonesArray with no dictionary defined in branch: %s", name);
2318 if (splitlevel > 0) {
2319 if (hasCustomStreamer)
2320 Warning(
"Bronch",
"Using split mode on a class: %s with a custom Streamer", clones->
GetClass()->
GetName());
2335 if (!inklass && (collProxy->
GetType() == 0)) {
2336 Error(
"Bronch",
"%s with no class defined in branch: %s", classname, name);
2343 Error(
"Bronch",
"Container with no dictionary defined in branch: %s", name);
2347 Warning(
"Bronch",
"Using split mode on a class: %s with a custom Streamer", inklass->
GetName());
2358 branch =
new TBranchSTL(
this, name, collProxy, bufsize, splitlevel );
2360 branch =
new TBranchElement(
this, name, collProxy, bufsize, splitlevel);
2363 branch->SetAddress(addr);
2365 branch->SetObject(addr);
2372 Error(
"Bronch",
"Cannot find dictionary for class: %s", classname);
2378 hasCustomStreamer =
kTRUE;
2381 if (splitlevel < 0 || ((splitlevel == 0) && hasCustomStreamer && cl->
IsTObject())) {
2412 objptr = (
char*) cl->
New();
2420 if ((splitlevel > 0) && !cl->
CanSplit()) {
2421 if (splitlevel != 99) {
2422 Warning(
"Bronch",
"%s cannot be split, resetting splitlevel to 0", cl->
GetName());
2436 Error(
"Bronch",
"Cannot build the StreamerInfo for class: %s", cl->
GetName());
2445 if (splitlevel > 0) {
2456 branch->
Unroll(name, cl, sinfo, objptr, bufsize, splitlevel);
2600 char* fname =
new char[2000];
2603 for (
Int_t i = 0; i < 10; ++i) {
2611 strlcpy(fname, file->
GetName(),2000);
2614 char* cunder = strrchr(fname,
'_');
2617 const char* cdot = strrchr(file->
GetName(),
'.');
2619 strlcat(fname, cdot,2000);
2624 strlcat(fname, fcount,2000);
2627 char* cdot = strrchr(fname,
'.');
2630 strlcat(fname, strrchr(file->
GetName(),
'.'),2000);
2634 strlcat(fname, fcount,2000);
2641 Warning(
"ChangeFile",
"file %s already exist, trying with %d underscores", fname, nus+1);
2646 Error(
"Fill",
"Failed to open new file %s, continuing as a memory tree.",fname);
2648 Printf(
"Fill: Switching to new file: %s", fname);
2671 while ((branch = (
TBranch*)nextb())) {
2680 if (newfile) newfile->
Append(obj);
2716 TClass* expectedClass = 0;
2722 if (expectedClass && datatype ==
kOther_t && ptrClass == 0) {
2728 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". " 2729 "The class expected (%s) refers to an stl collection and do not have a compiled CollectionProxy. " 2730 "Please generate the dictionary for this class (%s)",
2737 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". " 2738 "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." 2739 "Please generate the dictionary for this class (%s)",
2742 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". " 2743 "This is probably due to a missing dictionary, the original data class for this branch is %s.", branch->
GetName(), expectedClass->
GetName());
2747 if (expectedClass && ptrClass && (branch->
GetMother() == branch)) {
2750 Error(
"SetBranchAddress",
"The address for \"%s\" should be the address of a pointer!", branch->
GetName());
2770 if( expectedClass && ptrClass &&
2771 expectedClass != ptrClass &&
2779 Info(
"SetBranchAddress",
"Matching STL collection (at least according to the SchemaRuleSet when " 2780 "reading a %s into a %s",expectedClass->
GetName(),ptrClass->
GetName());
2787 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());
2798 }
else if (expectedClass && ptrClass && !expectedClass->
InheritsFrom(ptrClass)) {
2820 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());
2830 Error(
"SetBranchAddress",
"The pointer type given \"%s\" (%d) does not correspond to the type needed \"%s\" (%d) by the branch: %s",
2837 if (expectedClass) {
2838 Error(
"SetBranchAddress",
"The pointer type given \"%s\" (%d) does not correspond to the type needed \"%s\" by the branch: %s",
2852 if (rdm->GetThisOffset() == 0) {
2856 if (etype == expectedType) {
2867 if (dm->GetOffset() == 0) {
2871 if (etype == expectedType) {
2883 if (len <= ptrClass->
Size()) {
2887 Error(
"SetBranchAddress",
"The pointer type given \"%s\" does not correspond to the type needed \"%s\" (%d) by the branch: %s",
2893 Error(
"SetBranchAddress", writeStlWithoutProxyMsg,
3007 for (
Int_t i = 0; i < nb; ++i) {
3017 if (thistree !=
this) {
3042 for (
Int_t lndx = 0; lndx < nleaves; ++lndx) {
3048 if (branch && (newcomp > -1)) {
3057 for (
Long64_t i = 0; i < nb; ++i) {
3068 for (
Int_t j = 0; j < nb1; ++j) {
3082 for (
Int_t k = 0; k < nb2; ++k) {
3110 if (nentries != 0) {
3111 if (fastClone && (nentries < 0)) {
3112 if ( newtree->
CopyEntries(
this, -1, option ) < 0 ) {
3114 Error(
"CloneTTree",
"TTree has not been cloned\n");
3137 for (
Int_t i = 0; i < nbranches; ++i) {
3173 Warning(
"CopyAddresses",
"Could not find branch named '%s' in tree named '%s'", branch->
GetName(), tree->
GetName());
3181 for (
Int_t i = 0; i < ntleaves; ++i) {
3182 TLeaf* tleaf = (
TLeaf*) tleaves->UncheckedAt(i);
3234 Warning(
"CopyAddresses",
"Could not find branch named '%s' in tree named '%s'", branch->
GetName(), tree->
GetName());
3261 switch (onIndexError) {
3285 switch (onIndexError) {
3309 }
else if ( onIndexError == kDrop ) {
3366 onIndexError = kKeep;
3367 }
else if (opt.
Contains(
"buildindex")) {
3368 onIndexError = kBuild;
3369 }
else if (opt.
Contains(
"dropindex")) {
3370 onIndexError = kDrop;
3372 onIndexError = kBuild;
3375 Int_t cacheSize = -1;
3378 Ssiz_t cacheSizeEnd = opt.
Index(
" ",cacheSizeLoc+10) - (cacheSizeLoc+10);
3379 TSubString cacheSizeStr( opt(cacheSizeLoc+10,cacheSizeEnd) );
3382 Warning(
"CopyEntries",
"The cachesize option can not be parsed: %s. The default size will be used.",cacheSizeStr.
String().
Data());
3385 const char *munit =
nullptr;
3388 Warning(
"CopyEntries",
"The cachesize option is too large: %s (%g%s max). The default size will be used.",cacheSizeStr.
String().
Data(),
m,munit);
3391 if (
gDebug > 0 && cacheSize != -1)
Info(
"CopyEntries",
"Using Cache size: %d\n",cacheSize);
3396 nentries = treeEntries;
3397 }
else if (nentries > treeEntries) {
3398 nentries = treeEntries;
3401 if (fastClone && (nentries < 0 || nentries == tree->
GetEntriesFast())) {
3409 withIndex = R__HandleIndex( onIndexError,
this, tree );
3420 if (cloner.IsValid()) {
3422 if (cacheSize != -1) cloner.SetCacheSize(cacheSize);
3426 Warning(
"CopyEntries",
"%s",cloner.GetWarning());
3431 if (cloner.NeedConversion()) {
3434 for (
Long64_t ii = 0; ii < tentries; ii++) {
3435 if (localtree->
GetEntry(ii) <= 0) {
3444 Warning(
"CopyEntries",
"%s",cloner.GetWarning());
3461 nentries = treeEntries;
3462 }
else if (nentries > treeEntries) {
3463 nentries = treeEntries;
3465 Int_t treenumber = -1;
3472 withIndex = R__HandleIndex( onIndexError,
this, tree );
3479 nbytes += this->
Fill();
3556 if (file && !strcmp(option,
"all")) {
3558 Error(
"Delete",
"File : %s is not writable, cannot delete Tree:%s", file->
GetName(),
GetName());
3575 Int_t nbytes,objlen,keylen;
3576 while ((leaf = (
TLeaf*)next())) {
3579 for (
Int_t i=0;i<nbaskets;i++) {
3583 if (!branchFile)
continue;
3585 if (nbytes <= 0)
continue;
3586 branchFile->
MakeFree(pos,pos+nbytes-1);
3600 if (dirsav) dirsav->
cd();
3601 if (
gDebug)
Info(
"TTree::Delete",
"Deleting Tree: %s: %d baskets deleted. Total space freed = %d bytes\n",
GetName(),nbask,ntot);
3635 while((b = (
TBranch*) next())) {
4298 for (
Int_t i = 0; i < nb; ++i) {
4312 for (
Int_t i = 0; i < nleaves; ++i) {
4316 for (
Int_t j = 0; j < nbaskets - 1; ++j) {
4400 for (
Int_t i = 0; i < nbranches; ++i) {
4408 nwrite = branch->
FillImpl(
nullptr);
4410 nwrite = branch->
FillImpl(useIMT ? &imtHelper :
nullptr);
4414 Error(
"Fill",
"Failed filling branch:%s.%s, nbytes=%d, entry=%lld\n" 4415 " This error is symptomatic of a Tree created as a memory-resident Tree\n" 4416 " Instead of doing:\n" 4417 " TTree *T = new TTree(...)\n" 4418 " TFile *f = new TFile(...)\n" 4420 " TFile *f = new TFile(...)\n" 4421 " TTree *T = new TTree(...)\n\n",
4424 Error(
"Fill",
"Failed filling branch:%s.%s, nbytes=%d, entry=%lld",
GetName(), branch->
GetName(), nwrite,
4456 bool autoFlush =
false;
4457 bool autoSave =
false;
4475 if (autoFlush || autoSave) {
4482 Info(
"TTree::Fill",
"OptimizeBaskets called at entry %lld, fZipBytes=%lld, fFlushedBytes=%lld\n",
4494 if (zipBytes != 0) {
4496 }
else if (totBytes != 0) {
4531 Info(
"TTree::Fill",
"FlushBaskets() called at entry %lld, fZipBytes=%lld, fFlushedBytes=%lld\n",
fEntries,
4539 Info(
"TTree::Fill",
"AutoSave called at entry %lld, fZipBytes=%lld, fSavedBytes=%lld\n",
fEntries,
4552 return nerror == 0 ? nbytes : -1;
4560 if (list==0 || branchname == 0 || branchname[0] ==
'\0')
return 0;
4564 UInt_t brlen = strlen(branchname);
4566 for(
Int_t index = 0; index < nbranches; ++index) {
4570 UInt_t len = strlen(name);
4571 if (len && name[len-1]==
']') {
4572 const char *dim = strchr(name,
'[');
4577 if (brlen == len && strncmp(branchname,name,len)==0) {
4581 if ((brlen >= len) && (branchname[len] ==
'.')
4582 && strncmp(name, branchname, len) == 0) {
4589 if (next)
return next;
4591 const char *dot = strchr((
char*)branchname,
'.');
4593 if (len==(
size_t)(dot-branchname) &&
4594 strncmp(branchname,name,dot-branchname)==0 ) {
4622 if (branch)
return branch;
4626 if (branch)
return branch;
4630 while ((branch = (
TBranch*) next())) {
4633 return nestedbranch;
4650 const char *subbranch = strstr(branchname, fe->
GetName());
4651 if (subbranch != branchname) {
4655 subbranch += strlen(fe->
GetName());
4656 if (*subbranch !=
'.') {
4662 std::ostringstream
name;
4664 name << t->
GetName() <<
"." << subbranch;
4689 char* subsearchname = (
char*) strstr(searchname,
GetName());
4690 if (subsearchname != searchname) {
4693 if (subsearchname) {
4694 subsearchname += strlen(
GetName());
4695 if (*subsearchname !=
'.') {
4699 if (subsearchname[0]==0) {
4713 while ((leaf = (
TLeaf*) next())) {
4716 if (dim >= 0) leafname.
Remove(dim);
4718 if (leafname == searchname) {
4721 if (subsearchname && leafname == subsearchname) {
4727 dim = leaftitle.
First(
'[');
4728 if (dim >= 0) leaftitle.
Remove(dim);
4730 if (leaftitle == searchname) {
4733 if (subsearchname && leaftitle == subsearchname) {
4739 dim = longname.
First(
'[');
4740 if (dim>=0) longname.
Remove(dim);
4741 if (longname == searchname) {
4744 if (subsearchname && longname == subsearchname) {
4748 dim = longtitle.
First(
'[');
4749 if (dim>=0) longtitle.
Remove(dim);
4750 if (longtitle == searchname) {
4753 if (subsearchname && longtitle == subsearchname) {
4761 if (strstr(searchname,
".") && !strcmp(searchname, branch->
GetName())) {
4764 if (subsearchname && strstr(subsearchname,
".") && !strcmp(subsearchname, branch->
GetName())) {
4782 subsearchname = (
char*) strstr(searchname, fe->
GetName());
4783 if (subsearchname != searchname) {
4786 if (subsearchname) {
4787 subsearchname += strlen(fe->
GetName());
4788 if (*subsearchname !=
'.') {
4794 if (subsearchname) {
4795 leafname.
Form(
"%s.%s",t->
GetName(),subsearchname);
4797 leafname = searchname;
4839 return fPlayer->
Fit(funcname, varexp, selection, option, goption, nentries, firstentry);
4845 struct BoolRAIIToggle {
4848 BoolRAIIToggle(
Bool_t &val) : m_val(val) { m_val =
true; }
4849 ~BoolRAIIToggle() { m_val =
false; }
4888 if (retval == -1)
return retval;
4918 std::atomic<Int_t> nerrpar(0);
4919 std::atomic<Int_t> nbpar(0);
4920 std::atomic<Int_t> pos(0);
4922 auto mapFunction = [&]() {
4928 Int_t j = pos.fetch_add(1);
4934 std::stringstream ss;
4935 ss << std::this_thread::get_id();
4936 Info(
"FlushBaskets",
"[IMT] Thread %s", ss.str().c_str());
4937 Info(
"FlushBaskets",
"[IMT] Running task for branch #%d: %s", j, branch->GetName());
4940 Int_t nbtask = branch->FlushBaskets();
4942 if (nbtask < 0) { nerrpar++; }
4943 else { nbpar += nbtask; }
4947 pool.
Foreach(mapFunction, nb);
4953 return nerrpar ? -1 : nbpar.load();
4956 for (
Int_t j = 0; j < nb; j++) {
4999 const char* alias = t->
GetAlias(aliasName);
5003 const char* subAliasName = strstr(aliasName, fe->
GetName());
5004 if (subAliasName && (subAliasName[strlen(fe->
GetName())] ==
'.')) {
5020 if (name == 0)
return 0;
5030 for (
Int_t i = 0; i < nb; i++) {
5040 for (
Int_t j = 0; j < nb1; j++) {
5047 for (
Int_t k = 0; k < nb2; k++) {
5059 for (
Int_t i = 0; i < nleaves; i++) {
5093 char* subname = (
char*) strstr(name, fe->
GetName());
5094 if (subname != name) {
5099 if (*subname !=
'.') {
5148 if (!(stcs =
gSystem->
Getenv(
"ROOT_TTREECACHE_SIZE")) || !*stcs) {
5154 if (cacheFactor < 0.0) {
5162 else if (fAutoFlush == 0) cacheSize = 0;
5165 if (cacheSize >= (INT_MAX / 4)) {
5166 cacheSize = INT_MAX / 4;
5169 if (cacheSize < 0) {
5173 if (cacheSize == 0 && withDefault) {
5175 else if (fAutoFlush == 0) cacheSize = 0;
5371 if (entry < 0 || entry >=
fEntries)
return 0;
5383 auto seqprocessing = [&]() {
5385 for (i=0;i<nbranches;i++) {
5387 nb = branch->
GetEntry(entry, getall);
5401 nb = branch->GetEntry(entry, getall);
5405 if (nb < 0)
return nb;
5411 std::atomic<Int_t> pos(0);
5412 std::atomic<Int_t> nbpar(0);
5414 auto mapFunction = [&]() {
5420 Int_t j = pos.fetch_add(1);
5426 std::stringstream ss;
5427 ss << std::this_thread::get_id();
5428 Info(
"GetEntry",
"[IMT] Thread %s", ss.str().c_str());
5429 Info(
"GetEntry",
"[IMT] Running task for branch #%d: %s", j, branch->GetName());
5432 std::chrono::time_point<std::chrono::system_clock> start, end;
5434 start = std::chrono::system_clock::now();
5435 nbtask = branch->GetEntry(entry, getall);
5436 end = std::chrono::system_clock::now();
5438 Long64_t tasktime = (
Long64_t)std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
5441 if (nbtask < 0) errnb = nbtask;
5442 else nbpar += nbtask;
5468 if (nb < 0)
return nb;
5485 if (nb < 0)
return nb;
5511 if (checkLeafCount) {
5512 for (
Int_t i = 0; i < nbranches; i++) {
5516 auto countBranch = leafCount->GetBranch();
5530 for (
Int_t i = 0; i < nbranches; i++) {
5542 [](std::pair<Long64_t,TBranch*>
a, std::pair<Long64_t,TBranch*>
b) {
5543 return a.first >
b.first;
5562 [](std::pair<Long64_t,TBranch*>
a, std::pair<Long64_t,TBranch*>
b) {
5563 return a.first >
b.first;
5668 for (i = 0; i < nbranches; ++i) {
5671 if (nb < 0)
return nb;
5683 if (serial <0)
return -nbytes;
5685 if (nb < 0)
return nb;
5710 if (strcmp(friendname,fe->
GetName())==0