407 #include "tbb/task.h" 408 #include "tbb/task_group.h" 445 case kchar:
return 0;
450 case kBits:
return 0;
472 fMethodBit = methodbit;
474 fPrevious = fTree->fFriendLockStatus & fMethodBit;
475 fTree->fFriendLockStatus |= fMethodBit;
528 fStartEntry = firstEntry;
539 if (fClusterRange == 0) {
541 entryInRange = firstEntry;
544 entryInRange = firstEntry - pedestal;
552 if (autoflush == 0) {
553 autoflush = GetEstimatedClusterSize();
555 fStartEntry = pedestal + entryInRange - entryInRange%autoflush;
559 fNextEntry = fStartEntry;
575 if (cacheSize == 0) {
587 if (clusterEstimate == 0)
590 return clusterEstimate;
600 fStartEntry = fNextEntry;
603 Long64_t clusterEstimate = GetEstimatedClusterSize();
604 fNextEntry = fStartEntry + clusterEstimate;
620 if (clusterSize == 0) {
621 clusterSize = GetEstimatedClusterSize();
623 fNextEntry += clusterSize;
818 if (strlen(title) > 2) {
819 if (title[0] ==
'/') {
820 Branch(title+1,32000,splitlevel);
943 Error(
"AddBranchToCache",
"Could not load a tree");
952 Error(
"AddBranchToCache",
"No tree is available. Branch was not added to the cache");
958 Error(
"AddBranchToCache",
"No file is available. Branch was not added to the cache");
963 Error(
"AddBranchToCache",
"No cache is available, branch not added");
982 Error(
"AddBranchToCache",
"Could not load a tree");
990 Error(
"AddBranchToCache",
"Error adding branch");
995 Error(
"AddBranchToCache",
"No tree is available. Branch was not added to the cache");
1001 Error(
"AddBranchToCache",
"No file is available. Branch was not added to the cache");
1006 Error(
"AddBranchToCache",
"No cache is available, branch not added");
1026 Error(
"DropBranchFromCache",
"Could not load a tree");
1035 Error(
"DropBranchFromCache",
"No tree is available. Branch was not dropped from the cache");
1041 Error(
"DropBranchFromCache",
"No file is available. Branch was not dropped from the cache");
1046 Error(
"DropBranchFromCache",
"No cache is available, branch not dropped");
1065 Error(
"DropBranchFromCache",
"Could not load a tree");
1073 Error(
"DropBranchFromCache",
"Error dropping branch");
1078 Error(
"DropBranchFromCache",
"No tree is available. Branch was not dropped from the cache");
1084 Error(
"DropBranchFromCache",
"No file is available. Branch was not dropped from the cache");
1089 Error(
"DropBranchFromCache",
"No cache is available, branch not dropped");
1195 Warning(
"AddFriend",
"FriendElement %s in file %s has less entries %lld than its parent Tree: %lld", treename, filename, t->
GetEntries(),
fEntries);
1198 Warning(
"AddFriend",
"Cannot add FriendElement %s in file %s", treename, filename);
1223 Warning(
"AddFriend",
"FriendElement %s in file %s has less entries %lld than its parent tree: %lld", treename, file->
GetName(), t->
GetEntries(),
fEntries);
1226 Warning(
"AddFriend",
"unknown tree '%s' in file '%s'", treename, file->
GetName());
1250 Warning(
"AddFriend",
"FriendElement '%s' in file '%s' has less entries %lld than its parent tree: %lld",
1345 if (opt.
Contains(
"flushbaskets")) {
1346 if (
gDebug > 0) printf(
"AutoSave: calling FlushBaskets \n");
1358 if (nbytes && key) {
1379 const char* writeStlWithoutProxyMsg =
"The class requested (%s) for the branch \"%s\"" 1380 " is an instance of an stl collection and does not have a compiled CollectionProxy." 1381 " Please generate the dictionary for this collection (%s) to avoid to write corrupted data.";
1395 Error(
"Branch", writeStlWithoutProxyMsg,
1399 return Branch(branchname, classname, (
void*) addobj, bufsize, splitlevel);
1402 void** addr = (
void**) addobj;
1406 if (ptrClass && claim) {
1413 Error(
"Branch",
"The class requested (%s) for \"%s\" is different from the type of the pointer passed (%s)",
1416 }
else if (actualClass && (claim != actualClass) && !actualClass->
InheritsFrom(claim)) {
1421 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s",
1427 Error(
"Branch", writeStlWithoutProxyMsg,
1431 return Branch(branchname, classname, (
void*) addobj, bufsize, splitlevel);
1441 Error(
"Branch",
"The pointer specified for %s is not of a class known to ROOT", branchname);
1445 void** addr = (
void**) addobj;
1446 if (addr && *addr) {
1449 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",
1450 branchname, ptrClass->
GetName());
1451 actualClass = ptrClass;
1452 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1453 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());
1457 actualClass = ptrClass;
1460 Error(
"Branch", writeStlWithoutProxyMsg,
1464 return Branch(branchname, actualClass->
GetName(), (
void*) addobj, bufsize, splitlevel);
1476 Error(
"Branch", writeStlWithoutProxyMsg,
1479 }
else if (claim == 0) {
1480 Error(
"Branch",
"The pointer specified for %s is not of a class known to ROOT and %s is not a known class", branchname, classname);
1487 Error(
"Branch",
"Reference interface requires a valid object (for branch: %s)!", branchname);
1491 if (ptrClass && claim) {
1498 Error(
"Branch",
"The class requested (%s) for \"%s\" is different from the type of the object passed (%s)",
1501 }
else if (actualClass && (claim != actualClass) && !actualClass->
InheritsFrom(claim)) {
1506 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s",
1512 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",
1513 branchname, ptrClass->
GetName());
1514 actualClass = ptrClass;
1515 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1516 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());
1520 Error(
"Branch", writeStlWithoutProxyMsg,
1535 Error(
"Branch",
"The pointer specified for %s is not of a class or type known to ROOT", branchname);
1538 return Branch(branchname,addobj,varname.
Data(),bufsize);
1544 Error(
"Branch",
"Reference interface requires a valid object (for branch: %s)!", branchname);
1549 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",
1550 branchname, ptrClass->
GetName());
1551 actualClass = ptrClass;
1552 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1553 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());
1557 Error(
"Branch", writeStlWithoutProxyMsg,
1660 Error(
"Branch",
"Cannot call this constructor for a TClonesArray");
1663 Int_t nch = strlen(name);
1666 while ((obj = next())) {
1674 Branch(col, bufsize, splitlevel - 1, branchname);
1676 if (nch && (name[nch-1] ==
'_')) {
1685 if (splitlevel > 99) {
1711 char* curname =
new char[1000];
1713 while ((obj = next())) {
1714 snprintf(curname,1000,
"%s/%s", foldername, obj->GetName());
1716 Branch(curname, bufsize, splitlevel - 1);
1719 for (
Int_t i = 0; i < 1000; ++i) {
1720 if (curname[i] == 0) {
1723 if (curname[i] ==
'/') {
1730 strlcat(curname, occur,1000);
1834 return Bronch(
name, classname, addobj, bufsize, splitlevel);
1836 if (splitlevel < 0) {
1839 return BranchOld(
name, classname, addobj, bufsize, splitlevel);
1888 Error(
"BranchOld",
"Cannot find class: '%s'", classname);
1893 Fatal(
"BranchOld",
"The requested class ('%s') does not inherit from TObject.\n" 1894 "\tfgBranchStyle is set to zero requesting by default to use BranchOld.\n" 1895 "\tIf this is intentional use Bronch instead of Branch or BranchOld.", classname);
1897 Fatal(
"BranchOld",
"The requested class ('%s') does not inherit from TObject.\n" 1898 "\tYou can not use BranchOld to store objects of this type.",classname);
1909 const char* rdname = 0;
1910 const char* dname = 0;
1912 char** apointer = (
char**) addobj;
1924 if (
name[lenName-1] ==
'.') {
1963 if (!strcmp(dname,
"fBits")) {
1966 if (!strcmp(dname,
"fUniqueID")) {
1976 branchname = rdname;
1980 branchname.
Form(
"%s%s",
name, &rdname[1]);
1982 branchname.
Form(
"%s%s",
name, &rdname[0]);
1988 char* pointer = ((
char*) obj) + offset;
1997 char* cpointer = (
char*) pointer;
1998 char** ppointer = (
char**) cpointer;
2000 if (splitlevel != 2) {
2002 branch1 =
new TBranchClones(branch,branchname, pointer, bufsize);
2007 blist->
Add(branch1);
2015 blist->
Add(branch1);
2032 blist->
Add(branch1);
2046 aindex.Remove(rdot+1);
2047 aindex.Append(index);
2053 if (!strcmp(rdi->
GetName(), index)) {
2056 if (!strcmp(rdi->
GetName(), aindex)) {
2068 leaflist.
Form(
"%s[%s]/%c", &rdname[0], index, vcode);
2070 Error(
"BranchOld",
"Cannot create branch for rdname: %s code: %d", branchname.
Data(), code);
2077 leaflist.
Form(
"%s/%s", dname,
"C");
2090 branch1 =
new TBranch(branch, bname, *((
void**) pointer), leaflist, bufsize);
2094 blist->
Add(branch1);
2101 leaflist.
Form(
"%s/%c", rdname, vcode);
2103 Error(
"BranchOld",
"Cannot create branch for rdname: %s code: %d", branchname.
Data(), code);
2106 branch1 =
new TBranch(branch, branchname, pointer, leaflist, bufsize);
2108 blist->
Add(branch1);
2117 Warning(
"BranchOld",
"Cannot process member: '%s'", rdname);
2226 Error(
"Bronch",
"Cannot find class:%s", classname);
2237 objptr = (
char*)addr;
2239 objptr = *((
char**) addr);
2245 Error(
"Bronch",
"Pointer to TClonesArray is null");
2249 Error(
"Bronch",
"TClonesArray with no class defined in branch: %s",
name);
2253 Error(
"Bronch",
"TClonesArray with no dictionary defined in branch: %s",
name);
2257 if (splitlevel > 0) {
2258 if (hasCustomStreamer)
2259 Warning(
"Bronch",
"Using split mode on a class: %s with a custom Streamer", clones->
GetClass()->
GetName());
2274 if (!inklass && (collProxy->
GetType() == 0)) {
2275 Error(
"Bronch",
"%s with no class defined in branch: %s", classname,
name);
2282 Error(
"Bronch",
"Container with no dictionary defined in branch: %s",
name);
2286 Warning(
"Bronch",
"Using split mode on a class: %s with a custom Streamer", inklass->
GetName());
2297 branch =
new TBranchSTL(
this,
name, collProxy, bufsize, splitlevel );
2302 branch->SetAddress(addr);
2304 branch->SetObject(addr);
2311 Error(
"Bronch",
"Cannot find dictionary for class: %s", classname);
2317 hasCustomStreamer =
kTRUE;
2320 if (splitlevel < 0 || ((splitlevel == 0) && hasCustomStreamer && cl->
IsTObject())) {
2351 objptr = (
char*) cl->
New();
2359 if ((splitlevel > 0) && !cl->
CanSplit()) {
2360 if (splitlevel != 99) {
2361 Warning(
"Bronch",
"%s cannot be split, resetting splitlevel to 0", cl->
GetName());
2375 Error(
"Bronch",
"Cannot build the StreamerInfo for class: %s", cl->
GetName());
2386 char* dot = (
char*) strchr(
name,
'.');
2389 if (nch && (
name[nch-1] ==
'.')) {
2398 if (splitlevel > 0) {
2424 char* pointer = (
char*) (objptr + element->GetOffset());
2431 TClass* clbase = element->GetClassPointer();
2448 bname.
Form(
"%s%s",
name, element->GetFullName());
2465 bname.
Form(
"%s.%s",
name, element->GetFullName());
2471 bname.
Form(
"%s", element->GetFullName());
2475 element->GetClass()->GetCollectionProxy() &&
2476 element->GetClass()->GetCollectionProxy()->HasPointers() )
2478 TBranchSTL* brSTL =
new TBranchSTL( branch, bname, element->GetClass()->GetCollectionProxy(), bufsize, splitlevel-1, sinfo,
id );
2631 char* fname =
new char[2000];
2634 for (
Int_t i = 0; i < 10; ++i) {
2642 strlcpy(fname, file->
GetName(),2000);
2645 char* cunder = strrchr(fname,
'_');
2648 const char* cdot = strrchr(file->
GetName(),
'.');
2650 strlcat(fname, cdot,2000);
2655 strlcat(fname, fcount,2000);
2658 char* cdot = strrchr(fname,
'.');
2661 strlcat(fname, strrchr(file->
GetName(),
'.'),2000);
2665 strlcat(fname, fcount,2000);
2672 Warning(
"ChangeFile",
"file %s already exist, trying with %d underscores", fname, nus+1);
2677 Error(
"Fill",
"Failed to open new file %s, continuing as a memory tree.",fname);
2679 Printf(
"Fill: Switching to new file: %s", fname);
2702 while ((branch = (
TBranch*)nextb())) {
2711 if (newfile) newfile->
Append(obj);
2747 TClass* expectedClass = 0;
2753 if (expectedClass && datatype ==
kOther_t && ptrClass == 0) {
2759 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". " 2760 "The class expected (%s) refers to an stl collection and do not have a compiled CollectionProxy. " 2761 "Please generate the dictionary for this class (%s)",
2768 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". " 2769 "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." 2770 "Please generate the dictionary for this class (%s)",
2773 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". " 2774 "This is probably due to a missing dictionary, the original data class for this branch is %s.", branch->
GetName(), expectedClass->
GetName());
2778 if (expectedClass && ptrClass && (branch->
GetMother() == branch)) {
2781 Error(
"SetBranchAddress",
"The address for \"%s\" should be the address of a pointer!", branch->
GetName());
2801 if( expectedClass && ptrClass &&
2802 expectedClass != ptrClass &&
2810 Info(
"SetBranchAddress",
"Matching STL collection (at least according to the SchemaRuleSet when " 2811 "reading a %s into a %s",expectedClass->
GetName(),ptrClass->
GetName());
2818 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());
2829 }
else if (expectedClass && ptrClass && !expectedClass->
InheritsFrom(ptrClass)) {
2851 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());
2861 Error(
"SetBranchAddress",
"The pointer type given \"%s\" (%d) does not correspond to the type needed \"%s\" (%d) by the branch: %s",
2868 if (expectedClass) {
2869 Error(
"SetBranchAddress",
"The pointer type given \"%s\" (%d) does not correspond to the type needed \"%s\" by the branch: %s",
2883 if (rdm->GetThisOffset() == 0) {
2887 if (etype == expectedType) {
2898 if (dm->GetOffset() == 0) {
2902 if (etype == expectedType) {
2914 if (len <= ptrClass->
Size()) {
2918 Error(
"SetBranchAddress",
"The pointer type given \"%s\" does not correspond to the type needed \"%s\" (%d) by the branch: %s",
2924 Error(
"SetBranchAddress", writeStlWithoutProxyMsg,
3034 for (
Int_t i = 0; i < nb; ++i) {
3044 if (thistree !=
this) {
3069 for (
Int_t lndx = 0; lndx < nleaves; ++lndx) {
3075 if (branch && (newcomp > -1)) {
3083 for (
Long64_t i = 0; i < nb; ++i) {
3094 for (
Int_t j = 0; j < nb1; ++j) {
3108 for (
Int_t k = 0; k < nb2; ++k) {
3138 if ( newtree->
CopyEntries(
this, -1, option ) < 0 ) {
3140 Error(
"CloneTTree",
"TTree has not been cloned\n");
3163 for (
Int_t i = 0; i < nbranches; ++i) {
3199 Warning(
"CopyAddresses",
"Could not find branch named '%s' in tree named '%s'", branch->
GetName(), tree->
GetName());
3207 for (
Int_t i = 0; i < ntleaves; ++i) {
3208 TLeaf* tleaf = (
TLeaf*) tleaves->UncheckedAt(i);
3245 Warning(
"CopyAddresses",
"Could not find branch named '%s' in tree named '%s'", branch->
GetName(), tree->
GetName());
3272 switch (onIndexError) {
3296 switch (onIndexError) {
3320 }
else if ( onIndexError == kDrop ) {
3377 onIndexError = kKeep;
3378 }
else if (opt.
Contains(
"buildindex")) {
3379 onIndexError = kBuild;
3380 }
else if (opt.
Contains(
"dropindex")) {
3381 onIndexError = kDrop;
3383 onIndexError = kBuild;
3386 Int_t cacheSize = -1;
3389 Ssiz_t cacheSizeEnd = opt.
Index(
" ",cacheSizeLoc+10) - (cacheSizeLoc+10);
3390 TSubString cacheSizeStr( opt(cacheSizeLoc+10,cacheSizeEnd) );
3393 Warning(
"CopyEntries",
"The cachesize option can not be parsed: %s. The default size will be used.",cacheSizeStr.
String().
Data());
3396 const char *munit =
nullptr;
3399 Warning(
"CopyEntries",
"The cachesize option is too large: %s (%g%s max). The default size will be used.",cacheSizeStr.
String().
Data(),
m,munit);
3402 if (
gDebug > 0 && cacheSize != -1)
Info(
"CopyEntries",
"Using Cache size: %d\n",cacheSize);
3408 }
else if (
nentries > treeEntries) {
3412 if (fastClone && (nentries < 0 || nentries == tree->
GetEntriesFast())) {
3420 withIndex = R__HandleIndex( onIndexError,
this, tree );
3431 if (cloner.IsValid()) {
3433 if (cacheSize != -1) cloner.SetCacheSize(cacheSize);
3437 Warning(
"CopyEntries",
"%s",cloner.GetWarning());
3442 if (cloner.NeedConversion()) {
3445 for (
Long64_t ii = 0; ii < tentries; ii++) {
3446 if (localtree->
GetEntry(ii) <= 0) {
3455 Warning(
"CopyEntries",
"%s",cloner.GetWarning());
3473 }
else if (
nentries > treeEntries) {
3476 Int_t treenumber = -1;
3483 withIndex = R__HandleIndex( onIndexError,
this, tree );
3490 nbytes += this->
Fill();
3567 if (file && !strcmp(option,
"all")) {
3569 Error(
"Delete",
"File : %s is not writable, cannot delete Tree:%s", file->
GetName(),
GetName());
3586 Int_t nbytes,objlen,keylen;
3587 while ((leaf = (
TLeaf*)next())) {
3590 for (
Int_t i=0;i<nbaskets;i++) {
3594 if (!branchFile)
continue;
3596 if (nbytes <= 0)
continue;
3597 branchFile->
MakeFree(pos,pos+nbytes-1);
3611 if (dirsav) dirsav->
cd();
3612 if (
gDebug) printf(
" Deleting Tree: %s: %d baskets deleted. Total space freed = %d bytes\n",
GetName(),nbask,ntot);
3646 while((b = (
TBranch*) next())) {
4297 for (
Int_t i = 0; i < nb; ++i) {
4311 for (
Int_t i = 0; i < nleaves; ++i) {
4315 for (
Int_t j = 0; j < nbaskets - 1; ++j) {
4388 for (
Int_t i = 0; i < nb; ++i) {
4397 Error(
"Fill",
"Failed filling branch:%s.%s, nbytes=%d, entry=%lld\n" 4398 " This error is symptomatic of a Tree created as a memory-resident Tree\n" 4399 " Instead of doing:\n" 4400 " TTree *T = new TTree(...)\n" 4401 " TFile *f = new TFile(...)\n" 4403 " TFile *f = new TFile(...)\n" 4404 " TTree *T = new TTree(...)",
4421 if (
gDebug > 0) printf(
"TTree::Fill - A: %d %lld %lld %lld %lld %lld %lld \n",
4429 if ((fAutoFlush<0 && fZipBytes > -
fAutoFlush) ||
4430 (fAutoSave <0 && fZipBytes > -
fAutoSave ) ||
4510 if (list==0 || branchname == 0 || branchname[0] ==
'\0')
return 0;
4514 UInt_t brlen = strlen(branchname);
4516 for(
Int_t index = 0; index < nbranches; ++index) {
4520 UInt_t len = strlen(name);
4521 if (len && name[len-1]==
']') {
4522 const char *dim = strchr(name,
'[');
4527 if (brlen == len && strncmp(branchname,name,len)==0) {
4531 if ((brlen >= len) && (branchname[len] ==
'.')
4532 && strncmp(name, branchname, len) == 0) {
4539 if (next)
return next;
4541 const char *dot = strchr((
char*)branchname,
'.');
4543 if (len==(
size_t)(dot-branchname) &&
4544 strncmp(branchname,name,dot-branchname)==0 ) {
4572 if (branch)
return branch;
4576 if (branch)
return branch;
4580 while ((branch = (
TBranch*) next())) {
4583 return nestedbranch;
4600 const char *subbranch = strstr(branchname, fe->
GetName());
4601 if (subbranch != branchname) {
4605 subbranch += strlen(fe->
GetName());
4606 if (*subbranch !=
'.') {
4612 std::ostringstream
name;
4614 name << t->
GetName() <<
"." << subbranch;
4639 char* subsearchname = (
char*) strstr(searchname,
GetName());
4640 if (subsearchname != searchname) {
4643 if (subsearchname) {
4644 subsearchname += strlen(
GetName());
4645 if (*subsearchname !=
'.') {
4649 if (subsearchname[0]==0) {
4663 while ((leaf = (
TLeaf*) next())) {
4666 if (dim >= 0) leafname.
Remove(dim);
4668 if (leafname == searchname) {
4671 if (subsearchname && leafname == subsearchname) {
4677 dim = leaftitle.
First(
'[');
4678 if (dim >= 0) leaftitle.
Remove(dim);
4680 if (leaftitle == searchname) {
4683 if (subsearchname && leaftitle == subsearchname) {
4689 dim = longname.
First(
'[');
4690 if (dim>=0) longname.
Remove(dim);
4691 if (longname == searchname) {
4694 if (subsearchname && longname == subsearchname) {
4698 dim = longtitle.
First(
'[');
4699 if (dim>=0) longtitle.
Remove(dim);
4700 if (longtitle == searchname) {
4703 if (subsearchname && longtitle == subsearchname) {
4711 if (strstr(searchname,
".") && !strcmp(searchname, branch->
GetName())) {
4714 if (subsearchname && strstr(subsearchname,
".") && !strcmp(subsearchname, branch->
GetName())) {
4732 subsearchname = (
char*) strstr(searchname, fe->
GetName());
4733 if (subsearchname != searchname) {
4736 if (subsearchname) {
4737 subsearchname += strlen(fe->
GetName());
4738 if (*subsearchname !=
'.') {
4744 if (subsearchname) {
4745 leafname.
Form(
"%s.%s",t->
GetName(),subsearchname);
4747 leafname = searchname;
4789 return fPlayer->
Fit(funcname, varexp, selection, option, goption, nentries, firstentry);
4806 for (
Int_t j = 0; j < nb; j++) {
4849 const char* alias = t->
GetAlias(aliasName);
4853 const char* subAliasName = strstr(aliasName, fe->
GetName());
4854 if (subAliasName && (subAliasName[strlen(fe->
GetName())] ==
'.')) {
4870 if (name == 0)
return 0;
4880 for (
Int_t i = 0; i < nb; i++) {
4887 for (
Int_t j = 0; j < nb1; j++) {
4894 for (
Int_t k = 0; k < nb2; k++) {
4906 for (
Int_t i = 0; i < nleaves; i++) {
4940 char* subname = (
char*) strstr(name, fe->
GetName());
4941 if (subname != name) {
4946 if (*subname !=
'.') {
4995 if (!(stcs =
gSystem->
Getenv(
"ROOT_TTREECACHE_SIZE")) || !*stcs) {
5001 if (cacheFactor < 0.0) {
5009 else if (fAutoFlush == 0) cacheSize = 0;
5012 if (cacheSize >= (INT_MAX / 4)) {
5013 cacheSize = INT_MAX / 4;
5016 if (cacheSize < 0) {
5020 if (cacheSize == 0 && withDefault) {
5022 else if (fAutoFlush == 0) cacheSize = 0;
5217 if (entry < 0 || entry >=
fEntries)
return 0;
5228 auto seqprocessing = [&]() {
5230 for (i=0;i<nbranches;i++) {
5232 nb = branch->
GetEntry(entry, getall);
5244 nb = branch->
GetEntry(entry, getall);
5248 if (nb < 0)
return nb;
5254 std::atomic<Int_t> pos(0);
5255 std::atomic<Int_t> nbpar(0);
5265 Int_t j = pos.fetch_add(1);
5271 std::stringstream ss;
5272 ss << std::this_thread::get_id();
5273 Info(
"GetEntry",
"[IMT] Thread %s", ss.str().c_str());
5274 Info(
"GetEntry",
"[IMT] Running task for branch #%d: %s", j, branch->
GetName());
5277 std::chrono::time_point<std::chrono::system_clock> start, end;
5279 start = std::chrono::system_clock::now();
5280 nbtask = branch->
GetEntry(entry, getall);
5281 end = std::chrono::system_clock::now();
5283 Long64_t tasktime = (
Long64_t)std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
5286 if (nbtask < 0) errnb = nbtask;
5287 else nbpar += nbtask;
5312 if (nb < 0)
return nb;
5329 if (nb < 0)
return nb;
5355 if (checkLeafCount) {
5356 for (
Int_t i = 0; i < nbranches; i++) {
5360 auto countBranch = leafCount->GetBranch();
5374 for (
Int_t i = 0; i < nbranches; i++) {
5386 [](std::pair<Long64_t,TBranch*>
a, std::pair<Long64_t,TBranch*>
b) {
5387 return a.first > b.first;
5406 [](std::pair<Long64_t,TBranch*>
a, std::pair<Long64_t,TBranch*>
b) {
5407 return a.first > b.first;
5511 for (i = 0; i < nbranches; ++i) {
5514 if (nb < 0)
return nb;
5526 if (serial <0)
return -nbytes;
5528 if (nb < 0)
return nb;
5553 if (strcmp(friendname,fe->
GetName())==0
5597 if ((tree ==
this) || (tree ==
GetTree())) {
5660 leaf = branch->
GetLeaf(leafname);
5667 while ((leaf = (
TLeaf*)nextl())) {
5668 if (strcmp(leaf->
GetName(),leafname))
continue;
5670 UInt_t nbch = strlen(branchname);
5672 const char* brname = br->
GetName();
5674 if (strncmp(brname,branchname,nbch)) {
5676 const char *mothername = mother->
GetName();
5677 UInt_t motherlen = strlen(mothername);
5678 if (nbch > motherlen && strncmp(mothername,branchname,motherlen)==0 && (mothername[motherlen-1]==
'.' || branchname[motherlen]==
'.')) {
5680 if (strncmp(brname,branchname+motherlen+1,nbch-motherlen-1)) {
5696 if ((strlen(brname) > nbch) && (brname[nbch] !=
'.') && (brname[nbch] !=
'[')) {
5710 if (leaf)
return leaf;
5721 char *subname = (
char*)strstr(leafname,fe->
GetName());
5722 if (subname != leafname)
continue;
5725 if (*subname !=
'.')
continue;
5727 strippedArg += subname;