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

Last change on this file since 2041 was 2015, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 2.7 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 TH2;
10class TH3;
11class TAxis;
12class TArrayD;
13class TCanvas;
14
15class MBinning;
16class MParList;
17
18class MH : public MParContainer
19{
20public:
21 MH(const char *name=NULL, const char *title=NULL);
22
23 Bool_t OverwritesDraw(TClass *cls=NULL) const;
24
25 virtual Bool_t SetupFill(const MParList *pList) { return kTRUE; }
26 virtual Bool_t Fill(const MParContainer *par, Double_t weight=1);
27 virtual Bool_t Finalize() { return kTRUE; }
28
29 virtual TString GetDataMember() const { return ""; }
30
31 virtual TH1 *GetHistByName(const TString name);
32
33 static TCanvas *MakeDefCanvas(TString name="", const char *title="",
34 const UInt_t w=625, const UInt_t h=440);
35 static TCanvas *MakeDefCanvas(const TObject *obj,
36 const UInt_t w=625, const UInt_t h=440);
37
38 static void SetBinning(TH1 *h, const MBinning *binsx);
39 static void SetBinning(TH2 *h, const MBinning *binsx, const MBinning *binsy);
40 static void SetBinning(TH3 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz);
41
42 static void SetBinning(TH1 *h, const TArrayD &binsx);
43 static void SetBinning(TH2 *h, const TArrayD &binsx, const TArrayD &binsy);
44 static void SetBinning(TH3 *h, const TArrayD &binsx, const TArrayD &binsy, const TArrayD &binsz);
45
46 static void SetBinning(TH1 *h, const TAxis *binsx);
47 static void SetBinning(TH2 *h, const TAxis *binsx, const TAxis *binsy);
48 static void SetBinning(TH3 *h, const TAxis *binsx, const TAxis *binsy, const TAxis *binsz);
49
50 static void SetBinning(TH1 *h, const TH1 *x);
51
52 static Bool_t ApplyBinning(const MParList &plist, TString name, TH1 *h);
53
54 static void ScaleArray(TArrayD &bins, Double_t f);
55 static TArrayD ScaleAxis(TAxis &axe, Double_t f);
56 static void ScaleAxis(TH1 *bins, Double_t fx=1, Double_t fy=1, Double_t fz=1);
57
58 static Double_t GetBinCenterLog(const TAxis &axe, Int_t nbin);
59
60 static void DrawCopy(const TH1 &hist1, const TH1 &hist2, const TString title);
61 static void Draw(TH1 &hist1, TH1 &hist2, const TString title);
62
63 void Draw(Option_t *o="") { MParContainer::Draw(o); }
64 TObject *DrawClone(Option_t *opt, Int_t w, Int_t h) const;
65 TObject *DrawClone(Option_t *opt="") const
66 {
67 return MH::DrawClone(opt, 625, 440);
68 }
69
70 static TVirtualPad *GetNewPad(Option_t *opt);
71
72 static void FindGoodLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger);
73 static Double_t GetMinimumGT(const TH1 &h, Double_t gt=0);
74
75 ClassDef(MH, 0) //A base class for Mars histograms
76};
77
78#endif
79
Note: See TracBrowser for help on using the repository browser.