125 fDidBooleanOptimization(false), fDimensionSetup(nullptr)
158 :
ROOT::v5::
TFormula(), fTree(tree), fQuickLoad(false), fNeedLoading(true),
159 fDidBooleanOptimization(false), fDimensionSetup(nullptr)
168 const std::vector<std::string>& aliases)
169 :
ROOT::v5::
TFormula(), fTree(tree), fQuickLoad(false), fNeedLoading(true),
170 fDidBooleanOptimization(false), fDimensionSetup(nullptr), fAliasesUsed(aliases)
210 if(savedir) savedir->
cd();
215 Warning(
"TTreeFormula",
"Too many items in expression:%s",expression);
225 if (!leafc)
continue;
268 for(k0 = 0; k0 <
fNcodes; k0++) {
273 Error(
"TTreeFormula",
274 "Index %d for dimension #%d in %s is too high (max is %d)",
277 if(savedir) savedir->
cd();
306 if (readentry >= 0) {
311 if (readentry >= 0) {
318 if(savedir) savedir->
cd();
340 for (
int j=0; j<
fNcodes; j++) {
368 bool scalarindex =
false;
374 switch (index_multiplicity) {
405 const char * current;
414 if (current[0] !=
'[') current--;
417 scanindex = sscanf(current,
"%d",&
size);
421 if (scanindex==0)
size = -1;
430 current = (
char*)strstr( current,
"[" );
444 return (
size==-1) ? 1 : 0;
452 bool useCollectionObject) {
485 if (maininfo==0 || maininfo==leafinfo || 1) {
491 delete currentinfo->
fNext;
516 }
else if (
c &&
c->GetReferenceProxy() &&
c->GetReferenceProxy()->HasCounter() ) {
547 }
while (current<ndim);
584 Int_t numberOfVarDim = 0;
589 const char *tname = leaf->
GetTitle();
590 char *leaf_dim = (
char*)strstr( tname,
"[" );
593 char *branch_dim = (
char*)strstr(bname,
"[");
594 if (branch_dim) branch_dim++;
596 bool isString =
false;
606 if (!branch_dim || strncmp(branch_dim,leaf_dim,strlen(branch_dim))) {
609 }
else if (branch_dim && strncmp(branch_dim,leaf_dim,strlen(branch_dim))==0
610 && strlen(leaf_dim)>strlen(branch_dim)
611 && (leaf_dim+strlen(branch_dim))[0]==
'[') {
630 "Noticed an incorrect in-memory TBranchElement object (%s).\nIt has a BranchCount2 but no BranchCount!\nThe result might be incorrect!",
632 return numberOfVarDim;
638 "Already in kDataMember mode when handling multiple variable dimensions");
646 return numberOfVarDim;
659 static const char *altfunc =
"Alt$(";
660 static const char *minfunc =
"MinIf$(";
661 static const char *maxfunc =
"MaxIf$(";
665 if ( strncmp(expression,altfunc,strlen(altfunc))==0
666 && expression[strlen(expression)-1]==
')' ) {
668 start = strlen(altfunc);
670 if ( strncmp(expression,maxfunc,strlen(maxfunc))==0
671 && expression[strlen(expression)-1]==
')' ) {
673 start = strlen(maxfunc);
675 if ( strncmp(expression,minfunc,strlen(minfunc))==0
676 && expression[strlen(expression)-1]==
')' ) {
678 start = strlen(minfunc);
688 for(
unsigned int i=start;i<strlen(expression);++i) {
689 switch (expression[i]) {
690 case '(': paran++;
break;
691 case ')': paran--;
break;
692 case '"': instr = instr ? 0 : 1;
break;
693 case '[': brack++;
break;
694 case ']': brack--;
break;
696 if (expression[i]==
',' && paran==0 && instr==0 && brack==0) {
697 part1 = full( start, i-start );
698 part2 = full( i+1, full.Length() -1 - (i+1) );
710 Error(
"DefinedVariable",
"The 2nd arguments in %s can not be an array (%s,%d)!",
719 Error(
"DefinedVariable",
720 "The 2nd arguments in %s has to return the same type as the 1st argument (string)!",
726 Error(
"DefinedVariable",
727 "The 2nd arguments in %s has to return the same type as the 1st argument (numerical type)!",
736 Error(
"DefinedVariable",
737 "The arguments of %s can not be strings!",
768 Int_t numberOfVarDim = 0;
771 char scratch[
kMaxLen]; scratch[0] =
'\0';
772 char work[
kMaxLen]; work[0] =
'\0';
774 const char *right = subExpression;
779 if (readentry < 0) readentry=0;
781 bool useLeafReferenceObject =
false;
791 if ( br->
GetInfo() == nullptr ) {
792 Error(
"DefinedVariable",
"Missing StreamerInfo for %s. We will be unable to read!",
804 Error(
"DefinedVariable",
"Missing StreamerInfo for %s."
805 " We will be unable to read!",
810 Error(
"DefinedVariable",
"Address not set when the type of the branch is negative for for %s. We will be unable to read!", mom->
GetName());
823 const char* alias =
nullptr;
826 if (!alias && realtree!=
fTree) {
834 TTree *tleaf = realtree;
841 if (mother_name[strlen(mother_name)-1]!=
'.') {
842 br_extended_name = mother_name;
843 br_extended_name.
Append(
'.');
848 if (dim >= 0) br_extended_name.
Remove(dim);
868 bool unwindCollection =
false;
936 "Missing TStreamerElement in object in TClonesArray section");
947 maininfo = clonesinfo;
966 maininfo->
fNext = previnfo;
967 unwindCollection =
true;
969 }
else if (branchEl->
GetType()==41) {
974 Warning(
"DefinedVariable",
"Missing TStreamerElement in object in Collection section");
980 if ( count->
GetID() >= 0 ) {
999 maininfo = collectioninfo;
1018 maininfo->
fNext = previnfo;
1019 unwindCollection =
true;
1021 }
else if ( branchEl->
GetType()==3) {
1023 if (useLeafCollectionObject) {
1028 numberOfVarDim +=
RegisterDimensions(code,clonesinfo,maininfo,useLeafCollectionObject);
1031 maininfo = clonesinfo;
1032 previnfo = maininfo;
1034 }
else if (!useLeafCollectionObject && branchEl->
GetType()==4) {
1037 if (useLeafCollectionObject) {
1042 numberOfVarDim +=
RegisterDimensions(code,collectioninfo,maininfo,useLeafCollectionObject);
1045 maininfo = collectioninfo;
1046 previnfo = maininfo;
1050 if (useLeafCollectionObject) {
1053 maininfo = collectioninfo;
1054 previnfo = collectioninfo;
1061 maininfo = collectioninfo;
1062 previnfo = collectioninfo;
1072 previnfo->
fNext = multi;
1075 previnfo = multi->
fNext;
1083 previnfo = previnfo->
fNext;
1089 }
else if (strlen(right)==0 && cl && element &&
final) {
1092 if (!useLeafCollectionObject
1103 maininfo = collectioninfo;
1104 previnfo = collectioninfo;
1113 previnfo->
fNext = multi;
1116 previnfo = multi->
fNext;
1123 previnfo = previnfo->
fNext;
1126 }
else if (!useLeafCollectionObject
1142 collectioninfo->
fNext =
1145 maininfo = collectioninfo;
1146 previnfo = maininfo->
fNext;
1148 }
else if (!useLeafCollectionObject
1159 previnfo = maininfo;
1164 if ( useLeafCollectionObject || fullExpression[0] ==
'@' || fullExpression[strlen(scratch)] ==
'@' ) {
1165 useLeafReferenceObject =
true;
1182 Error(
"DefinedVariable",
"Failed to access class type of reference target (%s)",element->
GetName());
1189 if (subExpression && subExpression[0]) {
1190 Error(
"ParseWithLeaf",
"Found a numerical leaf but the name has trailing characters: \"%s\"", subExpression);
1199 if (unwindCollection) {
1202 R__ASSERT(numberOfVarDim==1 && maininfo);
1209 previnfo->
fNext = multi;
1212 previnfo = multi->
fNext;
1219 previnfo = previnfo->
fNext;
1227 previnfo->
fNext = multi;
1230 previnfo = multi->
fNext;
1239 Int_t nchname = strlen(right);
1254 Error(
"DefinedVariable",
"%s does not inherit from %s. Casting not possible!",
1260 if (maininfo==
nullptr) {
1261 maininfo = leafinfo;
1263 if (previnfo==
nullptr) {
1264 previnfo = leafinfo;
1266 previnfo->
fNext = leafinfo;
1267 previnfo = leafinfo;
1272 castqueue.
AddAt(
nullptr,paran_level);
1276 bool prevUseCollectionObject = useLeafCollectionObject;
1277 bool useCollectionObject = useLeafCollectionObject;
1278 bool useReferenceObject = useLeafReferenceObject;
1279 bool prevUseReferenceObject = useLeafReferenceObject;
1280 for (i=0, current = &(work[0]); i<=nchname;i++ ) {
1282 if (right[i] ==
'(') {
1285 *current++ = right[i++];
1286 }
while(right[i]!=
')' && right[i]);
1287 *current++ = right[i];
1289 char *params = strchr(work,
'(');
1291 *params = 0; params++;
1292 }
else params = (
char *)
")";
1294 Error(
"DefinedVariable",
"Can not call '%s' with a class",work);
1298 Error(
"DefinedVariable",
"Class probably unavailable:%s",cl->
GetName());
1325 previnfo = clonesinfo;
1326 maininfo = clonesinfo;
1340 if (previnfo==
nullptr) {
1358 previnfo = collectioninfo;
1359 maininfo = collectioninfo;
1364 if (inside_cl) cl = inside_cl;
1366 Warning(
"DefinedVariable",
"Can not call method on content of %s in %s\n",
1373 Error(
"DefinedVariable",
1374 "Could not discover the TClass corresponding to (%s)!",
1378 method =
new TMethodCall(cl,
"GetEntriesFast",
"");
1380 if (maininfo==
nullptr) {
1382 if (useLeafCollectionObject) {
1388 maininfo=previnfo=collectioninfo;
1394 Error(
"DefinedVariable",
1395 "Can not call method %s on class without dictionary (%s)!",
1403 Error(
"DefinedVariable",
"Unknown method:%s in %s",right,cl->
GetName());
1428 Error(
"DefineVariable",
"Method %s from %s has an impossible return type %d",
1433 if (maininfo==
nullptr) {
1434 maininfo = leafinfo;
1436 if (previnfo==
nullptr) {
1437 previnfo = leafinfo;
1439 previnfo->
fNext = leafinfo;
1440 previnfo = leafinfo;
1443 current = &(work[0]);
1445 prevUseCollectionObject =
false;
1446 prevUseReferenceObject =
false;
1447 useCollectionObject =
false;
1450 if (numberOfVarDim>1) {
1451 Warning(
"DefinedVariable",
"TTreeFormula support only 2 level of variables size collections. Assuming '@' notation for the collection %s.",
1454 useCollectionObject =
true;
1455 }
else if (numberOfVarDim==0) {
1459 }
else if (numberOfVarDim==1) {
1464 previnfo->
fNext = leafinfo;
1465 previnfo = leafinfo;
1471 previnfo->
fNext = leafinfo;
1472 previnfo = leafinfo;
1476 }
else if (right[i] ==
')') {
1479 TClass * casted = (
TClass*) ((
int(--paran_level)>=0) ? castqueue.
At(paran_level) :
nullptr);
1484 if (maininfo==
nullptr) {
1485 maininfo = leafinfo;
1487 if (previnfo==
nullptr) {
1488 previnfo = leafinfo;
1490 previnfo->
fNext = leafinfo;
1491 previnfo = leafinfo;
1494 current = &(work[0]);
1501 }
else if (i > 0 && (right[i] ==
'.' || right[i] ==
'[' || right[i] ==
'\0') ) {
1504 bool needClass =
true;
1508 if (strlen(work)==0)
continue;
1510 prevUseCollectionObject = useCollectionObject;
1511 prevUseReferenceObject = useReferenceObject;
1513 useReferenceObject =
true;
1514 useCollectionObject =
true;
1516 for(
l=0;work[
l+1]!=0;++
l) work[
l] = work[
l+1];
1518 }
else if (work[strlen(work)-1]==
'@') {
1519 useReferenceObject =
true;
1520 useCollectionObject =
true;
1521 work[strlen(work)-1] =
'\0';
1523 useReferenceObject =
false;
1524 useCollectionObject =
false;
1527 bool mustderef =
false;
1535 prevUseReferenceObject =
false;
1538 previnfo = previnfo->
fNext;
1542 for(
Long64_t entry=0; entry<leaf->
GetBranch()->GetEntries()-readentry; ++entry) {
1580 previnfo = clonesinfo;
1581 maininfo = clonesinfo;
1585 Error(
"DefinedVariable",
"Unimplemented usage of ClonesArray");
1594 if (clones==
nullptr) {
1596 "TClonesArray object was not retrievable for %s!",
1605 if (1 || inside_cl) cl = inside_cl;
1607 if (0 && strlen(work)==0) {
1622 if (maininfo==
nullptr) {
1641 previnfo = collectioninfo;
1642 maininfo = collectioninfo;
1651 Error(
"DefinedVariable",
"Could you not find the inner class for %s with coll type = %d",
1655 Warning(
"DefinedVariable",
"No data member in content of %s in %s\n",
1664 Warning(
"DefinedVariable",
"Missing class for %s!",
name.Data());
1669 if (!element && !prevUseCollectionObject) {
1676 Int_t clones_offset = 0;
1684 previnfo->
fNext = clonesinfo;
1686 previnfo->
fNext =
nullptr;
1698 if (maininfo==
nullptr) maininfo = leafinfo;
1699 if (previnfo==
nullptr) previnfo = leafinfo;
1701 previnfo->
fNext = leafinfo;
1702 previnfo = leafinfo;
1710 Int_t coll_offset = 0;
1719 if (numberOfVarDim>1) {
1720 Warning(
"DefinedVariable",
"TTreeFormula support only 2 level of variables size collections. Assuming '@' notation for the collection %s.",
1723 useCollectionObject =
true;
1724 }
else if (numberOfVarDim==1) {
1736 if (maininfo==
nullptr) maininfo = leafinfo;
1737 if (previnfo==
nullptr) previnfo = leafinfo;
1739 previnfo->
fNext = leafinfo;
1740 previnfo = leafinfo;
1742 if (leafinfo->
fNext) {
1743 previnfo = leafinfo->
fNext;
1758 if (numberOfVarDim>=1 &&
type>40) {
1763 if (leafinfo &&
type<=40 ) {
1770 bool object =
false;
1771 bool pointer =
false;
1772 bool objarr =
false;
1803 Error(
"DefinedVariable",
1804 "%s is a datamember of %s BUT is not yet of a supported type (%d)",
1809 Error(
"DefinedVariable",
1810 "%s is a datamember of %s BUT is not of a unknown type (%d)",
1815 if (
object && !useCollectionObject &&
1821 if (
object && leafinfo) {
1823 }
else if (objarr) {
1838 if (numberOfVarDim>1) {
1839 Warning(
"DefinedVariable",
"TTreeFormula support only 2 level of variables size collections. Assuming '@' notation for the collection %s.",
1842 useCollectionObject =
true;
1843 }
else if (numberOfVarDim==1) {
1863 else leafinfo->
fNext = info;
1870 if (!maininfo) maininfo = leafinfo;
1875 if (previnfo==
nullptr) previnfo = leafinfo;
1877 previnfo->
fNext = leafinfo;
1878 previnfo = leafinfo;
1893 else leafinfo->
fNext = info;
1909 prevUseReferenceObject =
false;
1912 }
else if (pointer) {
1924 if (cl)
Error(
"DefinedVariable",
"%s is not a datamember of %s",work,cl->
GetName());
1930 if (maininfo==
nullptr) {
1931 maininfo = leafinfo;
1933 if (previnfo==
nullptr) {
1934 previnfo = leafinfo;
1935 }
else if (previnfo!=leafinfo) {
1936 previnfo->
fNext = leafinfo;
1937 previnfo = leafinfo;
1939 while (previnfo->
fNext) previnfo = previnfo->
fNext;
1941 if ( right[i] !=
'\0' ) {
1942 if ( !needClass && mustderef ) {
1948 if ( inf->IsReference() ) {
1959 Error(
"DefinedVariable",
"Failed to access class type of reference target (%s)",element->
GetName());
1965 Error(
"DefinedVariable",
"Failed to access class type of reference target (%s)",element->
GetName());
1969 else if ( needClass ) {
1973 if (mustderef) leafinfo =
nullptr;
1974 current = &(work[0]);
1983 nchname = strlen(right);
1987 *current++ = right[i];
1996 if (strlen(work)!=0) {
2008 if (!last)
return action;
2012 if (last && last->
GetClass() != objClass) {
2024 last->
fNext = collectioninfo;
2036 if (!last)
return action;
2040 const char *funcname =
nullptr;
2044 }
else if (objClass == stdStringClass) {
2087 method =
new TMethodCall(objClass,
"AsString",
"");
2140 const char *funcname =
nullptr;
2143 }
else if (objClass == stdStringClass) {
2183 if (readentry < 0) readentry=0;
2184 const char *
cname = expression;
2185 char first[
kMaxLen]; first[0] =
'\0';
2186 char second[
kMaxLen*2]; second[0] =
'\0';
2187 char right[
kMaxLen*2]; right[0] =
'\0';
2188 char work[
kMaxLen]; work[0] =
'\0';
2189 char left[
kMaxLen]; left[0] =
'\0';
2192 std::string currentname;
2193 Int_t previousdot = 0;
2195 TLeaf *tmp_leaf=
nullptr;
2196 TBranch *branch=
nullptr, *tmp_branch=
nullptr;
2199 bool foundAtSign =
false;
2200 bool startWithParan =
false;
2202 for (i=0, current = &(work[0]); i<=nchname && !
final;i++ ) {
2204 *current++ =
cname[i];
2206 if (
cname[i] ==
'(') {
2209 if (current==work+1) {
2212 startWithParan =
true;
2224 if (
cname[i] ==
')') {
2225 if (paran_level==0) {
2226 Error(
"DefinedVariable",
"Unmatched parenthesis in %s",fullExpression);
2231 if (startWithParan) {
2232 startWithParan =
false;
2241 current = &(work[0]);
2245 }
else if (
gROOT->GetType(cast_name)) {
2247 current = &(work[0]);
2250 "Casting to primary types like \"%s\" is not supported yet",cast_name.
Data());
2257 char *params = strchr(work,
'(');
2259 *params = 0; params++;
2261 if (branch && !leaf) {
2272 TLeaf* leafcur =
nullptr;
2273 while (!leaf && (leafcur = (
TLeaf*) next())) {
2283 if (strlen(left) && left[strlen(left)-1]==
'.') left[strlen(left)-1]=0;
2285 if (aliasValue && strcspn(aliasValue,
"+*/-%&!=<>|")==strlen(aliasValue)) {
2288 if (find(aliasUsed.begin(),
2290 left) != aliasUsed.end()) {
2291 Error(
"DefinedVariable",
2292 "The substitution of the branch alias \"%s\" by \"%s\" in \"%s\" failed\n"\
2293 "\tbecause \"%s\" is used [recursively] in its own definition!",
2294 left,aliasValue,fullExpression,left);
2297 aliasUsed.push_back(left);
2298 TString newExpression = aliasValue;
2299 newExpression += (
cname+strlen(left));
2301 castqueue, aliasUsed, useLeafCollectionObject, fullExpression);
2303 Error(
"DefinedVariable",
2304 "The substitution of the alias \"%s\" by \"%s\" failed.",left,aliasValue);
2321 strlcpy(right,work,2*
kMaxLen);
2322 strncat(right,
"(",2*
kMaxLen-1-strlen(right));
2323 strncat(right,params,2*
kMaxLen-1-strlen(right));
2327 i += strlen(params);
2330 current = &(work[0]);
2344 for(
l=0;work[
l+1]!=0;++
l) work[
l] = work[
l+1];
2347 }
else if (
len>=2 && work[
len-2]==
'@') {
2353 foundAtSign =
false;
2356 if (left[0]==0) strlcpy(left,work,
kMaxLen);
2357 if (!leaf && !branch) {
2361 std::string treename(first);
2362 if (!treename.empty() && treename[treename.size()-1]==
'.') {
2363 treename.erase(treename.size()-1);
2365 if (treename==
"This" ) {
2402 if (
cname[i]) first[strlen(first)-1]=
'\0';
2416 useLeafCollectionObject = foundAtSign;
2418 current = &(work[0]);
2421 else if (branch && (foundAtSign ||
cname[i] != 0) ) {
2426 if (leaf==
nullptr) {
2435 useLeafCollectionObject = foundAtSign;
2436 foundAtSign =
false;
2437 current = &(work[0]);
2447 useLeafCollectionObject = foundAtSign;
2448 foundAtSign =
false;
2449 current = &(work[0]);
2451 }
else if (leaf || branch) {
2452 if (leaf && branch) {
2466 current = &(work[0]);
2479 if (foundAtSign) strncat(right,
"@",2*
kMaxLen-1-strlen(right));
2480 if (
cname[i]==
'.') strncat(right,
".",2*
kMaxLen-1-strlen(right));
2483 current = &(work[0]);
2486 }
else if (
cname[i] ==
'.') {
2493 while(!branch && (branchcur=(
TBranch*)next()) ) {
2498 current = &(work[0]);
2505 Error(
"DefinedVariable",
"Unexpected control flow!");
2511 if (
cname[i]) work[strlen(work)-1] =
'\0';
2512 snprintf(scratch,
sizeof(scratch),
"%s.%s",first,work);
2513 snprintf(scratch2,
sizeof(scratch2),
"%s.%s.%s",first,second,work);
2516 currentname = &(work[previousdot+1]);
2523 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(scratch);
2524 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(scratch2);
2525 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(currentname.c_str());
2535 if (!tmp_branch) tmp_branch = branch->
FindBranch(scratch);
2536 if (!tmp_branch) tmp_branch = branch->
FindBranch(scratch2);
2537 if (!tmp_branch) tmp_branch = branch->
FindBranch(currentname.c_str());
2545 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(scratch);
2546 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(scratch2);
2547 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(currentname.c_str());
2558 if (second[0]) strncat(second,
".",2*
kMaxLen-1-strlen(second));
2559 strncat(second,work,2*
kMaxLen-1-strlen(second));
2561 useLeafCollectionObject = foundAtSign;
2562 foundAtSign =
false;
2565 current = &(work[0]);
2571 Int_t where = strlen(work);
2573 work[where+1] =
cname[i];
2575 previousdot = where+1;
2577 previousdot = strlen(work);
2578 work[strlen(work)] =
cname[i];
2588 strncat(right,work,2*
kMaxLen-1-strlen(right));
2592 if (strlen(right) && right[strlen(right)-1]!=
'.' &&
cname[i]!=
'.') {
2596 strncat(right,
".",2*
kMaxLen-1-strlen(right));
2601 if (!
final && branch) {
2604 if (!leaf)
return -1;
2610 if (strlen(right)==0) strlcpy(right,work,2*
kMaxLen);
2613 if (leaf==
nullptr && left[0]!=0) {
2614 if (left[strlen(left)-1]==
'.') left[strlen(left)-1]=0;
2618 if (aliasValue && strcspn(aliasValue,
"()[]+*/-%&!=<>|")==strlen(aliasValue)) {
2621 if (find(aliasUsed.begin(),
2623 left) != aliasUsed.end()) {
2624 Error(
"DefinedVariable",
2625 "The substitution of the branch alias \"%s\" by \"%s\" in \"%s\" failed\n"\
2626 "\tbecause \"%s\" is used [recursively] in its own definition!",
2627 left,aliasValue,fullExpression,left);
2630 aliasUsed.push_back(left);
2631 TString newExpression = aliasValue;
2632 newExpression += (
cname+strlen(left));
2634 castqueue, aliasUsed, useLeafCollectionObject, fullExpression);
2636 Error(
"DefinedVariable",
2637 "The substitution of the alias \"%s\" by \"%s\" failed.",left,aliasValue);
2688 if (!
fTree)
return -1;
2694 if (
name ==
"Entry$") {
2700 if (
name ==
"LocalEntry$") {
2706 if (
name ==
"Entries$") {
2714 if (
name ==
"LocalEntries$") {
2722 if (
name ==
"Iteration$") {
2728 if (
name ==
"Length$") {
2734 static const char *
lenfunc =
"Length$(";
2735 if (strncmp(
name.Data(),
"Length$(",strlen(
lenfunc))==0
2747 static const char *minfunc =
"Min$(";
2748 if (strncmp(
name.Data(),
"Min$(",strlen(minfunc))==0
2760 static const char *maxfunc =
"Max$(";
2761 if (strncmp(
name.Data(),
"Max$(",strlen(maxfunc))==0
2773 static const char *sumfunc =
"Sum$(";
2774 if (strncmp(
name.Data(),
"Sum$(",strlen(sumfunc))==0
2793 if (res<0)
return res;
2801 char dims[
kMaxLen]; dims[0] =
'\0';
2810 for(i=0,k=0; i<cnamelen; ++i, ++k) {
2811 if (
cname[i] ==
'[') {
2813 int bracket_level = 1;
2815 for (j=++i; j<cnamelen && (bracket_level>0 ||
cname[j]==
'['); j++, i++) {
2816 if (
cname[j]==
'[') bracket_level++;
2817 else if (
cname[j]==
']') bracket_level--;
2819 if (bracket_level != 0) {
2823 strncat(dims,&
cname[bracket],j-bracket);
2830 bool useLeafCollectionObject =
false;
2832 TLeaf *leaf =
nullptr;
2837 if (res<0)
return res;
2839 if (!leaf && res!=2) {
2848 Error(
"DefinedVariable",
2849 "The substitution of the alias \"%s\" by \"%s\" failed\n"\
2850 "\tbecause \"%s\" is recursively used in its own definition!",
2856 if (strcspn(aliasValue,
"()+*/-%&!=<>|")!=strlen(aliasValue)) {
2862 aliasSofar.push_back(
cname );
2864 TString subValue( aliasValue );
2873 Error(
"DefinedVariable",
2874 "The substitution of the alias \"%s\" by \"%s\" failed.",
cname,aliasValue);
2889 TString thisAlias( aliasValue );
2897 Error(
"Compile",
" Bad numerical expression : \"%s\"",thisAlias.
Data());
2898 }
else if (aliasRes==-2) {
2899 Error(
"Compile",
" Part of the Variable \"%s\" exists but some of it is not accessible or useable",thisAlias.
Data());
2902 Error(
"DefinedVariable",
2903 "The substitution of the alias \"%s\" by \"%s\" failed.",
cname,aliasValue);
2912 if (leaf || res==2) {
2915 Error(
"DefinedVariable",
"the branch \"%s\" has to be enabled to be used",leaf->
GetBranch()->
GetName());
2924 char *current = &( dims[0] );
2931 if (current[0] ==
']') {
2934 scanindex = sscanf(current,
"%d",&
index);
2940 char *end = (
char*)(varindex.
Data());
2941 for(
char bracket_level = 0;*end!=0;end++) {
2942 if (*end==
'[') bracket_level++;
2943 if (bracket_level==0 && *end==
']')
break;
2944 if (*end==
']') bracket_level--;
2954 current += strlen(varindex)+1;
2962 current = (
char*)strstr( current,
"[" );
2969 res =
ParseWithLeaf(leaf,leftover,
final,paran_level,castqueue,useLeafCollectionObject,
name);
2970 if (res<0)
return res;
2971 if (res>0) action = res;
2999 }
else if (strlen(gcut->
GetVarX())) {
3008 for(
Int_t i2 = 1; i2<
n; i2++) {
3009 if (
x[i2] < min) min =
x[i2];
3010 if (
x[i2] > max) max =
x[i2];
3029 Error(
"DefinedVariable",
"Found a TCutG without leaf information (%s)",
3066 while ((leafcur = (
TLeaf*)nextleaf())) {
3094 if (clonesinfo) {
delete clonesinfo; clonesinfo =
nullptr; }
3114 bool toplevel = (branch == branch->
GetMother());
3118 if (clones) cl = clones->
GetClass();
3160 leafinfo = clonesinfo;
3172 Int_t clones_offset = 0;
3177 else leafinfo->
fNext = sub_clonesinfo;
3178 else leafinfo = sub_clonesinfo;
3184 delete leafinfo; clonesinfo =
nullptr;
3189 if (!clones)
continue;
3250 }
else if (
type > 60) {
3309 Error(
"BranchHasMethod",
"A TClonesArray was stored in a branch type no yet support (i.e. neither TBranchObject nor TBranchElement): %s",branch->
IsA()->
GetName());
3312 cl = clones ? clones->
GetClass() :
nullptr;
3346 Int_t real_instance = 0;
3381 if (local_index<0) {
3382 Error(
"EvalInstance",
"Index %s is out of bound (%d) in formula %s",
3389 real_instance = local_index *
fCumulSizes[codeindex][1];
3414 if (local_index<0) {
3415 Error(
"EvalInstance",
"Index %s is out of bound (%d) in formula %s",
3435 if (check)
return fNdata[0]+1;
3440 }
while(
instance >= virt_accum && local_index<maxloop);
3446 if (local_index==(maxloop-1) && (
instance >= virt_accum)) {
3448 if (check)
return fNdata[0]+1;
3454 if (check)
return fNdata[0]+1;
3462 local_index =
fIndexes[codeindex][0];
3489 if (
fIndexes[codeindex][vdim]>=0) {
3492 if (isize!=1 &&
fIndexes[codeindex][vdim]>isize) {
3497 for(
Int_t k=vdim -1; k>0; --k) {
3501 real_instance = local_index *
fCumulSizes[codeindex][1];
3505 for (
Int_t dim = 1; dim < max_dim; dim++) {
3516 if (
fIndexes[codeindex][dim]==-2) {
3523 if (local_index<0 ||
3525 Error(
"EvalInstance",
"Index %s is out of bound (%d/%d) in formula %s",
3533 real_instance += local_index *
fCumulSizes[codeindex][dim+1];
3537 if (
fIndexes[codeindex][max_dim]>=0) {
3538 if (!info) real_instance +=
fIndexes[codeindex][max_dim];
3546 if (info && local_index>=
fCumulSizes[codeindex][max_dim]) {
3550 if (
fIndexes[codeindex][max_dim]==-2) {
3556 if (local_index<0 ||
3558 Error(
"EvalInstance",
"Index %s is of out bound (%d/%d) in formula %s",
3566 real_instance += local_index;
3571 return real_instance;
3610 if (elem==
nullptr) {
3625 if (!obj)
return nullptr;
3629 default:
return nullptr;
3669 else if (real_instance>=
fNdata[0])
return nullptr;
3675 if (real_instance) {
3676 Warning(
"EvalObject",
"Not yet implement for kDirect and arrays (for %s).\nPlease contact the developers",
GetName());
3683 default:
return nullptr;
3695 const Int_t kMAXSTRINGFOUND = 10;
3696 const char *stringStack[kMAXSTRINGFOUND];
3707 }
else if (real_instance>=
fNdata[0]) {
3720 return stringStack[0];
3723#define TT_EVAL_INIT \
3724 TLeaf *leaf = (TLeaf*)fLeaves.UncheckedAt(0); \
3726 const Int_t real_instance = GetRealInstance(instance,0); \
3728 if (instance==0) fNeedLoading = true; \
3729 if (real_instance>=fNdata[0]) return 0; \
3735 if (fNeedLoading) { \
3736 fNeedLoading = false; \
3737 TBranch *br = leaf->GetBranch(); \
3738 Long64_t tentry = br->GetTree()->GetReadEntry(); \
3739 R__LoadBranch(br,tentry,fQuickLoad); \
3746 if (fLookupType[0]==kDirect) { \
3747 label = (char*)leaf->GetValuePointer(); \
3749 label = (char*)GetLeafInfo(0)->GetValuePointer(leaf,instance); \
3751 Int_t bin = fAxis->FindBin(label); \
3755#define TREE_EVAL_INIT \
3756 const Int_t real_instance = GetRealInstance(instance,0); \
3758 if (real_instance>=fNdata[0]) return 0; \
3764 label = (char*)GetLeafInfo(0)->GetValuePointer((TLeaf*)0x0,instance); \
3765 Int_t bin = fAxis->FindBin(label); \
3769#define TT_EVAL_INIT_LOOP \
3770 TLeaf *leaf = (TLeaf*)fLeaves.UncheckedAt(code); \
3773 const Int_t real_instance = GetRealInstance(instance,code); \
3776 TBranch *branch = (TBranch*)fBranches.UncheckedAt(code); \
3778 Long64_t treeEntry = branch->GetTree()->GetReadEntry(); \
3779 R__LoadBranch(branch,treeEntry,fQuickLoad); \
3780 } else if (fDidBooleanOptimization) { \
3781 branch = leaf->GetBranch(); \
3782 Long64_t treeEntry = branch->GetTree()->GetReadEntry(); \
3783 if (branch->GetReadEntry() != treeEntry) branch->GetEntry( treeEntry ); \
3789 if (fDidBooleanOptimization) { \
3790 TBranch *br = leaf->GetBranch(); \
3791 Long64_t treeEntry = br->GetTree()->GetReadEntry(); \
3792 if (br->GetReadEntry() != treeEntry) br->GetEntry( treeEntry ); \
3795 if (real_instance>=fNdata[code]) return 0;
3797#define TREE_EVAL_INIT_LOOP \
3799 const Int_t real_instance = GetRealInstance(instance,code); \
3801 if (real_instance>=fNdata[code]) return 0;
3807 for (
int i=0; i<
len; ++i) res +=
sum->EvalInstance<T>(i);
3816 for (
int i=1; i<
len; ++i) {
3831 for (
int i=1; i<
len; ++i) {
3850 }
while (!condval && i<
len);
3851 if (!condval && i==
len) {
3860 for (; i<
len; ++i) {
3882 }
while (!condval && i<
len);
3883 if (!condval && i==
len) {
3892 for (; i<
len; ++i) {
3907template <
typename T>
T fmod_local(T
x, T
y) {
return fmod(
x,
y); }
3924 if( !strncmp(
fExpr[op],
"0x", 2) || !strncmp(
fExpr[op],
"0X", 2) ) {
3926 sscanf(
fExpr[op],
"%llx", &val );
3952 return leaf->GetTypedValue<T>(real_instance);
4010 const Int_t kMAXSTRINGFOUND = 10;
4011 const char *stringStackLocal[kMAXSTRINGFOUND];
4012 const char **stringStack = stringStackArg?stringStackArg:stringStackLocal;
4028 if (newaction==
kConstant) { pos++; tab[pos-1] = GetConstant<T>(oper &
kTFOperMask);
continue; }
4032 case kEnd :
return tab[0];
4033 case kAdd : pos--; tab[pos-1] += tab[pos];
continue;
4034 case kSubstract : pos--; tab[pos-1] -= tab[pos];
continue;
4035 case kMultiply : pos--; tab[pos-1] *= tab[pos];
continue;
4036 case kDivide : pos--;
if (tab[pos] == 0) tab[pos-1] = 0;
4037 else tab[pos-1] /= tab[pos];
4042 tab[pos-1] =
T(int1 % int2);
4062 case kacosh:
if (tab[pos-1] < 1) {tab[pos-1] = 0;}
4071 case kfmod : pos--; tab[pos-1] = fmod_local(tab[pos-1],tab[pos]);
continue;
4072 case kpow : pos--; tab[pos-1] =
TMath::Power(tab[pos-1],tab[pos]);
continue;
4073 case ksq : tab[pos-1] = tab[pos-1]*tab[pos-1];
continue;
4076 case kstrstr : pos2 -= 2; pos++;
if (strstr(stringStack[pos2],stringStack[pos2+1])) tab[pos-1]=1;
4080 case kmin : pos--; tab[pos-1] = std::min(tab[pos-1],tab[pos]);
continue;
4081 case kmax : pos--; tab[pos-1] = std::max(tab[pos-1],tab[pos]);
continue;
4083 case klog :
if (tab[pos-1] > 0) tab[pos-1] =
TMath::Log(tab[pos-1]);
4084 else {tab[pos-1] = 0;}
4087 if (dexp < -700) {tab[pos-1] = 0;
continue;}
4088 if (dexp > 700) {tab[pos-1] =
TMath::Exp(700);
continue;}
4092 else {tab[pos-1] = 0;}
4098 case ksign :
if (tab[pos-1] < 0) tab[pos-1] = -1;
else tab[pos-1] = 1;
4101 case kSignInv: tab[pos-1] = -1 * tab[pos-1];
continue;
4104 case kAnd : pos--;
if (tab[pos-1]!=0 && tab[pos]!=0) tab[pos-1]=1;
4107 case kOr : pos--;
if (tab[pos-1]!=0 || tab[pos]!=0) tab[pos-1]=1;
4111 case kEqual : pos--; tab[pos-1] = (tab[pos-1] == tab[pos]) ? 1 : 0;
continue;
4112 case kNotEqual : pos--; tab[pos-1] = (tab[pos-1] != tab[pos]) ? 1 : 0;
continue;
4113 case kLess : pos--; tab[pos-1] = (tab[pos-1] < tab[pos]) ? 1 : 0;
continue;
4114 case kGreater : pos--; tab[pos-1] = (tab[pos-1] > tab[pos]) ? 1 : 0;
continue;
4115 case kLessThan : pos--; tab[pos-1] = (tab[pos-1] <= tab[pos]) ? 1 : 0;
continue;
4116 case kGreaterThan: pos--; tab[pos-1] = (tab[pos-1] >= tab[pos]) ? 1 : 0;
continue;
4117 case kNot : tab[pos-1] = (tab[pos-1] != 0) ? 0 : 1;
continue;
4119 case kStringEqual : pos2 -= 2; pos++;
if (!strcmp(stringStack[pos2+1],stringStack[pos2])) tab[pos-1]=1;
4122 case kStringNotEqual: pos2 -= 2; pos++;
if (strcmp(stringStack[pos2+1],stringStack[pos2])) tab[pos-1]=1;
4147 pos2++; stringStack[pos2-1] = (
char*)
fExpr[i].Data();
4161 int op = param % 10;
4163 if (op == 1 && (!tab[pos-1]) ) {
4172 }
else if (op == 2 && tab[pos-1] ) {
4183 int toskip = param / 10;
4194 int fno = param / 1000;
4195 int nargs = param % 1000;
4203 UInt_t argloc = pos-nargs;
4204 for(
Int_t j=0;j<nargs;j++,argloc++,pos--) {
4205 SetMethodParam(method, tab[argloc]);
4228 switch (lookupType) {
4243 GetTypedValue<T>(leaf,real_instance);
continue; }
4245 GetTypedValue<T>((
TLeaf*)
nullptr,real_instance);
continue; }
4250 default: tab[pos++] = 0;
continue;
4263 tab[pos++] = gcut->
IsInside(xcut,ycut);
4292 tab[pos] = param; pos++;
4310 T param = FindMin<T>(primary,condition);
4312 tab[pos] = param; pos++;
4319 T param = FindMax<T>(primary,condition);
4321 tab[pos] = param; pos++;
4331 if (instance < primary->
GetNdata()) {
4337 tab[pos] = param; pos++;
4351 if (instance < primary->
GetNdata()) {
4389 if (real_instance>=
fNdata[string_code])
return 0;
4411template double TTreeFormula::EvalInstance<double> (
int,
char const**);
4412template long double TTreeFormula::EvalInstance<long double> (
int,
char const**);
4413template long long TTreeFormula::EvalInstance<long long> (
int,
char const**);
4466 void* thisobj =
nullptr;
4479 Warning(
"GetValueFromMethod",
"No streamer info for branch %s.", branch->
GetName());
4489 thisobj = *((
char**) (address +
offset));
4539 Warning(
"GetValuePointerFromMethod",
"No streamer info for branch %s.", branch->
GetName());
4549 thisobj = *((
char**) (address +
offset));
4605 if (
fNoper > 1)
return false;
4664 if (
fAxis)
return true;
4675 if (!strcmp(leaf->
GetTypeName(),
"Int_t"))
return true;
4676 if (!strcmp(leaf->
GetTypeName(),
"Short_t"))
return true;
4677 if (!strcmp(leaf->
GetTypeName(),
"UInt_t"))
return true;
4678 if (!strcmp(leaf->
GetTypeName(),
"UShort_t"))
return true;
4679 if (!strcmp(leaf->
GetTypeName(),
"Bool_t"))
return true;
4680 if (!strcmp(leaf->
GetTypeName(),
"Char_t"))
return true;
4681 if (!strcmp(leaf->
GetTypeName(),
"UChar_t"))
return true;
4682 if (!strcmp(leaf->
GetTypeName(),
"Long64_t"))
return true;
4683 if (!strcmp(leaf->
GetTypeName(),
"ULong64_t"))
return true;
4684 if (!strcmp(leaf->
GetTypeName(),
"string"))
return true;
4732 if (indexname[strlen(indexname)-1] ==
'_' ) {
4744 if (bid < 0)
return false;
4807 const int kMAXLENGTH = 1024;
4808 static char value[kMAXLENGTH];
4811 for (
int i = 0; i < kMAXLENGTH-1; i++)
4813 value[kMAXLENGTH-1] = 0;
4814 }
else if (
mode == -1) {
4816 }
else if (
mode == 0) {
4819 const char * val =
nullptr;
4842 strlcpy(
value, val, kMAXLENGTH);
4846 value[kMAXLENGTH-1] = 0;
4851 if (real_instance<
fNdata[0]) {
4853 Char_t outputSizeLevel = 1;
4854 char *expo =
nullptr;
4856 switch (decform[
len-2]) {
4859 outputSizeLevel = 2;
4860 if (
len>3 && tolower(decform[
len-3])==
'l') {
4861 outputSizeLevel = 3;
4865 case 'h': outputSizeLevel = 0;
break;
4868 switch(decform[
len-1]) {
4873 switch (outputSizeLevel) {
4887 switch (outputSizeLevel) {
4902 switch (outputSizeLevel) {
4907 expo = strchr(
value,
'e');
4912 expo = strchr(
value,
'e');
4917 UInt_t declen = atoi(decform);
4918 if (strlen(
value)>declen) {
4920 char *start = expo - off;
4921 UInt_t vlen = strlen(expo);
4922 for(
UInt_t z=0;z<=vlen;++z) {
4929 if (isalpha(decform[strlen(decform)-1])) {
4930 TString short_decform(decform);
4953 for(
UInt_t dim=0; dim<max_dim ;++dim) {
4963 for(
Int_t k=0; k <=
n; ++k) {
4986 if (!axis) {
fAxis =
nullptr;
return;}
5076 for (
Int_t i=0;i<nleaves;i++) {
5106 if (
fy)
fy->UpdateFormulaLeaves();
5159 Int_t last_code = -1;
5162 if (last_code!=info->fCode) {
5167 last_code = info->fCode;
5176 while(nextinfo && nextinfo->
fCode==info->fCode) {
5180 if (!nextinfo)
break;
5184 last_code = info->fCode;
5236 if (!gcut)
continue;
5249 switch(
fy->GetMultiplicity()) {
5266 if (!leaf)
continue;
5295 if (tleaf && tleaf != realtree && tleaf->
GetTreeIndex()) {
5301 Int_t virt_dim2 = 0;
5309 if (
fIndexes[i][k] < 0 ) virt_dim2++;
5337 for (i=0; i<
fNoper ; ++i) {
5339 if (leaf==
nullptr)
continue;
5349 for (
Int_t dim = 0; dim < max_dim; ++dim) {
5360 bool outofbounds =
false;
5363 if (
fCodes[i] < 0)
continue;
5391 if (tleaf && tleaf != realtree && tleaf->
GetTreeIndex()) {
5400 bool hasBranchCount2 =
false;
5409 if (readentry < 0) readentry=0;
5416 branchcount->TBranch::GetEntry(readentry);
5444 hasBranchCount2 =
true;
5451 for(
Int_t k=vdim -1; k>=0; k--) {
5465 if (readentry < 0) readentry=0;
5469 if (hasBranchCount2) {
5498 }
else if (hasBranchCount2) {
5514 if (readentry < 0) readentry=0;
5539 hasBranchCount2 =
true;
5541 for(
int z=0; z<
size; ++z) {
5545 }
else if (
fIndexes[i][vdim] >= 0 ) {
5555 for(
Int_t k=vdim -1; k>=0; k--) {
5565 if (readentry < 0) readentry=0;
5584 if (
fManager->
fUsedSizes[virt_dim]==1 || (index_size!=1 && index_size<fManager->fUsedSizes[virt_dim]) )
5591 if (index_size==1) {
5595 if (index_size<fManager->fUsedSizes[virt_dim])
fManager->
fUsedSizes[virt_dim] = index_size;
5599 index_size<fManager->fUsedSizes[virt_dim]) {
5603 }
else if (hasBranchCount2 && info && k==info->
GetVarDim()) {
5607 if (
fManager->
fUsedSizes[virt_dim]==1 || (index_size!=1 && index_size<fManager->fUsedSizes[virt_dim]) )
5612 }
else if (hasBranchCount2 && info && k==info->
GetVarDim()) {
5625 return ! outofbounds;
5635 enum { kOldAlias = 100000+10000+1,
5636 kOldAliasString = kOldAlias+1,
5637 kOldAlternate = kOldAlias+2,
5638 kOldAlternateString = kOldAliasString+2
5641 for (
int k=0; k<
fNoper; k++) {
5648 case kOldAlias:
GetOper()[k] = -kOldAlias;
break;
5649 case kOldAliasString:
GetOper()[k] = -kOldAliasString;
break;
5650 case kOldAlternate:
GetOper()[k] = -kOldAlternate;
break;
5651 case kOldAlternateString:
GetOper()[k] = -kOldAlternateString;
break;
5683 if (!leaf)
return false;
5697 last = clonesinfo->
fNext;
5701 }
else if (br->
GetType()==41) {
5706 if ( count->
GetID() >= 0 ) {
5725 last = collectioninfo->
fNext;
5729 }
else if (br->
GetID()<0) {
static Roo_reg_AGKInteg1D instance
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
unsigned long long ULong64_t
const Int_t kDoNotProcess
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
void Set(Int_t n) override
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
const char * GetClassName() const override
Return the name of the user class whose content is stored in this branch, if any.
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
void SetupAddresses() override
If the branch address is not set, we set all addresses starting with the top level parent branch.
Int_t GetStreamerType() const
TBranchElement * GetBranchCount2() const
char * GetAddress() const override
Get the branch address.
char * GetObject() const
Return a pointer to our object.
A Branch for the case of an object.
const char * GetClassName() const override
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.
TClass * IsA() const override
void Print(Option_t *option="") const override
Print TBranch parameters.
virtual TLeaf * FindLeaf(const char *name)
Find the leaf corresponding to the name 'searchname'.
Long64_t GetReadEntry() const
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 Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=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.
Bool_t HasDataMemberInfo() const
ClassInfo_t * GetClassInfo() const
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
TClass * IsA() const override
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
A small helper class to help in keeping track of the array dimensions encountered in the analysis of ...
TDimensionInfo(Int_t code, Int_t oper, Int_t size, TFormLeafInfoMultiVarDim *multiDim)
~TDimensionInfo() override
TFormLeafInfoMultiVarDim * fMultiDim
Describe directory structure in memory.
virtual Bool_t cd()
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=nullptr)
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.
TObject * FindObject(const char *name) const override
Search object named name in the list of functions.
A TLeaf for the general case when using the branches created via a TStreamerInfo (i....
bool IsOnTerminalBranch() const override
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 IsUnsigned() 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...
TClass * IsA() const override
virtual bool IsOnTerminalBranch() const
TBranch * GetBranch() const
virtual Int_t GetLenStatic() const
Return the fixed length of this leaf.
void Add(TObject *obj) override
void Delete(Option_t *option="") override
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.
void Execute(const char *, const char *, int *=nullptr) override
Execute method on this object with the given parameter string, e.g.
Bool_t IsValid() const
Return true if the method call has been properly initialized and is usable.
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.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Int_t GetEntriesFast() const
Int_t IndexOf(const TObject *obj) const override
void AddAt(TObject *obj, Int_t idx) override
Add object at position ids.
TObject * Last() const override
Return the object in the last filled slot. Returns 0 if no entries.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
void Streamer(TBuffer &) override
Stream all objects in the array to or from the I/O buffer.
Int_t GetEntries() const override
Return the number of objects in array (i.e.
void Delete(Option_t *option="") override
Remove all objects from the array AND delete all heap based objects.
TObject * At(Int_t idx) const override
TObject * UncheckedAt(Int_t i) const
TObject * FindObject(const char *name) const override
Find an object in this collection using its name.
Int_t GetLast() const override
Return index of last object in array.
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.
virtual void Execute(const char *method, const char *params, Int_t *error=nullptr)
Execute method on this object with the given parameter string, e.g.
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.
Double_t Rndm() override
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
TClass * IsA() const override
Describes a persistent version of a class.
TStreamerElement * GetElement(Int_t id) const override
Int_t GetElementOffset(Int_t id) const override
TClass * GetClass() const override
TStreamerElement * GetStreamerElement(const char *datamember, Int_t &offset) const override
Return the StreamerElement of "datamember" inside our class or any of its base classes.
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 TIterator * GetIteratorOnAllLeaves(bool dir=kIterForward)
Creates a new iterator that will go through all the leaves on the tree itself and its friend.
virtual TVirtualIndex * GetTreeIndex() const
virtual Long64_t GetEntries() const
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
If the value type is a fundamental data type, return its type (see enumeration EDataType).
virtual TClass * GetValueClass() const =0
If the value type is a user-defined class, return a pointer to the TClass representing the value type...
virtual TClass * GetValueClass(void *data) const =0
virtual Bool_t HasCounter() const =0
Bool_t IsCompiled() const
virtual TObjArray * GetElements() const =0
RVec< PromoteTypes< T0, T1 > > fmod(const T0 &x, const RVec< T1 > &v)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Double_t CosH(Double_t)
Returns the hyperbolic cosine of x.
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Double_t ASin(Double_t)
Returns the principal value of the arc sine of x, expressed in radians.
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
Double_t ATan(Double_t)
Returns the principal value of the arc tangent of x, expressed in radians.
Double_t ASinH(Double_t)
Returns the area hyperbolic sine of x.
Double_t TanH(Double_t)
Returns the hyperbolic tangent of x.
Double_t ACosH(Double_t)
Returns the nonnegative area hyperbolic cosine of x.
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
Double_t ATanH(Double_t)
Returns the area hyperbolic tangent of x.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Double_t SinH(Double_t)
Returns the hyperbolic sine of `x.
static uint64_t sum(uint64_t i)