source: trunk/Mars/mhbase/MHn.h@ 9841

Last change on this file since 9841 was 9821, checked in by tbretz, 14 years ago
Added the possibility to set a conversion function which is applied before the histogram is displayed.
File size: 2.6 KB
Line 
1#ifndef MARS_MHn
2#define MARS_MHn
3
4#ifndef MARS_MH3
5#include "MH3.h"
6#endif
7
8class MHn : public MH
9{
10public:
11 enum Layout_t { kSimple, kComplex };
12
13protected:
14 MH3 *fHist[6]; // Possible six histograms
15 TString fDrawOption[6]; // Possible corresponding draw options
16
17 Layout_t fLayout; // Specifier for the layout in the canvas
18
19 Int_t fNum; // Number of initialized histograms
20
21 void InitHist();
22
23 Bool_t InitName(Int_t n, const char *name);
24 Bool_t InitTitle(Int_t n, const char *title);
25 Bool_t SetDrawOption(Int_t n, const char *opt);
26
27public:
28 MHn(const char *name=NULL, const char *title=NULL);
29 ~MHn();
30
31 // Setter
32 void SetLayout(Layout_t t) { fLayout = t; }
33 void SetDrawOption(const char *opt) { SetDrawOption(fNum-1, opt); }
34
35 Bool_t AddHist(const char *memberx);
36 Bool_t AddHist(const char *memberx, const char *membery, MH3::Type_t type=MH3::kHistogram);
37 Bool_t AddHist(const char *memberx, const char *membery, const char *memberz, MH3::Type_t type=MH3::kHistogram);
38
39 void InitName(const char *n) { InitName(fNum-1, n); }
40 void InitTitle(const char *t) { InitTitle(fNum-1, t); }
41
42 // General interfact to MH3
43 void SetScale(Double_t x, Double_t y=1, Double_t z=2) const;
44 void SetLog(Bool_t x=kTRUE, Bool_t y=kTRUE, Bool_t z=kTRUE) const;
45 void SetAutoRange(Bool_t x=kTRUE, Bool_t y=kTRUE, Bool_t z=kTRUE) const;
46 void SetBinnings(MBinning *x=0, MBinning *y=0, MBinning *z=0) const;
47 void Sumw2() const;
48
49 // Interface to labels of MH3
50 void InitLabels(MH3::Labels_t labels) const;
51
52 void DefaultLabelX(const char *name=0);
53 void DefaultLabelY(const char *name=0);
54 void DefaultLabelZ(const char *name=0);
55
56 void DefineLabelX(Int_t label, const char *name);
57 void DefineLabelY(Int_t label, const char *name);
58 void DefineLabelZ(Int_t label, const char *name);
59
60 void DefineLabelsX(const TString &labels);
61 void DefineLabelsY(const TString &labels);
62 void DefineLabelsZ(const TString &labels);
63
64 // Set additonal weights for MH3
65 void SetWeight(const char *phrase);
66
67 // Set a conversion function for displaying the histogram
68 void SetConversion(const char *func="");
69
70 // MH
71 Bool_t SetupFill(const MParList *pList);
72 Int_t Fill(const MParContainer *par, const Stat_t w=1);
73 Bool_t Finalize();
74
75 // TObject
76 //void SetColors() const;
77 void Draw(Option_t *opt=NULL);
78 //void Paint(Option_t *opt="");
79
80 void RecursiveRemove(TObject *obj);
81
82 ClassDef(MHn, 1) // Generalized histogram class for up to six histograms
83};
84
85#endif
Note: See TracBrowser for help on using the repository browser.