401 static
char DataTypeToChar(
EDataType datatype)
420 case kchar:
return 0;
425 case kBits:
return 0;
447 fMethodBit = methodbit;
449 fPrevious = fTree->fFriendLockStatus & fMethodBit;
450 fTree->fFriendLockStatus |= fMethodBit;
461 fMethodBit(tfl.fMethodBit),
462 fPrevious(tfl.fPrevious)
486 fTree->fFriendLockStatus &= ~(fMethodBit &
kBitMask);
501 if ( fTree->GetAutoFlush() <= 0 ) {
503 fStartEntry = firstEntry;
504 }
else if (fTree->fNClusterRange) {
510 fClusterRange =
TMath::BinarySearch(fTree->fNClusterRange, fTree->fClusterRangeEnd, firstEntry - 1) + 1;
514 if (fClusterRange == 0) {
516 entryInRange = firstEntry;
518 pedestal = fTree->fClusterRangeEnd[fClusterRange-1] + 1;
519 entryInRange = firstEntry - pedestal;
522 if (fClusterRange == fTree->fNClusterRange) {
523 autoflush = fTree->fAutoFlush;
525 autoflush = fTree->fClusterSize[fClusterRange];
527 if (autoflush == 0) {
528 autoflush = GetEstimatedClusterSize();
530 fStartEntry = pedestal + entryInRange - entryInRange%autoflush;
532 fStartEntry = firstEntry - firstEntry%fTree->GetAutoFlush();
534 fNextEntry = fStartEntry;
544 Long64_t zipBytes = fTree->GetZipBytes();
546 return fTree->GetEntries() - 1;
549 Long64_t cacheSize = fTree->GetCacheSize();
550 if (cacheSize == 0) {
552 TFile *file = fTree->GetCurrentFile();
561 clusterEstimate = fTree->GetEntries() * cacheSize / zipBytes;
562 if (clusterEstimate == 0)
565 return clusterEstimate;
575 fStartEntry = fNextEntry;
576 if ( fTree->GetAutoFlush() <= 0 ) {
578 Long64_t clusterEstimate = GetEstimatedClusterSize();
579 fNextEntry = fStartEntry + clusterEstimate;
581 if (fClusterRange == fTree->fNClusterRange) {
584 fNextEntry += fTree->GetAutoFlush();
586 if (fStartEntry > fTree->fClusterRangeEnd[fClusterRange]) {
589 if (fClusterRange == fTree->fNClusterRange) {
592 fNextEntry += fTree->GetAutoFlush();
594 Long64_t clusterSize = fTree->fClusterSize[fClusterRange];
595 if (clusterSize == 0) {
596 clusterSize = GetEstimatedClusterSize();
598 fNextEntry += clusterSize;
599 if (fNextEntry > fTree->fClusterRangeEnd[fClusterRange]) {
603 fNextEntry = fTree->fClusterRangeEnd[fClusterRange] + 1;
608 if (fNextEntry > fTree->GetEntries()) {
609 fNextEntry = fTree->GetEntries();
789 if (strlen(title) > 2) {
790 if (title[0] ==
'/') {
791 Branch(title+1,32000,splitlevel);
914 Error(
"AddBranchToCache",
"Could not load a tree");
923 Error(
"AddBranchToCache",
"No tree is available. Branch was not added to the cache");
929 Error(
"AddBranchToCache",
"No file is available. Branch was not added to the cache");
934 Error(
"AddBranchToCache",
"No cache is available, branch not added");
953 Error(
"AddBranchToCache",
"Could not load a tree");
961 Error(
"AddBranchToCache",
"Error adding branch");
966 Error(
"AddBranchToCache",
"No tree is available. Branch was not added to the cache");
972 Error(
"AddBranchToCache",
"No file is available. Branch was not added to the cache");
977 Error(
"AddBranchToCache",
"No cache is available, branch not added");
997 Error(
"DropBranchFromCache",
"Could not load a tree");
1006 Error(
"DropBranchFromCache",
"No tree is available. Branch was not dropped from the cache");
1012 Error(
"DropBranchFromCache",
"No file is available. Branch was not dropped from the cache");
1017 Error(
"DropBranchFromCache",
"No cache is available, branch not dropped");
1036 Error(
"DropBranchFromCache",
"Could not load a tree");
1044 Error(
"DropBranchFromCache",
"Error dropping branch");
1049 Error(
"DropBranchFromCache",
"No tree is available. Branch was not dropped from the cache");
1055 Error(
"DropBranchFromCache",
"No file is available. Branch was not dropped from the cache");
1060 Error(
"DropBranchFromCache",
"No cache is available, branch not dropped");
1166 Warning(
"AddFriend",
"FriendElement %s in file %s has less entries %lld than its parent Tree: %lld", treename, filename, t->
GetEntries(),
fEntries);
1169 Warning(
"AddFriend",
"Cannot add FriendElement %s in file %s", treename, filename);
1194 Warning(
"AddFriend",
"FriendElement %s in file %s has less entries %lld than its parent tree: %lld", treename, file->
GetName(), t->
GetEntries(),
fEntries);
1197 Warning(
"AddFriend",
"unknown tree '%s' in file '%s'", treename, file->
GetName());
1221 Warning(
"AddFriend",
"FriendElement '%s' in file '%s' has less entries %lld than its parent tree: %lld",
1316 if (opt.
Contains(
"flushbaskets")) {
1317 if (
gDebug > 0)
printf(
"AutoSave: calling FlushBaskets \n");
1329 if (nbytes && key) {
1350 const char* writeStlWithoutProxyMsg =
"The class requested (%s) for the branch \"%s\""
1351 " is an instance of an stl collection and does not have a compiled CollectionProxy."
1352 " Please generate the dictionary for this collection (%s) to avoid to write corrupted data.";
1366 Error(
"Branch", writeStlWithoutProxyMsg,
1370 return Branch(branchname, classname, (
void*) addobj, bufsize, splitlevel);
1373 void** addr = (
void**) addobj;
1377 if (ptrClass && claim) {
1384 Error(
"Branch",
"The class requested (%s) for \"%s\" is different from the type of the pointer passed (%s)",
1387 }
else if (actualClass && (claim != actualClass) && !actualClass->
InheritsFrom(claim)) {
1392 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s",
1398 Error(
"Branch", writeStlWithoutProxyMsg,
1402 return Branch(branchname, classname, (
void*) addobj, bufsize, splitlevel);
1412 Error(
"Branch",
"The pointer specified for %s is not of a class known to ROOT", branchname);
1416 void** addr = (
void**) addobj;
1417 if (addr && *addr) {
1420 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",
1421 branchname, ptrClass->
GetName());
1422 actualClass = ptrClass;
1423 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1424 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());
1428 actualClass = ptrClass;
1431 Error(
"Branch", writeStlWithoutProxyMsg,
1435 return Branch(branchname, actualClass->
GetName(), (
void*) addobj, bufsize, splitlevel);
1447 Error(
"Branch", writeStlWithoutProxyMsg,
1450 }
else if (claim == 0) {
1451 Error(
"Branch",
"The pointer specified for %s is not of a class known to ROOT and %s is not a known class", branchname, classname);
1458 Error(
"Branch",
"Reference interface requires a valid object (for branch: %s)!", branchname);
1462 if (ptrClass && claim) {
1469 Error(
"Branch",
"The class requested (%s) for \"%s\" is different from the type of the object passed (%s)",
1472 }
else if (actualClass && (claim != actualClass) && !actualClass->
InheritsFrom(claim)) {
1477 Error(
"Branch",
"The actual class (%s) of the object provided for the definition of the branch \"%s\" does not inherit from %s",
1483 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",
1484 branchname, ptrClass->
GetName());
1485 actualClass = ptrClass;
1486 }
else if ((ptrClass != actualClass) && !actualClass->
InheritsFrom(ptrClass)) {
1487 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());
1491 Error(
"Branch", writeStlWithoutProxyMsg,
1506 Error(
"Branch",
"The pointer specified for %s is not of a class or type known to ROOT", branchname);
1508 TString varname; varname.
Form(
"%s/%c",branchname,DataTypeToChar(datatype));
1509 return Branch(branchname,addobj,varname.
Data(),bufsize);
1515 Error(
"Branch",
"Reference interface requires a valid object (for branch: %s)!", branchname);
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,
1631 Error(
"Branch",
"Cannot call this constructor for a TClonesArray");
1634 Int_t nch = strlen(name);
1637 while ((obj =
next())) {
1645 Branch(col, bufsize, splitlevel - 1, branchname);
1647 if (nch && (name[nch-1] ==
'_')) {
1656 if (splitlevel > 99) {
1682 char* curname =
new char[1000];
1684 while ((obj =
next())) {
1685 snprintf(curname,1000,
"%s/%s", foldername, obj->GetName());
1687 Branch(curname, bufsize, splitlevel - 1);
1690 for (
Int_t i = 0; i < 1000; ++i) {
1691 if (curname[i] == 0) {
1694 if (curname[i] ==
'/') {
1700 snprintf(occur,20,
"_%d", noccur);
1701 strlcat(curname, occur,1000);
1769 TBranch* branch =
new TBranch(
this, name, address, leaflist, bufsize);
1805 return Bronch(name, classname, addobj, bufsize, splitlevel);
1807 if (splitlevel < 0) {
1810 return BranchOld(name, classname, addobj, bufsize, splitlevel);
1859 Error(
"BranchOld",
"Cannot find class: '%s'", classname);
1864 Fatal(
"BranchOld",
"The requested class ('%s') does not inherit from TObject.\n"
1865 "\tfgBranchStyle is set to zero requesting by default to use BranchOld.\n"
1866 "\tIf this is intentional use Bronch instead of Branch or BranchOld.", classname);
1868 Fatal(
"BranchOld",
"The requested class ('%s') does not inherit from TObject.\n"
1869 "\tYou can not use BranchOld to store objects of this type.",classname);
1880 const char* rdname = 0;
1881 const char* dname = 0;
1883 char** apointer = (
char**) addobj;
1893 Int_t lenName = strlen(name);
1895 if (name[lenName-1] ==
'.') {
1934 if (!strcmp(dname,
"fBits")) {
1937 if (!strcmp(dname,
"fUniqueID")) {
1947 branchname = rdname;
1951 branchname.
Form(
"%s%s", name, &rdname[1]);
1953 branchname.
Form(
"%s%s", name, &rdname[0]);
1959 char* pointer = ((
char*) obj) +
offset;
1968 char* cpointer = (
char*) pointer;
1969 char** ppointer = (
char**) cpointer;
1971 if (splitlevel != 2) {
1973 branch1 =
new TBranchClones(branch,branchname, pointer, bufsize);
1978 blist->
Add(branch1);
1986 blist->
Add(branch1);
2003 blist->
Add(branch1);
2017 aindex.Remove(rdot+1);
2018 aindex.Append(index);
2024 if (!strcmp(rdi->
GetName(), index)) {
2027 if (!strcmp(rdi->
GetName(), aindex)) {
2033 char vcode = DataTypeToChar((
EDataType)code);
2039 leaflist.
Form(
"%s[%s]/%c", &rdname[0], index, vcode);
2041 Error(
"BranchOld",
"Cannot create branch for rdname: %s code: %d", branchname.
Data(), code);
2048 leaflist.
Form(
"%s/%s", dname,
"C");
2061 branch1 =
new TBranch(branch, bname, *((
void**) pointer), leaflist, bufsize);
2065 blist->
Add(branch1);
2070 char vcode = DataTypeToChar((
EDataType)code);
2072 leaflist.
Form(
"%s/%c", rdname, vcode);
2074 Error(
"BranchOld",
"Cannot create branch for rdname: %s code: %d", branchname.
Data(), code);
2077 branch1 =
new TBranch(branch, branchname, pointer, leaflist, bufsize);
2079 blist->
Add(branch1);
2088 Warning(
"BranchOld",
"Cannot process member: '%s'", rdname);
2197 Error(
"Bronch",
"Cannot find class:%s", classname);
2208 objptr = (
char*)addr;
2210 objptr = *((
char**) addr);
2216 Error(
"Bronch",
"Pointer to TClonesArray is null");
2220 Error(
"Bronch",
"TClonesArray with no class defined in branch: %s", name);
2224 Error(
"Bronch",
"TClonesArray with no dictionary defined in branch: %s", name);
2228 if (splitlevel > 0) {
2229 if (hasCustomStreamer)
2230 Warning(
"Bronch",
"Using split mode on a class: %s with a custom Streamer", clones->
GetClass()->
GetName());
2245 if (!inklass && (collProxy->
GetType() == 0)) {
2246 Error(
"Bronch",
"%s with no class defined in branch: %s", classname, name);
2253 Error(
"Bronch",
"Container with no dictionary defined in branch: %s", name);
2257 Warning(
"Bronch",
"Using split mode on a class: %s with a custom Streamer", inklass->
GetName());
2268 branch =
new TBranchSTL(
this, name, collProxy, bufsize, splitlevel );
2270 branch =
new TBranchElement(
this, name, collProxy, bufsize, splitlevel);
2282 Error(
"Bronch",
"Cannot find dictionary for class: %s", classname);
2288 hasCustomStreamer =
kTRUE;
2291 if (splitlevel < 0 || ((splitlevel == 0) && hasCustomStreamer && cl->
IsTObject())) {
2322 objptr = (
char*) cl->
New();
2330 if ((splitlevel > 0) && !cl->
CanSplit()) {
2331 if (splitlevel != 99) {
2332 Warning(
"Bronch",
"%s cannot be split, resetting splitlevel to 0", cl->
GetName());
2346 Error(
"Bronch",
"Cannot build the StreamerInfo for class: %s", cl->
GetName());
2357 char*
dot = (
char*) strchr(name,
'.');
2358 Int_t nch = strlen(name);
2360 if (nch && (name[nch-1] ==
'.')) {
2369 if (splitlevel > 0) {
2395 char* pointer = (
char*) (objptr + element->GetOffset());
2402 TClass* clbase = element->GetClassPointer();
2419 bname.
Form(
"%s%s", name, element->GetFullName());
2436 bname.
Form(
"%s.%s", name, element->GetFullName());
2442 bname.
Form(
"%s", element->GetFullName());
2446 element->GetClass()->GetCollectionProxy() &&
2447 element->GetClass()->GetCollectionProxy()->HasPointers() )
2449 TBranchSTL* brSTL =
new TBranchSTL( branch, bname, element->GetClass()->GetCollectionProxy(), bufsize, splitlevel-1, sinfo,
id );
2602 char* fname =
new char[2000];
2605 for (
Int_t i = 0; i < 10; ++i) {
2613 strlcpy(fname, file->
GetName(),2000);
2616 char* cunder = strrchr(fname,
'_');
2619 const char* cdot = strrchr(file->
GetName(),
'.');
2621 strlcat(fname, cdot,2000);
2626 strlcat(fname, fcount,2000);
2629 char* cdot = strrchr(fname,
'.');
2632 strlcat(fname, strrchr(file->
GetName(),
'.'),2000);
2636 strlcat(fname, fcount,2000);
2643 Warning(
"ChangeFile",
"file %s already exist, trying with %d underscores", fname, nus+1);
2648 Error(
"Fill",
"Failed to open new file %s, continuing as a memory tree.",fname);
2650 Printf(
"Fill: Switching to new file: %s", fname);
2673 while ((branch = (
TBranch*)nextb())) {
2682 if (newfile) newfile->
Append(obj);
2718 TClass* expectedClass = 0;
2724 if (expectedClass && datatype ==
kOther_t && ptrClass == 0) {
2730 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". "
2731 "The class expected (%s) refers to an stl collection and do not have a compiled CollectionProxy. "
2732 "Please generate the dictionary for this class (%s)",
2739 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". "
2740 "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."
2741 "Please generate the dictionary for this class (%s)",
2744 Error(
"SetBranchAddress",
"Unable to determine the type given for the address for \"%s\". "
2745 "This is probably due to a missing dictionary, the original data class for this branch is %s.", branch->
GetName(), expectedClass->
GetName());
2749 if (expectedClass && ptrClass && (branch->
GetMother() == branch)) {
2752 Error(
"SetBranchAddress",
"The address for \"%s\" should be the address of a pointer!", branch->
GetName());
2772 if( expectedClass && ptrClass &&
2773 expectedClass != ptrClass &&
2781 Info(
"SetBranchAddress",
"Matching STL collection (at least according to the SchemaRuleSet when "
2782 "reading a %s into a %s",expectedClass->
GetName(),ptrClass->
GetName());
2789 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());
2800 }
else if (expectedClass && ptrClass && !expectedClass->
InheritsFrom(ptrClass)) {
2822 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());
2832 Error(
"SetBranchAddress",
"The pointer type given \"%s\" (%d) does not correspond to the type needed \"%s\" (%d) by the branch: %s",
2839 if (expectedClass) {
2840 Error(
"SetBranchAddress",
"The pointer type given \"%s\" (%d) does not correspond to the type needed \"%s\" by the branch: %s",
2854 if (rdm->GetThisOffset() == 0) {
2862 if (dm->GetOffset() == 0) {
2866 good = (etype == expectedType);
2873 Error(
"SetBranchAddress",
"The pointer type given \"%s\" does not correspond to the type needed \"%s\" (%d) by the branch: %s",
2880 Error(
"SetBranchAddress", writeStlWithoutProxyMsg,
2990 for (
Int_t i = 0; i < nb; ++i) {
3000 if (thistree !=
this) {
3025 for (
Int_t lndx = 0; lndx < nleaves; ++lndx) {
3031 if (branch && (newcomp > -1)) {
3039 for (
Long64_t i = 0; i < nb; ++i) {
3050 for (
Int_t j = 0; j < nb1; ++j) {
3064 for (
Int_t k = 0; k < nb2; ++k) {
3092 if (nentries != 0) {
3093 if (fastClone && (nentries < 0)) {
3094 if ( newtree->
CopyEntries(
this, -1, option ) < 0 ) {
3096 Error(
"CloneTTree",
"TTree has not been cloned\n");
3119 for (
Int_t i = 0; i < nbranches; ++i) {
3155 Warning(
"CopyAddresses",
"Could not find branch named '%s' in tree named '%s'", branch->
GetName(), tree->
GetName());
3163 for (
Int_t i = 0; i < ntleaves; ++i) {
3201 Warning(
"CopyAddresses",
"Could not find branch named '%s' in tree named '%s'", branch->
GetName(), tree->
GetName());
3228 switch (onIndexError) {
3252 switch (onIndexError) {
3276 }
else if ( onIndexError == kDrop ) {
3333 onIndexError = kKeep;
3334 }
else if (opt.
Contains(
"buildindex")) {
3335 onIndexError = kBuild;
3336 }
else if (opt.
Contains(
"dropindex")) {
3337 onIndexError = kDrop;
3339 onIndexError = kBuild;
3345 nentries = treeEntries;
3346 }
else if (nentries > treeEntries) {
3347 nentries = treeEntries;
3350 if (fastClone && (nentries < 0 || nentries == tree->
GetEntriesFast())) {
3358 withIndex = R__HandleIndex( onIndexError,
this, tree );
3369 if (cloner.IsValid()) {
3374 Warning(
"CopyEntries",
"%s",cloner.GetWarning());
3379 if (cloner.NeedConversion()) {
3392 Warning(
"CopyEntries",
"%s",cloner.GetWarning());
3409 nentries = treeEntries;
3410 }
else if (nentries > treeEntries) {
3411 nentries = treeEntries;
3413 Int_t treenumber = -1;
3420 withIndex = R__HandleIndex( onIndexError,
this, tree );
3427 nbytes += this->
Fill();
3504 if (file && !strcmp(option,
"all")) {
3506 Error(
"Delete",
"File : %s is not writable, cannot delete Tree:%s", file->
GetName(),
GetName());
3523 Int_t nbytes,objlen,keylen;
3527 for (
Int_t i=0;i<nbaskets;i++) {
3531 if (!branchFile)
continue;
3533 if (nbytes <= 0)
continue;
3534 branchFile->
MakeFree(pos,pos+nbytes-1);
3548 if (dirsav) dirsav->
cd();
3549 if (
gDebug)
printf(
" Deleting Tree: %s: %d baskets deleted. Total space freed = %d bytes\n",
GetName(),nbask,ntot);
4228 for (
Int_t i = 0; i < nb; ++i) {
4242 for (
Int_t i = 0; i < nleaves; ++i) {
4246 for (
Int_t j = 0; j < nbaskets - 1; ++j) {
4322 for (
Int_t i = 0; i < nb; ++i) {
4331 Error(
"Fill",
"Failed filling branch:%s.%s, nbytes=%d, entry=%lld\n"
4332 " This error is symptomatic of a Tree created as a memory-resident Tree\n"
4333 " Instead of doing:\n"
4334 " TTree *T = new TTree(...)\n"
4335 " TFile *f = new TFile(...)\n"
4337 " TFile *f = new TFile(...)\n"
4338 " TTree *T = new TTree(...)",
4355 if (
gDebug > 0)
printf(
"TTree::Fill - A: %d %lld %lld %lld %lld %lld %lld \n",
4363 if ((fAutoFlush<0 && fZipBytes > -
fAutoFlush) ||
4364 (fAutoSave <0 && fZipBytes > -
fAutoSave ) ||
4444 if (list==0 || branchname == 0 || branchname[0] ==
'\0')
return 0;
4448 UInt_t brlen = strlen(branchname);
4450 for(
Int_t index = 0; index < nbranches; ++index) {
4454 UInt_t len = strlen(name);
4455 if (len && name[len-1]==
']') {
4456 const char *dim = strchr(name,
'[');
4461 if (brlen == len && strncmp(branchname,name,len)==0) {
4465 if ((brlen >= len) && (branchname[len] ==
'.')
4466 && strncmp(name, branchname, len) == 0) {
4473 if (next)
return next;
4475 const char *
dot = strchr((
char*)branchname,
'.');
4477 if (len==(
size_t)(dot-branchname) &&
4478 strncmp(branchname,name,dot-branchname)==0 ) {
4506 if (branch)
return branch;
4510 if (branch)
return branch;
4517 return nestedbranch;
4534 const char *subbranch = strstr(branchname, fe->
GetName());
4535 if (subbranch != branchname) {
4539 subbranch += strlen(fe->
GetName());
4540 if (*subbranch !=
'.') {
4546 std::ostringstream
name;
4548 name << t->
GetName() <<
"." << subbranch;
4573 char* subsearchname = (
char*) strstr(searchname,
GetName());
4574 if (subsearchname != searchname) {
4577 if (subsearchname) {
4578 subsearchname += strlen(
GetName());
4579 if (*subsearchname !=
'.') {
4583 if (subsearchname[0]==0) {
4600 if (dim >= 0) leafname.
Remove(dim);
4602 if (leafname == searchname) {
4605 if (subsearchname && leafname == subsearchname) {
4611 dim = leaftitle.
First(
'[');
4612 if (dim >= 0) leaftitle.
Remove(dim);
4614 if (leaftitle == searchname) {
4617 if (subsearchname && leaftitle == subsearchname) {
4623 dim = longname.
First(
'[');
4624 if (dim>=0) longname.
Remove(dim);
4625 if (longname == searchname) {
4628 if (subsearchname && longname == subsearchname) {
4632 dim = longtitle.
First(
'[');
4633 if (dim>=0) longtitle.
Remove(dim);
4634 if (longtitle == searchname) {
4637 if (subsearchname && longtitle == subsearchname) {
4645 if (strstr(searchname,
".") && !strcmp(searchname, branch->
GetName())) {
4648 if (subsearchname && strstr(subsearchname,
".") && !strcmp(subsearchname, branch->
GetName())) {
4666 subsearchname = (
char*) strstr(searchname, fe->
GetName());
4667 if (subsearchname != searchname) {
4670 if (subsearchname) {
4671 subsearchname += strlen(fe->
GetName());
4672 if (*subsearchname !=
'.') {
4678 if (subsearchname) {
4679 leafname.
Form(
"%s.%s",t->
GetName(),subsearchname);
4681 leafname = searchname;
4723 return fPlayer->
Fit(funcname, varexp, selection, option, goption, nentries, firstentry);
4740 for (
Int_t j = 0; j < nb; j++) {
4783 const char* alias = t->
GetAlias(aliasName);
4787 const char* subAliasName = strstr(aliasName, fe->
GetName());
4788 if (subAliasName && (subAliasName[strlen(fe->
GetName())] ==
'.')) {
4804 if (name == 0)
return 0;
4814 for (
Int_t i = 0; i < nb; i++) {
4821 for (
Int_t j = 0; j < nb1; j++) {
4828 for (
Int_t k = 0; k < nb2; k++) {
4840 for (
Int_t i = 0; i < nleaves; i++) {
4874 char* subname = (
char*) strstr(name, fe->
GetName());
4875 if (subname != name) {
4880 if (*subname !=
'.') {
4929 if (!(stcs =
gSystem->
Getenv(
"ROOT_TTREECACHE_SIZE")) || !*stcs) {
4935 if (cacheFactor < 0.0) {
4943 else if (fAutoFlush == 0) cacheSize = 0;
4946 if (cacheSize >= (INT_MAX / 4)) {
4947 cacheSize = INT_MAX / 4;
4950 if (cacheSize < 0) {
4954 if (cacheSize == 0 && withDefault) {
4956 else if (fAutoFlush == 0) cacheSize = 0;
5150 if (entry < 0 || entry >=
fEntries)
return 0;
5161 for (i=0;i<nbranches;i++) {
5163 nb = branch->
GetEntry(entry, getall);
5164 if (nb < 0)
return nb;
5183 if (nb < 0)
return nb;
5286 for (i = 0; i < nbranches; ++i) {
5289 if (nb < 0)
return nb;
5301 if (serial <0)
return -nbytes;
5303 if (nb < 0)
return nb;
5328 if (strcmp(friendname,fe->
GetName())==0
5372 if ((tree ==
this) || (tree ==
GetTree())) {
5435 leaf = branch->
GetLeaf(leafname);
5442 while ((leaf = (
TLeaf*)nextl())) {
5443 if (strcmp(leaf->
GetName(),leafname))
continue;
5445 UInt_t nbch = strlen(branchname);
5447 const char* brname = br->
GetName();
5449 if (strncmp(brname,branchname,nbch)) {
5451 const char *mothername = mother->
GetName();
5452 UInt_t motherlen = strlen(mothername);
5453 if (nbch > motherlen && strncmp(mothername,branchname,motherlen)==0 && (mothername[motherlen-1]==
'.' || branchname[motherlen]==
'.')) {
5455 if (strncmp(brname,branchname+motherlen+1,nbch-motherlen-1)) {
5471 if ((strlen(brname) > nbch) && (brname[nbch] !=
'.') && (brname[nbch] !=
'[')) {
5485 if (leaf)
return leaf;
5496 char *subname = (
char*)strstr(leafname,fe->
GetName());
5497 if (subname != leafname)
continue;
5500 if (*subname !=
'.')
continue;
5502 strippedArg += subname;
5503 leaf = t->
GetLeaf(branchname,subname);
5504 if (leaf)
return leaf;
5521 if (leafname == 0)
return 0;
5540 if (aname == 0)
return 0;
5547 char*
slash = (
char*) strrchr(aname,
'/');
5552 nbch = slash - aname;
5579 if (entryNumber < 0)
break;
5618 if (entryNumber < 0)
break;
5650 if (pe && pe->
GetTree() !=
this) pe = 0;
5651 if (create && !pe) {
5654 if (pe && pe->
GetTree() !=
this) pe = 0;
5719 if (autoflush > 0 && autosave > 0) {
5731 for (
Int_t i = 0; i < nb; ++i) {
5738 for(
Int_t i = 0, j = 0; j < oldsize; ++j) {
5769 Int_t nimported = 0;
5820 if (friendTree == 0) {
5825 friendHasEntry =
kTRUE;
5832 friendHasEntry =
kTRUE;
5835 if (oldNumber != newNumber) {
5961 Warning(
"MakeCode",
"MakeCode is obsolete. Use MakeClass or MakeSelector instead");
6087 Int_t TTree::MakeProxy(
const char* proxyClassname,
const char* macrofilename,
const char* cutfilename,
const char* option,
Int_t maxUnrolling)
6091 return fPlayer->
MakeProxy(proxyClassname,macrofilename,cutfilename,option,maxUnrolling);
6144 if(opt.
EqualTo(
"=legacy", TString::ECaseCompare::kIgnoreCase)) {
6177 while ((obj=
next())) {
6181 if (nentries == 0)
continue;
6184 if (!newtree)
continue;
6225 if (tree==
this)
continue;
6233 if (nentries == 0)
continue;
6256 const char *options = info ? info->
fOptions.
Data() :
"";
6278 if (tree==
this)
continue;
6307 if (src == dst)
return;
6361 if (nleaves == 0 || treeSize == 0) {
6365 Double_t aveSize = treeSize/nleaves;
6369 Int_t i, oldMemsize,newMemsize,oldBaskets,newBaskets;
6370 i = oldMemsize = newMemsize = oldBaskets = newBaskets = 0;
6375 for (
Int_t pass =0;pass<2;pass++) {
6380 for (i=0;i<nleaves;i++) {
6384 Double_t idealFactor = totBytes/aveSize;
6388 sizeOfOneEntry = aveSize;
6393 oldMemsize += oldBsize;
6394 oldBaskets += 1+
Int_t(totBytes/oldBsize);
6397 newBaskets += 1+
Int_t(totBytes/oldBsize);
6401 if (bsize < 0) bsize = bmax;
6402 if (bsize > bmax) bsize = bmax;
6404 newBsize = newBsize - newBsize%512;
6405 if (newBsize < sizeOfOneEntry) newBsize = sizeOfOneEntry;
6406 if (newBsize < bmin) newBsize = bmin;
6407 if (newBsize > 10000000) newBsize = bmax;
6409 if (pDebug)
printf(
"Changing buffer size from %6d to %6d bytes for %s\n",oldBsize,newBsize,branch->
GetName());
6412 newMemsize += newBsize;
6416 newBaskets += 1+
Int_t(totBytes/newBsize);
6417 if (pass == 0)
continue;
6421 if (comp > 1 && comp < minComp) {
6422 if (pDebug)
printf(
"Disabling compression for branch : %s\n",branch->
GetName());
6428 if (memFactor > 100) memFactor = 100;
6429 Double_t bmin_new = bmin*memFactor;
6430 Double_t bmax_new = bmax*memFactor;
6431 static const UInt_t hardmax = 1*1024*1024*1024;
6438 static const UInt_t hardmin = 8;
6439 bmin = (bmin_new > hardmax) ? hardmax : ( bmin_new < hardmin ? hardmin : (
UInt_t)bmin_new );
6440 bmax = (bmax_new > hardmax) ? bmin : (
UInt_t)bmax_new;
6443 printf(
"oldMemsize = %d, newMemsize = %d\n",oldMemsize, newMemsize);
6444 printf(
"oldBaskets = %d, newBaskets = %d\n",oldBaskets, newBaskets);
6479 return fPlayer->
Principal(varexp, selection, option, nentries, firstentry);
6522 Printf(
"******************************************************************************");
6524 Printf(
"*Entries : %8lld : Total = %15lld bytes File Size = %10lld *",
fEntries, total, file);
6525 Printf(
"* : : Tree compression factor = %6.2f *", cx);
6526 Printf(
"******************************************************************************");
6528 if (strncmp(option,
"clusterRange",strlen(
"clusters"))==0) {
6529 Printf(
"%-16s %-16s %-16s %5s",
6530 "Cluster Range #",
"Entry Start",
"Last Entry",
"Size");
6535 Printf(
"%-16d %-16lld %-16lld %5lld",
6540 Printf(
"%-16d %-16lld %-16lld %5lld",
6549 if (strstr(option,
"toponly")) {
6552 for (l=0;l<nl;l++) {
6553 leaf = (
TLeaf *)const_cast<TTree*>(
this)->GetListOfLeaves()->At(l);
6555 if (strchr(br->
GetName(),
'.')) {
6563 for (l=0;l<nl;l++) {
6564 if (count[l] < 0)
continue;
6565 leaf = (
TLeaf *)const_cast<TTree*>(
this)->GetListOfLeaves()->At(l);
6572 if (strlen(option) && strchr(option,
'*')) reg = option;
6588 if (!
fFriends || !strstr(option,
"all"))
return;
6594 if (t) t->
Print(option);
6613 if (tc) tc->
Print(option);
6737 var.
Form(
"%s>>%s", varexp, hname);
6740 opt.
Form(
"%sgoff", option);
6742 Long64_t nsel =
Draw(var, selection, opt, nentries, firstentry);
6753 return fPlayer->
Query(varexp, selection, option, nentries, firstentry);
6805 Error(
"ReadFile",
"Cannot open file: %s",filename);
6808 const char* ext = strrchr(filename,
'.');
6809 if(ext !=
NULL && ((strcmp(ext,
".csv") == 0) || (strcmp(ext,
".CSV") == 0)) && delimiter ==
' ') {
6812 return ReadStream(in, branchDescriptor, delimiter);
6821 Long_t inPos = inputStream.tellg();
6822 char newline =
'\n';
6826 if(!inputStream.good()) {
6827 Error(
"ReadStream",
"Error reading stream: no newline found.");
6830 if(c == newline)
break;
6836 inputStream.clear();
6837 inputStream.seekg(inPos);
6849 std::istream& in = inputStream;
6854 if (nbranches == 0) {
6855 char *bdname =
new char[4000];
6856 char *bd =
new char[100000];
6858 if (branchDescriptor) nch = strlen(branchDescriptor);
6862 in.getline(bd, 100000, newline);
6866 Error(
"ReadStream",
"Error reading stream");
6870 while( isspace(*cursor) && *cursor !=
'\n' && *cursor !=
'\0') {
6873 if (*cursor !=
'#' && *cursor !=
'\n' && *cursor !=
'\0') {
6880 strlcpy(bd,branchDescriptor,100000);
6885 void *address = &bd[90000];
6889 if(delimiter !=
' ') {
6891 if (strchr(bdcur,bdelim)==0 && strchr(bdcur,
':') != 0) {
6897 char *colon = strchr(bdcur,bdelim);
6898 if (colon) *colon = 0;
6899 strlcpy(bdname,bdcur,4000);
6900 char *
slash = strchr(bdname,
'/');
6906 desc.
Form(
"%s/%s",bdname,olddesc.Data());
6908 char *bracket = strchr(bdname,
'[');
6912 branch =
new TBranch(
this,bdname,address,desc.
Data(),32000);
6915 Warning(
"ReadStream",
"Illegal branch definition: %s",bdcur);
6930 Info(
"ReadStream",
"Will use branches:");
6931 for (
int i = 0 ; i < nbranches; ++i) {
6937 Info(
"ReadStream",
"Dumping read tokens, format:");
6938 Info(
"ReadStream",
"LLLLL:BBB:gfbe:GFBE:T");
6939 Info(
"ReadStream",
" L: line number");
6940 Info(
"ReadStream",
" B: branch number");
6941 Info(
"ReadStream",
" gfbe: good / fail / bad / eof of token");
6942 Info(
"ReadStream",
" GFBE: good / fail / bad / eof of file");
6943 Info(
"ReadStream",
" T: Token being read");
6950 const char sDelimBuf[2] = { delimiter, 0 };
6951 const char* sDelim = sDelimBuf;
6952 if (delimiter ==
' ') {
6957 if (newline ==
'\r' && in.peek() ==
'\n') {
6961 std::getline(in, line, newline);
6968 Info(
"ReadStream",
"Skipping empty line number %lld", nlines);
6972 if (sLine[0] ==
'#') {
6974 Info(
"ReadStream",
"Skipping comment line number %lld: '%s'",
6975 nlines, line.c_str());
6980 Info(
"ReadStream",
"Parsing line number %lld: '%s'",
6981 nlines, line.c_str());
6988 std::stringstream sToken;
6992 Int_t remainingLeafLen = 0;
6993 while (goodLine && iBranch < nbranches
6994 && sLine.
Tokenize(tok, pos, sDelim)) {
6996 if (tok.
IsNull() && delimiter ==
' ') {
7002 if (!remainingLeafLen) {
7007 if (!remainingLeafLen) {
7008 remainingLeafLen = leaf->
GetLen();
7012 remainingLeafLen = 1;
7022 if (remainingLeafLen) {
7030 sToken.seekp(0, std::ios_base::beg);
7031 sToken.str(leafData.
Data());
7032 sToken.seekg(0, std::ios_base::beg);
7035 Info(
"ReadStream",
"%5lld:%3d:%d%d%d%d:%d%d%d%d:%s",
7037 (
int)sToken.good(), (int)sToken.fail(),
7038 (int)sToken.bad(), (int)sToken.eof(),
7039 (int)in.good(), (int)in.fail(),
7040 (int)in.bad(), (int)in.eof(),
7041 sToken.str().c_str());
7048 "Buffer error while reading data for branch %s on line %lld",
7050 }
else if (!sToken.eof()) {
7051 if (sToken.fail()) {
7053 "Couldn't read formatted data in \"%s\" for branch %s on line %lld; ignoring line",
7057 std::string remainder;
7058 std::getline(sToken, remainder, newline);
7059 if (!remainder.empty()) {
7061 "Ignoring trailing \"%s\" while reading data for branch %s on line %lld",
7062 remainder.c_str(), branch->
GetName(), nlines);
7068 if (iBranch < nbranches) {
7070 "Read too few columns (%d < %d) in line %lld; ignoring line",
7071 iBranch, nbranches, nlines);
7073 }
else if (pos !=
kNPOS) {
7075 if (pos < sLine.
Length()) {
7077 "Ignoring trailing \"%s\" while reading line %lld",
7078 sLine.
Data() + pos - 1 ,
7153 for (
Int_t i = 0; i < nleaves; i++) {
7182 if (friend_t == oldFriend) {
7210 for (
Int_t i = 0; i < nb; ++i) {
7212 branch->
Reset(option);
7240 for (
Int_t i = 0; i < nb; ++i) {
7269 for (
Int_t i = 0; i < nbranches; ++i) {
7288 return fPlayer->
Scan(varexp, selection, option, nentries, firstentry);
7328 if (!aliasName || !aliasFormula) {
7331 if (!aliasName[0] || !aliasFormula[0]) {
7487 for (
Int_t i = 0; i < nleaves; i++) {
7498 Error(
"SetBasketSize",
"unknown branch -> '%s'", bname);
7514 Error(
"SetBranchAddress",
"unknown branch -> %s", bname);
7544 Error(
"SetBranchAddress",
"unknown branch -> %s", bname);
7575 const char *bname = branch->
GetName();
7578 if (cloneBr && (cloneBr->
GetAddress() == oldAddr)) {
7663 TBranch *branch, *bcount, *bson;
7664 TLeaf *leaf, *leafcount;
7673 for (i=0;i<nleaves;i++) {
7677 if (strcmp(bname,
"*")) {
7680 if (strcmp(bname,branch->
GetName())
7681 && longname != bname
7694 if (nb==0 && strchr(bname,
'*')==0) {
7704 UInt_t foundInFriend = 0;
7715 char *subbranch = (
char*)strstr(bname,fe->
GetName());
7716 if (subbranch!=bname) subbranch = 0;
7718 subbranch += strlen(fe->
GetName());
7719 if ( *subbranch !=
'.' ) subbranch = 0;
7730 if (!nb && !foundInFriend) {
7731 if (found==0)
Error(
"SetBranchStatus",
"unknown branch -> %s", bname);
7734 if (found) *found = nb + foundInFriend;
7738 for (i = 0; i < nleaves; i++) {
7750 for (j=0;j<nbranches;j++) {
7752 if (!bson)
continue;
7820 if (cacheSize < 0) {
7824 if (cacheSize == 0) {
7826 }
else if (cacheSize < 0) {
7832 if (!file ||
GetTree() !=
this) {
7841 if (!autocache && cacheSize>0) {
7842 Warning(
"SetCacheSizeAux",
"A TTreeCache could not be created because the TTree has no file");
7877 if (cacheSize == 0) {
7899 Error(
"SetCacheSizeAux",
"Not setting up an automatically sized TTreeCache because of missing cache previously set");
7907 if (cacheSize == 0 || pf) {
7932 Error(
"SetCacheEntryRange",
"Could not load a tree");
7941 Error(
"SetCacheEntryRange",
"No tree is available. Could not set cache entry range");
7947 Error(
"SetCacheEntryRange",
"No file is available. Could not set cache entry range");
7952 Error(
"SetCacheEntryRange",
"No cache is available. Could not set entry range");
7991 if (maxEntries <= 0) {
8006 for (
Int_t i = 0; i < nb; i++) {
8039 if (newdefault < 10) {
8043 if (updateExisting) {
8131 Warning(
"SetEntries",
"Tree branches have different numbers of entries, with %lld maximum.", nMax);
8183 char enlistname[100];
8184 snprintf(enlistname,100,
"%s_%s", evlist->
GetName(),
"entrylist");
8188 fEntryList->SetTree(
this);
8190 for (
Int_t i=0; i<nsel; i++){
8192 fEntryList->Enter(entry);
8229 Warning(
"SetFileNumber",
"file number must be positive. Set to 0");
8245 for (
Int_t i = 0; i < nb; ++i) {
8403 Error(
"Show()",
"Cannot read entry %lld (entry does not exist)", entry);
8405 }
else if (ret == -1) {
8406 Error(
"Show()",
"Cannot read entry %lld (I/O error)", entry);
8411 Error(
"Show()",
"Cannot read entry %lld (I/O error)", entry);
8413 }
else if (ret == 0) {
8414 Error(
"Show()",
"Cannot read entry %lld (no data read)", entry);
8422 for (
Int_t i = 0; i < nleaves; i++) {
8454 if (
l == (len - 1)) {
8459 if ((
l % ltype) == 0) {
8491 Error(
"StopCacheLearningPhase",
"Could not load a tree");
8500 Error(
"StopCacheLearningPhase",
"No tree is available. Could not stop cache learning phase");
8506 Error(
"StopCacheLearningPhase",
"No file is available. Could not stop cache learning phase");
8511 Error(
"StopCacheLearningPhase",
"No cache is available. Could not stop learning phase");
8524 for (
Int_t i = 0; i < nb; ++i) {
8530 for (
Int_t j=writeBasket,
n=0;j>=0 &&
n<nBaskets;--j) {
8560 void TTree::Streamer(
TBuffer& b)
8587 Warning(
"Streamer",
"Old style index in this tree is deleted. Rebuild the index via TTree::BuildIndex");
8626 TNamed::Streamer(b);
8627 TAttLine::Streamer(b);
8628 TAttFill::Streamer(b);
8629 TAttMarker::Streamer(b);
8645 if (R__v > 2)
fIndex.Streamer(b);
8648 OldInfoList.Streamer(b);
8734 return fPlayer->
UnbinnedFit(funcname, varexp, selection, option, nentries, firstentry);
8781 return ((
const TTree*)
this)->Write(name, option, bufsize);
8796 : fTree(const_cast<
TTree*>(tree))
8811 , fDirection(iter.fDirection)
8843 if (!fTree)
return 0;
8849 TObjArray *list = fTree->GetListOfLeaves();
8850 if (!list)
return 0;
8852 if (!fLeafIter)
return 0;
8855 next = fLeafIter->Next();
8859 if (!list)
return next;
8861 if (!fTreeIter)
return 0;
8867 if (!nextTree)
return Next();
8870 if (!fLeafIter)
return 0;
8871 next = fLeafIter->Next();
8882 if (fLeafIter)
return fLeafIter->GetOption();
void Add(TObject *obj, const char *name=0, Int_t check=-1)
Add object with name to browser.
virtual Int_t GetLen() const
Return the number of effective elements of this leaf.
Describe Streamer information for one class version.
virtual void UpdateAddress()
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
virtual TBranch * FindBranch(const char *name)
Return the branch that correspond to the path 'branchname', which can include the name of the tree or...
virtual Int_t GetEntries() const
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual Bool_t GetReapplyCut() const
virtual const char * GetTitle() const
Returns title of object.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual Int_t MakeProxy(const char *classname, const char *macrofilename=0, const char *cutfilename=0, const char *option=0, Int_t maxUnrolling=3)=0
virtual Style_t GetLineStyle() const
virtual Style_t GetFillStyle() const
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual void SetLineWidth(Width_t lwidth)
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TTreeCache * GetReadCache(TFile *file, Bool_t create=kFALSE)
Find and return the TTreeCache registered with the file and which may contain branches for us...
A TFolder object is a collection of objects and folders.
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch after a Merge operation (drop data but keep customizations) TRefTable is cleared...
virtual TList * GetListOfClones()
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
virtual TTree * CopyTree(const char *selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)=0
TStreamerInfo * BuildStreamerInfo(TClass *cl, void *pointer=0, Bool_t canOptimize=kTRUE)
Build StreamerInfo for class cl.
static TDataType * GetDataType(EDataType type)
Given a EDataType type, get the TDataType* that represents it.
Long64_t fDebugMin
Debug level.
Principal Components Analysis (PCA)
virtual Long64_t GetAutoSave() const
Bool_t IsAutoCreated() const
virtual void Append(const TVirtualIndex *, Bool_t delaySort=kFALSE)=0
virtual void PrintValue(Int_t i=0) const
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual void UpdateFile()
Refresh the value of fDirectory (i.e.
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
TString GetTypeName()
Get basic type of typedef, e,g.
virtual TTree * GetTree()
Return pointer to friend TTree.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
virtual void SetAddress(void *add)
Set address of this branch.
virtual void OptimizeBaskets(ULong64_t maxMemory=10000000, Float_t minComp=1.1, Option_t *option="")
This function may be called after having filled some entries in a Tree Using the information in the e...
virtual const char * GetFriendAlias(TTree *) const
If the 'tree' is a friend, this method returns its alias name.
Bool_t MemoryFull(Int_t nbytes)
Check if adding nbytes to memory we are still below MaxVirtualsize.
virtual TBranch * BranchImpRef(const char *branchname, const char *classname, TClass *ptrClass, void *addobj, Int_t bufsize, Int_t splitlevel)
Same as TTree::Branch but automatic detection of the class name.
Long64_t fTotalBuffers
Number of the entry being processed.
virtual Int_t MakeCode(const char *filename=0)
Generate a skeleton function for this tree.
Abstract interface for Tree Index.
virtual TLeaf * GetLeaf(const char *name) const
Return pointer to the 1st Leaf named name in thisBranch.
virtual Int_t MakeReader(const char *classname, Option_t *option)=0
virtual const char * GetName() const
Return name of this collection.
virtual Int_t StopCacheLearningPhase()
Stop the cache learning phase.
virtual void SetBranchStatus(const char *bname, Bool_t status=1, UInt_t *found=0)
Set branch status to Process or DoNotProcess.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual TList * GetListOfKeys() const
virtual void IncrementTotalBuffers(Int_t nbytes)
virtual void Delete(Option_t *option="")
Delete this tree from memory or/and disk.
A Branch for the case of an object.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
TObjArray * GetListOfBaskets()
static Int_t fgBranchStyle
true if the cache setting was explicitly given by user
virtual void SetTree(const TTree *T)=0
virtual Int_t LoadBaskets(Long64_t maxmemory=2000000000)
Read in memory all baskets from all branches up to the limit of maxmemory bytes.
virtual void Clear(Option_t *option="")
Remove all objects from the array.
virtual Int_t GetExpectedType(TClass *&clptr, EDataType &type)
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
static Long64_t GetMaxTreeSize()
Static function which returns the tree file size limit in bytes.
virtual void SetParallelUnzip(Bool_t opt=kTRUE, Float_t RelSize=-1)
Enable or disable parallel unzipping of Tree buffers.
virtual Int_t MakeCode(const char *filename)=0
Provides the interface for the PROOF internal performance measurement and event tracing.
Style_t GetHistLineStyle() const
A cache when reading files over the network.
virtual Bool_t Notify()
Function called when loading a new class library.
TTree()
Default constructor and I/O constructor.
void GetObject(const char *namecycle, T *&ptr)
virtual TClass * GetValueClass() const =0
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
virtual Long64_t GetReadEntry() const
All ROOT classes may have RTTI (run time type identification) support added.
TBuffer * fTransientBuffer
Record which method is locking the friend recursion.
virtual void Flush()
Synchronize a file's in-memory and on-disk states.
virtual void SetCacheRead(TFileCacheRead *cache, TObject *tree=0, ECacheAction action=kDisconnect)
Set a pointer to the read cache.
virtual Int_t Fit(const char *funcname, const char *varexp, const char *selection="", Option_t *option="", Option_t *goption="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Fit a projected item(s) from a tree.
TString & ReplaceAll(const TString &s1, const TString &s2)
R__EXTERN TStyle * gStyle
void SetHistLineWidth(Width_t width=1)
TPrincipal * Principal(const char *varexp="", const char *selection="", Option_t *option="np", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Interface to the Principal Components Analysis class.
virtual Int_t Fill()
Fill all branches.
virtual TEntryList * GetEntryList()
Returns the entry list, set to this tree.
virtual void SetName(const char *name)
Change (i.e.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual TList * GetList() const
virtual void DropBaskets(Option_t *option="")
Loop on all branch baskets.
Long64_t GetCacheAutoSize(Bool_t withDefault=kFALSE) const
Used for automatic sizing of the cache.
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
static void SetBranchStyle(Int_t style=1)
Set the current branch style.
A specialized TFileCacheRead object for a TTree.
virtual TLeaf * GetLeaf(const char *branchname, const char *leafname)
Return pointer to the 1st Leaf named name in any Branch of this Tree or any branch in the list of fri...
virtual Long64_t GetEntriesFriend() const
Return pointer to the 1st Leaf named name in any Branch of this Tree or any branch in the list of fri...
static Int_t SetParallelUnzip(TTreeCacheUnzip::EParUnzipMode option=TTreeCacheUnzip::kEnable)
Static function that (de)activates multithreading unzipping.
Double_t Atof() const
Return floating-point value contained in string.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual TLeaf * GetLeafImpl(const char *branchname, const char *leafname)
Return pointer to the 1st Leaf named name in any Branch of this Tree or any branch in the list of fri...
Long64_t GetTotBytes(Option_t *option="") const
Return total number of bytes in the branch (excluding current buffer) if option ="*" includes all sub...
virtual void Print(Option_t *option="") const
Print TBranch parameters.
Buffer base class used for serializing objects.
Regular expression class.
TDirectory * fDirectory
Object to be notified when loading a Tree.
static const char * filename()
Bool_t IsPersistent() const
Int_t fMakeClass
Last entry number to debug.
virtual TBasket * CreateBasket(TBranch *)
Create a basket for this tree and given branch.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
virtual Int_t WriteTObject(const TObject *obj, const char *name=0, Option_t *="", Int_t=0)
See TDirectoryFile::WriteTObject for details.
void ForceWriteInfo(TFile *file, Bool_t force=kFALSE)
Recursively mark streamer infos for writing to a file.
virtual TPrincipal * Principal(const char *varexp="", const char *selection="", Option_t *option="np", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)=0
virtual void SetAutoSave(Long64_t autos=-300000000)
This function may be called at the start of a program to change the default value for fAutoSave (and ...
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
virtual Int_t ReadKeys(Bool_t=kTRUE)
virtual TTree * GetFriend(const char *) const
Return a pointer to the TTree friend whose name or alias is 'friendname.
virtual void SetAddress(void *addobj)
Point this branch at an object.
virtual Int_t MakeProxy(const char *classname, const char *macrofilename=0, const char *cutfilename=0, const char *option=0, Int_t maxUnrolling=3)
Generate a skeleton analysis class for this Tree using TBranchProxy.
virtual Long64_t GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor) const =0
Short_t Min(Short_t a, Short_t b)
virtual void SetTargetClass(const char *name)
Set the name of the class of the in-memory object into which the data will loaded.
void ToLower()
Change string to lower-case.
static TBranch * R__FindBranchHelper(TObjArray *list, const char *branchname)
Search in the array for a branch matching the branch name, with the branch possibly expressed as a 'f...
TDataType * GetDataType() const
virtual void PrintCacheStats(Option_t *option="") const
print statistics about the TreeCache for this tree, like ******TreeCache statistics for file: cms2...
Bool_t IsaPointer() const
Return true if data member is a pointer.
virtual void Browse(TBrowser *)
Browse content of the TTree.
constexpr std::array< decltype(std::declval< F >)(std::declval< int >))), N > make(F f)
virtual void SetFillStyle(Style_t fstyle)
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
TBranch * GetBranch() const
virtual Long64_t GetBasketSeek(Int_t basket) const
Return address of basket in the file.
virtual void StopLearningPhase()
This is the counterpart of StartLearningPhase() and can be used to stop the learning phase...
virtual Long64_t GetEntryNumber(Long64_t entry) const
Return entry number corresponding to entry.
virtual Long64_t GetEND() const
virtual Int_t FlushBaskets() const
Write to disk all the basket that have not yet been individually written.
Int_t GetEntriesFast() const
virtual TTree * CloneTree(Long64_t nentries=-1, Option_t *option="")
Create a clone of this tree and copy nentries.
virtual TTree * CopyTree(const char *selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Copy a tree with selection.
virtual TVirtualIndex * GetTreeIndex() const
virtual void KeepCircular()
Keep a maximum of fMaxEntries in memory.
TArrayD fIndexValues
Pointer to event selection list (if one)
Style_t GetHistFillStyle() const
void SetAutoCreated(Bool_t val)
TFile * GetCurrentFile() const
Return pointer to the current file.
virtual EDataType GetType() const =0
virtual Long64_t GetEntries(const char *)=0
TVirtualTreePlayer * GetPlayer()
Load the TTreePlayer (if not already done).
virtual void SetMaxVirtualSize(Long64_t size=0)
virtual TSQLResult * Query(const char *varexp="", const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Loop over entries and return a TSQLResult object containing entries following selection.
Streamer around an arbitrary STL like container, which implements basic container functionality...
virtual Int_t AddBranch(TBranch *b, Bool_t subgbranches=kFALSE)
Add a branch to the list of branches to be stored in the cache this function is called by TBranch::Ge...
virtual Int_t DeleteGlobal(void *obj)=0
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual void SetupAddresses()
If the branch address is not set, we set all addresses starting with the top level parent branch...
virtual void SetTree(const TTree *tree)
If a list for a tree with such name and filename exists, sets it as the current sublist If not...
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Returns an array iterator.
Iterator abstract base class.
const char * GetFullTypeName() const
Get full type description of data member, e,g.: "class TDirectory*".
virtual void Print(Option_t *option="") const
Print cache statistics.
void BypassStreamer(Bool_t bypass=kTRUE)
When the kBypassStreamer bit is set, the automatically generated Streamer can call directly TClass::W...
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Reset(Option_t *option="")
const char * GetArrayIndex() const
If the data member is pointer and has a valid array size in its comments GetArrayIndex returns a stri...
virtual Int_t Fit(const char *formula, const char *varexp, const char *selection, Option_t *option, Option_t *goption, Long64_t nentries, Long64_t firstentry)=0
virtual void Refresh()
Refresh contents of this tree and its branches from the current status on disk.
virtual void SetFileNumber(Int_t number=0)
Set fFileNumber to number.
virtual Double_t GetMinimum(const char *columname)
Return minimum of column with name columname.
virtual void DirectoryAutoAdd(TDirectory *)
Called by TKey and TObject::Clone to automatically add us to a directory when we are read from a file...
static Bool_t IsParallelUnzip()
Static function that tells wether the multithreading unzipping is activated.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
virtual void SetTree(TTree *tree)
virtual void SetDirectory(TDirectory *dir)
Add reference to directory dir. dir can be 0.
TList * GetListOfRealData() const
static void SetRefTable(TRefTable *table)
Static function setting the current TRefTable.
virtual Int_t GetN() const
virtual void StartViewer()
Start the TTreeViewer on this tree.
virtual Long64_t Merge(TCollection *list, Option_t *option="")
Merge the trees in the TList into this tree.
const char * Data() const
virtual void Print(Option_t *option="") const
Print a summary of the tree contents.
virtual void SetBranchFolder()
virtual TKey * GetKey(const char *, Short_t=9999) const
TFileCacheRead * GetCacheRead(TObject *tree=0) const
Return a pointer to the current read cache.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual Int_t GetEntryWithIndex(Int_t major, Int_t minor=0)
Read entry corresponding to major and minor number.
virtual Long64_t DrawSelect(const char *varexp, const char *selection, Option_t *option, Long64_t nentries, Long64_t firstentry)=0
virtual TObjArray * GetListOfBranches()
Helper class to iterate over cluster of baskets.
TVirtualTreePlayer * fPlayer
Double_t dot(const TVector2 &v1, const TVector2 &v2)
Fill Area Attributes class.
void ImportClusterRanges(TTree *fromtree)
Appends the cluster range information stored in 'fromtree' to this tree, including the value of fAuto...
virtual void SetAutoFlush(Long64_t autof=-30000000)
This function may be called at the start of a program to change the default value for fAutoFlush...
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Int_t GetCompressionLevel() const
virtual const char * GetTreeName() const
virtual Long64_t CopyEntries(TTree *tree, Long64_t nentries=-1, Option_t *option="")
Copy nentries from given tree to this tree.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
void SetHistFillColor(Color_t color=1)
Int_t fNfill
Number of entries in one packet for parallel root.
virtual void SetObject(const char *name, const char *title)
Change the name and title of this tree.
virtual void ReadValue(std::istream &, Char_t= ' ')
The TNamed class is the base class for all named ROOT classes.
virtual Bool_t Notify()
This method must be overridden to handle object notification.
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.
Bool_t fCacheUserSet
true if cache auto creation or resize check is needed
virtual void SetTreeIndex(TVirtualIndex *index)
The current TreeIndex is replaced by the new index.
static Int_t GetBranchStyle()
Static function returning the current branch style.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
virtual Int_t BuildIndex(const char *majorname, const char *minorname="0")
Build a Tree Index (default is TTreeIndex).
virtual Int_t UnbinnedFit(const char *funcname, const char *varexp, const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Unbinned fit of one or more variable(s) from a tree.
virtual Bool_t SetMakeClass(Bool_t decomposeObj=kTRUE)
Set the branch in a mode where the object are decomposed (Also known as MakeClass mode)...
virtual TBranch * BranchOld(const char *name, const char *classname, void *addobj, Int_t bufsize=32000, Int_t splitlevel=1)
Create a new TTree BranchObject.
TClass * GetActualClass(const void *object) const
Return a pointer the the real class of the object.
virtual void Show(Long64_t entry=-1, Int_t lenmax=20)
Print values of all active leaves for entry.
std::map< std::string, std::string >::const_iterator iter
virtual Int_t GetBufferSize() const
virtual TBranch * FindBranch(const char *name)
Find the immediate sub-branch with passed name.
TBranchRef * fBranchRef
List of cloned trees which share our addresses.
virtual Int_t MakeClass(const char *classname=0, Option_t *option="")
Generate a skeleton analysis class for this tree.
virtual const char * Getenv(const char *env)
Get environment variable.
virtual TClusterIterator GetClusterIterator(Long64_t firstentry)
Return an iterator over the cluster of baskets starting at firstentry.
virtual void SetMarkerColor(Color_t mcolor=1)
const Int_t kDoNotProcess
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
virtual Int_t MakeClass(const char *classname, const char *option)=0
Long64_t GetEntries() const
virtual TFriendElement * AddFriend(const char *treename, const char *filename="")
Add a TFriendElement to the list of friends.
Long64_t GetZipBytes(Option_t *option="") const
Return total number of zip bytes in the branch if option ="*" includes all sub-branches of this branc...
Bool_t IsWritable() const
virtual Long64_t Scan(const char *varexp="", const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Loop over tree entries and print entries passing selection.
TObjArray * GetListOfBranches()
Specialization of TTreeCache for parallel Unzipping.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Delete(Option_t *option="")
Delete an object from the file.
virtual Double_t GetMaximum(const char *columname)
Return maximum of column with name columname.
void Set(Int_t n)
Set size of this array to n ints.
virtual void RemoveFriend(TTree *)
Remove a friend from the list of friends.
virtual void SetAddress(void *add=0)
virtual TList * GetUserInfo()
Return a pointer to the list containing user objects associated to this tree.
virtual void SetCacheLearnEntries(Int_t n=10)
Interface to TTreeCache to set the number of entries for the learning phase.
A branch containing and managing a TRefTable for TRef autoloading.
Long64_t fDebugMax
First entry number to debug.
virtual Double_t GetValue(Int_t i=0) const
virtual TBranch * BranchImp(const char *branchname, const char *classname, TClass *ptrClass, void *addobj, Int_t bufsize, Int_t splitlevel)
Same as TTree::Branch() with added check that addobj matches className.
virtual void SetEventList(TEventList *list)
This function transfroms the given TEventList into a TEntryList The new TEntryList is owned by the TT...
void Expand(Int_t newsize, Bool_t copy=kTRUE)
Expand (or shrink) the I/O buffer to newsize bytes.
ClassImp(TTree) static char DataTypeToChar(EDataType datatype)
void UseCurrentStyle()
Replace current attributes by current style.
A specialized string object used for TTree selections.
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
Bool_t fCacheDoAutoInit
Pointer to the current transient buffer.
virtual TFile * GetFile() const
Int_t GetRecordHeader(char *buf, Long64_t first, Int_t maxbytes, Int_t &nbytes, Int_t &objlen, Int_t &keylen)
Read the logical record header starting at a certain postion.
virtual Int_t GetMaximum() const
virtual Int_t Fill()
Loop on all leaves of this branch to fill Basket buffer.
TObject * UncheckedAt(Int_t i) const
Long64_t * fClusterRangeEnd
static TVirtualTreePlayer * TreePlayer(TTree *obj)
virtual Long64_t GetTotBytes() const
virtual void SetLineColor(Color_t lcolor)
void BuildRealData(void *pointer=0, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
Int_t GetBufferSize() const
Using a TBrowser one can browse all ROOT objects.
virtual Long64_t GetEntry(Int_t index) const
Return value of entry at index in the list.
Bool_t HasRuleWithSourceClass(const TString &source) const
Return True if we have any rule whose source class is 'source'.
virtual char * GetAddress() const
TEntryList * fEntryList
Pointer to event selection list (if one)
void SetParentClass(TClass *clparent)
virtual Size_t GetMarkerSize() const
virtual void SetEntryRange(Long64_t emin, Long64_t emax)
Set the minimum and maximum entry number to be processed this information helps to optimize the numbe...
const char * GetTypeName() const
Get type of data member, e,g.: "class TDirectory*" -> "TDirectory".
Option_t * GetOption() const
Returns the object option stored in the list.
Color_t GetHistFillColor() const
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
TVirtualStreamerInfo * FindConversionStreamerInfo(const char *onfile_classname, UInt_t checksum) const
Return a Conversion StreamerInfo from the class 'classname' for the layout represented by 'checksum' ...
virtual void SetEstimate(Long64_t nentries=1000000)
Set number of entries to estimate variable limits.
Width_t GetHistLineWidth() const
virtual void SetOffset(Int_t offset=0)
virtual Long64_t Process(const char *filename, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)=0
virtual void UpdateFormulaLeaves()=0
virtual Int_t DropBranch(TBranch *b, Bool_t subbranches=kFALSE)
Remove a branch to the list of branches to be stored in the cache this function is called by TBranch:...
void SetHistFillStyle(Style_t styl=0)
TObjArray * GetElements() const
void SetCompressionSettings(Int_t settings=1)
Set compression settings.
R__EXTERN TSystem * gSystem
Long64_t fChainOffset
Maximum size of file buffers.
~TFriendLock()
Restore the state of tree the same as before we set the lock.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
Bool_t EqualTo(const char *cs, ECaseCompare cmp=kExact) const
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
virtual void WriteStreamerInfo()
Write the list of TStreamerInfo as a single object in this file The class Streamer description for al...
virtual void SetFillColor(Color_t fcolor)
Basic data type descriptor (datatype information is obtained from CINT).
void TFriendElement__SetTree(TTree *tree, TList *frlist)
Set the fTree member for all friend elements.
TVirtualPerfStats * fPerfStats
virtual Int_t GetTreeNumber() const
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const =0
virtual TObject * RemoveAt(Int_t idx)
Remove object at index idx.
TDirectory * GetDirectory() const
TVirtualStreamerInfo * GetConversionStreamerInfo(const char *onfile_classname, Int_t version) const
Return a Conversion StreamerInfo from the class 'classname' for version number 'version' to this clas...
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual Int_t ReadTObject(TObject *, const char *)
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Long64_t fReadEntry
Offset of 1st entry of this Tree in a TChain.
virtual Bool_t HasPointers() const =0
virtual ~TTree()
Destructor.
virtual Color_t GetFillColor() const
Collection abstract base class.
virtual const char * GetAlias(const char *aliasName) const
Returns the expanded value of the alias. Search in the friends if any.
TObject * GetObject() const
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
TBranch * GetMother() const
Get our top-level parent branch in the tree.
TList * fUserInfo
pointer to the current perf stats object
TObjArray fBranches
Pointer to directory holding this tree.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t TestBit(UInt_t f) const
virtual Long64_t GetN() const =0
static void SetMaxTreeSize(Long64_t maxsize=1900000000)
Set the maximum size in bytes of a Tree file (static function).
virtual Long64_t GetEntry(Int_t index)
Return the number of the entry #index of this TEntryList in the TTree or TChain See also Next()...
virtual void MakeFree(Long64_t first, Long64_t last)
Mark unused bytes on the file.
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
Manages buffers for branches of a Tree.
virtual TBranchRef * GetBranchRef() const
A TEventList object is a list of selected events (entries) in a TTree.
virtual TLeaf * FindLeaf(const char *name)
Find leaf..
The TRealData class manages the effective list of all data members for a given class.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
virtual Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor=0) const
Return entry number corresponding to major and minor number.
Bool_t CanIgnoreTObjectStreamer()
virtual const char * GetName() const
Returns name of object.
TSubString Strip(EStripType s=kTrailing, char c= ' ') const
Return a substring of self stripped at beginning and/or end.
The ROOT global object gROOT contains a list of all defined classes.
virtual void SetMarkerStyle(Style_t mstyle=1)
static void SetLearnEntries(Int_t n=10)
Static function to set the number of entries to be used in learning mode The default value for n is 1...
Version_t GetClassVersion() const
virtual TObjLink * FirstLink() const
void SetName(const char *name)
virtual void ResetBranchAddress(TBranch *)
Tell all of our branches to set their addresses to zero.
virtual Color_t GetLineColor() const
virtual TBranch * Bronch(const char *name, const char *classname, void *addobj, Int_t bufsize=32000, Int_t splitlevel=99)
Create a new TTree BranchElement.
virtual void SetMarkerSize(Size_t msize=1)
Long64_t fMaxEntries
Memory allocated for the cluster range.
void AddClone(TTree *)
Add a cloned tree to our list of trees to be notified whenever we change our branch addresses or when...
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
virtual void KeepCircular(Long64_t maxEntries)
keep a maximum of fMaxEntries in memory
virtual TLeaf * GetLeafCount() const
Each class (see TClass) has a linked list of its base class(es).
char GetNewlineValue(std::istream &inputStream)
Determine which newline this file is using.
A Branch for the case of an object.
virtual Int_t DropBranchFromCache(const char *bname, Bool_t subbranches=kFALSE)
Remove the branch with name 'bname' from the Tree cache.
Int_t GetCompressionSettings() const
virtual void SaveSelf(Bool_t=kFALSE)
virtual void SetBasketSize(Int_t buffsize)
Set the basket size The function makes sure that the basket size is greater than fEntryOffsetlen.
virtual Int_t CheckBranchAddressType(TBranch *branch, TClass *ptrClass, EDataType datatype, Bool_t ptr)
Check whether or not the address described by the last 3 parameters matches the content of the branch...
virtual void SetDebug(Int_t level=1, Long64_t min=0, Long64_t max=9999999)
Set the debug level and the debug range.
virtual Long64_t Process(const char *filename, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Process this tree executing the TSelector code in the specified filename.
TString & Remove(Ssiz_t pos)
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
virtual Int_t GetBasketSize() const
virtual Long64_t ReadStream(std::istream &inputStream, const char *branchDescriptor="", char delimiter= ' ')
Create or simply read branches from an input stream.
virtual void DropBuffers(Int_t nbytes)
Drop branch buffers to accommodate nbytes below MaxVirtualsize.
virtual Int_t Fill()
Fill the branch basket with the referenced objects parent numbers.
virtual void SetMakeClass(Int_t make)
Set all the branches in this TTree to be in decomposed object mode (also known as MakeClass mode)...
virtual void SetWeight(Double_t w=1, Option_t *option="")
Set tree weight.
Long64_t Next()
Move on to the next cluster and return the starting entry of this next cluster.
virtual Int_t GetSize() const
virtual void SetDirectory(TDirectory *dir)
Change the tree's directory.
virtual Long64_t LoadTreeFriend(Long64_t entry, TTree *T)
Load entry on behalf of our master tree, we may use an index.
virtual void SetEstimate(Long64_t n)=0
virtual Long64_t GetAutoFlush() const
virtual TObject * Remove(TObject *)
Remove an object from the in-memory list.
TCollection * GetListOfFolders() const
virtual void StartViewer(Int_t ww, Int_t wh)=0
virtual void SetEntryList(TEntryList *list, Option_t *opt="")
Set an EntryList.
TIterator & operator=(const TIterator &rhs)
Overridden assignment operator. Does NOT copy the 'cursor' location!
virtual void ResetAddress()
Reset the address of the branch.
virtual const char * GetName() const
Returns name of object.
virtual void Clear(Option_t *option="")
Clear entries in the TRefTable.
static TRefTable * GetRefTable()
Static function returning the current TRefTable.
void SetHistLineStyle(Style_t styl=0)
virtual void WaitFinishPrefetch()
TClass * GetClass() const
Describe directory structure in memory.
virtual void SetPerfStats(TVirtualPerfStats *perf)
Set perf stats.
static void TBranch__SetTree(TTree *tree, TObjArray &branches)
Set the fTree member for all branches and sub branches.
Wrapper around a TObject so it can be stored in a TList.
virtual Long64_t GetEntriesFast() const
unsigned long long ULong64_t
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
virtual void ResetBranchAddresses()
Tell all of our branches to drop their current objects and allocate new ones.
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
virtual void SetObject(void *objadd)
Set object this branch is pointing to.
A TRefTable maintains the association between a referenced object and the parent object supporting th...
Int_t fDefaultEntryOffsetLen
virtual TTree * GetTree() const
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
Color_t GetHistLineColor() const
TObjArray * GetListOfLeaves()
Int_t GetEntries() const
Return the number of objects in array (i.e.
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
static void SetUnzipRelBufferSize(Float_t relbufferSize)
static function: Sets the unzip relatibe buffer size
Helper class to prevent infinite recursion in the usage of TTree Friends.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual Int_t SetBufferSize(Int_t buffersize)
Change the underlying buffer size of the cache.
virtual Int_t SetCacheSize(Long64_t cachesize=-1)
Set maximum size of the file cache .
Int_t fDebug
Local for EntryLoop.
virtual Int_t UnbinnedFit(const char *formula, const char *varexp, const char *selection, Option_t *option, Long64_t nentries, Long64_t firstentry)=0
Int_t SetCacheSizeAux(Bool_t autocache=kTRUE, Long64_t cacheSize=0)
Set the size of the file cache and create it if possible.
virtual void SetLineStyle(Style_t lstyle)
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
virtual void SetBasketSize(const char *bname, Int_t buffsize=16000)
Set a branch's basket size.
virtual TFile * GetFile()
Return pointer to TFile containing this friend TTree.
virtual TBranch * BranchRef()
Build the optional branch supporting the TRefTable.
virtual void ResetAfterMerge(TFileMergeInfo *)
Resets the state of this TTree after a merge (keep the customization but forget the data)...
virtual Bool_t SetAlias(const char *aliasName, const char *aliasFormula)
Set a tree variable alias.
Int_t fFileNumber
not zero when processing code generated by MakeClass
Mother of all ROOT objects.
virtual Long64_t ReadFile(const char *filename, const char *branchDescriptor="", char delimiter= ' ')
Create or simply read branches from filename.
A Branch handling STL collection of pointers (vectors, lists, queues, sets and multisets) while stori...
static void * ReAlloc(void *vp, size_t size)
Reallocate (i.e.
virtual Int_t Branch(TCollection *list, Int_t bufsize=32000, Int_t splitlevel=99, const char *name="")
Create one branch for each element in the collection.
TDirectory * fOutputDirectory
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual void SetEntryOffsetLen(Int_t len, Bool_t updateSubBranches=kFALSE)
Update the default value for the branch's fEntryOffsetLen if and only if it was already non zero (and...
virtual Long64_t Scan(const char *varexp, const char *selection, Option_t *option, Long64_t nentries, Long64_t firstentry)=0
virtual void SetFile(TFile *file=0)
Set file where this branch writes/reads its buffers.
TList * fClones
Pointer to current Tree player.
Int_t GetMaxBaskets() const
virtual void Refresh(TBranch *b)
Refresh this branch using new information in b This function is called by TTree::Refresh.
virtual Int_t MakeSelector(const char *selector=0, Option_t *option="")
Generate skeleton selector class for this tree.
An array of clone (identical) objects.
TBuffer * GetTransientBuffer(Int_t size)
Returns the transient buffer currently used by this TTree for reading/writing baskets.
virtual Color_t GetMarkerColor() const
virtual TDirectory * GetDirectory() const
Class implementing or helping the various TTree cloning method.
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
virtual Int_t DropBuffers()
Drop buffers of this basket if it is not the current basket.
ROOT::ESTLType IsSTLContainer()
Return which type (if any) of STL container the data member is.
Abstract base class defining the interface for the plugins that implement Draw, Scan, Process, MakeProxy, etc.
A Branch for the case of an array of clone objects.
virtual void * GetValuePointer() const
virtual void Add(TObject *obj)
TClusterIterator(TTree *tree, Long64_t firstEntry)
Regular constructor.
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
Short_t Max(Short_t a, Short_t b)
virtual void Reset(Option_t *option="")
Reset a Branch.
A TFriendElement TF describes a TTree object TF in a file.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual Bool_t IsWritable() const
virtual const char * GetMinorName() const =0
Iterator on all the leaves in a TTree and its friend.
virtual TBranch * BronchExec(const char *name, const char *classname, void *addobj, Bool_t isptrptr, Int_t bufsize, Int_t splitlevel)
Helper function implementing TTree::Bronch and TTree::Branch(const char *name, T &obj);.
virtual void RecursiveRemove(TObject *obj)
Make sure that obj (which is being deleted or will soon be) is no longer referenced by this TTree...
virtual Int_t LoadBaskets()
Baskets associated to this branch are forced to be in memory.
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
virtual void SetCircular(Long64_t maxEntries)
Enable/Disable circularity for this tree.
virtual void Reset(Option_t *option="")
Reset baskets, buffers and entries count in all branches and leaves.
virtual const char * GetMajorName() const =0
ROOT::ESTLType GetCollectionType() const
Return the 'type' of the STL the TClass is representing.
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
TObject * fNotify
current file number (if file extensions)
virtual Int_t SetCacheEntryRange(Long64_t first, Long64_t last)
interface to TTreeCache to set the cache entry range
virtual Long64_t GetEntries() const
A TTree object has a header with a name and a title.
TVirtualIndex * fTreeIndex
TFriendLock & operator=(const TFriendLock &)
Assignment operator.
Int_t SetBranchAddressImp(TBranch *branch, void *addr, TBranch **ptr)
Change branch address, dealing with clone trees properly.
TDataMember * GetDataMember() const
virtual TVirtualIndex * BuildIndex(const TTree *T, const char *majorname, const char *minorname)=0
virtual void SetDefaultEntryOffsetLen(Int_t newdefault, Bool_t updateExisting=kFALSE)
Update the default value for the branch's fEntryOffsetLen.
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
Int_t GetMakeClass() const
virtual TObject ** GetObjectRef(const TObject *obj) const =0
TObject * Next()
Go the next friend element.
virtual void DropBaskets()
Remove some baskets from memory.
Int_t FlushBaskets()
Flush to disk all the baskets of this branch and any of subbranches.
Bool_t HasDataMemberInfo() const
virtual TSQLResult * Query(const char *varexp, const char *selection, Option_t *option, Long64_t nentries, Long64_t firstentry)=0
virtual TIterator * GetIteratorOnAllLeaves(Bool_t dir=kIterForward)
Creates a new iterator that will go through all the leaves on the tree itself and its friend...
static Long64_t fgMaxTreeSize
TObject * At(Int_t idx) const
virtual void WriteHeader()
Write File Header.
virtual Long64_t GetEntryNumberFriend(const TTree *)=0
virtual TFile * GetFile(Int_t mode=0)
Return pointer to the file where branch buffers reside, returns 0 in case branch buffers reside in th...
virtual Long64_t SetEntries(Long64_t n=-1)
Change number of entries in the tree.
R__EXTERN TInterpreter * gCling
virtual void Compress()
Remove empty slots from array.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual TFile * ChangeFile(TFile *file)
Called by TTree::Fill() when file has reached its maximum fgMaxTreeSize.
virtual Int_t Occurence(const TObject *obj) const
Return occurence number of object in the list of objects of this folder.
static TTree * MergeTrees(TList *list, Option_t *option="")
Static function merging the trees in the TList into a new tree.
A TTree is a list of TBranches.
virtual Bool_t GetBranchStatus(const char *branchname) const
Return status of branch with name branchname.
virtual Style_t GetMarkerStyle() const
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
virtual Width_t GetLineWidth() const
virtual const char * GetName() const
Returns name of object.
Long_t GetThisOffset() const
virtual const char * GetTitle() const
Returns title of object.
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
void SetHistLineColor(Color_t color=1)
A List of entry numbers in a TTree or TChain.
virtual Long64_t GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor=0) const
Return entry number corresponding to major and minor number.
virtual Int_t AddBranchToCache(const char *bname, Bool_t subbranches=kFALSE)
Add branch with name bname to the Tree cache.
Int_t fPacketSize
Total number of bytes in branch buffers.
void Set(Int_t n)
Set size of this array to n doubles.
virtual Long64_t Project(const char *hname, const char *varexp, const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Make a projection of a tree using selections.
virtual Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor) const =0
Int_t GetWriteBasket() const
Long64_t BinarySearch(Long64_t n, const T *array, T value)
const type_info * GetTypeInfo() const
TFriendLock(const TFriendLock &)
Copy constructor.
Ssiz_t First(char c) const
Find first occurrence of a character c.
virtual void SetObject(void *objadd)
Set object this branch is pointing to.
Int_t GetReadBasket() const
virtual void SetName(const char *name)
Change the name of this tree.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
Long64_t GetEstimatedClusterSize()
In the case where the cluster size was not fixed (old files and case where autoflush was explicitly s...
void MoveReadCache(TFile *src, TDirectory *dir)
Move a cache from a file to the current file in dir.
virtual void CopyAddresses(TTree *, Bool_t undo=kFALSE)
Set branch addresses of passed tree equal to ours.
virtual TObjArray * GetListOfLeaves()
static void ResetCount()
Static function resetting fgCount.
virtual void Print(Option_t *option="") const
Print the TRefTable branch.
virtual Long64_t AutoSave(Option_t *option="")
AutoSave tree header every fAutoSave bytes.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.