source: trunk/MagicSoft/Mars/mhist/MH.h@ 2231

Last change on this file since 2231 was 2150, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 3.1 KB
Line 
1#ifndef MARS_MH
2#define MARS_MH
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7
8class TH1;
9class TH1D;
10class TH2;
11class TH3;
12class TAxis;
13class TArrayD;
14class TCanvas;
15
16class MBinning;
17class MParList;
18
19class MH : public MParContainer
20{
21public:
22 MH(const char *name=NULL, const char *title=NULL);
23
24 Bool_t OverwritesDraw(TClass *cls=NULL) const;
25
26 virtual Bool_t SetupFill(const MParList *pList) { return kTRUE; }
27 virtual Bool_t Fill(const MParContainer *par, const Stat_t weight=1);
28 virtual Bool_t Finalize() { return kTRUE; }
29
30 virtual TString GetDataMember() const { return ""; }
31
32 virtual TH1 *GetHistByName(const TString name);
33
34 static TCanvas *MakeDefCanvas(TString name="", const char *title="",
35 UInt_t w=625, UInt_t h=440,
36 Bool_t usescreenfactor=kTRUE);
37 static TCanvas *MakeDefCanvas(const TObject *obj,
38 UInt_t w=625, UInt_t h=440,
39 Bool_t usescreenfactor=kFALSE);
40
41 // FIXME: * --> & !!!
42
43 static void SetBinning(TH1 *h, const MBinning *binsx);
44 static void SetBinning(TH2 *h, const MBinning *binsx, const MBinning *binsy);
45 static void SetBinning(TH3 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz);
46
47 static void SetBinning(TH1 *h, const TArrayD &binsx);
48 static void SetBinning(TH2 *h, const TArrayD &binsx, const TArrayD &binsy);
49 static void SetBinning(TH3 *h, const TArrayD &binsx, const TArrayD &binsy, const TArrayD &binsz);
50
51 static void SetBinning(TH1 *h, const TAxis *binsx);
52 static void SetBinning(TH2 *h, const TAxis *binsx, const TAxis *binsy);
53 static void SetBinning(TH3 *h, const TAxis *binsx, const TAxis *binsy, const TAxis *binsz);
54
55 static void SetBinning(TH1 *h, const TH1 *x);
56
57 static Bool_t ApplyBinning(const MParList &plist, TString name, TH1 *h);
58
59 static void ScaleArray(TArrayD &bins, Double_t f);
60 static TArrayD ScaleAxis(TAxis &axe, Double_t f);
61 static void ScaleAxis(TH1 *bins, Double_t fx=1, Double_t fy=1, Double_t fz=1);
62
63 static Double_t GetBinCenterLog(const TAxis &axe, Int_t nbin);
64
65 static void DrawCopy(const TH1 &hist1, const TH1 &hist2, const TString title);
66 static void Draw(TH1 &hist1, TH1 &hist2, const TString title);
67
68 TObject *Clone(const char *name="") const;
69
70 void Draw(Option_t *o="") { MParContainer::Draw(o); }
71 TObject *DrawClone(Option_t *opt, Int_t w, Int_t h) const;
72 TObject *DrawClone(Option_t *opt="") const
73 {
74 return MH::DrawClone(opt, 625, 440);
75 }
76
77 static TVirtualPad *GetNewPad(Option_t *opt);
78
79 static void FindGoodLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger);
80 static Double_t GetMinimumGT(const TH1 &h, Double_t gt=0);
81
82 static void ProjectionX(TH1D &dest, const TH2 &src, Int_t firstybin=-1, Int_t lastybin=9999);
83 static void ProjectionY(TH1D &dest, const TH2 &src, Int_t firstxbin=-1, Int_t lastxbin=9999);
84
85 static TObject *FindObjectInPad(const char *name, TVirtualPad *pad=NULL);
86
87 ClassDef(MH, 0) //A base class for Mars histograms
88};
89
90#endif
91
Note: See TracBrowser for help on using the repository browser.