112class TDimensionInfo :
public TObject {
119 : fCode(code), fOper(oper), fSize(size), fMultiDim(multiDim) {};
120 ~TDimensionInfo() {};
126 fDidBooleanOptimization(
kFALSE), fDimensionSetup(0)
160 fDidBooleanOptimization(
kFALSE), fDimensionSetup(0)
169 const std::vector<std::string>& aliases)
171 fDidBooleanOptimization(
kFALSE), fDimensionSetup(0), fAliasesUsed(aliases)
211 if(savedir) savedir->
cd();
216 Warning(
"TTreeFormula",
"Too many items in expression:%s",expression);
226 if (!leafc)
continue;
269 for(k0 = 0; k0 <
fNcodes; k0++) {
274 Error(
"TTreeFormula",
275 "Index %d for dimension #%d in %s is too high (max is %d)",
278 if(savedir) savedir->
cd();
307 if (readentry >= 0) {
312 if (readentry >= 0) {
319 if(savedir) savedir->
cd();
341 for (
int j=0; j<
fNcodes; j++) {
369 bool scalarindex =
false;
375 switch (index_multiplicity) {
406 const char * current;
407 Int_t size, scanindex, vardim;
415 if (current[0] !=
'[') current--;
418 scanindex = sscanf(current,
"%d",&size);
422 if (scanindex==0) size = -1;
431 current = (
char*)strstr( current,
"[" );
441 TDimensionInfo * info =
new TDimensionInfo(code,
fNoper,size,multidim);
445 return (size==-1) ? 1 : 0;
453 Bool_t useCollectionObject) {
454 Int_t ndim, size, current, vardim;
486 if (maininfo==0 || maininfo==leafinfo || 1) {
492 delete currentinfo->
fNext;
517 }
else if (
c &&
c->GetReferenceProxy() &&
c->GetReferenceProxy()->HasCounter() ) {
548 }
while (current<ndim);
585 Int_t numberOfVarDim = 0;
590 const char *tname = leaf->
GetTitle();
591 char *leaf_dim = (
char*)strstr( tname,
"[" );
594 char *branch_dim = (
char*)strstr(bname,
"[");
595 if (branch_dim) branch_dim++;
607 if (!branch_dim || strncmp(branch_dim,leaf_dim,strlen(branch_dim))) {
610 }
else if (branch_dim && strncmp(branch_dim,leaf_dim,strlen(branch_dim))==0
611 && strlen(leaf_dim)>strlen(branch_dim)
612 && (leaf_dim+strlen(branch_dim))[0]==
'[') {
631 "Noticed an incorrect in-memory TBranchElement object (%s).\nIt has a BranchCount2 but no BranchCount!\nThe result might be incorrect!",
633 return numberOfVarDim;
639 "Already in kDataMember mode when handling multiple variable dimensions");
647 return numberOfVarDim;
660 static const char *altfunc =
"Alt$(";
661 static const char *minfunc =
"MinIf$(";
662 static const char *maxfunc =
"MaxIf$(";
666 if ( strncmp(expression,altfunc,strlen(altfunc))==0
667 && expression[strlen(expression)-1]==
')' ) {
669 start = strlen(altfunc);
671 if ( strncmp(expression,maxfunc,strlen(maxfunc))==0
672 && expression[strlen(expression)-1]==
')' ) {
674 start = strlen(maxfunc);
676 if ( strncmp(expression,minfunc,strlen(minfunc))==0
677 && expression[strlen(expression)-1]==
')' ) {
679 start = strlen(minfunc);
689 for(
unsigned int i=start;i<strlen(expression);++i) {
690 switch (expression[i]) {
691 case '(': paran++;
break;
692 case ')': paran--;
break;
693 case '"': instr = instr ? 0 : 1;
break;
694 case '[': brack++;
break;
695 case ']': brack--;
break;
697 if (expression[i]==
',' && paran==0 && instr==0 && brack==0) {
698 part1 = full( start, i-start );
699 part2 = full( i+1, full.
Length() -1 - (i+1) );
711 Error(
"DefinedVariable",
"The 2nd arguments in %s can not be an array (%s,%d)!",
720 Error(
"DefinedVariable",
721 "The 2nd arguments in %s has to return the same type as the 1st argument (string)!",
727 Error(
"DefinedVariable",
728 "The 2nd arguments in %s has to return the same type as the 1st argument (numerical type)!",
737 Error(
"DefinedVariable",
738 "The arguments of %s can not be strings!",
769 Int_t numberOfVarDim = 0;
772 char scratch[
kMaxLen]; scratch[0] =
'\0';
773 char work[
kMaxLen]; work[0] =
'\0';
775 const char *right = subExpression;
780 if (readentry < 0) readentry=0;
782 Bool_t useLeafReferenceObject =
false;
793 Error(
"DefinedVariable",
"Missing StreamerInfo for %s. We will be unable to read!",
805 Error(
"DefinedVariable",
"Missing StreamerInfo for %s."
806 " We will be unable to read!",
811 Error(
"DefinedVariable",
"Address not set when the type of the branch is negative for for %s. We will be unable to read!", mom->
GetName());
824 const char* alias = 0;
827 if (!alias && realtree!=
fTree) {
835 TTree *tleaf = realtree;
842 if (mother_name[strlen(mother_name)-1]!=
'.') {
843 br_extended_name = mother_name;
844 br_extended_name.
Append(
'.');
849 if (dim >= 0) br_extended_name.
Remove(dim);
937 "Missing TStreamerElement in object in TClonesArray section");
948 maininfo = clonesinfo;
967 maininfo->
fNext = previnfo;
968 unwindCollection =
kTRUE;
970 }
else if (branchEl->
GetType()==41) {
975 Warning(
"DefinedVariable",
"Missing TStreamerElement in object in Collection section");
981 if ( count->
GetID() >= 0 ) {
1000 maininfo = collectioninfo;
1019 maininfo->
fNext = previnfo;
1020 unwindCollection =
kTRUE;
1022 }
else if ( branchEl->
GetType()==3) {
1024 if (useLeafCollectionObject) {
1029 numberOfVarDim +=
RegisterDimensions(code,clonesinfo,maininfo,useLeafCollectionObject);
1032 maininfo = clonesinfo;
1033 previnfo = maininfo;
1035 }
else if (!useLeafCollectionObject && branchEl->
GetType()==4) {
1038 if (useLeafCollectionObject) {
1043 numberOfVarDim +=
RegisterDimensions(code,collectioninfo,maininfo,useLeafCollectionObject);
1046 maininfo = collectioninfo;
1047 previnfo = maininfo;
1051 if (useLeafCollectionObject) {
1054 maininfo = collectioninfo;
1055 previnfo = collectioninfo;
1062 maininfo = collectioninfo;
1063 previnfo = collectioninfo;
1073 previnfo->
fNext = multi;
1076 previnfo = multi->
fNext;
1084 previnfo = previnfo->
fNext;
1090 }
else if (strlen(right)==0 && cl && element &&
final) {
1093 if (!useLeafCollectionObject
1104 maininfo = collectioninfo;
1105 previnfo = collectioninfo;
1114 previnfo->
fNext = multi;
1117 previnfo = multi->
fNext;
1124 previnfo = previnfo->
fNext;
1127 }
else if (!useLeafCollectionObject
1143 collectioninfo->
fNext =
1146 maininfo = collectioninfo;
1147 previnfo = maininfo->
fNext;
1149 }
else if (!useLeafCollectionObject
1160 previnfo = maininfo;
1165 if ( useLeafCollectionObject || fullExpression[0] ==
'@' || fullExpression[strlen(scratch)] ==
'@' ) {
1166 useLeafReferenceObject =
true;
1183 Error(
"DefinedVariable",
"Failed to access class type of reference target (%s)",element->
GetName());
1194 if (unwindCollection) {
1197 R__ASSERT(numberOfVarDim==1 && maininfo);
1204 previnfo->
fNext = multi;
1207 previnfo = multi->
fNext;
1214 previnfo = previnfo->
fNext;
1222 previnfo->
fNext = multi;
1225 previnfo = multi->
fNext;
1234 Int_t nchname = strlen(right);
1249 Error(
"DefinedVariable",
"%s does not inherit from %s. Casting not possible!",
1256 maininfo = leafinfo;
1259 previnfo = leafinfo;
1261 previnfo->
fNext = leafinfo;
1262 previnfo = leafinfo;
1267 castqueue.
AddAt(0,paran_level);
1271 Bool_t prevUseCollectionObject = useLeafCollectionObject;
1272 Bool_t useCollectionObject = useLeafCollectionObject;
1273 Bool_t useReferenceObject = useLeafReferenceObject;
1274 Bool_t prevUseReferenceObject = useLeafReferenceObject;
1275 for (i=0, current = &(work[0]); i<=nchname;i++ ) {
1277 if (right[i] ==
'(') {
1280 *current++ = right[i++];
1281 }
while(right[i]!=
')' && right[i]);
1282 *current++ = right[i];
1284 char *params = strchr(work,
'(');
1286 *params = 0; params++;
1287 }
else params = (
char *)
")";
1289 Error(
"DefinedVariable",
"Can not call '%s' with a class",work);
1293 Error(
"DefinedVariable",
"Class probably unavailable:%s",cl->
GetName());
1320 previnfo = clonesinfo;
1321 maininfo = clonesinfo;
1353 previnfo = collectioninfo;
1354 maininfo = collectioninfo;
1359 if (inside_cl) cl = inside_cl;
1361 Warning(
"DefinedVariable",
"Can not call method on content of %s in %s\n",
1368 Error(
"DefinedVariable",
1369 "Could not discover the TClass corresponding to (%s)!",
1373 method =
new TMethodCall(cl,
"GetEntriesFast",
"");
1377 if (useLeafCollectionObject) {
1383 maininfo=previnfo=collectioninfo;
1389 Error(
"DefinedVariable",
1390 "Can not call method %s on class without dictionary (%s)!",
1398 Error(
"DefinedVariable",
"Unknown method:%s in %s",right,cl->
GetName());
1423 Error(
"DefineVariable",
"Method %s from %s has an impossible return type %d",
1429 maininfo = leafinfo;
1432 previnfo = leafinfo;
1434 previnfo->
fNext = leafinfo;
1435 previnfo = leafinfo;
1438 current = &(work[0]);
1440 prevUseCollectionObject =
kFALSE;
1441 prevUseReferenceObject =
kFALSE;
1442 useCollectionObject =
kFALSE;
1445 if (numberOfVarDim>1) {
1446 Warning(
"DefinedVariable",
"TTreeFormula support only 2 level of variables size collections. Assuming '@' notation for the collection %s.",
1449 useCollectionObject =
kTRUE;
1450 }
else if (numberOfVarDim==0) {
1454 }
else if (numberOfVarDim==1) {
1459 previnfo->
fNext = leafinfo;
1460 previnfo = leafinfo;
1466 previnfo->
fNext = leafinfo;
1467 previnfo = leafinfo;
1471 }
else if (right[i] ==
')') {
1474 TClass * casted = (
TClass*) ((
int(--paran_level)>=0) ? castqueue.
At(paran_level) : 0);
1480 maininfo = leafinfo;
1483 previnfo = leafinfo;
1485 previnfo->
fNext = leafinfo;
1486 previnfo = leafinfo;
1489 current = &(work[0]);
1496 }
else if (i > 0 && (right[i] ==
'.' || right[i] ==
'[' || right[i] ==
'\0') ) {
1503 if (strlen(work)==0)
continue;
1505 prevUseCollectionObject = useCollectionObject;
1506 prevUseReferenceObject = useReferenceObject;
1508 useReferenceObject =
kTRUE;
1509 useCollectionObject =
kTRUE;
1511 for(
l=0;work[
l+1]!=0;++
l) work[
l] = work[
l+1];
1513 }
else if (work[strlen(work)-1]==
'@') {
1514 useReferenceObject =
kTRUE;
1515 useCollectionObject =
kTRUE;
1516 work[strlen(work)-1] =
'\0';
1518 useReferenceObject =
kFALSE;
1519 useCollectionObject =
kFALSE;
1530 prevUseReferenceObject =
kFALSE;
1533 previnfo = previnfo->
fNext;
1537 for(
Long64_t entry=0; entry<leaf->
GetBranch()->GetEntries()-readentry; ++entry) {
1575 previnfo = clonesinfo;
1576 maininfo = clonesinfo;
1580 Error(
"DefinedVariable",
"Unimplemented usage of ClonesArray");
1591 "TClonesArray object was not retrievable for %s!",
1600 if (1 || inside_cl) cl = inside_cl;
1602 if (0 && strlen(work)==0) {
1636 previnfo = collectioninfo;
1637 maininfo = collectioninfo;
1646 Error(
"DefinedVariable",
"Could you not find the inner class for %s with coll type = %d",
1650 Warning(
"DefinedVariable",
"No data member in content of %s in %s\n",
1659 Warning(
"DefinedVariable",
"Missing class for %s!",
name.Data());
1664 if (!element && !prevUseCollectionObject) {
1671 Int_t clones_offset = 0;
1679 previnfo->
fNext = clonesinfo;
1681 previnfo->
fNext = 0;
1693 if (maininfo==0) maininfo = leafinfo;
1694 if (previnfo==0) previnfo = leafinfo;
1696 previnfo->
fNext = leafinfo;
1697 previnfo = leafinfo;
1705 Int_t coll_offset = 0;
1714 if (numberOfVarDim>1) {
1715 Warning(
"DefinedVariable",
"TTreeFormula support only 2 level of variables size collections. Assuming '@' notation for the collection %s.",
1718 useCollectionObject =
kTRUE;
1719 }
else if (numberOfVarDim==1) {
1731 if (maininfo==0) maininfo = leafinfo;
1732 if (previnfo==0) previnfo = leafinfo;
1734 previnfo->
fNext = leafinfo;
1735 previnfo = leafinfo;
1737 if (leafinfo->
fNext) {
1738 previnfo = leafinfo->
fNext;
1753 if (numberOfVarDim>=1 &&
type>40) {
1758 if (leafinfo &&
type<=40 ) {
1798 Error(
"DefinedVariable",
1799 "%s is a datamember of %s BUT is not yet of a supported type (%d)",
1804 Error(
"DefinedVariable",
1805 "%s is a datamember of %s BUT is not of a unknown type (%d)",
1810 if (
object && !useCollectionObject &&
1816 if (
object && leafinfo) {
1818 }
else if (objarr) {
1833 if (numberOfVarDim>1) {
1834 Warning(
"DefinedVariable",
"TTreeFormula support only 2 level of variables size collections. Assuming '@' notation for the collection %s.",
1837 useCollectionObject =
kTRUE;
1838 }
else if (numberOfVarDim==1) {
1858 else leafinfo->
fNext = info;
1865 if (!maininfo) maininfo = leafinfo;
1870 if (previnfo==0) previnfo = leafinfo;
1872 previnfo->
fNext = leafinfo;
1873 previnfo = leafinfo;
1888 else leafinfo->
fNext = info;
1904 prevUseReferenceObject =
kFALSE;
1907 }
else if (pointer) {
1919 if (cl)
Error(
"DefinedVariable",
"%s is not a datamember of %s",work,cl->
GetName());
1926 maininfo = leafinfo;
1929 previnfo = leafinfo;
1930 }
else if (previnfo!=leafinfo) {
1931 previnfo->
fNext = leafinfo;
1932 previnfo = leafinfo;
1934 while (previnfo->
fNext) previnfo = previnfo->
fNext;
1936 if ( right[i] !=
'\0' ) {
1937 if ( !needClass && mustderef ) {
1943 if ( inf->IsReference() ) {
1954 Error(
"DefinedVariable",
"Failed to access class type of reference target (%s)",element->
GetName());
1960 Error(
"DefinedVariable",
"Failed to access class type of reference target (%s)",element->
GetName());
1964 else if ( needClass ) {
1968 if (mustderef) leafinfo = 0;
1969 current = &(work[0]);
1978 nchname = strlen(right);
1982 *current++ = right[i];
1991 if (strlen(work)!=0) {
2003 if (!last)
return action;
2007 if (last && last->
GetClass() != objClass) {
2019 last->
fNext = collectioninfo;
2031 if (!last)
return action;
2035 const char *funcname = 0;
2039 }
else if (objClass == stdStringClass) {
2082 method =
new TMethodCall(objClass,
"AsString",
"");
2135 const char *funcname = 0;
2138 }
else if (objClass == stdStringClass) {
2178 if (readentry < 0) readentry=0;
2179 const char *cname = expression;
2182 char right[
kMaxLen*2]; right[0] =
'\0';
2183 char work[
kMaxLen]; work[0] =
'\0';
2184 char left[
kMaxLen]; left[0] =
'\0';
2187 std::string currentname;
2188 Int_t previousdot = 0;
2191 TBranch *branch=0, *tmp_branch=0;
2192 Int_t nchname = strlen(cname);
2197 for (i=0, current = &(work[0]); i<=nchname && !
final;i++ ) {
2199 *current++ = cname[i];
2201 if (cname[i] ==
'(') {
2204 if (current==work+1) {
2207 startWithParan =
kTRUE;
2219 if (cname[i] ==
')') {
2220 if (paran_level==0) {
2221 Error(
"DefinedVariable",
"Unmatched paranthesis in %s",fullExpression);
2226 if (startWithParan) {
2236 current = &(work[0]);
2240 }
else if (
gROOT->GetType(cast_name)) {
2242 current = &(work[0]);
2245 "Casting to primary types like \"%s\" is not supported yet",cast_name.
Data());
2252 char *params = strchr(work,
'(');
2254 *params = 0; params++;
2256 if (branch && !leaf) {
2268 while (!leaf && (leafcur = (
TLeaf*) next())) {
2278 if (strlen(left) && left[strlen(left)-1]==
'.') left[strlen(left)-1]=0;
2280 if (aliasValue && strcspn(aliasValue,
"+*/-%&!=<>|")==strlen(aliasValue)) {
2283 if (find(aliasUsed.begin(),
2285 left) != aliasUsed.end()) {
2286 Error(
"DefinedVariable",
2287 "The substitution of the branch alias \"%s\" by \"%s\" in \"%s\" failed\n"\
2288 "\tbecause \"%s\" is used [recursively] in its own definition!",
2289 left,aliasValue,fullExpression,left);
2292 aliasUsed.push_back(left);
2293 TString newExpression = aliasValue;
2294 newExpression += (cname+strlen(left));
2296 castqueue, aliasUsed, useLeafCollectionObject, fullExpression);
2298 Error(
"DefinedVariable",
2299 "The substitution of the alias \"%s\" by \"%s\" failed.",left,aliasValue);
2316 strlcpy(right,work,2*
kMaxLen);
2317 strncat(right,
"(",2*
kMaxLen-1-strlen(right));
2318 strncat(right,params,2*
kMaxLen-1-strlen(right));
2322 i += strlen(params);
2325 current = &(work[0]);
2330 if (cname[i] ==
'.' || cname[i] ==
'\0' || cname[i] ==
')') {
2335 Int_t len = strlen(work);
2337 foundAtSign =
kTRUE;
2339 for(
l=0;work[
l+1]!=0;++
l) work[
l] = work[
l+1];
2342 }
else if (len>=2 && work[len-2]==
'@') {
2343 foundAtSign =
kTRUE;
2344 work[len-2] = cname[i];
2351 if (left[0]==0) strlcpy(left,work,
kMaxLen);
2352 if (!leaf && !branch) {
2356 std::string treename(
first);
2357 if (treename.size() && treename[treename.size()-1]==
'.') {
2358 treename.erase(treename.size()-1);
2360 if (treename==
"This" ) {
2365 if (cname[i]) leftover = &(cname[i+1]);
2411 useLeafCollectionObject = foundAtSign;
2413 current = &(work[0]);
2416 else if (branch && (foundAtSign || cname[i] != 0) ) {
2430 useLeafCollectionObject = foundAtSign;
2432 current = &(work[0]);
2442 useLeafCollectionObject = foundAtSign;
2444 current = &(work[0]);
2446 }
else if (leaf || branch) {
2447 if (leaf && branch) {
2461 current = &(work[0]);
2474 if (foundAtSign) strncat(right,
"@",2*
kMaxLen-1-strlen(right));
2475 if (cname[i]==
'.') strncat(right,
".",2*
kMaxLen-1-strlen(right));
2478 current = &(work[0]);
2481 }
else if (cname[i] ==
'.') {
2488 while(!branch && (branchcur=(
TBranch*)next()) ) {
2493 current = &(work[0]);
2500 Error(
"DefinedVariable",
"Unexpected control flow!");
2506 if (cname[i]) work[strlen(work)-1] =
'\0';
2511 currentname = &(work[previousdot+1]);
2518 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(scratch);
2519 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(scratch2);
2520 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(currentname.c_str());
2530 if (!tmp_branch) tmp_branch = branch->
FindBranch(scratch);
2531 if (!tmp_branch) tmp_branch = branch->
FindBranch(scratch2);
2532 if (!tmp_branch) tmp_branch = branch->
FindBranch(currentname.c_str());
2540 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(scratch);
2541 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(scratch2);
2542 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(currentname.c_str());
2556 useLeafCollectionObject = foundAtSign;
2560 current = &(work[0]);
2566 Int_t where = strlen(work);
2568 work[where+1] = cname[i];
2570 previousdot = where+1;
2572 previousdot = strlen(work);
2573 work[strlen(work)] = cname[i];
2583 strncat(right,work,2*
kMaxLen-1-strlen(right));
2587 if (strlen(right) && right[strlen(right)-1]!=
'.' && cname[i]!=
'.') {
2591 strncat(right,
".",2*
kMaxLen-1-strlen(right));
2593 strncat(right,&cname[i],2*
kMaxLen-1-strlen(right));
2596 if (!
final && branch) {
2599 if (!leaf)
return -1;
2605 if (strlen(right)==0) strlcpy(right,work,2*
kMaxLen);
2608 if (leaf==0 && left[0]!=0) {
2609 if (left[strlen(left)-1]==
'.') left[strlen(left)-1]=0;
2613 if (aliasValue && strcspn(aliasValue,
"()[]+*/-%&!=<>|")==strlen(aliasValue)) {
2616 if (find(aliasUsed.begin(),
2618 left) != aliasUsed.end()) {
2619 Error(
"DefinedVariable",
2620 "The substitution of the branch alias \"%s\" by \"%s\" in \"%s\" failed\n"\
2621 "\tbecause \"%s\" is used [recursively] in its own definition!",
2622 left,aliasValue,fullExpression,left);
2625 aliasUsed.push_back(left);
2626 TString newExpression = aliasValue;
2627 newExpression += (cname+strlen(left));
2629 castqueue, aliasUsed, useLeafCollectionObject, fullExpression);
2631 Error(
"DefinedVariable",
2632 "The substitution of the alias \"%s\" by \"%s\" failed.",left,aliasValue);
2683 if (!
fTree)
return -1;
2689 if (
name ==
"Entry$") {
2695 if (
name ==
"LocalEntry$") {
2701 if (
name ==
"Entries$") {
2709 if (
name ==
"LocalEntries$") {
2717 if (
name ==
"Iteration$") {
2723 if (
name ==
"Length$") {
2729 static const char *
lenfunc =
"Length$(";
2730 if (strncmp(
name.Data(),
"Length$(",strlen(
lenfunc))==0
2742 static const char *minfunc =
"Min$(";
2743 if (strncmp(
name.Data(),
"Min$(",strlen(minfunc))==0
2755 static const char *maxfunc =
"Max$(";
2756 if (strncmp(
name.Data(),
"Max$(",strlen(maxfunc))==0
2768 static const char *sumfunc =
"Sum$(";
2769 if (strncmp(
name.Data(),
"Sum$(",strlen(sumfunc))==0
2788 if (res<0)
return res;
2796 char dims[
kMaxLen]; dims[0] =
'\0';
2804 Int_t cnamelen = strlen(cname);
2805 for(i=0,k=0; i<cnamelen; ++i, ++k) {
2806 if (cname[i] ==
'[') {
2808 int bracket_level = 1;
2810 for (j=++i; j<cnamelen && (bracket_level>0 || cname[j]==
'['); j++, i++) {
2811 if (cname[j]==
'[') bracket_level++;
2812 else if (cname[j]==
']') bracket_level--;
2814 if (bracket_level != 0) {
2818 strncat(dims,&cname[bracket],j-bracket);
2821 if (i!=k) cname[k] = cname[i];
2830 res =
FindLeafForExpression(cname, leaf, leftover,
final, paran_level, castqueue, aliasSofar, useLeafCollectionObject,
name);
2832 if (res<0)
return res;
2834 if (!leaf && res!=2) {
2843 Error(
"DefinedVariable",
2844 "The substitution of the alias \"%s\" by \"%s\" failed\n"\
2845 "\tbecause \"%s\" is recursively used in its own definition!",
2846 cname,aliasValue,cname);
2851 if (strcspn(aliasValue,
"()+*/-%&!=<>|")!=strlen(aliasValue)) {
2857 aliasSofar.push_back( cname );
2859 TString subValue( aliasValue );
2868 Error(
"DefinedVariable",
2869 "The substitution of the alias \"%s\" by \"%s\" failed.",cname,aliasValue);
2884 TString thisAlias( aliasValue );
2892 Error(
"Compile",
" Bad numerical expression : \"%s\"",thisAlias.
Data());
2893 }
else if (aliasRes==-2) {
2894 Error(
"Compile",
" Part of the Variable \"%s\" exists but some of it is not accessible or useable",thisAlias.
Data());
2897 Error(
"DefinedVariable",
2898 "The substitution of the alias \"%s\" by \"%s\" failed.",cname,aliasValue);
2907 if (leaf || res==2) {
2910 Error(
"DefinedVariable",
"the branch \"%s\" has to be enabled to be used",leaf->
GetBranch()->
GetName());
2919 char *current = &( dims[0] );
2926 if (current[0] ==
']') {
2929 scanindex = sscanf(current,
"%d",&index);
2935 char *end = (
char*)(varindex.
Data());
2936 for(
char bracket_level = 0;*end!=0;end++) {
2937 if (*end==
'[') bracket_level++;
2938 if (bracket_level==0 && *end==
']')
break;
2939 if (*end==
']') bracket_level--;
2949 current += strlen(varindex)+1;
2957 current = (
char*)strstr( current,
"[" );
2964 res =
ParseWithLeaf(leaf,leftover,
final,paran_level,castqueue,useLeafCollectionObject,
name);
2965 if (res<0)
return res;
2966 if (res>0) action = res;
2996 }
else if (strlen(gcut->
GetVarX())) {
3005 for(
Int_t i2 = 1; i2<
n; i2++) {
3006 if (
x[i2] < min) min =
x[i2];
3007 if (
x[i2] > max) max =
x[i2];
3026 Error(
"DefinedVariable",
"Found a TCutG without leaf information (%s)",
3063 while ((leafcur = (
TLeaf*)nextleaf())) {
3091 if (clonesinfo) {
delete clonesinfo; clonesinfo = 0; }
3115 if (clones) cl = clones->
GetClass();
3157 leafinfo = clonesinfo;
3169 Int_t clones_offset = 0;
3174 else leafinfo->
fNext = sub_clonesinfo;
3175 else leafinfo = sub_clonesinfo;
3181 delete leafinfo; clonesinfo = 0;
3186 if (!clones)
continue;
3247 }
else if (
type > 60) {
3306 Error(
"BranchHasMethod",
"A TClonesArray was stored in a branch type no yet support (i.e. neither TBranchObject nor TBranchElement): %s",branch->IsA()->
GetName());
3309 cl = clones ? clones->
GetClass() : 0;
3343 Int_t real_instance = 0;
3378 if (local_index<0) {
3379 Error(
"EvalInstance",
"Index %s is out of bound (%d) in formula %s",
3386 real_instance = local_index *
fCumulSizes[codeindex][1];
3411 if (local_index<0) {
3412 Error(
"EvalInstance",
"Index %s is out of bound (%d) in formula %s",
3432 if (check)
return fNdata[0]+1;
3437 }
while( instance >= virt_accum && local_index<maxloop);
3443 if (local_index==(maxloop-1) && (instance >= virt_accum)) {
3445 if (check)
return fNdata[0]+1;
3451 if (check)
return fNdata[0]+1;
3459 local_index =
fIndexes[codeindex][0];
3486 if (
fIndexes[codeindex][vdim]>=0) {
3489 if (isize!=1 &&
fIndexes[codeindex][vdim]>isize) {
3494 for(
Int_t k=vdim -1; k>0; --k) {
3498 real_instance = local_index *
fCumulSizes[codeindex][1];
3502 for (
Int_t dim = 1; dim < max_dim; dim++) {
3513 if (
fIndexes[codeindex][dim]==-2) {
3520 if (local_index<0 ||
3522 Error(
"EvalInstance",
"Index %s is out of bound (%d/%d) in formula %s",
3530 real_instance += local_index *
fCumulSizes[codeindex][dim+1];
3534 if (
fIndexes[codeindex][max_dim]>=0) {
3535 if (!info) real_instance +=
fIndexes[codeindex][max_dim];
3541 local_index = instance;
3543 if (info && local_index>=
fCumulSizes[codeindex][max_dim]) {
3547 if (
fIndexes[codeindex][max_dim]==-2) {
3553 if (local_index<0 ||
3555 Error(
"EvalInstance",
"Index %s is of out bound (%d/%d) in formula %s",
3563 real_instance += local_index;
3568 return real_instance;
3666 else if (real_instance>=
fNdata[0])
return 0;
3672 if (real_instance) {
3673 Warning(
"EvalObject",
"Not yet implement for kDirect and arrays (for %s).\nPlease contact the developers",
GetName());
3692 const Int_t kMAXSTRINGFOUND = 10;
3693 const char *stringStack[kMAXSTRINGFOUND];
3704 }
else if (real_instance>=
fNdata[0]) {
3717 return stringStack[0];
3720#define TT_EVAL_INIT \
3721 TLeaf *leaf = (TLeaf*)fLeaves.UncheckedAt(0); \
3723 const Int_t real_instance = GetRealInstance(instance,0); \
3725 if (instance==0) fNeedLoading = kTRUE; \
3726 if (real_instance>=fNdata[0]) return 0; \
3732 if (fNeedLoading) { \
3733 fNeedLoading = kFALSE; \
3734 TBranch *br = leaf->GetBranch(); \
3735 Long64_t tentry = br->GetTree()->GetReadEntry(); \
3736 R__LoadBranch(br,tentry,fQuickLoad); \
3743 if (fLookupType[0]==kDirect) { \
3744 label = (char*)leaf->GetValuePointer(); \
3746 label = (char*)GetLeafInfo(0)->GetValuePointer(leaf,instance); \
3748 Int_t bin = fAxis->FindBin(label); \
3752#define TREE_EVAL_INIT \
3753 const Int_t real_instance = GetRealInstance(instance,0); \
3755 if (real_instance>=fNdata[0]) return 0; \
3761 label = (char*)GetLeafInfo(0)->GetValuePointer((TLeaf*)0x0,instance); \
3762 Int_t bin = fAxis->FindBin(label); \
3766#define TT_EVAL_INIT_LOOP \
3767 TLeaf *leaf = (TLeaf*)fLeaves.UncheckedAt(code); \
3770 const Int_t real_instance = GetRealInstance(instance,code); \
3773 TBranch *branch = (TBranch*)fBranches.UncheckedAt(code); \
3775 Long64_t treeEntry = branch->GetTree()->GetReadEntry(); \
3776 R__LoadBranch(branch,treeEntry,fQuickLoad); \
3777 } else if (fDidBooleanOptimization) { \
3778 branch = leaf->GetBranch(); \
3779 Long64_t treeEntry = branch->GetTree()->GetReadEntry(); \
3780 if (branch->GetReadEntry() != treeEntry) branch->GetEntry( treeEntry ); \
3786 if (fDidBooleanOptimization) { \
3787 TBranch *br = leaf->GetBranch(); \
3788 Long64_t treeEntry = br->GetTree()->GetReadEntry(); \
3789 if (br->GetReadEntry() != treeEntry) br->GetEntry( treeEntry ); \
3792 if (real_instance>=fNdata[code]) return 0;
3794#define TREE_EVAL_INIT_LOOP \
3796 const Int_t real_instance = GetRealInstance(instance,code); \
3798 if (real_instance>=fNdata[code]) return 0;
3804 for (
int i=0; i<len; ++i) res +=
sum->EvalInstance<
T>(i);
3813 for (
int i=1; i<len; ++i) {
3828 for (
int i=1; i<len; ++i) {
3847 }
while (!condval && i<len);
3848 if (!condval && i==len) {
3857 for (; i<len; ++i) {
3879 }
while (!condval && i<len);
3880 if (!condval && i==len) {
3889 for (; i<len; ++i) {
3904template <
typename T>
T fmod_local(
T x,
T y) {
return fmod(
x,
y); }
3921 if( !strncmp(
fExpr[op],
"0x", 2) || !strncmp(
fExpr[op],
"0X", 2) ) {
3923 sscanf(
fExpr[op],
"%llx", &val );
3949 return leaf->GetTypedValue<
T>(real_instance);
4007 const Int_t kMAXSTRINGFOUND = 10;
4008 const char *stringStackLocal[kMAXSTRINGFOUND];
4009 const char **stringStack = stringStackArg?stringStackArg:stringStackLocal;
4025 if (newaction==
kConstant) { pos++; tab[pos-1] = GetConstant<T>(oper &
kTFOperMask);
continue; }
4029 case kEnd :
return tab[0];
4030 case kAdd : pos--; tab[pos-1] += tab[pos];
continue;
4031 case kSubstract : pos--; tab[pos-1] -= tab[pos];
continue;
4032 case kMultiply : pos--; tab[pos-1] *= tab[pos];
continue;
4033 case kDivide : pos--;
if (tab[pos] == 0) tab[pos-1] = 0;
4034 else tab[pos-1] /= tab[pos];
4039 tab[pos-1] =
T(int1 % int2);
4059 case kacosh:
if (tab[pos-1] < 1) {tab[pos-1] = 0;}
4068 case kfmod : pos--; tab[pos-1] = fmod_local(tab[pos-1],tab[pos]);
continue;
4069 case kpow : pos--; tab[pos-1] =
TMath::Power(tab[pos-1],tab[pos]);
continue;
4070 case ksq : tab[pos-1] = tab[pos-1]*tab[pos-1];
continue;
4073 case kstrstr : pos2 -= 2; pos++;
if (strstr(stringStack[pos2],stringStack[pos2+1])) tab[pos-1]=1;
4077 case kmin : pos--; tab[pos-1] = std::min(tab[pos-1],tab[pos]);
continue;
4078 case kmax : pos--; tab[pos-1] = std::max(tab[pos-1],tab[pos]);
continue;
4080 case klog :
if (tab[pos-1] > 0) tab[pos-1] =
TMath::Log(tab[pos-1]);
4081 else {tab[pos-1] = 0;}
4084 if (dexp < -700) {tab[pos-1] = 0;
continue;}
4085 if (dexp > 700) {tab[pos-1] =
TMath::Exp(700);
continue;}
4089 else {tab[pos-1] = 0;}
4095 case ksign :
if (tab[pos-1] < 0) tab[pos-1] = -1;
else tab[pos-1] = 1;
4098 case kSignInv: tab[pos-1] = -1 * tab[pos-1];
continue;
4101 case kAnd : pos--;
if (tab[pos-1]!=0 && tab[pos]!=0) tab[pos-1]=1;
4104 case kOr : pos--;
if (tab[pos-1]!=0 || tab[pos]!=0) tab[pos-1]=1;
4108 case kEqual : pos--; tab[pos-1] = (tab[pos-1] == tab[pos]) ? 1 : 0;
continue;
4109 case kNotEqual : pos--; tab[pos-1] = (tab[pos-1] != tab[pos]) ? 1 : 0;
continue;
4110 case kLess : pos--; tab[pos-1] = (tab[pos-1] < tab[pos]) ? 1 : 0;
continue;
4111 case kGreater : pos--; tab[pos-1] = (tab[pos-1] > tab[pos]) ? 1 : 0;
continue;
4112 case kLessThan : pos--; tab[pos-1] = (tab[pos-1] <= tab[pos]) ? 1 : 0;
continue;
4113 case kGreaterThan: pos--; tab[pos-1] = (tab[pos-1] >= tab[pos]) ? 1 : 0;
continue;
4114 case kNot : tab[pos-1] = (tab[pos-1] != 0) ? 0 : 1;
continue;
4116 case kStringEqual : pos2 -= 2; pos++;
if (!strcmp(stringStack[pos2+1],stringStack[pos2])) tab[pos-1]=1;
4119 case kStringNotEqual: pos2 -= 2; pos++;
if (strcmp(stringStack[pos2+1],stringStack[pos2])) tab[pos-1]=1;
4144 pos2++; stringStack[pos2-1] = (
char*)
fExpr[i].Data();
4158 int op = param % 10;
4160 if (op == 1 && (!tab[pos-1]) ) {
4169 }
else if (op == 2 && tab[pos-1] ) {
4180 int toskip = param / 10;
4191 int fno = param / 1000;
4192 int nargs = param % 1000;
4200 UInt_t argloc = pos-nargs;
4201 for(
Int_t j=0;j<nargs;j++,argloc++,pos--) {
4202 SetMethodParam(method, tab[argloc]);
4225 switch (lookupType) {
4232 case kIteration: tab[pos++] = instance;
continue;
4240 GetTypedValue<T>(leaf,real_instance);
continue; }
4242 GetTypedValue<T>((
TLeaf*)0x0,real_instance);
continue; }
4247 default: tab[pos++] = 0;
continue;
4260 tab[pos++] = gcut->
IsInside(xcut,ycut);
4289 tab[pos] = param; pos++;
4307 T param = FindMin<T>(primary,condition);
4309 tab[pos] = param; pos++;
4316 T param = FindMax<T>(primary,condition);
4318 tab[pos] = param; pos++;
4328 if (instance < primary->
GetNdata()) {
4334 tab[pos] = param; pos++;
4348 if (instance < primary->
GetNdata()) {
4386 if (real_instance>=
fNdata[string_code])
return 0;
4408template double TTreeFormula::EvalInstance<double> (
int,
char const**);
4409template long double TTreeFormula::EvalInstance<long double> (
int,
char const**);
4410template long long TTreeFormula::EvalInstance<long long> (
int,
char const**);
4476 Warning(
"GetValueFromMethod",
"No streamer info for branch %s.", branch->
GetName());
4486 thisobj = *((
char**) (address + offset));
4498 m->Execute(thisobj,
l);
4504 m->Execute(thisobj,
d);
4508 m->Execute(thisobj);
4536 Warning(
"GetValuePointerFromMethod",
"No streamer info for branch %s.", branch->
GetName());
4546 thisobj = *((
char**) (address + offset));
4558 m->Execute(thisobj,
l);
4564 m->Execute(thisobj,
d);
4570 m->Execute(thisobj, &
c);
4574 m->Execute(thisobj);
4729 if (indexname[strlen(indexname)-1] ==
'_' ) {
4741 if (bid < 0)
return kFALSE;
4804 const int kMAXLENGTH = 1024;
4805 static char value[kMAXLENGTH];
4808 for (
int i = 0; i < kMAXLENGTH-1; i++)
4810 value[kMAXLENGTH-1] = 0;
4811 }
else if (mode == -1) {
4813 }
else if (mode == 0) {
4816 const char * val = 0;
4819 }
else if (instance<
fNdata[0]) {
4831 val = ((
TTreeFormula*)
this)->EvalStringInstance(instance);
4835 val = ((
TTreeFormula*)
this)->EvalStringInstance(instance);
4839 strlcpy(value, val, kMAXLENGTH);
4843 value[kMAXLENGTH-1] = 0;
4848 if (real_instance<
fNdata[0]) {
4849 Ssiz_t len = strlen(decform);
4850 Char_t outputSizeLevel = 1;
4853 switch (decform[len-2]) {
4856 outputSizeLevel = 2;
4857 if (len>3 && tolower(decform[len-3])==
'l') {
4858 outputSizeLevel = 3;
4862 case 'h': outputSizeLevel = 0;
break;
4865 switch(decform[len-1]) {
4870 switch (outputSizeLevel) {
4884 switch (outputSizeLevel) {
4899 switch (outputSizeLevel) {
4904 expo = strchr(value,
'e');
4909 expo = strchr(value,
'e');
4914 UInt_t declen = atoi(decform);
4915 if (strlen(value)>declen) {
4916 UInt_t off = strlen(value)-declen;
4917 char *start = expo - off;
4918 UInt_t vlen = strlen(expo);
4919 for(
UInt_t z=0;z<=vlen;++z) {
4926 if (isalpha(decform[strlen(decform)-1])) {
4927 TString short_decform(decform);
4950 for(
UInt_t dim=0; dim<max_dim ;++dim) {
4960 for(
Int_t k=0; k <=
n; ++k) {
4983 if (!axis) {
fAxis = 0;
return;}
5073 for (
Int_t i=0;i<nleaves;i++) {
5156 Int_t last_code = -1;
5158 for(TDimensionInfo * info; (info = (TDimensionInfo*)next()); ) {
5159 if (last_code!=info->fCode) {
5164 last_code = info->fCode;
5172 TDimensionInfo *nextinfo = (TDimensionInfo*)next();
5173 while(nextinfo && nextinfo->fCode==info->fCode) {
5175 nextinfo = (TDimensionInfo*)next();
5177 if (!nextinfo)
break;
5181 last_code = info->fCode;
5233 if (!gcut)
continue;
5263 if (!leaf)
continue;
5292 if (tleaf && tleaf != realtree && tleaf->
GetTreeIndex()) {
5298 Int_t virt_dim2 = 0;
5306 if (
fIndexes[i][k] < 0 ) virt_dim2++;
5334 for (i=0; i<
fNoper ; ++i) {
5336 if (leaf==0)
continue;
5346 for (
Int_t dim = 0; dim < max_dim; ++dim) {
5360 if (
fCodes[i] < 0)
continue;
5381 outofbounds =
kTRUE;
5388 if (tleaf && tleaf != realtree && tleaf->
GetTreeIndex()) {
5391 outofbounds =
kTRUE;
5406 if (readentry < 0) readentry=0;
5413 branchcount->TBranch::GetEntry(readentry);
5441 hasBranchCount2 =
kTRUE;
5448 for(
Int_t k=vdim -1; k>=0; k--) {
5462 if (readentry < 0) readentry=0;
5466 if (hasBranchCount2) {
5477 for(
Int_t j=0; j<size; j++) {
5490 }
else if (
fIndexes[i][0] >= size) {
5494 outofbounds =
kTRUE;
5495 }
else if (hasBranchCount2) {
5503 outofbounds =
kTRUE;
5511 if (readentry < 0) readentry=0;
5520 }
else if (
fIndexes[i][0] >= size) {
5524 outofbounds =
kTRUE;
5536 hasBranchCount2 =
kTRUE;
5538 for(
int z=0; z<size; ++z) {
5542 }
else if (
fIndexes[i][vdim] >= 0 ) {
5552 for(
Int_t k=vdim -1; k>=0; k--) {
5562 if (readentry < 0) readentry=0;
5565 outofbounds =
kTRUE;
5581 if (
fManager->
fUsedSizes[virt_dim]==1 || (index_size!=1 && index_size<fManager->fUsedSizes[virt_dim]) )
5588 if (index_size==1) {
5592 if (index_size<fManager->fUsedSizes[virt_dim])
fManager->
fUsedSizes[virt_dim] = index_size;
5596 index_size<fManager->fUsedSizes[virt_dim]) {
5600 }
else if (hasBranchCount2 && info && k==info->
GetVarDim()) {
5604 if (
fManager->
fUsedSizes[virt_dim]==1 || (index_size!=1 && index_size<fManager->fUsedSizes[virt_dim]) )
5609 }
else if (hasBranchCount2 && info && k==info->
GetVarDim()) {
5622 return ! outofbounds;
5632 enum { kOldAlias = 100000+10000+1,
5633 kOldAliasString = kOldAlias+1,
5634 kOldAlternate = kOldAlias+2,
5635 kOldAlternateString = kOldAliasString+2
5638 for (
int k=0; k<
fNoper; k++) {
5645 case kOldAlias:
GetOper()[k] = -kOldAlias;
break;
5646 case kOldAliasString:
GetOper()[k] = -kOldAliasString;
break;
5647 case kOldAlternate:
GetOper()[k] = -kOldAlternate;
break;
5648 case kOldAlternateString:
GetOper()[k] = -kOldAlternateString;
break;
5654 for (
int i=0,offset=0; i<
fNoper; i++) {
5680 if (!leaf)
return kFALSE;
5694 last = clonesinfo->
fNext;
5698 }
else if (br->
GetType()==41) {
5703 if ( count->
GetID() >= 0 ) {
5722 last = collectioninfo->
fNext;
5726 }
else if (br->
GetID()<0) {
unsigned long long ULong64_t
const Int_t kDoNotProcess
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
void Set(Int_t n)
Set size of this array to n ints.
const Int_t * GetArray() const
void AddAt(Int_t c, Int_t i)
Add Int_t c at position i. Check for out of bounds.
Class to manage histogram axis.
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
A Branch for the case of an object.
TBranchElement * GetBranchCount() const
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
virtual char * GetAddress() const
Get the branch address.
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
Int_t GetStreamerType() const
TBranchElement * GetBranchCount2() const
char * GetObject() const
Return a pointer to our object.
virtual void SetupAddresses()
If the branch address is not set, we set all addresses starting with the top level parent branch.
A Branch for the case of an object.
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
A TTree is a list of TBranches.
virtual char * GetAddress() const
TObjArray * GetListOfBranches()
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 TLeaf * FindLeaf(const char *name)
Find the leaf corresponding to the name 'searchname'.
Long64_t GetReadEntry() const
virtual void Print(Option_t *option="") const
Print TBranch parameters.
virtual void ResetReadEntry()
virtual TBranch * FindBranch(const char *name)
Find the immediate sub-branch with passed name.
TObjArray * GetListOfLeaves()
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TClassRef is used to implement a permanent reference to a TClass object.
TClass instances represent classes, structs and namespaces in the ROOT type system.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
Bool_t HasDataMemberInfo() const
ClassInfo_t * GetClassInfo() const
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
TVirtualRefProxy * GetReferenceProxy() const
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.
An array of clone (identical) objects.
TClass * GetClass() const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
const char * GetVarX() const
virtual void SetObjectY(TObject *obj)
Set the Y object (and delete the previous one if any).
TObject * GetObjectY() const
virtual void SetObjectX(TObject *obj)
Set the X object (and delete the previous one if any).
TObject * GetObjectX() const
const char * GetVarY() const
Describe directory structure in memory.
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
A List of entry numbers in a TTree or TChain.
virtual Int_t Contains(Long64_t entry, TTree *tree=0)
virtual Int_t IsInside(Double_t x, Double_t y) const
Return 1 if the point (x,y) is inside the polygon defined by the graph vertices 0 otherwise.
A TLeaf for the general case when using the branches created via a TStreamerInfo (i....
virtual Bool_t IsOnTerminalBranch() const
Return true if this leaf is does not have any sub-branch/leaf.
A TLeaf for a general object derived from TObject.
TClass * GetClass() const
TObject * GetObject() const
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual void * GetValuePointer() const
virtual Bool_t IsOnTerminalBranch() const
virtual const char * GetTypeName() const
virtual Int_t GetLen() const
Return the number of effective elements of this leaf, for the current entry.
virtual TLeaf * GetLeafCount() const
If this leaf stores a variable-sized array or a multi-dimensional array whose last dimension has vari...
TBranch * GetBranch() const
virtual Int_t GetLenStatic() const
Return the fixed length of this leaf.
virtual Bool_t IsUnsigned() const
virtual void Add(TObject *obj)
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Method or function calling interface.
EReturnType ReturnType()
Returns the return type of the method.
static const EReturnType kLong
static const EReturnType kString
void ResetParam()
Reset parameter list. To be used before the first call the SetParam().
static const EReturnType kOther
TFunction * GetMethod()
Returns the TMethod describing the method to be executed.
Bool_t IsValid() const
Return true if the method call has been properly initialized and is usable.
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
static const EReturnType kDouble
void SetParam(Long_t l)
Add a long method parameter.
The TNamed class is the base class for all named ROOT classes.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Int_t IndexOf(const TObject *obj) const
Int_t GetEntriesFast() const
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
TObject * Last() const
Return the object in the last filled slot. Returns 0 if no entries.
Int_t GetEntries() const
Return the number of objects in array (i.e.
TObject * UncheckedAt(Int_t i) const
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
Int_t GetLast() const
Return index of last object in array.
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
TObject * At(Int_t idx) const
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual Double_t Rndm()
Machine independent random number generator.
const char * GetCountName() const
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
Int_t GetArrayDim() const
Int_t GetMaxIndex(Int_t i) const
virtual Bool_t IsaPointer() const
TClass * GetClass() const
Describe Streamer information for one class version.
TStreamerElement * GetStreamerElement(const char *datamember, Int_t &offset) const
Return the StreamerElement of "datamember" inside our class or any of its base classes.
Int_t GetElementOffset(Int_t id) const
TClass * GetClass() const
TStreamerElement * GetElement(Int_t id) const
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & Remove(Ssiz_t pos)
TString & Append(const char *cs)
A TTree represents a columnar dataset.
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 TObjArray * GetListOfLeaves()
virtual TVirtualIndex * GetTreeIndex() const
virtual Long64_t GetEntries() const
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.
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 GetReadEntry() const
virtual TObjArray * GetListOfBranches()
virtual TTree * GetTree() const
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.
virtual const char * GetAlias(const char *aliasName) const
Returns the expanded value of the alias. Search in the friends if any.
virtual Int_t GetTreeNumber() const
virtual TLeaf * FindLeaf(const char *name)
Find leaf..
virtual const char * GetFriendAlias(TTree *) const
If the 'tree' is a friend, this method returns its alias name.
virtual EDataType GetType() const =0
virtual TClass * GetValueClass() const =0
virtual TClass * GetValueClass(void *data) const =0
virtual Bool_t HasCounter() const =0
Bool_t IsCompiled() const
virtual TObjArray * GetElements() const =0
Namespace for new ROOT classes and functions.
static constexpr double second
Double_t ATan2(Double_t, Double_t)
Double_t Sqrt(Double_t x)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Double_t Log10(Double_t x)
static long int sum(long int i)