| 1 | #ifndef MARS_MHn | 
|---|
| 2 | #define MARS_MHn | 
|---|
| 3 |  | 
|---|
| 4 | #ifndef ROOT_TH1 | 
|---|
| 5 | #include <TH1.h> | 
|---|
| 6 | #endif | 
|---|
| 7 | #ifndef MARS_MH | 
|---|
| 8 | #include "MH.h" | 
|---|
| 9 | #endif | 
|---|
| 10 |  | 
|---|
| 11 | class MH3; | 
|---|
| 12 |  | 
|---|
| 13 | class MHn : public MH | 
|---|
| 14 | { | 
|---|
| 15 | public: | 
|---|
| 16 | enum Layout_t { kSimple, kComplex }; | 
|---|
| 17 |  | 
|---|
| 18 | protected: | 
|---|
| 19 | MH3    *fHist[6];        // Possible six histograms | 
|---|
| 20 | TString fDrawOption[6];  // Possible corresponding draw options | 
|---|
| 21 |  | 
|---|
| 22 | Layout_t fLayout;        // Specifier for the layout in the canvas | 
|---|
| 23 |  | 
|---|
| 24 | Int_t fNum;              // Number of initialized histograms | 
|---|
| 25 |  | 
|---|
| 26 | void InitHist(); | 
|---|
| 27 |  | 
|---|
| 28 | Bool_t InitName(Int_t n,  const char *n); | 
|---|
| 29 | Bool_t InitTitle(Int_t n, const char *t); | 
|---|
| 30 | Bool_t SetDrawOption(Int_t n, const char *opt); | 
|---|
| 31 |  | 
|---|
| 32 | public: | 
|---|
| 33 | MHn(const char *name=NULL, const char *title=NULL); | 
|---|
| 34 | ~MHn(); | 
|---|
| 35 |  | 
|---|
| 36 | // Setter | 
|---|
| 37 | void SetLayout(Layout_t t) { fLayout = t; } | 
|---|
| 38 | void SetDrawOption(const char *opt) { SetDrawOption(fNum-1, opt); } | 
|---|
| 39 |  | 
|---|
| 40 | Bool_t AddHist(const char *memberx); | 
|---|
| 41 | Bool_t AddHist(const char *memberx, const char *membery); | 
|---|
| 42 | Bool_t AddHist(const char *memberx, const char *membery, const char *memberz); | 
|---|
| 43 |  | 
|---|
| 44 | void InitName(const char *n) | 
|---|
| 45 | { | 
|---|
| 46 | InitName(fNum-1, n); | 
|---|
| 47 | } | 
|---|
| 48 |  | 
|---|
| 49 | void InitTitle(const char *t) | 
|---|
| 50 | { | 
|---|
| 51 | InitTitle(fNum-1, t); | 
|---|
| 52 | } | 
|---|
| 53 |  | 
|---|
| 54 | // Interfact to MH3 | 
|---|
| 55 | void SetScale(Double_t x, Double_t y=1, Double_t z=2) const; | 
|---|
| 56 | void SetLog(Bool_t x=kTRUE, Bool_t y=kTRUE, Bool_t z=kTRUE) const; | 
|---|
| 57 | void SetAutoRange(Bool_t x=kTRUE, Bool_t y=kTRUE, Bool_t z=kTRUE) const; | 
|---|
| 58 | void SetBinnings(MBinning *x=0, MBinning *y=0, MBinning *z=0) const; | 
|---|
| 59 | void Sumw2() const; | 
|---|
| 60 |  | 
|---|
| 61 | // MH | 
|---|
| 62 | Bool_t SetupFill(const MParList *pList); | 
|---|
| 63 | Bool_t Fill(const MParContainer *par, const Stat_t w=1); | 
|---|
| 64 | Bool_t Finalize(); | 
|---|
| 65 |  | 
|---|
| 66 | // TObject | 
|---|
| 67 | //void SetColors() const; | 
|---|
| 68 | void Draw(Option_t *opt=NULL); | 
|---|
| 69 | //void Paint(Option_t *opt=""); | 
|---|
| 70 |  | 
|---|
| 71 | ClassDef(MHn, 1) // Generalized histogram class for up to six histograms | 
|---|
| 72 | }; | 
|---|
| 73 |  | 
|---|
| 74 | #endif | 
|---|