source: trunk/MagicSoft/Mars/mhbase/MH3.h@ 4895

Last change on this file since 4895 was 4891, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 2.2 KB
Line 
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
11class TH1;
12class TMethodCall;
13class MDataChain;
14
15class MH3 : public MH
16{
17private:
18 static const TString gsDefName;
19 static const TString gsDefTitle;
20
21protected:
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 void StreamPrimitive(ofstream &out) const;
29
30 enum {
31 kIsLogx = BIT(17),
32 kIsLogy = BIT(18),
33 kIsLogz = BIT(19)
34 };
35
36public:
37 MH3(const unsigned int dim=0);
38 MH3(const char *memberx);
39 MH3(const char *memberx, const char *membery);
40 MH3(const char *memberx, const char *membery, const char *memberz);
41 ~MH3();
42
43 void SetScaleX(Double_t scale) { fScale[0] = scale; }
44 void SetScaleY(Double_t scale) { fScale[1] = scale; }
45 void SetScaleZ(Double_t scale) { fScale[2] = scale; }
46
47 void SetLogx(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogx) : fHist->ResetBit(kIsLogx); }
48 void SetLogy(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogy) : fHist->ResetBit(kIsLogy); }
49 void SetLogz(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogz) : fHist->ResetBit(kIsLogz); }
50
51 Int_t GetDimension() const { return fDimension; }
52 Int_t GetNbins() const;
53 Int_t FindFixBin(Double_t x, Double_t y=0, Double_t z=0) const;
54
55 void SetName(const char *name);
56 void SetTitle(const char *title);
57
58 Bool_t SetupFill(const MParList *pList);
59 Bool_t Fill(const MParContainer *par, const Stat_t w=1);
60
61 TString GetDataMember() const;
62 TString GetRule(const Char_t axis='x') const;
63
64 TH1 &GetHist() { return *fHist; }
65 const TH1 &GetHist() const { return *fHist; }
66
67 TH1 *GetHistByName(const TString name="") { return fHist; }
68
69 void SetColors() const;
70 void Draw(Option_t *opt=NULL);
71 void Paint(Option_t *opt="");
72
73 MParContainer *New() const;
74
75 ClassDef(MH3, 1) // Generalized 1/2/3D-histogram for Mars variables
76};
77
78#endif
Note: See TracBrowser for help on using the repository browser.