]>
Commit | Line | Data |
---|---|---|
4c0d7bc7 | 1 | // This class is used to print a table which can be pasted on a latex |
2 | // document | |
3 | ||
4 | #ifndef ALILATEXTABLE_H | |
5 | #define ALILATEXTABLE_H | |
6 | ||
7 | #if !defined(__CINT__) || defined(__MAKECINT__) | |
8 | ||
9 | #include "TObject.h" | |
10 | #include "TString.h" | |
11 | class TObjArray; | |
12 | ||
13 | #endif | |
14 | ||
15 | ||
16 | using namespace std; | |
17 | ||
18 | class AliLatexTable : public TObject { | |
19 | ||
20 | public: | |
21 | AliLatexTable() : fNcol(1), fFormat("c"), fRows(0), fCols(0), fNcolReady(0) {;} | |
22 | AliLatexTable(Int_t ncol, TString format); | |
23 | ~AliLatexTable(); | |
24 | ||
25 | // first you set the value of each column | |
26 | void SetNextCol(Int_t val); | |
27 | void SetNextCol(Int_t val, Int_t err); | |
28 | ||
29 | void SetNextCol(Double_t val, Int_t scientificNotation = -1); // if different from -1 gives significant digits | |
30 | void SetNextCol(Double_t val, Double_t err, Int_t scientificNotation = -1); | |
31 | void SetNextCol(Double_t val, Double_t err, Double_t errSyst, Int_t scientificNotation = -1); | |
32 | ||
33 | void SetNextCol(TString val); | |
34 | // // allows to use printf syntax | |
35 | // void SetNextColPrintf(const char *va_(fmt), ...); | |
36 | ||
37 | // Then you add the row (it's up to user make sure all columns are | |
38 | // there) | |
39 | void InsertRow(); | |
40 | ||
41 | ||
42 | // insert a row without building it up with the methods. May be | |
43 | // usefull for header or multcol rows | |
44 | void InsertCustomRow(TString row); | |
45 | ||
46 | ||
47 | void InsertHline(); | |
48 | ||
49 | void PrintTable(Option_t * opt = ""); | |
50 | // void ParseExponent(TString &expo); | |
51 | void GetMantissaAndExpBase10(Double_t num, Double_t &man, Double_t &exp) ; | |
52 | ||
53 | // used to print columns with correct width | |
54 | Int_t * GetColWidths(); | |
55 | void StripLatex(TString &row, TString format) ; | |
56 | ||
57 | ||
58 | private: | |
59 | ||
60 | Int_t fNcol; // number of columns | |
61 | TString fFormat; // latex format (es "c|ccc") | |
62 | ||
63 | TObjArray * fRows; // rows | |
64 | TObjArray * fCols; // columns | |
65 | ||
66 | Int_t fNcolReady; // number of cols ready to be insert | |
67 | ||
68 | ||
69 | AliLatexTable(const AliLatexTable&); | |
70 | AliLatexTable& operator=(const AliLatexTable&); | |
71 | ||
72 | ClassDef(AliLatexTable, 1) | |
73 | ||
74 | ||
75 | }; | |
76 | ||
77 | #endif | |
78 |