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()
481 if (
GetNRows() == 0 || varexp00 == 0 || varexp00[0]==0)
return 0;
484 const char *hdefault =
"htemp";
489 char *varexp0 =
StrDup(varexp00);
490 char *hname = strstr(varexp0,
">>");
495 gCurrentTableHist = 0;
500 i = strcspn(varexp0,
">>");
502 while (*hname ==
' ') hname++;
506 while (*hname ==
' ') hname++;
509 if (hname[j] !=
' ')
break;
516 if (oldh1 && !hnameplus) oldh1->
Reset();
520 elist =
new TEventList(hname,selection,1000,0);
522 if (elist && !hnameplus) elist->
Reset();
525 if (!hname || *hname==0) {
529 if (oldh1 ) { oldh1->
Delete(); oldh1 = 0;}
534 const Char_t *expressions[] ={varexp0,0,0,0,selection};
535 Int_t maxExpressions =
sizeof(expressions)/
sizeof(
Char_t *);
536 Char_t *nextColon = varexp0;
538 while ((nextColon = strchr(nextColon,
':')) && ( colIndex < maxExpressions - 1 ) ) {
541 expressions[colIndex] = nextColon;
545 expressions[colIndex] = selection;
550 Printf(
" Draw %s for <%s>\n", varexp00, selection);
561 Int_t dimension = colIndex;
563 TString title = expressions[0];
564 for (i=1;i<colIndex;i++) {
566 title += expressions[i];
568 Int_t nsel = strlen(selection);
570 if (nsel < 80-title.
Length()) {
581 Int_t mustdelete = 0;
584 if (!profile) mustdelete = 1;
589 Warning(
"Draw",
"Deleting old histogram with different dimensions");
590 delete oldh1; oldh1 = 0;
595 gROOT->MakeDefCanvas();
598 if (dimension == 1) {
603 TH1 *oldhtemp = (
TH1*)
gPad->FindObject(hdefault);
629 EntryLoop(exprFileName,action, h1, nentries, firstentry, option);
635 }
else if (dimension == 2) {
638 if (!oldh1 || !opt.
Contains(
"same")) {
643 TH1 *oldhtemp = (
TH1*)
gPad->FindObject(hdefault);
663 if (profile || opt.
Contains(
"prof")) {
669 if (action < 0) action = -4;
680 EntryLoop(exprFileName,action,hp,nentries, firstentry, option);
696 Int_t noscat = strlen(option);
697 if (opt.
Contains(
"same")) noscat -= 4;
699 EntryLoop(exprFileName,action,h2,nentries, firstentry, option);
704 if (!oldh1 && !opt.
Contains(
"same")) action = -12;
705 EntryLoop(exprFileName,action,h2,nentries, firstentry, option);
712 }
else if (dimension == 3) {
714 if (!opt.
Contains(
"same")) action = -13;
715 EntryLoop(exprFileName,action,0,nentries, firstentry, option);
725 delete [] exprFileName;
736 Double_t binlow=0,binhigh=0,binwidth=0;
741 if (umin < 0 && xmin >= 0) umin = 0;
742 if (umax > 0 && xmax <= 0) umax = 0;
744 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,03,5) 750 if (binwidth <= 0 || binwidth > 1.
e+39) {
789 Error(
"EntryLoop",
"Error: loading file %s",exprFileName);
796 const Char_t *funcName =
"SelectionQWERTY";
798 const Char_t *argtypes =
"Float_t *,float **, int&, int& ";
800 G__ClassInfo globals;
801 G__MethodInfo func = globals.GetMethod(funcName,argtypes,&offset);
804 struct G__bytecodefunc *pbc = func.GetBytecode();
806 Error(
"EntryLoop",
"Bytecode compilation %s",funcName);
807 G__unloadfile((
Char_t *)exprFileName);
816 Float_t results[] = {1,1,1,1,1};
819 const Char_t *argtypes =
"Float_t *,float **, int&, int& ";
821 ClassInfo_t *globals =
gInterpreter->ClassInfo_Factory();
822 CallFunc_t *callfunc =
gInterpreter->CallFunc_Factory();
823 gInterpreter->CallFunc_SetFunc(callfunc,globals,funcName,argtypes,&offset);
832 #define CALLMETHOD gInterpreter->CallFunc_Exec(callfunc,0); 834 #define TAKEACTION_BEGIN \ 835 descTable = tabsDsc->GetTable(); \ 836 for (i=0; i < tabsDsc->GetNRows(); i++,descTable++ ) \ 837 addressArray[i] = addressEntry + descTable->fOffset; \ 838 for(i=firstentry;i<lastEntry;i++) { \ 841 #define TAKEACTION_END for (int j=0; j < tabsDsc->GetNRows(); j++ ) addressArray[j] += rSize;} 844 if (firstentry < nRows ) {
846 Char_t *addressEntry = thisTable + rSize*firstentry;
857 if (
gVmin[0] > results[0])
gVmin[0] = results[0];
858 if (
gVmax[0] < results[0])
gVmax[0] = results[0];
870 if (results[1]) ((
TH1 *)obj)->Fill(
Axis_t(results[0]),
Stat_t(results[1]));
872 gCurrentTableHist = ((
TH1 *)obj);
877 if (
gVmin[0] > results[1])
gVmin[0] = results[1];
878 if (
gVmax[0] < results[1])
gVmax[0] = results[1];
879 if (
gVmin[1] > results[0])
gVmin[1] = results[0];
880 if (
gVmax[1] < results[0])
gVmax[1] = results[0];
908 gCurrentTableHist = ((
TH1 *)obj);
913 if (
gVmin[0] > results[1])
gVmin[0] = results[1];
914 if (
gVmax[0] < results[1])
gVmax[0] = results[1];
915 if (
gVmin[1] > results[0])
gVmin[1] = results[0];
916 if (
gVmax[1] < results[0])
gVmax[1] = results[0];
932 if (
gVmin[0] > results[1])
gVmin[0] = results[1];
933 if (
gVmax[0] < results[1])
gVmax[0] = results[1];
934 if (
gVmin[1] > results[0])
gVmin[1] = results[0];
935 if (
gVmax[1] < results[0])
gVmax[1] = results[0];
946 if (!strstr(option,
"same") && !strstr(option,
"goff")) {
947 ((
TH2F*)obj)->DrawCopy(option);
960 Int_t pointIndex = 0;
963 u =
gPad->XtoPad(results[0]);
964 v =
gPad->YtoPad(results[1]);
965 if (u < umin) u = umin;
966 if (u > umax) u = umax;
967 if (v < vmin) v = vmin;
968 if (v > vmax) v = vmax;
974 if (pointIndex && !strstr(option,
"goff")) {
981 for(i=0;i<pointIndex;i++) ((
TH2F*)obj)->Fill(x[i], y[i]);
982 delete []
x;
delete []
y;
983 gCurrentTableHist = ((
TH1*)obj);
989 if (
gVmin[0] > results[2])
gVmin[0] = results[2];
990 if (
gVmax[0] < results[2])
gVmax[0] = results[2];
991 if (
gVmin[1] > results[1])
gVmin[1] = results[1];
992 if (
gVmax[1] < results[1])
gVmax[1] = results[1];
993 if (
gVmin[2] > results[0])
gVmin[2] = results[0];
994 if (
gVmax[2] < results[0])
gVmax[2] = results[0];
1000 gPad->Range(-1,-1,1,1);
1010 if (results[3]) pm3d->
SetNextPoint(results[0],results[1],results[2]);
1016 Error(
"EntryLoop",
"unknown action \"%d\" for table <%s>", action,
GetName());
1023 delete [] addressArray;
1033 if (size == 0)
Warning(
"TTable(0)",
"Wrong table format");
1085 if (
this != &rhs && rhs.
GetNRows() >0 ){
1142 else memset(
fTable+i*fSize,127,fSize);
1168 for (
int i=0; i<= columnIndex; i++) nxc = nextComment();
1246 Int_t sleepCounter = 0;
1250 "Not enough memory to Reallocate %d bytes for table <%s::%s>. Please cancel some jobs",
1253 if (sleepCounter > 30) {
1254 Error(
"ReAlloc",
"I can not wait anymore. Good bye");
1271 Int_t sleepCounter = 0;
1275 "Not enough memory to allocate %d rows for table <%s::%s>. Please cancel some jobs",
1278 if (sleepCounter > 30){
1279 Error(
"Create",
"I can not wait anymore. Good bye");
1297 if (nrows == 0) nrows = 1;
1301 for (
UInt_t i = 0;i<nCol;i++){
1325 for (k=0;k<nDim; k++) totalSize *= indx[k];
1326 for (k=0;k<totalSize;k++) {
1328 buffer.
Form(
"%s[%d]",colName,k);
1345 dtor = opt && (strcmp(opt,
gDtorName)==0);
1346 if (!opt || !opt[0] || dtor ) {
1379 else Error(
"GetRowClass()",
"Table descriptor of <%s::%s> table lost",
1426 Draw(varexp,selection,opt,nentries,firstentry);
1430 Printf(
"hname=%s, formula=%s, option=%s, goption=%s\n",hfit->
GetName(),formula,option,goption);
1434 hfit->
Fit(formula,option,goption);
1437 else Printf(
"ERROR hfit=0\n");
1476 char const *cell,*colname,*table;
1478 int icol,irow,colsize,wordsize,nwords,iword,nerr,offset;
1489 for (icol=0; icol < ncols; icol++) {
1496 nwords = colsize/wordsize;
1497 for (irow=0; irow < nrows; irow++) {
1498 cell = table + offset + irow*lrow;
1499 for (iword=0;iword<nwords; iword++,cell+=wordsize) {
1500 word = (code==
kDouble) ? *(
double*)cell : *(
float*)cell;
1541 Error(where,
"index %d out of bounds (size: %d, this: 0x%lx)", i,
fN, (
Long_t)
this);
1553 Error(
"Print",
" No dictionary entry for <%s> structure",
GetTitle());
1554 if (lenbuf>0) iOut +=
snprintf(strbuf,lenbuf,
" *** Errror ***");
1564 Char_t *last = strrchr(typenam,
'_');
1567 if (last) eon = strstr(last,
"_st");
1569 if (eon) *eon =
'\0';
1570 iOut +=
snprintf(strbuf+iOut,lenbuf-iOut,
"struct %s {",typenam);
1573 std::cout <<
"struct " << dscT->
GetName() <<
" {" << std::endl;
1579 for (;dsc != dscE; dsc++) {
1586 iOut +=
snprintf(strbuf+iOut,lenbuf-iOut,
" %s %s",name.
Data(),(*dsc).fColumnName);
1588 std::cout <<
'\t'<< name.
Data() <<
'\t'<< (*dsc).fColumnName;
1591 Int_t dim = (*dsc).fDimensions;
1592 for (indx = 0; indx < dim; indx++) {
1594 iOut +=
snprintf(strbuf+iOut,lenbuf-iOut,
"[%d]",(*dsc).fIndexArray[indx]);
1596 std::cout <<
"[" << std::dec << (*dsc).fIndexArray[indx]<<
"]";
1601 iOut +=
snprintf(strbuf+iOut,lenbuf-iOut,
";");
1603 const char *title = nxc ? nxc->
GetTitle() :
" ";
1604 std::cout <<
";\t//" << title << std::endl;
1610 iOut +=
snprintf(strbuf+iOut,lenbuf-iOut,
"}");
1612 std::cout <<
"}" << std::endl;
1621 std::cout << std::endl <<
" ---------------------------------------------------------------------------------------" << std::endl
1623 <<
" Allocated rows: "<<
fN 1625 <<
"\t Row size: " <<
fSize <<
" bytes" 1642 Int_t const width = 8;
1644 Int_t rowNumber = rownumber;
1647 std::cout <<
" ======================================================================================" << std::endl
1648 <<
" There are " <<
GetSize() <<
" allocated rows for this table only" << std::endl
1649 <<
" ======================================================================================" << std::endl;
1653 if (!rowNumber)
return 0;
1662 if (!dscT )
return 0;
1667 Int_t rowCount = rowNumber;
1668 Int_t thisLoopLenth = 0;
1669 const Char_t *nextRow = 0;
1673 std::cout <<
" ======================================================================================" << std::endl
1674 <<
" There is NO filled row in this table" << std::endl
1675 <<
" ======================================================================================" << std::endl;
1678 std::cout <<
" Table: " << dscT->
GetName()<<
"\t";
1679 for (
Int_t j = row+rowNumber-rowCount; j<row+rowNumber-rowCount+rowStep && j < row+rowNumber ;j++) {
1682 std::cout << std::setw(hW) <<
"["<<j<<
"]";
1685 std::cout << std::endl
1686 <<
" ======================================================================================" << std::endl;
1691 for (; member != dscE; member++){
1694 if (strcmp((*member).fColumnName,
"fDatime") == 0 &&
EColumnType((*member).fType) ==
kUInt)
1696 std::cout << membertype.
Data();
1699 Int_t dim = (*member).fDimensions;
1703 arrayLayout =
new UInt_t[dim];
1704 memset(arrayLayout,0,dim*
sizeof(
Int_t));
1706 Int_t arrayLength = 1;
1707 while (indx < dim ){
1708 arrayLength *= (*member).fIndexArray[indx];
1712 Int_t offset = (*member).fOffset;
1714 thisLoopLenth =
TMath::Min(rowCount,rowStep);
1718 for (indexOffset=0; indexOffset < arrayLength && !breakLoop; indexOffset++) {
1721 if (!indexOffset) std::cout <<
"\t" << (*member).fColumnName;
1722 else std::cout <<
"\t" << std::setw(strlen((*member).fColumnName)) <<
" ";
1725 for (
Int_t i=0;i<dim;i++) std::cout <<
"["<<std::dec<<arrayLayout[i]<<
"]";
1726 ArrayLayout(arrayLayout,(*member).fIndexArray,dim);
1729 if ( strlen((*member).fColumnName)+3*dim < 8) std::cout <<
"\t";
1731 for (thisStepRows = 0;thisStepRows < thisLoopLenth; thisStepRows++,nextRow +=
GetRowSize()) {
1732 const char *pointer = nextRow + offset + indexOffset*(*member).fTypeSize;
1734 cdatime = (
UInt_t*)pointer;
1736 std::cout << cdate <<
"/" << ctime;
1737 }
else if ((*member).fType ==
kChar && dim == 1) {
1738 char charbuffer[11];
1739 strlcpy(charbuffer,pointer,
TMath::Min(10,arrayLength)+1);
1741 std::cout <<
"\"" << charbuffer;
1742 if (arrayLength > 10)
1743 std::cout <<
" . . . ";
1752 if (indexOffset==0) {
1754 std::cout <<
" " << (
const char *)(nxc ? nxc->
GetTitle() :
"no comment");
1756 std::cout << std::endl;
1758 if (arrayLayout)
delete [] arrayLayout;
1760 rowCount -= thisLoopLenth;
1763 std::cout <<
"---------------------------------------------------------------------------------------" << std::endl;
1773 Printf(
"\tclass %s: public TTable\t --> Allocated rows: %d\t Used rows: %d\t Row size: %d bytes\n",
1789 var.
Form(
"%s>>%s",varexp,hname);
1794 Draw(var,selection,opt,nentries,firstentry);
1811 UInt_t arrayLayout[10],arraySize[10];
1812 const unsigned char *pointer=0,*startRow=0;
1813 int i,rowCount;
unsigned char ic;
1815 out <<
"TDataSet *CreateTable() { " << std::endl;
1821 if (!rowNumber || !dscT ) {
1822 out <<
"// The output table was bad-defined!" << std::endl
1823 <<
" fprintf(stderr, \"Bad table found. Please remove me\\n\");" << std::endl
1824 <<
" return 0; } " << std::endl;
1829 assert(startRow!=0);
1831 const Char_t *rowId =
"row";
1832 const Char_t *tableId =
"tableSet";
1836 const char *className = IsA()->GetName();
1838 out <<
"// -----------------------------------------------------------------" << std::endl;
1839 out <<
"// " <<
Path()
1840 <<
" Allocated rows: "<< rowNumber
1841 <<
" Used rows: "<< rowNumber
1842 <<
" Row size: " <<
fSize <<
" bytes" << std::endl;
1843 out <<
"// " <<
" Table: " << dscT->
GetName()<<
"[0]--> " 1844 << dscT->
GetName()<<
"["<<rowNumber-1 <<
"]" << std::endl;
1845 out <<
"// ====================================================================" << std::endl;
1846 out <<
"// ------ Test whether this table share library was loaded ------" << std::endl;
1847 out <<
" if (!TClass::GetClass(\"" << className <<
"\")) return 0;" << std::endl;
1848 out << dscT->
GetName() <<
" " << rowId <<
";" << std::endl
1849 << className <<
" *" << tableId <<
" = new " 1852 <<
"//" <<std::endl ;
1856 for (rowCount=0;rowCount<rowNumber; rowCount++,startRow +=
fSize, nextComment.Reset()) {
1857 out <<
"memset(" <<
"&" << rowId <<
",0," << tableId <<
"->GetRowSize()" <<
");" << std::endl ;
1862 for (; member != dscE; member++) {
1864 TString memberName((*member).fColumnName);
1870 Int_t offset = (*member).fOffset;
1874 int typeSize = (*member).fTypeSize;
1877 Int_t dim = (*member).fDimensions;
1878 if (dim) memset(arrayLayout,0,dim*
sizeof(
Int_t));
1879 Int_t arrayLength = 1;
1880 for (
int indx=0;indx < dim ;indx++){
1881 arraySize[indx] = (*member).fIndexArray[indx];;
1882 arrayLength *= arraySize[indx];
1886 int charLen = (memberType.
CompareTo(
"char")==0);
1888 charLen=arrayLength;
1889 pointer = startRow + offset;
1892 charLen = strlen((
const char*)pointer)+1;
1893 if (charLen>arrayLength) charLen = arrayLength;
1895 for(;charLen && !pointer[charLen-1];charLen--){;}
1896 if (!charLen) charLen=1;
1899 out <<
" memcpy(&" << rowId <<
"." << (
const char*)memberName;
1901 for (
int ii=0; ii<charLen;ii++) {
1903 if (ic && (isalnum(ic)
1904 || strchr(
"!#$%&()*+-,./:;<>=?@{}[]_|~",ic))) {
1907 out <<
"\\x" << std::setw(2) << std::setfill(
'0') << std::hex << (unsigned)ic ;
1908 out << std::setw(1) << std::setfill(
' ') << std::dec;
1911 out <<
"\"," << std::dec << charLen <<
");";
1912 out <<
"// " << (
const char*)memberTitle << std::endl;
1918 for (indexOffset=0; indexOffset < arrayLength ; indexOffset++) {
1919 out << std::setw(3) <<
" " ;
1920 out <<
" " << rowId <<
"." << (
const char*)memberName;
1923 for (i=0;i<dim;i++) {out <<
"["<<std::dec<<arrayLayout[i]<<
"]";}
1929 pointer = startRow + offset + indexOffset*typeSize;
1934 if (indexOffset==0) out <<
"; // " << (
const char*)memberTitle;
1935 out <<
";" << std::endl;
1939 out << tableId <<
"->AddAt(&" << rowId <<
");" << std::endl;
1942 out <<
"// ----------------- end of code ---------------" << std::endl
1943 <<
" return (TDataSet *)tableSet;" << std::endl
1944 <<
"}" << std::endl;
1956 if (
fN == 0)
return;
1984 if (!tempDirs) tempDirs =
"/tmp";
2004 const Char_t *typeNames[] = {
"NAN",
"float",
"int",
"long",
"short",
"double" 2005 ,
"unsigned int",
"unsigned long",
"unsigned short",
"unsigned char" 2006 ,
"char",
"TTableMap &"};
2007 const char *resID =
"results";
2008 const char *addressID =
"address";
2011 Error(
"MakeExpression",
"Can not create a temporary file");
2018 Error(
"MakeExpression",
"Can not open the temporary file <%s>",fileName);
2026 str <<
"void SelectionQWERTY(float *"<<resID<<
", float **"<<addressID<<
", int& i$, int& n$ )" << std::endl;
2027 str <<
"{" << std::endl;
2029 for (i=0; i < dsc->
GetNRows(); i++,descTable++ ) {
2034 for (
Int_t exCount = 0; exCount < nExpressions; exCount++) {
2035 if (expressions[exCount] && expressions[exCount][0] && strstr(expressions[exCount],columnName))
goto LETSTRY;
2041 type = typeNames[descTable->
fType];
2043 if (!isScalar) str <<
"*";
2045 str << columnName <<
" = " ;
2046 if (isScalar) str <<
"*(";
2047 if (!isFloat) str <<
"(" << type <<
"*)";
2048 str << addressID <<
"[" << i <<
"]";
2049 if (isScalar) str <<
")" ;
2050 str <<
";" << std::endl;
2053 for (i=0; i < nExpressions; i++ ) {
2054 if (expressions[i] && expressions[i][0])
2055 str <<
" "<<resID<<
"["<<i<<
"]=(float)(" << expressions[i] <<
");" << std::endl;
2059 str <<
"}" << std::endl;
2062 if (str.good())
return fileName;
2090 for (;links != lastLinks;links++) {
2092 if (wipe)
delete *mp;
2107 if (
fN == 0)
return;
2119 TDataSet::Streamer(b);
2125 TDataSet::Streamer(b);
2145 long len = b.
Length() + (20+4) + (20+4) + 4;
2153 Warning(
"StreamerHeader",
"Schema evolution warning: row size mismatch: expected %ld, read %ld bytes\n",
GetRowSize(),rbytes);
2161 long len = b.
Length() + (4) + (4);
2180 #ifdef StreamElelement 2181 #define __StreamElelement__ StreamElelement 2182 #undef StreamElelement 2185 #define StreamElementIn(type) case TTableDescriptor::_NAME2_(k,type): \ 2186 if (evolutionOn) { \ 2187 if (nextCol->fDimensions) { \ 2188 if (nextCol->fOffset != UInt_t(-1)) { \ 2189 R__b.ReadFastArray((_NAME2_(type,_t) *)(row+nextCol->fOffset),nextCol->fSize/sizeof(_NAME2_(type,_t))); \ 2191 _NAME2_(type,_t) *readPtrV = new _NAME2_(type,_t)[nextCol->fSize/sizeof(_NAME2_(type,_t))]; \ 2192 R__b.ReadFastArray((_NAME2_(type,_t) *)(row+nextCol->fOffset),nextCol->fSize/sizeof(_NAME2_(type,_t))); \ 2193 delete [] readPtrV; \ 2198 _NAME2_(type,_t) skipBuffer; \ 2199 _NAME2_(type,_t) *readPtr = (_NAME2_(type,_t) *)(row+nextCol->fOffset); \ 2200 if (nextCol->fOffset == UInt_t(-1)) readPtr = &skipBuffer; \ 2204 if (nextCol->fDimensions) { \ 2205 R__b.ReadFastArray ((_NAME2_(type,_t) *)(row+nextCol->fOffset),nextCol->fSize/sizeof(_NAME2_(type,_t))); \ 2207 R__b >> *(_NAME2_(type,_t) *)(row+nextCol->fOffset); \ 2211 #define StreamElementOut(type) case TTableDescriptor::_NAME2_(k,type): \ 2212 if (nextCol->fDimensions) \ 2213 R__b.WriteFastArray((_NAME2_(type,_t) *)(row+nextCol->fOffset), nextCol->fSize/sizeof(_NAME2_(type,_t))); \ 2215 R__b << *(_NAME2_(type,_t) *)(row+nextCol->fOffset); \ 2226 Error(
"GetRowDescriptors()",
"%s has no dictionary !",
GetName());
2252 void TTable::Streamer(
TBuffer &R__b)
2264 R__b >> ioDescriptor;
2267 ioDescriptor->Streamer(R__b);
2269 if (!currentDescriptor) {
2270 currentDescriptor = ioDescriptor;
2288 if (evolutionOn)
Reset(0);
2291 for (
Int_t colCounter=0; colCounter < maxColumns; colCounter++,nextCol++) {
2293 switch(nextCol->
fType) {
2328 if ( Class_Version()>3 ) {
2329 R__b << ioDescriptor;
2331 ioDescriptor->Streamer(R__b);
2334 if ( Class_Version()<=3 )
fList = 0;
2344 for (
Int_t colCounter=0; colCounter < maxColumns; colCounter++,nextCol++) {
2346 switch(nextCol->
fType) {
2368 #ifdef __StreamElelement__ 2369 #define StreamElelement __StreamElelement__ 2370 #undef __StreamElelement__ 2386 if (set->HasData()) {
2388 if (strcmp(
GetTitle(),set->GetTitle()) == 0 ) {
2401 "This table is <%s> but the updating one has a wrong type <%s>",
GetTitle(),set->GetTitle());
2455 for( i = 0; ptr != lastPtr; ptr++,i++)
2457 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
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
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
1-D histogram with a float per channel (see TH1 documentation)}
static const char * TableDictionary()
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.
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
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.
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.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
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.
2-D histogram with a double per channel (see TH1 documentation)}
const char * Data() const