102 if (!quickLoad || (br->GetReadEntry() !=
entry)) {
112 class TDimensionInfo :
public TObject {
119 : fCode(code), fOper(oper), fSize(size), fMultiDim(multiDim) {};
120 ~TDimensionInfo() {};
126 fDidBooleanOptimization(
kFALSE), fDimensionSetup(0)
160 fDidBooleanOptimization(
kFALSE), fDimensionSetup(0)
162 Init(name,expression);
169 const std::vector<std::string>& aliases)
171 fDidBooleanOptimization(
kFALSE), fDimensionSetup(0), fAliasesUsed(aliases)
173 Init(name,expression);
210 fTree = 0;
fNdim = 0;
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)",
277 fTree = 0;
fNdim = 0;
278 if(savedir) savedir->
cd();
303 Long64_t readentry = fTree->GetReadEntry();
304 Int_t treenumber = fTree->GetTreeNumber();
306 if (treenumber != fTree->GetTreeNumber()) {
307 if (readentry >= 0) {
308 fTree->LoadTree(readentry);
312 if (readentry >= 0) {
313 fTree->LoadTree(readentry);
319 if(savedir) savedir->
cd();
341 for (
int j=0; j<
fNcodes; j++) {
374 switch (index_multiplicity) {
388 if (
fIndexes[code][fNdimensions[code]] < 0 ) {
392 fNdimensions[code] ++;
402 const char * current;
403 Int_t size, scanindex, vardim;
411 if (current[0] !=
'[') current--;
414 scanindex = sscanf(current,
"%d",&size);
418 if (scanindex==0) size = -1;
427 current = (
char*)strstr( current,
"[" );
437 TDimensionInfo * info =
new TDimensionInfo(code,
fNoper,size,multidim);
440 fNdimensions[code] ++;
441 return (size==-1) ? 1 : 0;
449 Bool_t useCollectionObject) {
450 Int_t ndim, size, current, vardim;
482 if (maininfo==0 || maininfo==leafinfo || 1) {
488 delete currentinfo->
fNext;
544 }
while (current<ndim);
581 Int_t numberOfVarDim = 0;
586 const char *tname = leaf->
GetTitle();
587 char *leaf_dim = (
char*)strstr( tname,
"[" );
590 char *branch_dim = (
char*)strstr(bname,
"[");
591 if (branch_dim) branch_dim++;
603 if (!branch_dim || strncmp(branch_dim,leaf_dim,strlen(branch_dim))) {
606 }
else if (branch_dim && strncmp(branch_dim,leaf_dim,strlen(branch_dim))==0
607 && strlen(leaf_dim)>strlen(branch_dim)
608 && (leaf_dim+strlen(branch_dim))[0]==
'[') {
627 "Noticed an incorrect in-memory TBranchElement object (%s).\nIt has a BranchCount2 but no BranchCount!\nThe result might be incorrect!",
629 return numberOfVarDim;
635 "Already in kDataMember mode when handling multiple variable dimensions");
643 return numberOfVarDim;
656 static const char *altfunc =
"Alt$(";
657 static const char *minfunc =
"MinIf$(";
658 static const char *maxfunc =
"MaxIf$(";
662 if ( strncmp(expression,altfunc,strlen(altfunc))==0
663 && expression[strlen(expression)-1]==
')' ) {
665 start = strlen(altfunc);
667 if ( strncmp(expression,maxfunc,strlen(maxfunc))==0
668 && expression[strlen(expression)-1]==
')' ) {
670 start = strlen(maxfunc);
672 if ( strncmp(expression,minfunc,strlen(minfunc))==0
673 && expression[strlen(expression)-1]==
')' ) {
675 start = strlen(minfunc);
685 for(
unsigned int i=start;i<strlen(expression);++i) {
686 switch (expression[i]) {
687 case '(': paran++;
break;
688 case ')': paran--;
break;
689 case '"': instr = instr ? 0 : 1;
break;
690 case '[': brack++;
break;
691 case ']': brack--;
break;
693 if (expression[i]==
',' && paran==0 && instr==0 && brack==0) {
694 part1 = full( start, i-start );
695 part2 = full( i+1, full.
Length() -1 - (i+1) );
707 Error(
"DefinedVariable",
"The 2nd arguments in %s can not be an array (%s,%d)!",
716 Error(
"DefinedVariable",
717 "The 2nd arguments in %s has to return the same type as the 1st argument (string)!",
723 Error(
"DefinedVariable",
724 "The 2nd arguments in %s has to return the same type as the 1st argument (numerical type)!",
733 Error(
"DefinedVariable",
734 "The arguments of %s can not be strings!",
765 Int_t numberOfVarDim = 0;
768 char scratch[
kMaxLen]; scratch[0] =
'\0';
769 char work[
kMaxLen]; work[0] =
'\0';
771 const char *right = subExpression;
776 if (readentry < 0) readentry=0;
778 Bool_t useLeafReferenceObject =
false;
779 Int_t code = fNcodes-1;
789 Error(
"DefinedVariable",
"Missing StreamerInfo for %s. We will be unable to read!",
801 Error(
"DefinedVariable",
"Missing StreamerInfo for %s."
802 " We will be unable to read!",
807 Error(
"DefinedVariable",
"Address not set when the type of the branch is negative for for %s. We will be unable to read!", mom->
GetName());
820 const char* alias = 0;
823 if (!alias && realtree!=fTree) {
828 if (alias) snprintf(scratch,kMaxLen-1,
"%s.%s",alias,leaf->
GetName());
831 TTree *tleaf = realtree;
834 fCodes[code] = tleaf->GetListOfLeaves()->IndexOf(leaf);
838 if (mother_name[strlen(mother_name)-1]!=
'.') {
839 br_extended_name = mother_name;
840 br_extended_name.
Append(
'.');
845 if (dim >= 0) br_extended_name.
Remove(dim);
856 if (fMultiplicity >= 0) fMultiplicity = 1;
933 "Missing TStreamerElement in object in TClonesArray section");
944 maininfo = clonesinfo;
963 maininfo->
fNext = previnfo;
964 unwindCollection =
kTRUE;
966 }
else if (branchEl->
GetType()==41) {
971 Warning(
"DefineVariable",
"Missing TStreamerElement in object in Collection section");
977 if ( count->
GetID() >= 0 ) {
996 maininfo = collectioninfo;
1015 maininfo->
fNext = previnfo;
1016 unwindCollection =
kTRUE;
1018 }
else if ( branchEl->
GetType()==3) {
1020 if (useLeafCollectionObject) {
1025 numberOfVarDim +=
RegisterDimensions(code,clonesinfo,maininfo,useLeafCollectionObject);
1028 maininfo = clonesinfo;
1029 previnfo = maininfo;
1031 }
else if (!useLeafCollectionObject && branchEl->
GetType()==4) {
1034 if (useLeafCollectionObject) {
1039 numberOfVarDim +=
RegisterDimensions(code,collectioninfo,maininfo,useLeafCollectionObject);
1042 maininfo = collectioninfo;
1043 previnfo = maininfo;
1047 if (useLeafCollectionObject) {
1050 maininfo = collectioninfo;
1051 previnfo = collectioninfo;
1058 maininfo = collectioninfo;
1059 previnfo = collectioninfo;
1069 previnfo->
fNext = multi;
1072 previnfo = multi->
fNext;
1080 previnfo = previnfo->
fNext;
1086 }
else if (strlen(right)==0 && cl && element &&
final) {
1089 if (!useLeafCollectionObject
1100 maininfo = collectioninfo;
1101 previnfo = collectioninfo;
1110 previnfo->
fNext = multi;
1113 previnfo = multi->
fNext;
1120 previnfo = previnfo->
fNext;
1123 }
else if (!useLeafCollectionObject
1139 collectioninfo->
fNext =
1142 maininfo = collectioninfo;
1143 previnfo = maininfo->
fNext;
1145 }
else if (!useLeafCollectionObject
1156 previnfo = maininfo;
1161 if ( useLeafCollectionObject || fullExpression[0] ==
'@' || fullExpression[strlen(scratch)] ==
'@' ) {
1162 useLeafReferenceObject =
true;
1179 Error(
"DefinedVariable",
"Failed to access class type of reference target (%s)",element->
GetName());
1190 if (unwindCollection) {
1193 R__ASSERT(numberOfVarDim==1 && maininfo);
1200 previnfo->
fNext = multi;
1203 previnfo = multi->
fNext;
1210 previnfo = previnfo->
fNext;
1218 previnfo->
fNext = multi;
1221 previnfo = multi->
fNext;
1230 Int_t nchname = strlen(right);
1245 Error(
"DefinedVariable",
"%s does not inherit from %s. Casting not possible!",
1252 maininfo = leafinfo;
1255 previnfo = leafinfo;
1257 previnfo->
fNext = leafinfo;
1258 previnfo = leafinfo;
1263 castqueue.
AddAt(0,paran_level);
1267 Bool_t prevUseCollectionObject = useLeafCollectionObject;
1268 Bool_t useCollectionObject = useLeafCollectionObject;
1269 Bool_t useReferenceObject = useLeafReferenceObject;
1270 Bool_t prevUseReferenceObject = useLeafReferenceObject;
1271 for (i=0, current = &(work[0]); i<=nchname;i++ ) {
1273 if (right[i] ==
'(') {
1276 *current++ = right[i++];
1277 }
while(right[i]!=
')' && right[i]);
1278 *current++ = right[i];
1280 char *params = strchr(work,
'(');
1282 *params = 0; params++;
1283 }
else params = (
char *)
")";
1285 Error(
"DefinedVariable",
"Can not call '%s' with a class",work);
1289 Error(
"DefinedVariable",
"Class probably unavailable:%s",cl->
GetName());
1298 R__LoadBranch(clbranch,readentry,
fQuickLoad);
1316 previnfo = clonesinfo;
1317 maininfo = clonesinfo;
1349 previnfo = collectioninfo;
1350 maininfo = collectioninfo;
1355 if (inside_cl) cl = inside_cl;
1357 Warning(
"DefinedVariable",
"Can not call method on content of %s in %s\n",
1364 Error(
"DefinedVariable",
1365 "Could not discover the TClass corresponding to (%s)!",
1369 method =
new TMethodCall(cl,
"GetEntriesFast",
"");
1373 if (useLeafCollectionObject) {
1379 maininfo=previnfo=collectioninfo;
1385 Error(
"DefinedVariable",
1386 "Can not call method %s on class without dictionary (%s)!",
1394 Error(
"DefinedVariable",
"Unknown method:%s in %s",right,cl->
GetName());
1421 Error(
"DefineVariable",
"Method %s from %s has an impossible return type %d",
1427 maininfo = leafinfo;
1430 previnfo = leafinfo;
1432 previnfo->
fNext = leafinfo;
1433 previnfo = leafinfo;
1436 current = &(work[0]);
1438 prevUseCollectionObject =
kFALSE;
1439 prevUseReferenceObject =
kFALSE;
1440 useCollectionObject =
kFALSE;
1443 if (numberOfVarDim>1) {
1444 Warning(
"DefinedVariable",
"TTreeFormula support only 2 level of variables size collections. Assuming '@' notation for the collection %s.",
1447 useCollectionObject =
kTRUE;
1448 }
else if (numberOfVarDim==0) {
1452 }
else if (numberOfVarDim==1) {
1457 previnfo->
fNext = leafinfo;
1458 previnfo = leafinfo;
1464 previnfo->
fNext = leafinfo;
1465 previnfo = leafinfo;
1469 }
else if (right[i] ==
')') {
1472 TClass * casted = (
TClass*) ((
int(--paran_level)>=0) ? castqueue.
At(paran_level) : 0);
1478 maininfo = leafinfo;
1481 previnfo = leafinfo;
1483 previnfo->
fNext = leafinfo;
1484 previnfo = leafinfo;
1487 current = &(work[0]);
1494 }
else if (i > 0 && (right[i] ==
'.' || right[i] ==
'[' || right[i] ==
'\0') ) {
1501 if (strlen(work)==0)
continue;
1503 prevUseCollectionObject = useCollectionObject;
1504 prevUseReferenceObject = useReferenceObject;
1506 useReferenceObject =
kTRUE;
1507 useCollectionObject =
kTRUE;
1509 for(l=0;work[l+1]!=0;++
l) work[l] = work[l+1];
1511 }
else if (work[strlen(work)-1]==
'@') {
1512 useReferenceObject =
kTRUE;
1513 useCollectionObject =
kTRUE;
1514 work[strlen(work)-1] =
'\0';
1516 useReferenceObject =
kFALSE;
1517 useCollectionObject =
kFALSE;
1528 prevUseReferenceObject =
kFALSE;
1531 previnfo = previnfo->
fNext;
1552 R__LoadBranch(clbranch,readentry,
fQuickLoad);
1573 previnfo = clonesinfo;
1574 maininfo = clonesinfo;
1578 Error(
"DefinedVariable",
"Unimplemented usage of ClonesArray");
1589 "TClonesArray object was not retrievable for %s!",
1598 if (1 || inside_cl) cl = inside_cl;
1600 if (0 && strlen(work)==0) {
1613 R__LoadBranch(clbranch,readentry,
fQuickLoad);
1634 previnfo = collectioninfo;
1635 maininfo = collectioninfo;
1644 Warning(
"DefinedVariable",
"No data member in content of %s in %s\n",
1652 Warning(
"DefinedVariable",
"Missing class for %s!",name.
Data());
1657 if (!element && !prevUseCollectionObject) {
1664 Int_t clones_offset = 0;
1672 previnfo->
fNext = clonesinfo;
1674 previnfo->
fNext = 0;
1686 if (maininfo==0) maininfo = leafinfo;
1687 if (previnfo==0) previnfo = leafinfo;
1689 previnfo->
fNext = leafinfo;
1690 previnfo = leafinfo;
1696 }
else if (curelem->GetClassPointer() && curelem->GetClassPointer()->GetCollectionProxy()) {
1698 Int_t coll_offset = 0;
1707 if (numberOfVarDim>1) {
1708 Warning(
"DefinedVariable",
"TTreeFormula support only 2 level of variables size collections. Assuming '@' notation for the collection %s.",
1709 curelem->GetName());
1711 useCollectionObject =
kTRUE;
1712 }
else if (numberOfVarDim==1) {
1724 if (maininfo==0) maininfo = leafinfo;
1725 if (previnfo==0) previnfo = leafinfo;
1727 previnfo->
fNext = leafinfo;
1728 previnfo = leafinfo;
1730 if (leafinfo->
fNext) {
1731 previnfo = leafinfo->
fNext;
1744 if (type<60 && type!=0) {
1746 if (numberOfVarDim>=1 && type>40) {
1751 if (leafinfo && type<=40 ) {
1791 Error(
"DefinedVariable",
1792 "%s is a datamember of %s BUT is not yet of a supported type (%d)",
1797 Error(
"DefinedVariable",
1798 "%s is a datamember of %s BUT is not of a unknown type (%d)",
1803 if (
object && !useCollectionObject &&
1809 if (
object && leafinfo) {
1811 }
else if (objarr) {
1826 if (numberOfVarDim>1) {
1827 Warning(
"DefinedVariable",
"TTreeFormula support only 2 level of variables size collections. Assuming '@' notation for the collection %s.",
1830 useCollectionObject =
kTRUE;
1831 }
else if (numberOfVarDim==1) {
1851 else leafinfo->
fNext = info;
1858 if (!maininfo) maininfo = leafinfo;
1863 if (previnfo==0) previnfo = leafinfo;
1865 previnfo->
fNext = leafinfo;
1866 previnfo = leafinfo;
1881 else leafinfo->
fNext = info;
1897 prevUseReferenceObject =
kFALSE;
1900 }
else if (pointer) {
1912 if (cl)
Error(
"DefinedVariable",
"%s is not a datamember of %s",work,cl->
GetName());
1919 maininfo = leafinfo;
1922 previnfo = leafinfo;
1923 }
else if (previnfo!=leafinfo) {
1924 previnfo->
fNext = leafinfo;
1925 previnfo = leafinfo;
1927 while (previnfo->
fNext) previnfo = previnfo->
fNext;
1929 if ( right[i] !=
'\0' ) {
1930 if ( !needClass && mustderef ) {
1936 if ( inf->IsReference() ) {
1947 Error(
"DefinedVariable",
"Failed to access class type of reference target (%s)",element->
GetName());
1953 Error(
"DefinedVariable",
"Failed to access class type of reference target (%s)",element->
GetName());
1957 else if ( needClass ) {
1961 if (mustderef) leafinfo = 0;
1962 current = &(work[0]);
1971 nchname = strlen(right);
1975 *current++ = right[i];
1984 if (strlen(work)!=0) {
1996 if (!last)
return action;
2000 if (last && last->
GetClass() != objClass) {
2012 last->
fNext = collectioninfo;
2024 if (!last)
return action;
2028 const char *funcname = 0;
2032 }
else if (objClass == stdStringClass) {
2075 method =
new TMethodCall(objClass,
"AsString",
"");
2130 const char *funcname = 0;
2133 }
else if (objClass == stdStringClass) {
2168 if (fTree->GetTree()==0) {
2170 if (fTree->GetTree()==0)
return -1;
2172 Long64_t readentry = fTree->GetTree()->GetReadEntry();
2173 if (readentry < 0) readentry=0;
2174 const char *cname = expression;
2175 char first[
kMaxLen]; first[0] =
'\0';
2176 char second[
kMaxLen]; second[0] =
'\0';
2177 char right[
kMaxLen]; right[0] =
'\0';
2178 char work[
kMaxLen]; work[0] =
'\0';
2179 char left[
kMaxLen]; left[0] =
'\0';
2182 std::string currentname;
2183 Int_t previousdot = 0;
2186 TBranch *branch=0, *tmp_branch=0;
2187 Int_t nchname = strlen(cname);
2192 for (i=0, current = &(work[0]); i<=nchname && !
final;i++ ) {
2194 *current++ = cname[i];
2196 if (cname[i] ==
'(') {
2199 if (current==work+1) {
2202 startWithParan =
kTRUE;
2214 if (cname[i] ==
')') {
2215 if (paran_level==0) {
2216 Error(
"DefinedVariable",
"Unmatched paranthesis in %s",fullExpression);
2221 if (startWithParan) {
2231 current = &(work[0]);
2235 }
else if (
gROOT->GetType(cast_name)) {
2237 current = &(work[0]);
2240 "Casting to primary types like \"%s\" is not supported yet",cast_name.
Data());
2247 char *params = strchr(work,
'(');
2249 *params = 0; params++;
2251 if (branch && !leaf) {
2261 TIter next(fTree->GetIteratorOnAllLeaves());
2263 while (!leaf && (leafcur = (
TLeaf*)
next())) {
2264 TBranch* br = leafcur->GetBranch();
2273 if (strlen(left) && left[strlen(left)-1]==
'.') left[strlen(left)-1]=0;
2274 const char *aliasValue = fTree->GetAlias(left);
2275 if (aliasValue && strcspn(aliasValue,
"+*/-%&!=<>|")==strlen(aliasValue)) {
2278 if (find(aliasUsed.begin(),
2280 left) != aliasUsed.end()) {
2281 Error(
"DefinedVariable",
2282 "The substitution of the branch alias \"%s\" by \"%s\" in \"%s\" failed\n"\
2283 "\tbecause \"%s\" is used [recursively] in its own definition!",
2284 left,aliasValue,fullExpression,left);
2287 aliasUsed.push_back(left);
2288 TString newExpression = aliasValue;
2289 newExpression += (cname+strlen(left));
2291 castqueue, aliasUsed, useLeafCollectionObject, fullExpression);
2293 Error(
"DefinedVariable",
2294 "The substitution of the alias \"%s\" by \"%s\" failed.",left,aliasValue);
2311 strlcpy(right,work,kMaxLen);
2312 strncat(right,
"(",kMaxLen-1-strlen(right));
2313 strncat(right,params,kMaxLen-1-strlen(right));
2317 i += strlen(params);
2320 current = &(work[0]);
2325 if (cname[i] ==
'.' || cname[i] ==
'\0' || cname[i] ==
')') {
2330 Int_t len = strlen(work);
2332 foundAtSign =
kTRUE;
2334 for(l=0;work[l+1]!=0;++
l) work[l] = work[l+1];
2337 }
else if (len>=2 && work[len-2]==
'@') {
2338 foundAtSign =
kTRUE;
2339 work[len-2] = cname[i];
2346 if (left[0]==0) strlcpy(left,work,kMaxLen);
2347 if (!leaf && !branch) {
2349 strlcpy(first,work,kMaxLen);
2351 std::string treename(first);
2352 if (treename.size() && treename[treename.size()-1]==
'.') {
2353 treename.erase(treename.size()-1);
2355 if (treename==
"This" ) {
2357 TNamed *named =
new TNamed(fTree->GetName(),fTree->GetName());
2360 if (cname[i]) leftover = &(cname[i+1]);
2388 leaf = fTree->FindLeaf(first);
2392 if (cname[i]) first[strlen(first)-1]=
'\0';
2393 if (!branch) branch = fTree->
FindBranch(first);
2394 if (!leaf) leaf = fTree->FindLeaf(first);
2406 useLeafCollectionObject = foundAtSign;
2408 current = &(work[0]);
2411 else if (branch && (foundAtSign || cname[i] != 0) ) {
2421 if ( type == 3 || type ==4) {
2425 useLeafCollectionObject = foundAtSign;
2427 current = &(work[0]);
2437 useLeafCollectionObject = foundAtSign;
2439 current = &(work[0]);
2441 }
else if (leaf || branch) {
2442 if (leaf && branch) {
2456 current = &(work[0]);
2467 strlcpy(right,first,kMaxLen);
2469 if (foundAtSign) strncat(right,
"@",kMaxLen-1-strlen(right));
2470 if (cname[i]==
'.') strncat(right,
".",kMaxLen-1-strlen(right));
2473 current = &(work[0]);
2476 }
else if (cname[i] ==
'.') {
2482 TIter next( fTree->GetListOfBranches() );
2488 current = &(work[0]);
2495 Error(
"DefinedVariable",
"Unexpected control flow!");
2501 if (cname[i]) work[strlen(work)-1] =
'\0';
2502 snprintf(scratch,
sizeof(scratch),
"%s.%s",first,work);
2503 snprintf(scratch2,
sizeof(scratch2),
"%s.%s.%s",first,second,work);
2506 currentname = &(work[previousdot+1]);
2513 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(scratch);
2514 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(scratch2);
2515 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(currentname.c_str());
2525 if (!tmp_branch) tmp_branch = branch->
FindBranch(scratch);
2526 if (!tmp_branch) tmp_branch = branch->
FindBranch(scratch2);
2527 if (!tmp_branch) tmp_branch = branch->
FindBranch(currentname.c_str());
2535 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(scratch);
2536 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(scratch2);
2537 if (!tmp_leaf) tmp_leaf = branch->
FindLeaf(currentname.c_str());
2548 if (second[0]) strncat(second,
".",kMaxLen-1-strlen(second));
2549 strncat(second,work,kMaxLen-1-strlen(second));
2551 useLeafCollectionObject = foundAtSign;
2555 current = &(work[0]);
2561 Int_t where = strlen(work);
2563 work[where+1] = cname[i];
2565 previousdot = where+1;
2567 previousdot = strlen(work);
2568 work[strlen(work)] = cname[i];
2578 strncat(right,work,kMaxLen-1-strlen(right));
2582 if (strlen(right) && right[strlen(right)-1]!=
'.' && cname[i]!=
'.') {
2586 strncat(right,
".",kMaxLen-1-strlen(right));
2588 strncat(right,&cname[i],kMaxLen-1-strlen(right));
2591 if (!
final && branch) {
2594 if (!leaf)
return -1;
2600 if (strlen(right)==0) strlcpy(right,work,kMaxLen);
2603 if (leaf==0 && left[0]!=0) {
2604 if (left[strlen(left)-1]==
'.') left[strlen(left)-1]=0;
2607 const char *aliasValue = fTree->GetAlias(left);
2608 if (aliasValue && strcspn(aliasValue,
"[]+*/-%&!=<>|")==strlen(aliasValue)) {
2611 if (find(aliasUsed.begin(),
2613 left) != aliasUsed.end()) {
2614 Error(
"DefinedVariable",
2615 "The substitution of the branch alias \"%s\" by \"%s\" in \"%s\" failed\n"\
2616 "\tbecause \"%s\" is used [recursively] in its own definition!",
2617 left,aliasValue,fullExpression,left);
2620 aliasUsed.push_back(left);
2621 TString newExpression = aliasValue;
2622 newExpression += (cname+strlen(left));
2624 castqueue, aliasUsed, useLeafCollectionObject, fullExpression);
2626 Error(
"DefinedVariable",
2627 "The substitution of the alias \"%s\" by \"%s\" failed.",left,aliasValue);
2678 if (!fTree)
return -1;
2684 if (name ==
"Entry$") {
2685 Int_t code = fNcodes++;
2690 if (name ==
"LocalEntry$") {
2691 Int_t code = fNcodes++;
2696 if (name ==
"Entries$") {
2697 Int_t code = fNcodes++;
2704 if (name ==
"LocalEntries$") {
2705 Int_t code = fNcodes++;
2712 if (name ==
"Iteration$") {
2713 Int_t code = fNcodes++;
2718 if (name ==
"Length$") {
2719 Int_t code = fNcodes++;
2724 static const char *
lenfunc =
"Length$(";
2725 if (strncmp(name.
Data(),
"Length$(",strlen(lenfunc))==0
2726 && name[name.
Length()-1]==
')') {
2732 Int_t code = fNcodes++;
2737 static const char *minfunc =
"Min$(";
2738 if (strncmp(name.
Data(),
"Min$(",strlen(minfunc))==0
2739 && name[name.
Length()-1]==
')') {
2745 Int_t code = fNcodes++;
2750 static const char *maxfunc =
"Max$(";
2751 if (strncmp(name.
Data(),
"Max$(",strlen(maxfunc))==0
2752 && name[name.
Length()-1]==
')') {
2758 Int_t code = fNcodes++;
2763 static const char *sumfunc =
"Sum$(";
2764 if (strncmp(name.
Data(),
"Sum$(",strlen(sumfunc))==0
2765 && name[name.
Length()-1]==
')') {
2771 Int_t code = fNcodes++;
2783 if (res<0)
return res;
2791 char dims[
kMaxLen]; dims[0] =
'\0';
2799 Int_t cnamelen = strlen(cname);
2800 for(i=0,k=0; i<cnamelen; ++i, ++k) {
2801 if (cname[i] ==
'[') {
2803 int bracket_level = 1;
2805 for (j=++i; j<cnamelen && (bracket_level>0 || cname[j]==
'['); j++, i++) {
2806 if (cname[j]==
'[') bracket_level++;
2807 else if (cname[j]==
']') bracket_level--;
2809 if (bracket_level != 0) {
2813 strncat(dims,&cname[bracket],j-bracket);
2816 if (i!=k) cname[k] = cname[i];
2825 res =
FindLeafForExpression(cname, leaf, leftover,
final, paran_level, castqueue, aliasSofar, useLeafCollectionObject, name);
2827 if (res<0)
return res;
2829 if (!leaf && res!=2) {
2831 const char *aliasValue = fTree->GetAlias(cname);
2838 Error(
"DefinedVariable",
2839 "The substitution of the alias \"%s\" by \"%s\" failed\n"\
2840 "\tbecause \"%s\" is recursively used in its own definition!",
2841 cname,aliasValue,cname);
2846 if (strcspn(aliasValue,
"+*/-%&!=<>|")!=strlen(aliasValue)) {
2852 aliasSofar.push_back( cname );
2854 TString subValue( aliasValue );
2863 Error(
"DefinedVariable",
2864 "The substitution of the alias \"%s\" by \"%s\" failed.",cname,aliasValue);
2879 TString thisAlias( aliasValue );
2887 Error(
"Compile",
" Bad numerical expression : \"%s\"",thisAlias.
Data());
2888 }
else if (aliasRes==-2) {
2889 Error(
"Compile",
" Part of the Variable \"%s\" exists but some of it is not accessible or useable",thisAlias.
Data());
2892 Error(
"DefinedVariable",
2893 "The substitution of the alias \"%s\" by \"%s\" failed.",cname,aliasValue);
2902 if (leaf || res==2) {
2905 Error(
"DefinedVariable",
"the branch \"%s\" has to be enabled to be used",leaf->
GetBranch()->
GetName());
2909 Int_t code = fNcodes++;
2914 char *current = &( dims[0] );
2921 if (current[0] ==
']') {
2924 scanindex = sscanf(current,
"%d",&index);
2930 char *end = (
char*)(varindex.
Data());
2931 for(
char bracket_level = 0;*end!=0;end++) {
2932 if (*end==
'[') bracket_level++;
2933 if (bracket_level==0 && *end==
']')
break;
2934 if (*end==
']') bracket_level--;
2944 current += strlen(varindex)+1;
2952 current = (
char*)strstr( current,
"[" );
2959 res =
ParseWithLeaf(leaf,leftover,
final,paran_level,castqueue,useLeafCollectionObject,name);
2960 if (res<0)
return res;
2961 if (res>0) action = res;
2991 }
else if (strlen(gcut->
GetVarX())) {
3000 for(
Int_t i2 = 1; i2<
n; i2++) {
3001 if (x[i2] < min) min = x[i2];
3002 if (x[i2] > max) max = x[i2];
3021 Error(
"DefinedVariable",
"Found a TCutG without leaf information (%s)",
3055 TIter nextleaf (fTree->GetIteratorOnAllLeaves());
3058 while ((leafcur = (
TLeaf*)nextleaf())) {
3075 }
else if (type>60 || type==0) {
3086 if (clonesinfo) {
delete clonesinfo; clonesinfo = 0; }
3108 clones = (
TClonesArray*)clonesinfo->GetLocalValuePointer(leafcur,0);
3110 if (clones) cl = clones->
GetClass();
3152 leafinfo = clonesinfo;
3164 Int_t clones_offset = 0;
3169 else leafinfo->
fNext = sub_clonesinfo;
3170 else leafinfo = sub_clonesinfo;
3176 delete leafinfo; clonesinfo = 0;
3181 if (!clones)
continue;
3188 else if (curelem->GetClassPointer() && curelem->GetClassPointer()->GetCollectionProxy()) {
3242 }
else if (type > 60) {
3268 R__LoadBranch(branch, readentry,
fQuickLoad);
3301 Error(
"BranchHasMethod",
"A TClonesArray was stored in a branch type no yet support (i.e. neither TBranchObject nor TBranchElement): %s",branch->IsA()->
GetName());
3304 cl = clones ? clones->
GetClass() : 0;
3338 Int_t real_instance = 0;
3373 if (local_index<0) {
3374 Error(
"EvalInstance",
"Index %s is out of bound (%d) in formula %s",
3381 real_instance = local_index *
fCumulSizes[codeindex][1];
3406 if (local_index<0) {
3407 Error(
"EvalInstance",
"Index %s is out of bound (%d) in formula %s",
3416 Int_t virt_accum = 0;
3421 if (check)
return fNdata[0]+1;
3426 }
while( instance >= virt_accum && local_index<maxloop);
3427 if (local_index==maxloop && (instance >= virt_accum)) {
3430 if (check)
return fNdata[0]+1;
3437 if (check)
return fNdata[0]+1;
3445 local_index =
fIndexes[codeindex][0];
3472 if (
fIndexes[codeindex][vdim]>=0) {
3475 if (isize!=1 &&
fIndexes[codeindex][vdim]>isize) {
3480 for(
Int_t k=vdim -1; k>0; --k) {
3481 fCumulSizes[codeindex][k] = fCumulSizes[codeindex][k+1]*
fFixedSizes[codeindex][k];
3484 real_instance = local_index *
fCumulSizes[codeindex][1];
3488 for (
Int_t dim = 1; dim < max_dim; dim++) {
3499 if (
fIndexes[codeindex][dim]==-2) {
3506 if (local_index<0 ||
3508 Error(
"EvalInstance",
"Index %s is out of bound (%d/%d) in formula %s",
3516 real_instance += local_index *
fCumulSizes[codeindex][dim+1];
3520 if (
fIndexes[codeindex][max_dim]>=0) {
3521 if (!info) real_instance +=
fIndexes[codeindex][max_dim];
3527 local_index = instance;
3529 if (info && local_index>=
fCumulSizes[codeindex][max_dim]) {
3533 if (
fIndexes[codeindex][max_dim]==-2) {
3539 if (local_index<0 ||
3541 Error(
"EvalInstance",
"Index %s is of out bound (%d/%d) in formula %s",
3549 real_instance += local_index;
3554 return real_instance;
3565 if (
fNoper != 1 || fNcodes <=0 )
return 0;
3627 if (
fNoper != 1 || fNcodes <=0 )
return 0;
3652 else if (real_instance>=
fNdata[0])
return 0;
3658 if (real_instance) {
3659 Warning(
"EvalObject",
"Not yet implement for kDirect and arrays (for %s).\nPlease contact the developers",
GetName());
3678 const Int_t kMAXSTRINGFOUND = 10;
3679 const char *stringStack[kMAXSTRINGFOUND];
3690 }
else if (real_instance>=
fNdata[0]) {
3703 return stringStack[0];
3706 #define TT_EVAL_INIT \
3707 TLeaf *leaf = (TLeaf*)fLeaves.UncheckedAt(0); \
3709 const Int_t real_instance = GetRealInstance(instance,0); \
3711 if (instance==0) fNeedLoading = kTRUE; \
3712 if (real_instance>=fNdata[0]) return 0; \
3718 if (fNeedLoading) { \
3719 fNeedLoading = kFALSE; \
3720 TBranch *br = leaf->GetBranch(); \
3721 Long64_t tentry = br->GetTree()->GetReadEntry(); \
3722 R__LoadBranch(br,tentry,fQuickLoad); \
3729 if (fLookupType[0]==kDirect) { \
3730 label = (char*)leaf->GetValuePointer(); \
3732 label = (char*)GetLeafInfo(0)->GetValuePointer(leaf,instance); \
3734 Int_t bin = fAxis->FindBin(label); \
3738 #define TREE_EVAL_INIT \
3739 const Int_t real_instance = GetRealInstance(instance,0); \
3741 if (real_instance>=fNdata[0]) return 0; \
3747 label = (char*)GetLeafInfo(0)->GetValuePointer((TLeaf*)0x0,instance); \
3748 Int_t bin = fAxis->FindBin(label); \
3752 #define TT_EVAL_INIT_LOOP \
3753 TLeaf *leaf = (TLeaf*)fLeaves.UncheckedAt(code); \
3756 const Int_t real_instance = GetRealInstance(instance,code); \
3759 TBranch *branch = (TBranch*)fBranches.UncheckedAt(code); \
3761 Long64_t treeEntry = branch->GetTree()->GetReadEntry(); \
3762 R__LoadBranch(branch,treeEntry,fQuickLoad); \
3763 } else if (fDidBooleanOptimization) { \
3764 branch = leaf->GetBranch(); \
3765 Long64_t treeEntry = branch->GetTree()->GetReadEntry(); \
3766 if (branch->GetReadEntry() != treeEntry) branch->GetEntry( treeEntry ); \
3772 if (fDidBooleanOptimization) { \
3773 TBranch *br = leaf->GetBranch(); \
3774 Long64_t treeEntry = br->GetTree()->GetReadEntry(); \
3775 if (br->GetReadEntry() != treeEntry) br->GetEntry( treeEntry ); \
3778 if (real_instance>=fNdata[code]) return 0;
3780 #define TREE_EVAL_INIT_LOOP \
3782 const Int_t real_instance = GetRealInstance(instance,code); \
3784 if (real_instance>=fNdata[code]) return 0;
3799 for (
int i=1; i<len; ++i) {
3814 for (
int i=1; i<len; ++i) {
3833 }
while (!condval && i<len);
3834 if (!condval && i==len) {
3843 for (; i<len; ++i) {
3865 }
while (!condval && i<len);
3866 if (!condval && i==len) {
3875 for (; i<len; ++i) {
3890 template <
typename T>
T fmod_local(
T x,
T y) {
return fmod(x,y); }
3893 template<
typename T>
inline void SetMethodParam(
TMethodCall *method,
T p) { method->
SetParam(p); }
3907 if( !strncmp(
fExpr[op],
"0x", 2) || !strncmp(
fExpr[op],
"0X", 2) ) {
3909 sscanf(
fExpr[op],
"%llx", &val );
3924 template<
typename T>
3930 if (
fNoper == 1 && fNcodes > 0) {
3935 return leaf->GetTypedValue<
T>(real_instance);
3953 case kEntries:
return (
T)fTree->GetEntries();
3963 return elist->
Contains(fTree->GetTree()->GetReadEntry());
3986 const Int_t kMAXSTRINGFOUND = 10;
3987 const char *stringStackLocal[kMAXSTRINGFOUND];
3988 const char **stringStack = stringStackArg?stringStackArg:stringStackLocal;
4004 if (newaction==
kConstant) { pos++; tab[pos-1] = GetConstant<T>(oper &
kTFOperMask);
continue; }
4008 case kEnd :
return tab[0];
4009 case kAdd : pos--; tab[pos-1] += tab[pos];
continue;
4010 case kSubstract : pos--; tab[pos-1] -= tab[pos];
continue;
4011 case kMultiply : pos--; tab[pos-1] *= tab[pos];
continue;
4012 case kDivide : pos--;
if (tab[pos] == 0) tab[pos-1] = 0;
4013 else tab[pos-1] /= tab[pos];
4018 tab[pos-1] =
T(int1 % int2);
4038 case kacosh:
if (tab[pos-1] < 1) {tab[pos-1] = 0;}
4047 case kfmod : pos--; tab[pos-1] = fmod_local(tab[pos-1],tab[pos]);
continue;
4048 case kpow : pos--; tab[pos-1] =
TMath::Power(tab[pos-1],tab[pos]);
continue;
4049 case ksq : tab[pos-1] = tab[pos-1]*tab[pos-1];
continue;
4052 case kstrstr : pos2 -= 2; pos++;
if (strstr(stringStack[pos2],stringStack[pos2+1])) tab[pos-1]=1;
4056 case kmin : pos--; tab[pos-1] =
std::min(tab[pos-1],tab[pos]);
continue;
4057 case kmax : pos--; tab[pos-1] =
std::max(tab[pos-1],tab[pos]);
continue;
4059 case klog :
if (tab[pos-1] > 0) tab[pos-1] =
TMath::Log(tab[pos-1]);
4060 else {tab[pos-1] = 0;}
4063 if (dexp < -700) {tab[pos-1] = 0;
continue;}
4064 if (dexp > 700) {tab[pos-1] =
TMath::Exp(700);
continue;}
4068 else {tab[pos-1] = 0;}
4074 case ksign :
if (tab[pos-1] < 0) tab[pos-1] = -1;
else tab[pos-1] = 1;
4077 case kSignInv: tab[pos-1] = -1 * tab[pos-1];
continue;
4080 case kAnd : pos--;
if (tab[pos-1]!=0 && tab[pos]!=0) tab[pos-1]=1;
4083 case kOr : pos--;
if (tab[pos-1]!=0 || tab[pos]!=0) tab[pos-1]=1;
4087 case kEqual : pos--; tab[pos-1] = (tab[pos-1] == tab[pos]) ? 1 : 0;
continue;
4088 case kNotEqual : pos--; tab[pos-1] = (tab[pos-1] != tab[pos]) ? 1 : 0;
continue;
4089 case kLess : pos--; tab[pos-1] = (tab[pos-1] < tab[pos]) ? 1 : 0;
continue;
4090 case kGreater : pos--; tab[pos-1] = (tab[pos-1] > tab[pos]) ? 1 : 0;
continue;
4091 case kLessThan : pos--; tab[pos-1] = (tab[pos-1] <= tab[pos]) ? 1 : 0;
continue;
4092 case kGreaterThan: pos--; tab[pos-1] = (tab[pos-1] >= tab[pos]) ? 1 : 0;
continue;
4093 case kNot : tab[pos-1] = (tab[pos-1] != 0) ? 0 : 1;
continue;
4095 case kStringEqual : pos2 -= 2; pos++;
if (!strcmp(stringStack[pos2+1],stringStack[pos2])) tab[pos-1]=1;
4098 case kStringNotEqual: pos2 -= 2; pos++;
if (strcmp(stringStack[pos2+1],stringStack[pos2])) tab[pos-1]=1;
4123 pos2++; stringStack[pos2-1] = (
char*)
fExpr[i].
Data();
4137 int op = param % 10;
4139 if (op == 1 && (!tab[pos-1]) ) {
4148 }
else if (op == 2 && tab[pos-1] ) {
4159 int toskip = param / 10;
4170 int fno = param / 1000;
4171 int nargs = param % 1000;
4179 UInt_t argloc = pos-nargs;
4180 for(
Int_t j=0;j<nargs;j++,argloc++,pos--) {
4181 SetMethodParam(method, tab[argloc]);
4204 switch (lookupType) {
4205 case kIndexOfEntry: tab[pos++] = (
T)fTree->GetReadEntry();
continue;
4207 case kEntries: tab[pos++] = (
T)fTree->GetEntries();
continue;
4208 case kLocalEntries: tab[pos++] = (
T)fTree->GetTree()->GetEntries();
continue;
4211 case kIteration: tab[pos++] = instance;
continue;
4219 GetTypedValue<T>(leaf,real_instance);
continue; }
4221 GetTypedValue<T>((
TLeaf*)0x0,real_instance);
continue; }
4223 tab[pos++] = elist->
Contains(fTree->GetReadEntry());
4226 default: tab[pos++] = 0;
continue;
4235 tab[pos++] = gcut->
IsInside(xcut,ycut);
4261 tab[pos] = param; pos++;
4279 T param = FindMin<T>(primary,condition);
4281 tab[pos] = param; pos++;
4288 T param = FindMax<T>(primary,condition);
4290 tab[pos] = param; pos++;
4300 if (instance < primary->
GetNdata()) {
4306 tab[pos] = param; pos++;
4320 if (instance < primary->
GetNdata()) {
4356 R__LoadBranch(br,treeEntry,
kTRUE);
4358 if (real_instance>=
fNdata[string_code])
return 0;
4380 template double TTreeFormula::EvalInstance<double> (int,
char const**);
4381 template long double TTreeFormula::EvalInstance<long double> (int,
char const**);
4382 template long long TTreeFormula::EvalInstance<long long> (int,
char const**);
4448 Warning(
"GetValueFromMethod",
"No streamer info for branch %s.", branch->
GetName());
4458 thisobj = *((
char**) (address + offset));
4508 Warning(
"GetValuePointerFromMethod",
"No streamer info for branch %s.", branch->
GetName());
4518 thisobj = *((
char**) (address + offset));
4701 if (indexname[strlen(indexname)-1] ==
'_' ) {
4713 if (bid < 0)
return kFALSE;
4776 const int kMAXLENGTH = 1024;
4777 static char value[kMAXLENGTH];
4780 for (
int i = 0; i < kMAXLENGTH-1; i++)
4782 value[kMAXLENGTH-1] = 0;
4783 }
else if (mode == -1) {
4784 snprintf(value, kMAXLENGTH-1,
"%s",
GetTitle());
4785 }
else if (mode == 0) {
4788 const char * val = 0;
4791 }
else if (instance<
fNdata[0]) {
4803 val = ((
TTreeFormula*)
this)->EvalStringInstance(instance);
4807 val = ((
TTreeFormula*)
this)->EvalStringInstance(instance);
4811 strlcpy(value, val, kMAXLENGTH);
4815 value[kMAXLENGTH-1] = 0;
4820 if (real_instance<
fNdata[0]) {
4821 Ssiz_t len = strlen(decform);
4822 Char_t outputSizeLevel = 1;
4825 switch (decform[len-2]) {
4828 outputSizeLevel = 2;
4829 if (len>3 && tolower(decform[len-3])==
'l') {
4830 outputSizeLevel = 3;
4834 case 'h': outputSizeLevel = 0;
break;
4837 switch(decform[len-1]) {
4842 switch (outputSizeLevel) {
4845 case 3: snprintf(value,kMAXLENGTH,
Form(
"%%%s",decform),(
Long64_t)((
TTreeFormula*)
this)->EvalInstance<LongDouble_t>(instance));
break;
4856 switch (outputSizeLevel) {
4859 case 3: snprintf(value,kMAXLENGTH,
Form(
"%%%s",decform),(
ULong64_t)((
TTreeFormula*)
this)->EvalInstance<LongDouble_t>(instance));
break;
4871 switch (outputSizeLevel) {
4872 case 2: snprintf(value,kMAXLENGTH,
Form(
"%%%s",decform),(
LongDouble_t)((
TTreeFormula*)
this)->EvalInstance<LongDouble_t>(instance));
break;
4876 expo = strchr(value,
'e');
4881 expo = strchr(value,
'e');
4886 UInt_t declen = atoi(decform);
4887 if (strlen(value)>declen) {
4888 UInt_t off = strlen(value)-declen;
4889 char *start = expo - off;
4890 UInt_t vlen = strlen(expo);
4891 for(
UInt_t z=0;z<=vlen;++z) {
4898 if (isalpha(decform[strlen(decform)-1])) {
4899 TString short_decform(decform);
4901 snprintf(value,kMAXLENGTH,
Form(
" %%%sc",short_decform.
Data()),
' ');
4903 snprintf(value,kMAXLENGTH,
Form(
" %%%sc",decform),
' ');
4922 for(
UInt_t dim=0; dim<max_dim ;++dim) {
4932 for(
Int_t k=0; k <=
n; ++k) {
4945 if (!axis) {
fAxis = 0;
return;}
5035 for (
Int_t i=0;i<nleaves;i++) {
5118 Int_t last_code = -1;
5120 for(TDimensionInfo * info; (info = (TDimensionInfo*)
next()); ) {
5121 if (last_code!=info->fCode) {
5126 last_code = info->fCode;
5134 TDimensionInfo *nextinfo = (TDimensionInfo*)
next();
5135 while(nextinfo && nextinfo->fCode==info->fCode) {
5137 nextinfo = (TDimensionInfo*)
next();
5139 if (!nextinfo)
break;
5143 last_code = info->fCode;
5167 case 1: fMultiplicity = 1;
break;
5168 case 2:
if (fMultiplicity!=1) fMultiplicity = 2;
break;
5195 if (!gcut)
continue;
5202 case 1: fMultiplicity = 1;
break;
5203 case 2:
if (fMultiplicity!=1) fMultiplicity = 2;
break;
5210 case 1: fMultiplicity = 1;
break;
5211 case 2:
if (fMultiplicity!=1) fMultiplicity = 2;
break;
5225 if (!leaf)
continue;
5240 if (fMultiplicity!=1) {
5241 if (leafinfo->
HasCounter() ) fMultiplicity = 1;
5242 else if (elem && elem->
GetArrayDim()>0) fMultiplicity = 2;
5246 if (leaf->
GetLenStatic()>1 && fMultiplicity!=1) fMultiplicity = 2;
5248 if (fMultiplicity!=1) {
5254 if (tleaf && tleaf != realtree && tleaf->
GetTreeIndex()) {
5260 Int_t virt_dim2 = 0;
5268 if (
fIndexes[i][k] < 0 ) virt_dim2++;
5273 for (k = fNdimensions[i]; (k > 0); k--) {
5296 for (i=0; i<
fNoper ; ++i) {
5298 if (leaf==0)
continue;
5302 R__LoadBranch(br,treeEntry,
kTRUE);
5308 for (
Int_t dim = 0; dim < max_dim; ++dim) {
5322 if (
fCodes[i] < 0)
continue;
5343 outofbounds =
kTRUE;
5350 if (tleaf && tleaf != realtree && tleaf->
GetTreeIndex()) {
5353 outofbounds =
kTRUE;
5368 if (readentry < 0) readentry=0;
5370 R__LoadBranch(branchcount, readentry,
fQuickLoad);
5375 branchcount->TBranch::GetEntry(readentry);
5397 else R__LoadBranch(branch,readentry,
fQuickLoad);
5403 hasBranchCount2 =
kTRUE;
5410 for(
Int_t k=vdim -1; k>=0; k--) {
5424 if (readentry < 0) readentry=0;
5425 R__LoadBranch(branchcount,readentry,
fQuickLoad);
5428 if (hasBranchCount2) {
5439 for(
Int_t j=0; j<size; j++) {
5452 }
else if (
fIndexes[i][0] >= size) {
5456 outofbounds =
kTRUE;
5457 }
else if (hasBranchCount2) {
5465 outofbounds =
kTRUE;
5473 if (readentry < 0) readentry=0;
5482 }
else if (
fIndexes[i][0] >= size) {
5486 outofbounds =
kTRUE;
5498 hasBranchCount2 =
kTRUE;
5500 for(
int z=0; z<size; ++z) {
5504 }
else if (
fIndexes[i][vdim] >= 0 ) {
5514 for(
Int_t k=vdim -1; k>=0; k--) {
5524 if (readentry < 0) readentry=0;
5527 outofbounds =
kTRUE;
5553 index<fManager->fUsedSizes[virt_dim]) {
5557 }
else if (hasBranchCount2 && info && k==info->
GetVarDim()) {
5561 if (
fManager->
fUsedSizes[virt_dim]==1 || (index!=1 && index<fManager->fUsedSizes[virt_dim]) )
5566 }
else if (hasBranchCount2 && info && k==info->
GetVarDim()) {
5579 return ! outofbounds;
5589 enum { kOldAlias = 100000+10000+1,
5590 kOldAliasString = kOldAlias+1,
5591 kOldAlternate = kOldAlias+2,
5592 kOldAlternateString = kOldAliasString+2
5595 for (
int k=0; k<
fNoper; k++) {
5602 case kOldAlias:
GetOper()[k] = -kOldAlias;
break;
5603 case kOldAliasString:
GetOper()[k] = -kOldAliasString;
break;
5604 case kOldAlternate:
GetOper()[k] = -kOldAlternate;
break;
5605 case kOldAlternateString:
GetOper()[k] = -kOldAlternateString;
break;
5611 for (
int i=0,offset=0; i<
fNoper; i++) {
5637 if (!leaf)
return kFALSE;
5651 last = clonesinfo->
fNext;
5655 }
else if (br->
GetType()==41) {
5660 if ( count->
GetID() >= 0 ) {
5679 last = collectioninfo->
fNext;
5683 }
else if (br->
GetID()<0) {
virtual Int_t GetLen() const
Return the number of effective elements of this leaf.
Describe Streamer information for one class version.
virtual const char * GetTitle() const
Returns title of object.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
TVirtualRefProxy * GetReferenceProxy() const
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual void SetObjectX(TObject *obj)
Set the X object (and delete the previous one if any).
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
virtual Bool_t IsOnTerminalBranch() const
Return true if this leaf is does not have any sub-branch/leaf.
virtual const char * GetFriendAlias(TTree *) const
If the 'tree' is a friend, this method returns its alias name.
virtual Bool_t IsUnsigned() const
Namespace for new ROOT classes and functions.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
A Branch for the case of an object.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
virtual Double_t Rndm(Int_t i=0)
Machine independent random number generator.
Int_t GetLast() const
Return index of last object in array.
TObject * GetObjectY() const
static const EReturnType kOther
virtual TClass * GetValueClass() const =0
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
virtual Long64_t GetReadEntry() const
TBranchElement * GetBranchCount2() const
A TLeaf for a general object derived from TObject.
char * GetObject() const
Return a pointer to our object.
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...
const char * GetReturnTypeName() const
Get full type description of function return type, e,g.: "class TDirectory*".
virtual void SetName(const char *name)
Change (i.e.
virtual TLeaf * FindLeaf(const char *name)
Find the leaf corresponding to the name 'searchname'.
Buffer base class used for serializing objects.
static const EReturnType kLong
TBranch * GetBranch() const
Int_t GetEntriesFast() const
virtual TVirtualIndex * GetTreeIndex() const
virtual EDataType GetType() const =0
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Int_t GetElementOffset(Int_t id) const
static const EReturnType kString
TBranchElement * GetBranchCount() const
const char * Data() const
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
virtual Bool_t IsOnTerminalBranch() const
The TNamed class is the base class for all named ROOT classes.
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
Bool_t IsCompiled() const
Double_t Log10(Double_t x)
virtual TBranch * FindBranch(const char *name)
Find the immediate sub-branch with passed name.
virtual Bool_t IsaPointer() const
const Int_t kDoNotProcess
TString & Append(const char *cs)
std::vector< std::vector< double > > Data
static const EReturnType kDouble
Long64_t GetEntries() const
TObject * GetObjectX() const
TObjArray * GetListOfBranches()
Double_t ATan2(Double_t, Double_t)
TClass * GetClass() const
Method or function calling interface.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void Set(Int_t n)
Set size of this array to n ints.
void AddAt(Int_t c, Int_t i)
Add Int_t c at position i. Check for out of bounds.
Int_t GetArrayDim() const
TObject * UncheckedAt(Int_t i) const
virtual Bool_t HasCounter() const =0
virtual char * GetAddress() const
virtual const char * GetTypeName() const
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
Class to manage histogram axis.
virtual void SetupAddresses()
If the branch address is not set, we set all addresses starting with the top level parent branch...
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
Int_t GetMaxIndex(Int_t i) const
ClassInfo_t * GetClassInfo() const
virtual void SetObjectY(TObject *obj)
Set the Y object (and delete the previous one if any).
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Bool_t TestBit(UInt_t f) const
char * Form(const char *fmt,...)
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
virtual const char * GetName() const
Returns name of object.
The ROOT global object gROOT contains a list of all defined classes.
R__EXTERN TRandom * gRandom
virtual Int_t Contains(Long64_t entry, TTree *tree=0)
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
A TLeaf for the general case when using the branches created via a TStreamerInfo (i.e.
virtual TLeaf * GetLeafCount() const
A Branch for the case of an object.
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
TString & Remove(Ssiz_t pos)
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
const char * GetCountName() const
TFunction * GetMethod()
Returns the TMethod describing the method to be executed.
TStreamerElement * GetStreamerElement(const char *datamember, Int_t &offset) const
Return the StreamerElement of "datamember" inside our class or any of its base classes.
void ResetParam()
Reset parameter list. To be used before the first call the SetParam().
const Int_t * GetArray() const
virtual TObjArray * GetElements() const =0
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
TClass * GetClass() const
Describe directory structure in memory.
TClass * GetClass() const
unsigned long long ULong64_t
TObject * GetObject() const
virtual TTree * GetTree() const
TObjArray * GetListOfLeaves()
Int_t GetEntries() const
Return the number of objects in array (i.e.
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
TClass * GetClass() const
Mother of all ROOT objects.
Global functions class (global functions are obtained from CINT).
TClassRef is used to implement a permanent reference to a TClass object.
TObject * Last() const
Return the object in the last filled slot. Returns 0 if no entries.
An array of clone (identical) objects.
virtual TClass * GetValueClass(void *data) const =0
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
virtual char * GetAddress() const
Get the branch address.
virtual void * GetValuePointer() const
virtual void Add(TObject *obj)
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
virtual Int_t GetLenStatic() const
const char * GetVarY() const
void SetParam(Long_t l)
Add a long method parameter.
TStreamerElement * GetElement(Int_t id) const
A TTree object has a header with a name and a title.
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
Bool_t HasDataMemberInfo() const
virtual void ResetReadEntry()
Double_t Sqrt(Double_t x)
TObject * At(Int_t idx) const
A TTree is a list of TBranches.
A List of entry numbers in a TTree or TChain.
static char * skip(char **buf, const char *delimiters)
Bool_t IsValid() const
Return true if the method call has been properly initialized and is usable.
Int_t GetStreamerType() const
Ssiz_t First(char c) const
Find first occurrence of a character c.
EReturnType ReturnType()
Returns the return type of the method.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
const char * GetVarX() const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.