1 | #ifndef ExRootResult_h |
---|
2 | #define ExRootResult_h |
---|
3 | |
---|
4 | #include "Rtypes.h" |
---|
5 | #include "Gtypes.h" |
---|
6 | #include "TMath.h" |
---|
7 | |
---|
8 | #include <set> |
---|
9 | #include <map> |
---|
10 | |
---|
11 | class TH1; |
---|
12 | class TH2; |
---|
13 | class THStack; |
---|
14 | class TCanvas; |
---|
15 | class TLegend; |
---|
16 | class TProfile; |
---|
17 | class TPaveText; |
---|
18 | class TObjArray; |
---|
19 | class TFolder; |
---|
20 | |
---|
21 | class ExRootResult |
---|
22 | { |
---|
23 | |
---|
24 | public: |
---|
25 | |
---|
26 | ExRootResult(); |
---|
27 | ~ExRootResult(); |
---|
28 | |
---|
29 | void Reset(); |
---|
30 | void Write(const char *fileName = "results.root"); |
---|
31 | void Print(const char *format = "eps"); |
---|
32 | |
---|
33 | TH1 *AddHist1D(const char *name, const char *title, |
---|
34 | const char *xlabel, const char *ylabel, |
---|
35 | Int_t nxbins, Axis_t xmin, Axis_t xmax, |
---|
36 | Int_t logx = 0, Int_t logy = 0); |
---|
37 | |
---|
38 | TH1 *AddHist1D(const char *name, const char *title, |
---|
39 | const char *xlabel, const char *ylabel, |
---|
40 | Int_t nxbins, const Float_t *bins, |
---|
41 | Int_t logx = 0, Int_t logy = 0); |
---|
42 | |
---|
43 | TProfile *AddProfile(const char *name, const char *title, |
---|
44 | const char *xlabel, const char *ylabel, |
---|
45 | Int_t nxbins, Axis_t xmin, Axis_t xmax, |
---|
46 | Int_t logx = 0, Int_t logy = 0); |
---|
47 | |
---|
48 | TH2 *AddHist2D(const char *name, const char *title, |
---|
49 | const char *xlabel, const char *ylabel, |
---|
50 | Int_t nxbins, Axis_t xmin, Axis_t xmax, |
---|
51 | Int_t nybins, Axis_t ymin, Axis_t ymax, |
---|
52 | Int_t logx = 0, Int_t logy = 0); |
---|
53 | |
---|
54 | THStack *AddHistStack(const char *name, const char *title); |
---|
55 | |
---|
56 | TLegend *AddLegend(Double_t x1, Double_t y1, Double_t x2, Double_t y2); |
---|
57 | |
---|
58 | TPaveText *AddComment(Double_t x1, Double_t y1, Double_t x2, Double_t y2); |
---|
59 | |
---|
60 | void Attach(TObject *plot, TObject *object); |
---|
61 | |
---|
62 | TCanvas *GetCanvas(); |
---|
63 | |
---|
64 | void PrintPlot(TObject *plot, const char *sufix = "", const char *format = "eps"); |
---|
65 | |
---|
66 | void SetFolder(TFolder *folder) { fFolder = folder; } |
---|
67 | |
---|
68 | private: |
---|
69 | |
---|
70 | struct PlotSettings |
---|
71 | { |
---|
72 | Int_t logx; |
---|
73 | Int_t logy; |
---|
74 | }; |
---|
75 | |
---|
76 | void CreateCanvas(); |
---|
77 | |
---|
78 | TCanvas *fCanvas; //! |
---|
79 | |
---|
80 | std::set<TObject*> fPool; //! |
---|
81 | |
---|
82 | std::map<TObject*, TObjArray*> fPlots; //! |
---|
83 | |
---|
84 | std::map<TObject*, ExRootResult::PlotSettings> fSettings; //! |
---|
85 | |
---|
86 | TFolder *fFolder; //! |
---|
87 | |
---|
88 | }; |
---|
89 | |
---|
90 | #endif /* ExRootResult_h */ |
---|
91 | |
---|