AliPhysics  ec7afe5 (ec7afe5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliLatexTable.h
Go to the documentation of this file.
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() ;
22  AliLatexTable(Int_t ncol, TString format);
23  ~AliLatexTable();
24 
25 
26  void LoadTeXFromFileAndPrintASCII(const char * filename);
27  // first you set the value of each column
28  void SetNextCol(Int_t val);
29  void SetNextCol(Int_t val, Int_t err);
30 
31  void SetNextCol(Double_t val, Int_t scientificNotation = -1, Bool_t rounding = kTRUE); // if different from -1 gives significant digits
32  void SetNextCol(Double_t val, Double_t err, Int_t scientificNotation = -1, Bool_t rounding = kTRUE);
33  void SetNextCol(Double_t val, Double_t err, Double_t errSyst, Int_t scientificNotation = -1, Bool_t rounding = kTRUE);
34 
35  void SetNextCol(TString val);
36 // // allows to use printf syntax
37 // void SetNextColPrintf(const char *va_(fmt), ...);
38 
39  // Then you add the row (it's up to user make sure all columns are
40  // there)
41  void InsertRow();
42 
43 
44  // insert a row without building it up with the methods. May be
45  // usefull for header or multcol rows
46  void InsertCustomRow(TString row);
47 
48 
49  void InsertHline();
50 
51  void PrintTable(Option_t * opt = "");
52  // void ParseExponent(TString &expo);
53  void GetMantissaAndExpBase10(Double_t num, Double_t &man, Double_t &exp) ;
54 
55  // used to print columns with correct width
56  Int_t * GetColWidths();
57  void StripLatex(TString &row, TString format) ;
58 
59 
60 private:
61 
62  Int_t fNcol; // number of columns
63  TString fFormat; // latex format (es "c|ccc")
64 
65  TObjArray * fRows; // rows
66  TObjArray * fCols; // columns
67 
68  Int_t fNcolReady; // number of cols ready to be insert
69 
70 
72  AliLatexTable& operator=(const AliLatexTable&);
73 
74  ClassDef(AliLatexTable, 1)
75 
76 
77 };
78 
79 #endif
80 
const char * filename
Definition: TestFCM.C:1
double Double_t
Definition: External.C:58
TString fFormat
Definition: AliLatexTable.h:63
int Int_t
Definition: External.C:63
TObjArray * fCols
Definition: AliLatexTable.h:66
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53
TObjArray * fRows
Definition: AliLatexTable.h:65