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 | static void SetBinning(TH1 *h, const MBinning *binsx);
|
---|
40 | static void SetBinning(TH2 *h, const MBinning *binsx, const MBinning *binsy);
|
---|
41 | static void SetBinning(TH3 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz);
|
---|
42 |
|
---|
43 | static void SetBinning(TH1 *h, const TArrayD &binsx);
|
---|
44 | static void SetBinning(TH2 *h, const TArrayD &binsx, const TArrayD &binsy);
|
---|
45 | static void SetBinning(TH3 *h, const TArrayD &binsx, const TArrayD &binsy, const TArrayD &binsz);
|
---|
46 |
|
---|
47 | static void SetBinning(TH1 *h, const TAxis *binsx);
|
---|
48 | static void SetBinning(TH2 *h, const TAxis *binsx, const TAxis *binsy);
|
---|
49 | static void SetBinning(TH3 *h, const TAxis *binsx, const TAxis *binsy, const TAxis *binsz);
|
---|
50 |
|
---|
51 | static void SetBinning(TH1 *h, const TH1 *x);
|
---|
52 |
|
---|
53 | static Bool_t ApplyBinning(const MParList &plist, TString name, TH1 *h);
|
---|
54 |
|
---|
55 | static void ScaleArray(TArrayD &bins, Double_t f);
|
---|
56 | static TArrayD ScaleAxis(TAxis &axe, Double_t f);
|
---|
57 | static void ScaleAxis(TH1 *bins, Double_t fx=1, Double_t fy=1, Double_t fz=1);
|
---|
58 |
|
---|
59 | static Double_t GetBinCenterLog(const TAxis &axe, Int_t nbin);
|
---|
60 |
|
---|
61 | static void DrawCopy(const TH1 &hist1, const TH1 &hist2, const TString title);
|
---|
62 | static void Draw(TH1 &hist1, TH1 &hist2, const TString title);
|
---|
63 |
|
---|
64 | TObject *Clone(const char *name="") const;
|
---|
65 |
|
---|
66 | void Draw(Option_t *o="") { MParContainer::Draw(o); }
|
---|
67 | TObject *DrawClone(Option_t *opt, Int_t w, Int_t h) const;
|
---|
68 | TObject *DrawClone(Option_t *opt="") const
|
---|
69 | {
|
---|
70 | return MH::DrawClone(opt, 625, 440);
|
---|
71 | }
|
---|
72 |
|
---|
73 | static TVirtualPad *GetNewPad(Option_t *opt);
|
---|
74 |
|
---|
75 | static void FindGoodLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger);
|
---|
76 | static Double_t GetMinimumGT(const TH1 &h, Double_t gt=0);
|
---|
77 |
|
---|
78 | static void ProjectionX(TH1D &dest, const TH2 &src, Int_t firstybin=-1, Int_t lastybin=9999);
|
---|
79 | static void ProjectionY(TH1D &dest, const TH2 &src, Int_t firstxbin=-1, Int_t lastxbin=9999);
|
---|
80 |
|
---|
81 | static TObject *FindObjectInPad(const char *name, TVirtualPad *pad=NULL);
|
---|
82 |
|
---|
83 | ClassDef(MH, 0) //A base class for Mars histograms
|
---|
84 | };
|
---|
85 |
|
---|
86 | #endif
|
---|
87 |
|
---|