349 #include "TClassEdit.h" 447 case kchar:
return 0;
452 case kBits:
return 0;
474 fMethodBit = methodbit;
476 fPrevious = fTree->fFriendLockStatus & fMethodBit;
477 fTree->fFriendLockStatus |= fMethodBit;
530 fStartEntry = firstEntry;
541 if (fClusterRange == 0) {
543 entryInRange = firstEntry;
546 entryInRange = firstEntry - pedestal;
554 if (autoflush == 0) {
555 autoflush = GetEstimatedClusterSize();
557 fStartEntry = pedestal + entryInRange - entryInRange%autoflush;
561 fNextEntry = fStartEntry;
577 if (cacheSize == 0) {
589 if (clusterEstimate == 0)
592 return clusterEstimate;
602 fStartEntry = fNextEntry;
605 Long64_t clusterEstimate = GetEstimatedClusterSize();
606 fNextEntry = fStartEntry + clusterEstimate;
622 if (clusterSize == 0) {
623 clusterSize = GetEstimatedClusterSize();
625 fNextEntry += clusterSize;
820 if (strlen(title) > 2) {
821 if (title[0] ==
'/') {
822 Branch(title+1,32000,splitlevel);
948 Error(
"AddBranchToCache",
"Could not load a tree");
957 Error(
"AddBranchToCache",
"No tree is available. Branch was not added to the cache");
963 Error(
"AddBranchToCache",
"No file is available. Branch was not added to the cache");
968 Error(
"AddBranchToCache",
"No cache is available, branch not added");
987 Error(
"AddBranchToCache",
"Could not load a tree");
995 Error(
"AddBranchToCache",
"Error adding branch");
1000 Error(
"AddBranchToCache",
"No tree is available. Branch was not added to the cache");
1006 Error(
"AddBranchToCache",
"No file is available. Branch was not added to the cache");
1011 Error(
"AddBranchToCache",
"No cache is available, branch not added");
1031 Error(
"DropBranchFromCache",
"Could not load a tree");
1040 Error(
"DropBranchFromCache",
"No tree is available. Branch was not dropped from the cache");
1046 Error(
"DropBranchFromCache",
"No file is available. Branch was not dropped from the cache");
1051 Error(
"DropBranchFromCache",
"No cache is available, branch not dropped");
1070 Error(
"DropBranchFromCache",
"Could not load a tree");
1078 Error(
"DropBranchFromCache",
"Error dropping branch");
1083 Error(
"DropBranchFromCache",
"No tree is available. Branch was not dropped from the cache");
1089 Error(
"DropBranchFromCache",
"No file is available. Branch was not dropped from the cache");
1094 Error(
"DropBranchFromCache",
"No cache is available, branch not dropped");
1203 Warning(
"AddFriend",
"FriendElement %s in file %s has less entries %lld than its parent Tree: %lld", treename, filename, t->
GetEntries(),
fEntries);
1206 Warning(
"AddFriend",
"Cannot add FriendElement %s in file %s", treename, filename);
1231 Warning(
"AddFriend",
"FriendElement %s in file %s has less entries %lld than its parent tree: %lld", treename, file->
GetName(), t->
GetEntries(),
fEntries);
1234 Warning(
"AddFriend",
"unknown tree '%s' in file '%s'", treename, file->
GetName());
1258 Warning(
"AddFriend",
"FriendElement '%s' in file '%s' has less entries %lld than its parent tree: %lld",
1353 if (opt.
Contains(
"flushbaskets")) {
1354 if (
gDebug > 0)
Info(
"AutoSave",
"calling FlushBaskets \n");
1366 if (nbytes && key) {
1387 const char* writeStlWithoutProxyMsg =
"The class requested (%s) for the branch \"%s\"" 1388 " is an instance of an stl collection and does not have a compiled CollectionProxy." 1389 " Please generate the dictionary for this collection (%s) to avoid to write corrupted data.";
1403 Error(
"Branch", writeStlWithoutProxyMsg,
1407 return Branch(branchname, classname, (
void*) addobj, bufsize, splitlevel);
1410 void** addr = (
void**) addobj;
1414 if (ptrClass && claim) {
1421 Error(
"Branch",
"The class requested (%s) for \"%s\" is different from the type of the pointer passed (%s)",
1424 }
else if (actualClass && (claim != actualClass) && !actualClass->
InheritsFrom(claim)) {
1429 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s",
1435 Error(
"Branch", writeStlWithoutProxyMsg,
1439 return Branch(branchname, classname, (
void*) addobj, bufsize, splitlevel);
1449 Error(
"Branch",
"The pointer specified for %s is not of a class known to ROOT", branchname);
1453 void** addr = (
void**) addobj;
1454 if (addr && *addr) {
1457 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",
1458 branchname, ptrClass->
GetName());
1459 actualClass = ptrClass;
1460 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1461 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());
1465 actualClass = ptrClass;
1468 Error(
"Branch", writeStlWithoutProxyMsg,
1472 return Branch(branchname, actualClass->
GetName(), (
void*) addobj, bufsize, splitlevel);
1484 Error(
"Branch", writeStlWithoutProxyMsg,
1487 }
else if (claim == 0) {
1488 Error(
"Branch",
"The pointer specified for %s is not of a class known to ROOT and %s is not a known class", branchname, classname);
1495 Error(
"Branch",
"Reference interface requires a valid object (for branch: %s)!", branchname);
1499 if (ptrClass && claim) {
1506 Error(
"Branch",
"The class requested (%s) for \"%s\" is different from the type of the object passed (%s)",
1509 }
else if (actualClass && (claim != actualClass) && !actualClass->
InheritsFrom(claim)) {
1514 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s",
1520 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",
1521 branchname, ptrClass->
GetName());
1522 actualClass = ptrClass;
1523 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1524 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());
1528 Error(
"Branch", writeStlWithoutProxyMsg,
1543 Error(
"Branch",
"The pointer specified for %s is not of a class or type known to ROOT", branchname);
1546 return Branch(branchname,addobj,varname.
Data(),bufsize);
1552 Error(
"Branch",
"Reference interface requires a valid object (for branch: %s)!", branchname);
1557 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",
1558 branchname, ptrClass->
GetName());
1559 actualClass = ptrClass;
1560 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1561 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());
1565 Error(
"Branch", writeStlWithoutProxyMsg,
1668 Error(
"Branch",
"Cannot call this constructor for a TClonesArray");
1671 Int_t nch = strlen(name);
1674 while ((obj = next())) {
1682 Branch(col, bufsize, splitlevel - 1, branchname);
1684 if (nch && (name[nch-1] ==
'_')) {
1693 if (splitlevel > 99) {
1719 char* curname =
new char[1000];
1721 while ((obj = next())) {
1722 snprintf(curname,1000,
"%s/%s", foldername, obj->GetName());
1724 Branch(curname, bufsize, splitlevel - 1);
1727 for (
Int_t i = 0; i < 1000; ++i) {
1728 if (curname[i] == 0) {
1731 if (curname[i] ==
'/') {
1738 strlcat(curname, occur,1000);
1842 return Bronch(
name, classname, addobj, bufsize, splitlevel);
1844 if (splitlevel < 0) {
1847 return BranchOld(
name, classname, addobj, bufsize, splitlevel);
1896 Error(
"BranchOld",
"Cannot find class: '%s'", classname);
1901 Fatal(
"BranchOld",
"The requested class ('%s') does not inherit from TObject.\n" 1902 "\tfgBranchStyle is set to zero requesting by default to use BranchOld.\n" 1903 "\tIf this is intentional use Bronch instead of Branch or BranchOld.", classname);
1905 Fatal(
"BranchOld",
"The requested class ('%s') does not inherit from TObject.\n" 1906 "\tYou can not use BranchOld to store objects of this type.",classname);
1917 const char* rdname = 0;
1918 const char* dname = 0;
1920 char** apointer = (
char**) addobj;
1932 if (
name[lenName-1] ==
'.') {
1971 if (!strcmp(dname,
"fBits")) {
1974 if (!strcmp(dname,
"fUniqueID")) {
1984 branchname = rdname;
1988 branchname.
Form(
"%s%s",
name, &rdname[1]);
1990 branchname.
Form(
"%s%s",
name, &rdname[0]);
1996 char* pointer = ((
char*) obj) + offset;
2005 char* cpointer = (
char*) pointer;
2006 char** ppointer = (
char**) cpointer;
2008 if (splitlevel != 2) {
2010 branch1 =
new TBranchClones(branch,branchname, pointer, bufsize);
2015 blist->
Add(branch1);
2023 blist->
Add(branch1);
2040 blist->
Add(branch1);
2054 aindex.Remove(rdot+1);
2055 aindex.Append(index);
2061 if (!strcmp(rdi->
GetName(), index)) {
2064 if (!strcmp(rdi->
GetName(), aindex)) {
2076 leaflist.
Form(
"%s[%s]/%c", &rdname[0], index, vcode);
2078 Error(
"BranchOld",
"Cannot create branch for rdname: %s code: %d", branchname.
Data(), code);
2085 leaflist.
Form(
"%s/%s", dname,
"C");
2098 branch1 =
new TBranch(branch, bname, *((
void**) pointer), leaflist, bufsize);
2102 blist->
Add(branch1);
2109 leaflist.
Form(
"%s/%c", rdname, vcode);
2111 Error(
"BranchOld",
"Cannot create branch for rdname: %s code: %d", branchname.
Data(), code);
2114 branch1 =
new TBranch(branch, branchname, pointer, leaflist, bufsize);
2116 blist->
Add(branch1);
2125 Warning(
"BranchOld",
"Cannot process member: '%s'", rdname);
2234 Error(
"Bronch",
"Cannot find class:%s", classname);
2245 objptr = (
char*)addr;
2247 objptr = *((
char**) addr);
2253 Error(
"Bronch",
"Pointer to TClonesArray is null");
2257 Error(
"Bronch",
"TClonesArray with no class defined in branch: %s",
name);
2261 Error(
"Bronch",
"TClonesArray with no dictionary defined in branch: %s",
name);
2265 if (splitlevel > 0) {
2266 if (hasCustomStreamer)
2267 Warning(
"Bronch",
"Using split mode on a class: %s with a custom Streamer", clones->
GetClass()->
GetName());
2282 if (!inklass && (collProxy->
GetType() == 0)) {
2283 Error(
"Bronch",
"%s with no class defined in branch: %s", classname,
name);
2288 if ((stl != ROOT::kSTLmap) && (stl != ROOT::kSTLmultimap)) {
2290 Error(
"Bronch",
"Container with no dictionary defined in branch: %s",
name);
2294 Warning(
"Bronch",
"Using split mode on a class: %s with a custom Streamer", inklass->
GetName());
2305 branch =
new TBranchSTL(
this,
name, collProxy, bufsize, splitlevel );
2310 branch->SetAddress(addr);
2312 branch->SetObject(addr);
2319 Error(
"Bronch",
"Cannot find dictionary for class: %s", classname);
2325 hasCustomStreamer =
kTRUE;
2328 if (splitlevel < 0 || ((splitlevel == 0) && hasCustomStreamer && cl->
IsTObject())) {
2359 objptr = (
char*) cl->
New();
2367 if ((splitlevel > 0) && !cl->
CanSplit()) {
2368 if (splitlevel != 99) {
2369 Warning(
"Bronch",
"%s cannot be split, resetting splitlevel to 0", cl->
GetName());
2383 Error(
"Bronch",
"Cannot build the StreamerInfo for class: %s", cl->
GetName());
2394 char* dot = (
char*) strchr(
name,
'.');
2397 if (nch && (
name[nch-1] ==
'.')) {
2406 if (splitlevel > 0) {
2432 char* pointer = (
char*) (objptr + element->GetOffset());
2439 TClass* clbase = element->GetClassPointer();
2456 bname.
Form(
"%s%s",
name, element->GetFullName());
2473 bname.
Form(
"%s.%s",
name, element->GetFullName());
2479 bname.
Form(
"%s", element->GetFullName());
2483 element->GetClass()->GetCollectionProxy() &&
2484 element->GetClass()->GetCollectionProxy()->HasPointers() )
2486 TBranchSTL* brSTL =
new TBranchSTL( branch, bname, element->GetClass()->GetCollectionProxy(), bufsize, splitlevel-1, sinfo, id );
2639 char* fname =
new char[2000];
2642 for (
Int_t i = 0; i < 10; ++i) {
2650 strlcpy(fname, file->
GetName(),2000);
2653 char* cunder = strrchr(fname,
'_');
2656 const char* cdot = strrchr(file->
GetName(),
'.');
2658 strlcat(fname, cdot,2000);
2663 strlcat(fname, fcount,2000);
2666 char* cdot = strrchr(fname,
'.');
2669 strlcat(fname, strrchr(file->
GetName(),
'.'),2000);
2673 strlcat(fname, fcount,2000);
2680 Warning(
"ChangeFile",
"file %s already exist, trying with %d underscores", fname, nus+1);
2685 Error(
"Fill",
"Failed to open new file %s, continuing as a memory tree.",fname);
2687 Printf(
"Fill: Switching to new file: %s", fname);
2710 while ((branch = (
TBranch*)nextb())) {
2719 if (newfile) newfile->
Append(obj);
2755 TClass* expectedClass = 0;
2761 if (expectedClass && datatype ==
kOther_t && ptrClass == 0) {
2767 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". " 2768 "The class expected (%s) refers to an stl collection and do not have a compiled CollectionProxy. " 2769 "Please generate the dictionary for this class (%s)",
2776 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". " 2777 "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." 2778 "Please generate the dictionary for this class (%s)",
2781 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". " 2782 "This is probably due to a missing dictionary, the original data class for this branch is %s.", branch->
GetName(), expectedClass->
GetName());
2786 if (expectedClass && ptrClass && (branch->
GetMother() == branch)) {
2789 Error(
"SetBranchAddress",
"The address for \"%s\" should be the address of a pointer!", branch->
GetName());
2809 if( expectedClass && ptrClass &&
2810 expectedClass != ptrClass &&
2818 Info(
"SetBranchAddress",
"Matching STL collection (at least according to the SchemaRuleSet when " 2819 "reading a %s into a %s",expectedClass->
GetName(),ptrClass->
GetName());
2826 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());
2837 }
else if (expectedClass && ptrClass && !expectedClass->
InheritsFrom(ptrClass)) {
2859 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());
2869 Error(
"SetBranchAddress",
"The pointer type given \"%s\" (%d) does not correspond to the type needed \"%s\" (%d) by the branch: %s",
2876 if (expectedClass) {
2877 Error(
"SetBranchAddress",
"The pointer type given \"%s\" (%d) does not correspond to the type needed \"%s\" by the branch: %s",
2891 if (rdm->GetThisOffset() == 0) {
2895 if (etype == expectedType) {
2906 if (dm->GetOffset() == 0) {
2910 if (etype == expectedType) {
2922 if (len <= ptrClass->
Size()) {
2926 Error(
"SetBranchAddress",
"The pointer type given \"%s\" does not correspond to the type needed \"%s\" (%d) by the branch: %s",
2932 Error(
"SetBranchAddress", writeStlWithoutProxyMsg,
3042 for (
Int_t i = 0; i < nb; ++i) {
3052 if (thistree !=
this) {
3077 for (
Int_t lndx = 0; lndx < nleaves; ++lndx) {
3083 if (branch && (newcomp > -1)) {
3091 for (
Long64_t i = 0; i < nb; ++i) {
3102 for (
Int_t j = 0; j < nb1; ++j) {
3116 for (
Int_t k = 0; k < nb2; ++k) {
3146 if ( newtree->
CopyEntries(
this, -1, option ) < 0 ) {
3148 Error(
"CloneTTree",
"TTree has not been cloned\n");
3171 for (
Int_t i = 0; i < nbranches; ++i) {
3207 Warning(
"CopyAddresses",
"Could not find branch named '%s' in tree named '%s'", branch->
GetName(), tree->
GetName());
3215 for (
Int_t i = 0; i < ntleaves; ++i) {
3216 TLeaf* tleaf = (
TLeaf*) tleaves->UncheckedAt(i);
3253 Warning(
"CopyAddresses",
"Could not find branch named '%s' in tree named '%s'", branch->
GetName(), tree->
GetName());
3280 switch (onIndexError) {
3304 switch (onIndexError) {
3328 }
else if ( onIndexError == kDrop ) {
3385 onIndexError = kKeep;
3386 }
else if (opt.
Contains(
"buildindex")) {
3387 onIndexError = kBuild;
3388 }
else if (opt.
Contains(
"dropindex")) {
3389 onIndexError = kDrop;
3391 onIndexError = kBuild;
3394 Int_t cacheSize = -1;
3397 Ssiz_t cacheSizeEnd = opt.
Index(
" ",cacheSizeLoc+10) - (cacheSizeLoc+10);
3398 TSubString cacheSizeStr( opt(cacheSizeLoc+10,cacheSizeEnd) );
3401 Warning(
"CopyEntries",
"The cachesize option can not be parsed: %s. The default size will be used.",cacheSizeStr.
String().
Data());
3404 const char *munit =
nullptr;
3407 Warning(
"CopyEntries",
"The cachesize option is too large: %s (%g%s max). The default size will be used.",cacheSizeStr.
String().
Data(),
m,munit);
3410 if (
gDebug > 0 && cacheSize != -1)
Info(
"CopyEntries",
"Using Cache size: %d\n",cacheSize);
3416 }
else if (
nentries > treeEntries) {
3420 if (fastClone && (nentries < 0 || nentries == tree->
GetEntriesFast())) {
3428 withIndex = R__HandleIndex( onIndexError,
this, tree );
3439 if (cloner.IsValid()) {
3441 if (cacheSize != -1) cloner.SetCacheSize(cacheSize);
3445 Warning(
"CopyEntries",
"%s",cloner.GetWarning());
3450 if (cloner.NeedConversion()) {
3453 for (
Long64_t ii = 0; ii < tentries; ii++) {
3454 if (localtree->
GetEntry(ii) <= 0) {
3463 Warning(
"CopyEntries",
"%s",cloner.GetWarning());
3481 }
else if (
nentries > treeEntries) {
3484 Int_t treenumber = -1;
3491 withIndex = R__HandleIndex( onIndexError,
this, tree );
3498 nbytes += this->
Fill();
3575 if (file && !strcmp(option,
"all")) {
3577 Error(
"Delete",
"File : %s is not writable, cannot delete Tree:%s", file->
GetName(),
GetName());
3594 Int_t nbytes,objlen,keylen;
3595 while ((leaf = (
TLeaf*)next())) {
3598 for (
Int_t i=0;i<nbaskets;i++) {
3602 if (!branchFile)
continue;
3604 if (nbytes <= 0)
continue;
3605 branchFile->
MakeFree(pos,pos+nbytes-1);
3619 if (dirsav) dirsav->
cd();
3620 if (
gDebug)
Info(
"TTree::Delete",
"Deleting Tree: %s: %d baskets deleted. Total space freed = %d bytes\n",
GetName(),nbask,ntot);
3654 while((b = (
TBranch*) next())) {
4305 for (
Int_t i = 0; i < nb; ++i) {
4319 for (
Int_t i = 0; i < nleaves; ++i) {
4323 for (
Int_t j = 0; j < nbaskets - 1; ++j) {
4406 for (
Int_t i = 0; i < nb; ++i) {
4415 Error(
"Fill",
"Failed filling branch:%s.%s, nbytes=%d, entry=%lld\n" 4416 " This error is symptomatic of a Tree created as a memory-resident Tree\n" 4417 " Instead of doing:\n" 4418 " TTree *T = new TTree(...)\n" 4419 " TFile *f = new TFile(...)\n" 4421 " TFile *f = new TFile(...)\n" 4422 " TTree *T = new TTree(...)",
4450 if (
gDebug > 0)
Info(
"TTree::Fill",
" - A: %d %lld %lld %lld %lld %lld %lld \n",
4459 if ((fAutoFlush<0 && zipBytes > -
fAutoFlush) ||
4460 (fAutoSave <0 && zipBytes > -
fAutoSave ) ||
4477 if (zipBytes != 0) {
4479 }
else if (totBytes != 0) {
4541 if (list==0 || branchname == 0 || branchname[0] ==
'\0')
return 0;
4545 UInt_t brlen = strlen(branchname);
4547 for(
Int_t index = 0; index < nbranches; ++index) {
4551 UInt_t len = strlen(name);
4552 if (len && name[len-1]==
']') {
4553 const char *dim = strchr(name,
'[');
4558 if (brlen == len && strncmp(branchname,name,len)==0) {
4562 if ((brlen >= len) && (branchname[len] ==
'.')
4563 && strncmp(name, branchname, len) == 0) {
4570 if (next)
return next;
4572 const char *dot = strchr((
char*)branchname,
'.');
4574 if (len==(
size_t)(dot-branchname) &&
4575 strncmp(branchname,name,dot-branchname)==0 ) {
4603 if (branch)
return branch;
4607 if (branch)
return branch;
4611 while ((branch = (
TBranch*) next())) {
4614 return nestedbranch;
4631 const char *subbranch = strstr(branchname, fe->
GetName());
4632 if (subbranch != branchname) {
4636 subbranch += strlen(fe->
GetName());
4637 if (*subbranch !=
'.') {
4643 std::ostringstream
name;
4645 name << t->
GetName() <<
"." << subbranch;
4670 char* subsearchname = (
char*) strstr(searchname,
GetName());
4671 if (subsearchname != searchname) {
4674 if (subsearchname) {
4675 subsearchname += strlen(
GetName());
4676 if (*subsearchname !=
'.') {
4680 if (subsearchname[0]==0) {
4694 while ((leaf = (
TLeaf*) next())) {
4697 if (dim >= 0) leafname.
Remove(dim);
4699 if (leafname == searchname) {
4702 if (subsearchname && leafname == subsearchname) {
4708 dim = leaftitle.
First(
'[');
4709 if (dim >= 0) leaftitle.
Remove(dim);
4711 if (leaftitle == searchname) {
4714 if (subsearchname && leaftitle == subsearchname) {
4720 dim = longname.
First(
'[');
4721 if (dim>=0) longname.
Remove(dim);
4722 if (longname == searchname) {
4725 if (subsearchname && longname == subsearchname) {
4729 dim = longtitle.
First(
'[');
4730 if (dim>=0) longtitle.
Remove(dim);
4731 if (longtitle == searchname) {
4734 if (subsearchname && longtitle == subsearchname) {
4742 if (strstr(searchname,
".") && !strcmp(searchname, branch->
GetName())) {
4745 if (subsearchname && strstr(subsearchname,
".") && !strcmp(subsearchname, branch->
GetName())) {
4763 subsearchname = (
char*) strstr(searchname, fe->
GetName());
4764 if (subsearchname != searchname) {
4767 if (subsearchname) {
4768 subsearchname += strlen(fe->
GetName());
4769 if (*subsearchname !=
'.') {
4775 if (subsearchname) {
4776 leafname.
Form(
"%s.%s",t->
GetName(),subsearchname);
4778 leafname = searchname;
4820 return fPlayer->
Fit(funcname, varexp, selection, option, goption, nentries, firstentry);
4826 struct BoolRAIIToggle {
4829 BoolRAIIToggle(
Bool_t &val) : m_val(val) { m_val =
true; }
4830 ~BoolRAIIToggle() { m_val =
false; }
4878 std::atomic<Int_t> nerrpar(0);
4879 std::atomic<Int_t> nbpar(0);
4880 std::atomic<Int_t> pos(0);
4882 auto mapFunction = [&]() {
4888 Int_t j = pos.fetch_add(1);
4894 std::stringstream ss;
4895 ss << std::this_thread::get_id();
4896 Info(
"FlushBaskets",
"[IMT] Thread %s", ss.str().c_str());
4897 Info(
"FlushBaskets",
"[IMT] Running task for branch #%d: %s", j, branch->
GetName());
4902 if (nbtask < 0) { nerrpar++; }
4903 else { nbpar += nbtask; }
4907 pool.
Foreach(mapFunction, nb);
4913 return nerrpar ? -1 : nbpar.load();
4916 for (
Int_t j = 0; j < nb; j++) {
4959 const char* alias = t->
GetAlias(aliasName);
4963 const char* subAliasName = strstr(aliasName, fe->
GetName());
4964 if (subAliasName && (subAliasName[strlen(fe->
GetName())] ==
'.')) {
4980 if (name == 0)
return 0;
4990 for (
Int_t i = 0; i < nb; i++) {
4997 for (
Int_t j = 0; j < nb1; j++) {
5004 for (
Int_t k = 0; k < nb2; k++) {
5016 for (
Int_t i = 0; i < nleaves; i++) {
5050 char* subname = (
char*) strstr(name, fe->
GetName());
5051 if (subname != name) {
5056 if (*subname !=
'.') {
5105 if (!(stcs =
gSystem->
Getenv(
"ROOT_TTREECACHE_SIZE")) || !*stcs) {
5111 if (cacheFactor < 0.0) {
5119 else if (fAutoFlush == 0) cacheSize = 0;
5122 if (cacheSize >= (INT_MAX / 4)) {
5123 cacheSize = INT_MAX / 4;
5126 if (cacheSize < 0) {
5130 if (cacheSize == 0 && withDefault) {
5132 else if (fAutoFlush == 0) cacheSize = 0;
5327 if (entry < 0 || entry >=
fEntries)
return 0;
5338 auto seqprocessing = [&]() {
5340 for (i=0;i<nbranches;i++) {
5342 nb = branch->
GetEntry(entry, getall);
5354 nb = branch->
GetEntry(entry, getall);
5358 if (nb < 0)
return nb;
5364 std::atomic<Int_t> pos(0);
5365 std::atomic<Int_t> nbpar(0);
5367 auto mapFunction = [&]() {
5373 Int_t j = pos.fetch_add(1);
5379 std::stringstream ss;
5380 ss << std::this_thread::get_id();
5381 Info(
"GetEntry",
"[IMT] Thread %s", ss.str().c_str());
5382 Info(
"GetEntry",
"[IMT] Running task for branch #%d: %s", j, branch->
GetName());
5385 std::chrono::time_point<std::chrono::system_clock> start, end;
5387 start = std::chrono::system_clock::now();
5388 nbtask = branch->
GetEntry(entry, getall);
5389 end = std::chrono::system_clock::now();
5391 Long64_t tasktime = (
Long64_t)std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
5394 if (nbtask < 0) errnb = nbtask;
5395 else nbpar += nbtask;
5421 if (nb < 0)
return nb;
5438 if (nb < 0)
return nb;
5464 if (checkLeafCount) {
5465 for (
Int_t i = 0; i < nbranches; i++) {
5469 auto countBranch = leafCount->GetBranch();
5483 for (
Int_t i = 0; i < nbranches; i++) {
5495 [](std::pair<Long64_t,TBranch*>
a, std::pair<Long64_t,TBranch*>
b) {
5496 return a.first > b.first;
5515 [](std::pair<Long64_t,TBranch*>
a, std::pair<Long64_t,TBranch*>
b) {
5516 return a.first > b.first;
5620 for (i = 0; i < nbranches; ++i) {
5623 if (nb < 0)
return nb;
5635 if (serial <0)
return -nbytes;
5637 if (nb < 0)
return nb;
5662 if (strcmp(friendname,fe->
GetName())==0
5706 if ((tree ==
this) || (tree ==
GetTree())) {