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 MDataChain;
|
---|
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 | MDataChain *fData[3]; // Object from which the data is filled
|
---|
26 | Double_t fScale[3]; // Scale for the three axis (eg unit)
|
---|
27 |
|
---|
28 | TString fNameProfX; //! This should make sure, that gROOT doen't confuse the profile with something else
|
---|
29 | TString fNameProfY; //! This should make sure, that gROOT doen't confuse the profile with something else
|
---|
30 |
|
---|
31 | void StreamPrimitive(ofstream &out) const;
|
---|
32 |
|
---|
33 | enum {
|
---|
34 | kIsLogx = BIT(17),
|
---|
35 | kIsLogy = BIT(18),
|
---|
36 | kIsLogz = BIT(19)
|
---|
37 | };
|
---|
38 |
|
---|
39 | public:
|
---|
40 | MH3(const unsigned int dim=0);
|
---|
41 | MH3(const TH1 &h1);
|
---|
42 | MH3(const char *memberx);
|
---|
43 | MH3(const char *memberx, const char *membery);
|
---|
44 | MH3(const char *memberx, const char *membery, const char *memberz);
|
---|
45 | ~MH3();
|
---|
46 |
|
---|
47 | void SetScaleX(Double_t scale) { fScale[0] = scale; }
|
---|
48 | void SetScaleY(Double_t scale) { fScale[1] = scale; }
|
---|
49 | void SetScaleZ(Double_t scale) { fScale[2] = scale; }
|
---|
50 |
|
---|
51 | void SetLogx(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogx) : fHist->ResetBit(kIsLogx); }
|
---|
52 | void SetLogy(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogy) : fHist->ResetBit(kIsLogy); }
|
---|
53 | void SetLogz(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogz) : fHist->ResetBit(kIsLogz); }
|
---|
54 |
|
---|
55 | Int_t GetDimension() const { return fDimension; }
|
---|
56 | Int_t GetNbins() const;
|
---|
57 | Int_t FindFixBin(Double_t x, Double_t y=0, Double_t z=0) const;
|
---|
58 |
|
---|
59 | void SetName(const char *name);
|
---|
60 | void SetTitle(const char *title);
|
---|
61 |
|
---|
62 | Bool_t SetupFill(const MParList *pList);
|
---|
63 | Bool_t Fill(const MParContainer *par, const Stat_t w=1);
|
---|
64 |
|
---|
65 | TString GetDataMember() const;
|
---|
66 | TString GetRule(const Char_t axis='x') const;
|
---|
67 |
|
---|
68 | TH1 &GetHist() { return *fHist; }
|
---|
69 | const TH1 &GetHist() const { return *fHist; }
|
---|
70 |
|
---|
71 | TH1 *GetHistByName(const TString name="") { return fHist; }
|
---|
72 |
|
---|
73 | void SetColors() const;
|
---|
74 | void Draw(Option_t *opt=NULL);
|
---|
75 | void Paint(Option_t *opt="");
|
---|
76 |
|
---|
77 | MParContainer *New() const;
|
---|
78 |
|
---|
79 | ClassDef(MH3, 1) // Generalized 1/2/3D-histogram for Mars variables
|
---|
80 | };
|
---|
81 |
|
---|
82 | #endif
|
---|