1 | #ifndef MARS_MH
|
---|
2 | #define MARS_MH
|
---|
3 |
|
---|
4 | #ifndef MARS_MParContainer
|
---|
5 | #include "MParContainer.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | class TH1;
|
---|
9 | class TH1D;
|
---|
10 | class TH2;
|
---|
11 | class TH3;
|
---|
12 | class TAxis;
|
---|
13 | class TArrayD;
|
---|
14 | class TCanvas;
|
---|
15 |
|
---|
16 | class MBinning;
|
---|
17 | class MParList;
|
---|
18 |
|
---|
19 | class MH : public MParContainer
|
---|
20 | {
|
---|
21 | public:
|
---|
22 | MH(const char *name=NULL, const char *title=NULL);
|
---|
23 |
|
---|
24 | Bool_t OverwritesDraw(TClass *cls=NULL) const;
|
---|
25 |
|
---|
26 | virtual Bool_t SetupFill(const MParList *pList) { return kTRUE; }
|
---|
27 | virtual Bool_t Fill(const MParContainer *par, const Stat_t weight=1);
|
---|
28 | virtual Bool_t Finalize() { return kTRUE; }
|
---|
29 |
|
---|
30 | virtual TString GetDataMember() const { return ""; }
|
---|
31 |
|
---|
32 | virtual TH1 *GetHistByName(const TString name);
|
---|
33 |
|
---|
34 | static TCanvas *MakeDefCanvas(TString name="", const char *title="",
|
---|
35 | const UInt_t w=625, const UInt_t h=440);
|
---|
36 | static TCanvas *MakeDefCanvas(const TObject *obj,
|
---|
37 | const UInt_t w=625, const UInt_t h=440);
|
---|
38 |
|
---|
39 | // FIXME: * --> & !!!
|
---|
40 |
|
---|
41 | static void SetBinning(TH1 *h, const MBinning *binsx);
|
---|
42 | static void SetBinning(TH2 *h, const MBinning *binsx, const MBinning *binsy);
|
---|
43 | static void SetBinning(TH3 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz);
|
---|
44 |
|
---|
45 | static void SetBinning(TH1 *h, const TArrayD &binsx);
|
---|
46 | static void SetBinning(TH2 *h, const TArrayD &binsx, const TArrayD &binsy);
|
---|
47 | static void SetBinning(TH3 *h, const TArrayD &binsx, const TArrayD &binsy, const TArrayD &binsz);
|
---|
48 |
|
---|
49 | static void SetBinning(TH1 *h, const TAxis *binsx);
|
---|
50 | static void SetBinning(TH2 *h, const TAxis *binsx, const TAxis *binsy);
|
---|
51 | static void SetBinning(TH3 *h, const TAxis *binsx, const TAxis *binsy, const TAxis *binsz);
|
---|
52 |
|
---|
53 | static void SetBinning(TH1 *h, const TH1 *x);
|
---|
54 |
|
---|
55 | static Bool_t ApplyBinning(const MParList &plist, TString name, TH1 *h);
|
---|
56 |
|
---|
57 | static void ScaleArray(TArrayD &bins, Double_t f);
|
---|
58 | static TArrayD ScaleAxis(TAxis &axe, Double_t f);
|
---|
59 | static void ScaleAxis(TH1 *bins, Double_t fx=1, Double_t fy=1, Double_t fz=1);
|
---|
60 |
|
---|
61 | static Double_t GetBinCenterLog(const TAxis &axe, Int_t nbin);
|
---|
62 |
|
---|
63 | static void DrawCopy(const TH1 &hist1, const TH1 &hist2, const TString title);
|
---|
64 | static void Draw(TH1 &hist1, TH1 &hist2, const TString title);
|
---|
65 |
|
---|
66 | TObject *Clone(const char *name="") const;
|
---|
67 |
|
---|
68 | void Draw(Option_t *o="") { MParContainer::Draw(o); }
|
---|
69 | TObject *DrawClone(Option_t *opt, Int_t w, Int_t h) const;
|
---|
70 | TObject *DrawClone(Option_t *opt="") const
|
---|
71 | {
|
---|
72 | return MH::DrawClone(opt, 625, 440);
|
---|
73 | }
|
---|
74 |
|
---|
75 | static TVirtualPad *GetNewPad(Option_t *opt);
|
---|
76 |
|
---|
77 | static void FindGoodLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger);
|
---|
78 | static Double_t GetMinimumGT(const TH1 &h, Double_t gt=0);
|
---|
79 |
|
---|
80 | static void ProjectionX(TH1D &dest, const TH2 &src, Int_t firstybin=-1, Int_t lastybin=9999);
|
---|
81 | static void ProjectionY(TH1D &dest, const TH2 &src, Int_t firstxbin=-1, Int_t lastxbin=9999);
|
---|
82 |
|
---|
83 | static TObject *FindObjectInPad(const char *name, TVirtualPad *pad=NULL);
|
---|
84 |
|
---|
85 | ClassDef(MH, 0) //A base class for Mars histograms
|
---|
86 | };
|
---|
87 |
|
---|
88 | #endif
|
---|
89 |
|
---|