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

Last change on this file since 4882 was 4828, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 2.1 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{
17protected:
18 // Could be const but root < 3.02/06 doesn't like this...
19 Int_t fDimension; // Number of dimensions of histogram
20 TH1 *fHist; // Histogram to fill
21 MDataChain *fData[3]; // Object from which the data is filled
22 Double_t fScale[3]; // Scale for the three axis (eg unit)
23
24 void StreamPrimitive(ofstream &out) const;
25
26 enum {
27 kIsLogx = BIT(17),
28 kIsLogy = BIT(18),
29 kIsLogz = BIT(19)
30 };
31
32public:
33 MH3(const unsigned int dim=0);
34 MH3(const char *memberx);
35 MH3(const char *memberx, const char *membery);
36 MH3(const char *memberx, const char *membery, const char *memberz);
37 ~MH3();
38
39 void SetScaleX(Double_t scale) { fScale[0] = scale; }
40 void SetScaleY(Double_t scale) { fScale[1] = scale; }
41 void SetScaleZ(Double_t scale) { fScale[2] = scale; }
42
43 void SetLogx(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogx) : fHist->ResetBit(kIsLogx); }
44 void SetLogy(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogy) : fHist->ResetBit(kIsLogy); }
45 void SetLogz(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogz) : fHist->ResetBit(kIsLogz); }
46
47 Int_t GetDimension() const { return fDimension; }
48 Int_t GetNbins() const;
49 Int_t FindFixBin(Double_t x, Double_t y=0, Double_t z=0) const;
50
51 void SetName(const char *name);
52 void SetTitle(const char *title);
53
54 Bool_t SetupFill(const MParList *pList);
55 Bool_t Fill(const MParContainer *par, const Stat_t w=1);
56
57 TString GetDataMember() const;
58 TString GetRule(const Char_t axis='x') const;
59
60 TH1 &GetHist() { return *fHist; }
61 const TH1 &GetHist() const { return *fHist; }
62
63 TH1 *GetHistByName(const TString name="") { return fHist; }
64
65 void SetColors() const;
66 void Draw(Option_t *opt=NULL);
67 void Paint(Option_t *opt="");
68
69 MParContainer *New() const;
70
71 ClassDef(MH3, 1) // Generalized 1/2/3D-histogram for Mars variables
72};
73
74#endif
Note: See TracBrowser for help on using the repository browser.