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