1 | #ifndef MARS_MH3
|
---|
2 | #define MARS_MH3
|
---|
3 |
|
---|
4 | #ifndef ROOT_TH1
|
---|
5 | #include <TH1.h>
|
---|
6 | #endif
|
---|
7 | #ifndef MARS_MH
|
---|
8 | #include "MH.h"
|
---|
9 | #endif
|
---|
10 |
|
---|
11 | class TH1;
|
---|
12 | class TMethodCall;
|
---|
13 | class MData;
|
---|
14 |
|
---|
15 | class MH3 : public MH
|
---|
16 | {
|
---|
17 | private:
|
---|
18 | static const TString gsDefName;
|
---|
19 | static const TString gsDefTitle;
|
---|
20 |
|
---|
21 | protected:
|
---|
22 | // Could be const but root < 3.02/06 doesn't like this...
|
---|
23 | Int_t fDimension; // Number of dimensions of histogram
|
---|
24 | TH1 *fHist; // Histogram to fill
|
---|
25 | MData *fData[3]; // Object from which the data is filled
|
---|
26 | Double_t fScale[3]; // Scale for the three axis (eg unit)
|
---|
27 |
|
---|
28 | void StreamPrimitive(ostream &out) const;
|
---|
29 |
|
---|
30 | enum {
|
---|
31 | kIsLogx = BIT(17),
|
---|
32 | kIsLogy = BIT(18),
|
---|
33 | kIsLogz = BIT(19)
|
---|
34 | };
|
---|
35 |
|
---|
36 | public:
|
---|
37 | MH3(const unsigned int dim=0);
|
---|
38 | MH3(const TH1 &h1);
|
---|
39 | MH3(const char *memberx);
|
---|
40 | MH3(const char *memberx, const char *membery);
|
---|
41 | MH3(const char *memberx, const char *membery, const char *memberz);
|
---|
42 | ~MH3();
|
---|
43 |
|
---|
44 | // Setter
|
---|
45 | void SetScaleX(Double_t scale) { fScale[0] = scale; }
|
---|
46 | void SetScaleY(Double_t scale) { fScale[1] = scale; }
|
---|
47 | void SetScaleZ(Double_t scale) { fScale[2] = scale; }
|
---|
48 |
|
---|
49 | void SetLogx(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogx) : fHist->ResetBit(kIsLogx); }
|
---|
50 | void SetLogy(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogy) : fHist->ResetBit(kIsLogy); }
|
---|
51 | void SetLogz(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogz) : fHist->ResetBit(kIsLogz); }
|
---|
52 |
|
---|
53 | void Sumw2() const { if (fHist) fHist->Sumw2(); }
|
---|
54 |
|
---|
55 | // Getter
|
---|
56 | Int_t GetDimension() const { return fDimension; }
|
---|
57 | Int_t GetNbins() const;
|
---|
58 | Int_t FindFixBin(Double_t x, Double_t y=0, Double_t z=0) const;
|
---|
59 |
|
---|
60 | TH1 &GetHist() { return *fHist; }
|
---|
61 | const TH1 &GetHist() const { return *fHist; }
|
---|
62 |
|
---|
63 | TString GetDataMember() const;
|
---|
64 | TString GetRule(const Char_t axis='x') const;
|
---|
65 |
|
---|
66 | // MH
|
---|
67 | Bool_t SetupFill(const MParList *pList);
|
---|
68 | Bool_t Fill(const MParContainer *par, const Stat_t w=1);
|
---|
69 |
|
---|
70 | TH1 *GetHistByName(const TString name="") const { return fHist; }
|
---|
71 | TObject *FindObject(const TObject *obj) const { return 0; }
|
---|
72 | TObject *FindObject(const char *name) const
|
---|
73 | {
|
---|
74 | return (TObject*)GetHistByName(name);
|
---|
75 | }
|
---|
76 |
|
---|
77 | // MParContainer
|
---|
78 | MParContainer *New() const;
|
---|
79 |
|
---|
80 | // TObject
|
---|
81 | void SetName(const char *name);
|
---|
82 | void SetTitle(const char *title);
|
---|
83 |
|
---|
84 | void SetColors() const;
|
---|
85 | void Draw(Option_t *opt=NULL);
|
---|
86 | void Paint(Option_t *opt="");
|
---|
87 |
|
---|
88 | ClassDef(MH3, 2) // Generalized 1/2/3D-histogram for Mars variables
|
---|
89 | };
|
---|
90 |
|
---|
91 | #endif
|
---|