133 #include "RConfigure.h" 178 "NAN",
"float",
"int",
"long",
"short",
"double",
179 "unsigned int",
"unsigned long",
"unsigned short",
180 "unsigned char",
"char",
"Ptr_t" 199 if (dim && layout && size) {
200 if (++layout[dim-1] >= size[dim-1]) {
230 int prevPrec = out.precision();
231 const std::ios_base::fmtflags prevFmt = out.flags();
235 out << std::dec << std::setw(width) << std::setprecision(width-3) << *(
float *)buf;
238 out << std::dec << std::setw(width) << *(
int *)buf;
241 out << std::dec << std::setw(width) << *(
Long_t *)buf;
244 out << std::dec << std::setw(width) << *(
short *)buf;
247 out << std::dec << std::setw(width) << std::setprecision(width-3) << *(
double *)buf;
250 out << std::dec << std::setw(width) << *(
unsigned int *)buf;
253 out << std::dec << std::setw(width) << *(
ULong_t *)buf;
256 out << std::setw(width) <<
"0x" << std::hex << *(
unsigned short *)buf;
259 out << std::setw(width) <<
"0x" << std::hex << int(*(
unsigned char *)buf);
262 out << std::setw(width) << *(
char *)buf;
265 out << std::setw(width) << *(
Bool_t *)buf;
268 out <<
"->" << std::setw(width) << *(
void **)buf;
274 out.precision(prevPrec);
294 for (
int i = 0; i < allTypes; i++)
334 if (!(srcTable && srcTable->
GetNRows()) || srcRow > srcTable->
GetNRows()-1 )
return 0;
337 if (!nRows) nRows = srcTable->
GetNRows();
339 Long_t extraRows = (tSize - dstRow) - nRows;
348 ::memmove((*
this)[dstRow],(*srcTable)[srcRow],(
size_t)
GetRowSize()*nRows);
352 "This table is <%s> but the src table has a wrong type <%s>",
GetType()
483 if (
GetNRows() == 0 || varexp00 == 0 || varexp00[0]==0)
return 0;
486 const char *hdefault =
"htemp";
491 char *varexp0 =
StrDup(varexp00);
492 char *hname = strstr(varexp0,
">>");
497 gCurrentTableHist = 0;
502 i = strcspn(varexp0,
">>");
504 while (*hname ==
' ') hname++;
508 while (*hname ==
' ') hname++;
511 if (hname[j] !=
' ')
break;
518 if (oldh1 && !hnameplus) oldh1->
Reset();
522 elist =
new TEventList(hname,selection,1000,0);
524 if (elist && !hnameplus) elist->
Reset();
527 if (!hname || *hname==0) {
531 if (oldh1 ) { oldh1->
Delete(); oldh1 = 0;}
536 const Char_t *expressions[] ={varexp0,0,0,0,selection};
537 Int_t maxExpressions =
sizeof(expressions)/
sizeof(
Char_t *);
538 Char_t *nextColon = varexp0;
540 while ((nextColon = strchr(nextColon,
':')) && ( colIndex < maxExpressions - 1 ) ) {
543 expressions[colIndex] = nextColon;
547 expressions[colIndex] = selection;
552 Printf(
" Draw %s for <%s>\n", varexp00, selection);
563 Int_t dimension = colIndex;
565 TString title = expressions[0];
566 for (i=1;i<colIndex;i++) {
568 title += expressions[i];
570 Int_t nsel = strlen(selection);
572 if (nsel < 80-title.
Length()) {
583 Int_t mustdelete = 0;
586 if (!profile) mustdelete = 1;
591 Warning(
"Draw",
"Deleting old histogram with different dimensions");
592 delete oldh1; oldh1 = 0;
597 gROOT->MakeDefCanvas();
600 if (dimension == 1) {
605 TH1 *oldhtemp = (
TH1*)
gPad->FindObject(hdefault);
631 EntryLoop(exprFileName,action, h1, nentries, firstentry, option);
637 }
else if (dimension == 2) {
640 if (!oldh1 || !opt.
Contains(
"same")) {
645 TH1 *oldhtemp = (
TH1*)
gPad->FindObject(hdefault);
665 if (profile || opt.
Contains(
"prof")) {
671 if (action < 0) action = -4;
682 EntryLoop(exprFileName,action,hp,nentries, firstentry, option);
698 Int_t noscat = strlen(option);
699 if (opt.
Contains(
"same")) noscat -= 4;
701 EntryLoop(exprFileName,action,h2,nentries, firstentry, option);
706 if (!oldh1 && !opt.
Contains(
"same")) action = -12;
707 EntryLoop(exprFileName,action,h2,nentries, firstentry, option);
714 }
else if (dimension == 3) {
716 if (!opt.
Contains(
"same")) action = -13;
717 EntryLoop(exprFileName,action,0,nentries, firstentry, option);
727 delete [] exprFileName;
740 Double_t binlow=0,binhigh=0,binwidth=0;
745 if (umin < 0 && xmin >= 0) umin = 0;
746 if (umax > 0 && xmax <= 0) umax = 0;
748 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,03,5) 754 if (binwidth <= 0 || binwidth > 1.
e+39) {
793 Error(
"EntryLoop",
"Error: loading file %s",exprFileName);
800 const Char_t *funcName =
"SelectionQWERTY";
802 const Char_t *argtypes =
"Float_t *,float **, int&, int& ";
804 G__ClassInfo globals;
805 G__MethodInfo
func = globals.GetMethod(funcName,argtypes,&offset);
808 struct G__bytecodefunc *pbc = func.GetBytecode();
810 Error(
"EntryLoop",
"Bytecode compilation %s",funcName);
811 G__unloadfile((
Char_t *)exprFileName);
820 Float_t results[] = {1,1,1,1,1};
823 const Char_t *argtypes =
"Float_t *,float **, int&, int& ";
825 ClassInfo_t *globals =
gInterpreter->ClassInfo_Factory();
826 CallFunc_t *callfunc =
gInterpreter->CallFunc_Factory();
827 gInterpreter->CallFunc_SetFunc(callfunc,globals,funcName,argtypes,&offset);
836 #define CALLMETHOD gInterpreter->CallFunc_Exec(callfunc,0); 838 #define TAKEACTION_BEGIN \ 839 descTable = tabsDsc->GetTable(); \ 840 for (i=0; i < tabsDsc->GetNRows(); i++,descTable++ ) \ 841 addressArray[i] = addressEntry + descTable->fOffset; \ 842 for(i=firstentry;i<lastEntry;i++) { \ 845 #define TAKEACTION_END for (int j=0; j < tabsDsc->GetNRows(); j++ ) addressArray[j] += rSize;} 848 if (firstentry < nRows ) {
850 Char_t *addressEntry = thisTable + rSize*firstentry;
861 if (
gVmin[0] > results[0])
gVmin[0] = results[0];
862 if (
gVmax[0] < results[0])
gVmax[0] = results[0];
874 if (results[1]) ((
TH1 *)obj)->Fill(
Axis_t(results[0]),
Stat_t(results[1]));
876 gCurrentTableHist = ((
TH1 *)obj);
881 if (
gVmin[0] > results[1])
gVmin[0] = results[1];
882 if (
gVmax[0] < results[1])
gVmax[0] = results[1];
883 if (
gVmin[1] > results[0])
gVmin[1] = results[0];
884 if (
gVmax[1] < results[0])
gVmax[1] = results[0];
912 gCurrentTableHist = ((
TH1 *)obj);
917 if (
gVmin[0] > results[1])
gVmin[0] = results[1];
918 if (
gVmax[0] < results[1])
gVmax[0] = results[1];
919 if (
gVmin[1] > results[0])
gVmin[1] = results[0];
920 if (
gVmax[1] < results[0])
gVmax[1] = results[0];
936 if (
gVmin[0] > results[1])
gVmin[0] = results[1];
937 if (
gVmax[0] < results[1])
gVmax[0] = results[1];
938 if (
gVmin[1] > results[0])
gVmin[1] = results[0];
939 if (
gVmax[1] < results[0])
gVmax[1] = results[0];
950 if (!strstr(option,
"same") && !strstr(option,
"goff")) {
951 ((
TH2F*)obj)->DrawCopy(option);
964 Int_t pointIndex = 0;
967 u =
gPad->XtoPad(results[0]);
968 v =
gPad->YtoPad(results[1]);
969 if (u < umin) u = umin;
970 if (u > umax) u = umax;
971 if (v < vmin) v = vmin;
972 if (v > vmax) v = vmax;
978 if (pointIndex && !strstr(option,
"goff")) {
985 for(i=0;i<pointIndex;i++) ((
TH2F*)obj)->Fill(x[i], y[i]);
986 delete []
x;
delete []
y;
987 gCurrentTableHist = ((
TH1*)obj);
993 if (
gVmin[0] > results[2])
gVmin[0] = results[2];
994 if (
gVmax[0] < results[2])
gVmax[0] = results[2];
995 if (
gVmin[1] > results[1])
gVmin[1] = results[1];
996 if (
gVmax[1] < results[1])
gVmax[1] = results[1];
997 if (
gVmin[2] > results[0])
gVmin[2] = results[0];
998 if (
gVmax[2] < results[0])
gVmax[2] = results[0];
1004 gPad->Range(-1,-1,1,1);
1014 if (results[3]) pm3d->
SetNextPoint(results[0],results[1],results[2]);
1020 Error(
"EntryLoop",
"unknown action \"%d\" for table <%s>", action,
GetName());
1027 delete [] addressArray;
1037 if (size == 0)
Warning(
"TTable(0)",
"Wrong table format");
1089 if (
this != &rhs && rhs.
GetNRows() >0 ){
1146 else memset(
fTable+i*fSize,127,fSize);
1172 for (
int i=0; i<= columnIndex; i++) nxc = nextComment();
1250 Int_t sleepCounter = 0;
1254 "Not enough memory to Reallocate %d bytes for table <%s::%s>. Please cancel some jobs",
1257 if (sleepCounter > 30) {
1258 Error(
"ReAlloc",
"I can not wait anymore. Good bye");
1275 Int_t sleepCounter = 0;
1279 "Not enough memory to allocate %d rows for table <%s::%s>. Please cancel some jobs",
1282 if (sleepCounter > 30){
1283 Error(
"Create",
"I can not wait anymore. Good bye");
1301 if (nrows == 0) nrows = 1;
1305 for (
UInt_t i = 0;i<nCol;i++){
1329 for (k=0;k<nDim; k++) totalSize *= indx[k];
1330 for (k=0;k<totalSize;k++) {
1332 buffer.
Form(
"%s[%d]",colName,k);
1349 dtor = opt && (strcmp(opt,
gDtorName)==0);
1350 if (!opt || !opt[0] || dtor ) {
1383 else Error(
"GetRowClass()",
"Table descriptor of <%s::%s> table lost",
1431 Draw(varexp,selection,opt,nentries,firstentry);
1435 Printf(
"hname=%s, formula=%s, option=%s, goption=%s\n",hfit->
GetName(),formula,option,goption);
1439 hfit->
Fit(formula,option,goption);
1442 else Printf(
"ERROR hfit=0\n");
1481 char const *cell,*colname,*table;
1483 int icol,irow,colsize,wordsize,nwords,iword,nerr,offset;
1494 for (icol=0; icol < ncols; icol++) {
1501 nwords = colsize/wordsize;
1502 for (irow=0; irow < nrows; irow++) {
1503 cell = table + offset + irow*lrow;
1504 for (iword=0;iword<nwords; iword++,cell+=wordsize) {
1505 word = (code==
kDouble) ? *(
double*)cell : *(
float*)cell;
1546 Error(where,
"index %d out of bounds (size: %d, this: 0x%lx)", i,
fN, (
Long_t)
this);
1558 Error(
"Print",
" No dictionary entry for <%s> structure",
GetTitle());
1559 if (lenbuf>0) iOut +=
snprintf(strbuf,lenbuf,
" *** Errror ***");
1569 Char_t *last = strrchr(typenam,
'_');
1572 if (last) eon = strstr(last,
"_st");
1574 if (eon) *eon =
'\0';
1575 iOut +=
snprintf(strbuf+iOut,lenbuf-iOut,
"struct %s {",typenam);
1578 std::cout <<
"struct " << dscT->
GetName() <<
" {" << std::endl;
1584 for (;dsc != dscE; dsc++) {
1591 iOut +=
snprintf(strbuf+iOut,lenbuf-iOut,
" %s %s",name.
Data(),(*dsc).fColumnName);
1593 std::cout <<
'\t'<< name.
Data() <<
'\t'<< (*dsc).fColumnName;
1596 Int_t dim = (*dsc).fDimensions;
1597 for (indx = 0; indx < dim; indx++) {
1599 iOut +=
snprintf(strbuf+iOut,lenbuf-iOut,
"[%d]",(*dsc).fIndexArray[indx]);
1601 std::cout <<
"[" << std::dec << (*dsc).fIndexArray[indx]<<
"]";
1606 iOut +=
snprintf(strbuf+iOut,lenbuf-iOut,
";");
1608 const char *title = nxc ? nxc->
GetTitle() :
" ";
1609 std::cout <<
";\t//" << title << std::endl;
1615 iOut +=
snprintf(strbuf+iOut,lenbuf-iOut,
"}");
1617 std::cout <<
"}" << std::endl;
1626 std::cout << std::endl <<
" ---------------------------------------------------------------------------------------" << std::endl
1628 <<
" Allocated rows: "<<
fN 1630 <<
"\t Row size: " <<
fSize <<
" bytes" 1651 Int_t const width = 8;
1653 Int_t rowNumber = rownumber;
1656 std::cout <<
" ======================================================================================" << std::endl
1657 <<
" There are " <<
GetSize() <<
" allocated rows for this table only" << std::endl
1658 <<
" ======================================================================================" << std::endl;
1662 if (!rowNumber)
return 0;
1671 if (!dscT )
return 0;
1676 Int_t rowCount = rowNumber;
1677 Int_t thisLoopLenth = 0;
1678 const Char_t *nextRow = 0;
1682 std::cout <<
" ======================================================================================" << std::endl
1683 <<
" There is NO filled row in this table" << std::endl
1684 <<
" ======================================================================================" << std::endl;
1687 std::cout <<
" Table: " << dscT->
GetName()<<
"\t";
1688 for (
Int_t j = row+rowNumber-rowCount; j<row+rowNumber-rowCount+rowStep && j < row+rowNumber ;j++) {
1691 std::cout << std::setw(hW) <<
"["<<j<<
"]";
1694 std::cout << std::endl
1695 <<
" ======================================================================================" << std::endl;
1700 for (; member != dscE; member++){
1703 if (strcmp((*member).fColumnName,
"fDatime") == 0 &&
EColumnType((*member).fType) ==
kUInt)
1705 std::cout << membertype.
Data();
1708 Int_t dim = (*member).fDimensions;
1712 arrayLayout =
new UInt_t[dim];
1713 memset(arrayLayout,0,dim*
sizeof(
Int_t));
1715 Int_t arrayLength = 1;
1716 while (indx < dim ){
1717 arrayLength *= (*member).fIndexArray[indx];
1721 Int_t offset = (*member).fOffset;
1723 thisLoopLenth =
TMath::Min(rowCount,rowStep);
1727 for (indexOffset=0; indexOffset < arrayLength && !breakLoop; indexOffset++) {
1730 if (!indexOffset) std::cout <<
"\t" << (*member).fColumnName;
1731 else std::cout <<
"\t" << std::setw(strlen((*member).fColumnName)) <<
" ";
1734 for (
Int_t i=0;i<dim;i++) std::cout <<
"["<<std::dec<<arrayLayout[i]<<
"]";
1735 ArrayLayout(arrayLayout,(*member).fIndexArray,dim);
1738 if ( strlen((*member).fColumnName)+3*dim < 8) std::cout <<
"\t";
1740 for (thisStepRows = 0;thisStepRows < thisLoopLenth; thisStepRows++,nextRow +=
GetRowSize()) {
1741 const char *pointer = nextRow + offset + indexOffset*(*member).fTypeSize;
1743 cdatime = (
UInt_t*)pointer;
1745 std::cout << cdate <<
"/" << ctime;
1746 }
else if ((*member).fType ==
kChar && dim == 1) {
1747 char charbuffer[11];
1748 strlcpy(charbuffer,pointer,
TMath::Min(10,arrayLength)+1);
1750 std::cout <<
"\"" << charbuffer;
1751 if (arrayLength > 10)
1752 std::cout <<
" . . . ";
1761 if (indexOffset==0) {
1763 std::cout <<
" " << (
const char *)(nxc ? nxc->
GetTitle() :
"no comment");
1765 std::cout << std::endl;
1767 if (arrayLayout)
delete [] arrayLayout;
1769 rowCount -= thisLoopLenth;
1772 std::cout <<
"---------------------------------------------------------------------------------------" << std::endl;
1782 Printf(
"\tclass %s: public TTable\t --> Allocated rows: %d\t Used rows: %d\t Row size: %d bytes\n",
1799 var.
Form(
"%s>>%s",varexp,hname);
1804 Draw(var,selection,opt,nentries,firstentry);
1821 UInt_t arrayLayout[10],arraySize[10];
1822 const unsigned char *pointer=0,*startRow=0;
1823 int i,rowCount;
unsigned char ic;
1825 out <<
"TDataSet *CreateTable() { " << std::endl;
1831 if (!rowNumber || !dscT ) {
1832 out <<
"// The output table was bad-defined!" << std::endl
1833 <<
" fprintf(stderr, \"Bad table found. Please remove me\\n\");" << std::endl
1834 <<
" return 0; } " << std::endl;
1839 assert(startRow!=0);
1841 const Char_t *rowId =
"row";
1842 const Char_t *tableId =
"tableSet";
1846 const char *className = IsA()->GetName();
1848 out <<
"// -----------------------------------------------------------------" << std::endl;
1849 out <<
"// " <<
Path()
1850 <<
" Allocated rows: "<< rowNumber
1851 <<
" Used rows: "<< rowNumber
1852 <<
" Row size: " <<
fSize <<
" bytes" << std::endl;
1853 out <<
"// " <<
" Table: " << dscT->
GetName()<<
"[0]--> " 1854 << dscT->
GetName()<<
"["<<rowNumber-1 <<
"]" << std::endl;
1855 out <<
"// ====================================================================" << std::endl;
1856 out <<
"// ------ Test whether this table share library was loaded ------" << std::endl;
1857 out <<
" if (!TClass::GetClass(\"" << className <<
"\")) return 0;" << std::endl;
1858 out << dscT->
GetName() <<
" " << rowId <<
";" << std::endl
1859 << className <<
" *" << tableId <<
" = new " 1862 <<
"//" <<std::endl ;
1866 for (rowCount=0;rowCount<rowNumber; rowCount++,startRow +=
fSize, nextComment.Reset()) {
1867 out <<
"memset(" <<
"&" << rowId <<
",0," << tableId <<
"->GetRowSize()" <<
");" << std::endl ;
1872 for (; member != dscE; member++) {
1874 TString memberName((*member).fColumnName);
1880 Int_t offset = (*member).fOffset;
1884 int typeSize = (*member).fTypeSize;
1887 Int_t dim = (*member).fDimensions;
1888 if (dim) memset(arrayLayout,0,dim*
sizeof(
Int_t));
1889 Int_t arrayLength = 1;
1890 for (
int indx=0;indx < dim ;indx++){
1891 arraySize[indx] = (*member).fIndexArray[indx];;
1892 arrayLength *= arraySize[indx];
1896 int charLen = (memberType.
CompareTo(
"char")==0);
1898 charLen=arrayLength;
1899 pointer = startRow + offset;
1902 charLen = strlen((
const char*)pointer)+1;
1903 if (charLen>arrayLength) charLen = arrayLength;
1905 for(;charLen && !pointer[charLen-1];charLen--){;}
1906 if (!charLen) charLen=1;
1909 out <<
" memcpy(&" << rowId <<
"." << (
const char*)memberName;
1911 for (
int ii=0; ii<charLen;ii++) {
1913 if (ic && (isalnum(ic)
1914 || strchr(
"!#$%&()*+-,./:;<>=?@{}[]_|~",ic))) {
1917 out <<
"\\x" << std::setw(2) << std::setfill(
'0') << std::hex << (unsigned)ic ;
1918 out << std::setw(1) << std::setfill(
' ') << std::dec;
1921 out <<
"\"," << std::dec << charLen <<
");";
1922 out <<
"// " << (
const char*)memberTitle << std::endl;
1928 for (indexOffset=0; indexOffset < arrayLength ; indexOffset++) {
1929 out << std::setw(3) <<
" " ;
1930 out <<
" " << rowId <<
"." << (
const char*)memberName;
1933 for (i=0;i<dim;i++) {out <<
"["<<std::dec<<arrayLayout[i]<<
"]";}
1939 pointer = startRow + offset + indexOffset*typeSize;
1944 if (indexOffset==0) out <<
"; // " << (
const char*)memberTitle;
1945 out <<
";" << std::endl;
1949 out << tableId <<
"->AddAt(&" << rowId <<
");" << std::endl;
1952 out <<
"// ----------------- end of code ---------------" << std::endl
1953 <<
" return (TDataSet *)tableSet;" << std::endl
1954 <<
"}" << std::endl;
1966 if (
fN == 0)
return;
1994 if (!tempDirs) tempDirs =
"/tmp";
2014 const Char_t *typeNames[] = {
"NAN",
"float",
"int",
"long",
"short",
"double" 2015 ,
"unsigned int",
"unsigned long",
"unsigned short",
"unsigned char" 2016 ,
"char",
"TTableMap &"};
2017 const char *resID =
"results";
2018 const char *addressID =
"address";
2021 Error(
"MakeExpression",
"Can not create a temporary file");
2028 Error(
"MakeExpression",
"Can not open the temporary file <%s>",fileName);
2036 str <<
"void SelectionQWERTY(float *"<<resID<<
", float **"<<addressID<<
", int& i$, int& n$ )" << std::endl;
2037 str <<
"{" << std::endl;
2039 for (i=0; i < dsc->
GetNRows(); i++,descTable++ ) {
2044 for (
Int_t exCount = 0; exCount < nExpressions; exCount++) {
2045 if (expressions[exCount] && expressions[exCount][0] && strstr(expressions[exCount],columnName))
goto LETSTRY;
2051 type = typeNames[descTable->
fType];
2053 if (!isScalar) str <<
"*";
2055 str << columnName <<
" = " ;
2056 if (isScalar) str <<
"*(";
2057 if (!isFloat) str <<
"(" << type <<
"*)";
2058 str << addressID <<
"[" << i <<
"]";
2059 if (isScalar) str <<
")" ;
2060 str <<
";" << std::endl;
2063 for (i=0; i < nExpressions; i++ ) {
2064 if (expressions[i] && expressions[i][0])
2065 str <<
" "<<resID<<
"["<<i<<
"]=(float)(" << expressions[i] <<
");" << std::endl;
2069 str <<
"}" << std::endl;
2072 if (str.good())
return fileName;
2100 for (;links != lastLinks;links++) {
2102 if (wipe)
delete *mp;
2117 if (
fN == 0)
return;
2129 TDataSet::Streamer(b);
2135 TDataSet::Streamer(b);
2155 long len = b.
Length() + (20+4) + (20+4) + 4;
2163 Warning(
"StreamerHeader",
"Schema evolution warning: row size mismatch: expected %ld, read %ld bytes\n",
GetRowSize(),rbytes);
2171 long len = b.
Length() + (4) + (4);
2190 #ifdef StreamElelement 2191 #define __StreamElelement__ StreamElelement 2192 #undef StreamElelement 2195 #define StreamElementIn(type) case TTableDescriptor::_NAME2_(k,type): \ 2196 if (evolutionOn) { \ 2197 if (nextCol->fDimensions) { \ 2198 if (nextCol->fOffset != UInt_t(-1)) { \ 2199 R__b.ReadFastArray((_NAME2_(type,_t) *)(row+nextCol->fOffset),nextCol->fSize/sizeof(_NAME2_(type,_t))); \ 2201 _NAME2_(type,_t) *readPtrV = new _NAME2_(type,_t)[nextCol->fSize/sizeof(_NAME2_(type,_t))]; \ 2202 R__b.ReadFastArray((_NAME2_(type,_t) *)(row+nextCol->fOffset),nextCol->fSize/sizeof(_NAME2_(type,_t))); \ 2203 delete [] readPtrV; \ 2208 _NAME2_(type,_t) skipBuffer; \ 2209 _NAME2_(type,_t) *readPtr = (_NAME2_(type,_t) *)(row+nextCol->fOffset); \ 2210 if (nextCol->fOffset == UInt_t(-1)) readPtr = &skipBuffer; \ 2214 if (nextCol->fDimensions) { \ 2215 R__b.ReadFastArray ((_NAME2_(type,_t) *)(row+nextCol->fOffset),nextCol->fSize/sizeof(_NAME2_(type,_t))); \ 2217 R__b >> *(_NAME2_(type,_t) *)(row+nextCol->fOffset); \ 2221 #define StreamElementOut(type) case TTableDescriptor::_NAME2_(k,type): \ 2222 if (nextCol->fDimensions) \ 2223 R__b.WriteFastArray((_NAME2_(type,_t) *)(row+nextCol->fOffset), nextCol->fSize/sizeof(_NAME2_(type,_t))); \ 2225 R__b << *(_NAME2_(type,_t) *)(row+nextCol->fOffset); \ 2236 Error(
"GetRowDescriptors()",
"%s has no dictionary !",
GetName());
2262 void TTable::Streamer(
TBuffer &R__b)
2274 R__b >> ioDescriptor;
2277 ioDescriptor->Streamer(R__b);
2279 if (!currentDescriptor) {
2280 currentDescriptor = ioDescriptor;
2298 if (evolutionOn)
Reset(0);
2301 for (
Int_t colCounter=0; colCounter < maxColumns; colCounter++,nextCol++) {
2303 switch(nextCol->
fType) {
2338 if ( Class_Version()>3 ) {
2339 R__b << ioDescriptor;
2341 ioDescriptor->Streamer(R__b);
2344 if ( Class_Version()<=3 )
fList = 0;
2354 for (
Int_t colCounter=0; colCounter < maxColumns; colCounter++,nextCol++) {
2356 switch(nextCol->
fType) {
2378 #ifdef __StreamElelement__ 2379 #define StreamElelement __StreamElelement__ 2380 #undef __StreamElelement__ 2396 if (set->HasData()) {
2398 if (strcmp(
GetTitle(),set->GetTitle()) == 0 ) {
2411 "This table is <%s> but the updating one has a wrong type <%s>",
GetTitle(),set->GetTitle());
2465 for( i = 0; ptr != lastPtr; ptr++,i++)
2467 if (
fPtrs.size()==0) {
void Add(TObject *obj, const char *name=0, Int_t check=-1)
Add object with name to browser.
virtual const char * GetName() const
Returns name of object.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
void SetBufferOffset(Int_t offset=0)
virtual void AsString(void *buf, EColumnType type, Int_t width, std::ostream &out) const
AsString represents the value provided via "void *b" with type defined by "name". ...
virtual void Draw(Option_t *option="")
Draw.
virtual Long_t InsertRows(const void *rows, Long_t indx, UInt_t nRows=1)
void InsertRows(cons void *row, Long_t indx, UInt_t nRows)
RooCmdArg Optimize(Int_t flag=2)
tableDescriptor_st * end() const
virtual int GetPid()
Get process id.
Int_t SetfN(Long_t len)
to be documented
void * ReAllocate()
Reallocate this table leaving only (used rows)+1 allocated GetTableSize() = GetNRows() + 1 returns a ...
void SetUsedRows(Int_t n)
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
TString & ReplaceAll(const TString &s1, const TString &s2)
tableDescriptor_st * begin() const
Bool_t TestBit(UInt_t f) const
virtual void SetName(const char *name)
Set the name of the TNamed.
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
virtual Bool_t IsFolder() const
return Folder flag to be used by TBrowse object The table is a folder if
static void Optimize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="")
static function to compute reasonable axis limits
virtual TClass * GetRowClass() const
to be documented
Buffer base class used for serializing objects.
virtual const Char_t * PrintHeader() const
Print general table inforamtion.
void StreamerHeader(TBuffer &b, Version_t version=3)
Read "table parameters first".
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
tomato 1-D histogram with a float per channel (see TH1 documentation)}
static const char * TableDictionary()
tomato 2-D histogram with a byte per channel (see TH1 documentation)
Short_t Min(Short_t a, Short_t b)
void ToLower()
Change string to lower-case.
virtual void Delete(Option_t *opt="")
Delete - deletes the list of the TDataSet objects and all "Structural Members" as well This method do...
static const char * gDtorName
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
virtual Int_t UpdateOffsets(const TTableDescriptor *newDesciptor)
"Schema evolution" Method updates the offsets with a new ones from another descriptor ...
#define StreamElementIn(type)
TTable & operator=(const TTable &rhs)
TTable assignment operator.
virtual const Char_t * GetType() const
Returns the type of the wrapped C-structure kept as the TNamed title.
virtual void Browse(TBrowser *b)
Browse this dataset (called by TBrowser).
virtual void Browse(TBrowser *b)
Wrap each table coulumn with TColumnView object to browse.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
virtual TTableDescriptor * GetDescriptorPointer() const
to be documented
if object in a list can be deleted
virtual Char_t * Print(Char_t *buf, Int_t n) const
Create IDL table defintion (to be used for XDF I/O)
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Int_t GetDimension() const
const UInt_t * IndexArray(Int_t columnIndex) const
Sequenceable collection abstract base class.
const Char_t * ColumnName(Int_t columnIndex) const
TTable(const char *name=0, Int_t size=0)
Default TTable ctor.
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
virtual const UInt_t * GetIndexArray(Int_t columnIndex) const
static void ArrayLayout(UInt_t *layout, const UInt_t *size, Int_t dim)
ArrayLayout - calculates the array layout recursively.
virtual void SetNRows(Int_t n)
Double_t Log10(Double_t x)
UInt_t Offset(Int_t columnIndex) const
static void GetDateTime(UInt_t datetime, Int_t &date, Int_t &time)
Static function that returns the date and time.
virtual const char * Getenv(const char *env)
Get environment variable.
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
UInt_t ColumnSize(Int_t columnIndex) const
TClass * RowClass() const
virtual void Set(Int_t n)
Set array size of TTable object to n longs. If n<0 leave array unchanged.
Bool_t OutOfBoundsError(const char *where, Int_t i) const
Generate an out-of-bounds error. Always returns false.
Int_t CopyRows(const TTable *srcTable, Long_t srcRow=0, Long_t dstRow=0, Long_t nRows=0, Bool_t expand=kFALSE)
CopyRows copies nRows from starting from the srcRow of srcTable to the dstRow in this table upto nRow...
A specialized string object used for TTree selections.
const void * At(Int_t i) const
Returns a pointer to the i-th row of the table.
virtual Bool_t EntryLoop(const Char_t *exprFileName, Int_t &action, TObject *obj, Int_t nentries=1000000000, Int_t firstentry=0, Option_t *option="")
EntryLoop creates a CINT bytecode to evaluate the given expressions for all table rows in loop and fi...
virtual void Delete(Option_t *option="")
Delete this object.
Using a TBrowser one can browse all ROOT objects.
TTableDescriptor * fSecondDescriptor
virtual TTableDescriptor * GetRowDescriptors() const
to be documented
UInt_t TypeSize(Int_t columnIndex) const
virtual void SetType(const char *const type)
to be documented
virtual const Char_t * GetColumnComment(Int_t columnIndex) const
Get a comment from the table descriptor.
R__EXTERN TSystem * gSystem
virtual void Draw(Option_t *option="")
Draw this histogram with options.
tomato 2-D histogram with a float per channel (see TH1 documentation)}
virtual Int_t AddAt(const void *c)
Add the "row" at the GetNRows() position, and reallocate the table if neccesary, and return the row i...
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual Long_t AppendRows(const void *row, UInt_t nRows)
Append nRows row of the array "row" to the table return.
virtual UInt_t GetDimensions(Int_t columnIndex) const
virtual void Fit(const char *formula, const char *varexp, const char *selection="", Option_t *option="", Option_t *goption="", Int_t nentries=1000000000, Int_t firstentry=0)
-*-*-*-*-*-*-*-*Fit a projected item(s) from a TTable-*-*-*-*-*-*-*-*-* *-* =========================...
tableDescriptor_st * GetTable(Int_t i=0) const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const Char_t * GetColumnName(Int_t columnIndex) const
virtual void Update()
to be documented
Int_t NaN()
return the total number of the NaN for float/double cells of this table Thanks Victor Perevoztchikov ...
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
virtual void ResetMap(Bool_t wipe=kTRUE)
Clean all filled columns with the pointers to TTableMap if any wipe = kTRUE - delete all object the M...
virtual void DeleteRows(Long_t indx, UInt_t nRows=1)
Delete one or several rows from the table.
A TEventList object is a list of selected events (entries) in a TTree.
std::vector< ULong_t > fPtrs
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
The ROOT global object gROOT contains a list of all defined classes.
#define StreamElementOut(type)
virtual void Draw(Option_t *option="")
Draws 3-D polymarker with its current attributes.
static TH1 * gCurrentTableHist
char * StrDup(const char *str)
Duplicate the string str.
virtual TString Path() const
return the full path of this data set
virtual ~TTable()
Delete TTable object.
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
virtual UInt_t GetColumnSize(Int_t columnIndex) const
A PolyMarker is defined by an array on N points in a 2-D space.
void StreamerTable(TBuffer &b, Version_t version=3)
Stream an object of class TTable.
virtual TTableDescriptor * GetTableDescriptors() const
protected: create a new TTableDescriptor descriptor for this table
Bool_t BoundsOk(const char *where, Int_t at) const
virtual Int_t Purge(Option_t *opt="")
Purge - deletes all "dummy" "Structural Members" those are not ended up with some dataset with data i...
void SetTablePointer(void *table)
to be documented
TTable::EColumnType ColumnType(Int_t columnIndex) const
double func(double *x, double *p)
void CopyStruct(Char_t *dest, const Char_t *src)
Copy the C-structure src into the new location the length of the strucutre is defined by this class d...
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
static EColumnType GetTypeId(const char *typeName)
return the Id of the C basic type by given name return kNAN if the name provided fits no knwn basic n...
static TTable * New(const Char_t *name, const Char_t *type, void *array, UInt_t size)
This static method creates a new TTable object if provided.
tomato 2-D histogram with a short per channel (see TH1 documentation)
static Char_t * GetExpressionFileName()
Create a name of the file in the temporary directory if any.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
virtual Int_t GetColumnIndex(const Char_t *columnName) const
UInt_t NumberOfColumns() 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.
static void FindGoodLimits(Int_t nbins, Int_t &newbins, Float_t &xmin, Float_t &xmax)
-*-*-*-*-*-*-*-*Find reasonable bin values-*-*-*-*-*-*-*-*-*-*-*-*-*-* *-* ==========================...
virtual Long_t GetTableSize() const
Returns the number of the allocated rows.
static TView * CreateView(Int_t system=1, const Double_t *rmin=0, const Double_t *rmax=0)
Create a concrete default 3-d view via the plug-in manager.
const Char_t * fCurrentRowPtr
Mother of all ROOT objects.
virtual Char_t * MakeExpression(const Char_t *expressions[], Int_t nExpressions)
Create CINT macro to evaluate the user-provided expresssion Expression may contains: ...
virtual void PrintContents(Option_t *opt="") const
to be documented
static const char * GetTypeName(EColumnType type)
return table type name
virtual void Update()
Update()
virtual void Project(const char *hname, const char *varexp, const char *selection="", Option_t *option="", Int_t nentries=1000000000, Int_t firstentry=0)
-*-*-*-*-*-*-*-*Make a projection of a TTable using selections-*-*-*-*-*-* *-* ======================...
#define dest(otri, vertexptr)
Short_t Max(Short_t a, Short_t b)
virtual Long_t GetNRows() const
Returns the number of the used rows for the wrapped table.
Char_t * Create()
Allocate a space for the new table, if any Sleep for a while if space is not available and try again...
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
void MakeEnd(UInt_t lastRowIndex)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual UInt_t GetTypeSize(Int_t columnIndex) const
virtual Long_t GetRowSize() const
Returns the size (in bytes) of one table row.
virtual void SetDescriptorPointer(TTableDescriptor *list)
to be documented
piterator(const TTable *t=0, EColumnType type=kPtr)
to be documented
virtual void Delete(Option_t *opt="")
Delete the internal array and free the memory it occupied if this object did own this array...
virtual EColumnType GetColumnType(Int_t columnIndex) const
Int_t ColumnByName(const Char_t *columnName=0) const
Find the column index but the column name.
virtual void Clear(Option_t *opt="")
Deletes the internal array of this class if this object does own its internal table.
static const char * fgTypeName[kEndColumnType]
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
THist< 2, float, THistStatContent, THistStatUncertainty > TH2F
virtual void PrintContents(Option_t *opt="") const
Callback method to complete ls() method recursive loop This is to allow to sepoarate navigation and t...
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.
UInt_t Dimensions(Int_t columnIndex) const
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
virtual void Adopt(Int_t n, void *array)
Adopt array arr into TTable, i.e.
TDataSet * MakeCommentField(Bool_t createFlag=kTRUE)
Instantiate a comment dataset if any.
virtual UInt_t GetNumberOfColumns() const
virtual void CopySet(TTable &array)
to be documented
virtual UInt_t GetOffset(Int_t columnIndex) const
void ReAlloc(Int_t newsize)
The table is reallocated if it is an owner of the internal array.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual void Reset(Int_t c=0)
Fill the entire table with byte "c" ; / c=0 "be default".
virtual const char * GetTitle() const
Returns title of object.
virtual TObject * Last() const =0
virtual void Reset(Option_t *option="")
Reset number of entries in event list.
virtual Int_t Purge(Option_t *opt="")
Shrink the table to free the unused but still allocated rows.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
tomato 2-D histogram with a double per channel (see TH1 documentation)}
const char * Data() const