source: branches/Mars_McMismatchStudy/mhbase/MHn.h@ 18679

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