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

Last change on this file since 2109 was 2109, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 3.0 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 const UInt_t w=625, const UInt_t h=440);
36 static TCanvas *MakeDefCanvas(const TObject *obj,
37 const UInt_t w=625, const UInt_t h=440);
38
39 static void SetBinning(TH1 *h, const MBinning *binsx);
40 static void SetBinning(TH2 *h, const MBinning *binsx, const MBinning *binsy);
41 static void SetBinning(TH3 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz);
42
43 static void SetBinning(TH1 *h, const TArrayD &binsx);
44 static void SetBinning(TH2 *h, const TArrayD &binsx, const TArrayD &binsy);
45 static void SetBinning(TH3 *h, const TArrayD &binsx, const TArrayD &binsy, const TArrayD &binsz);
46
47 static void SetBinning(TH1 *h, const TAxis *binsx);
48 static void SetBinning(TH2 *h, const TAxis *binsx, const TAxis *binsy);
49 static void SetBinning(TH3 *h, const TAxis *binsx, const TAxis *binsy, const TAxis *binsz);
50
51 static void SetBinning(TH1 *h, const TH1 *x);
52
53 static Bool_t ApplyBinning(const MParList &plist, TString name, TH1 *h);
54
55 static void ScaleArray(TArrayD &bins, Double_t f);
56 static TArrayD ScaleAxis(TAxis &axe, Double_t f);
57 static void ScaleAxis(TH1 *bins, Double_t fx=1, Double_t fy=1, Double_t fz=1);
58
59 static Double_t GetBinCenterLog(const TAxis &axe, Int_t nbin);
60
61 static void DrawCopy(const TH1 &hist1, const TH1 &hist2, const TString title);
62 static void Draw(TH1 &hist1, TH1 &hist2, const TString title);
63
64 TObject *Clone(const char *name="") const;
65
66 void Draw(Option_t *o="") { MParContainer::Draw(o); }
67 TObject *DrawClone(Option_t *opt, Int_t w, Int_t h) const;
68 TObject *DrawClone(Option_t *opt="") const
69 {
70 return MH::DrawClone(opt, 625, 440);
71 }
72
73 static TVirtualPad *GetNewPad(Option_t *opt);
74
75 static void FindGoodLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger);
76 static Double_t GetMinimumGT(const TH1 &h, Double_t gt=0);
77
78 static void ProjectionX(TH1D &dest, const TH2 &src, Int_t firstybin=-1, Int_t lastybin=9999);
79 static void ProjectionY(TH1D &dest, const TH2 &src, Int_t firstxbin=-1, Int_t lastxbin=9999);
80
81 static TObject *FindObjectInPad(const char *name, TVirtualPad *pad=NULL);
82
83 ClassDef(MH, 0) //A base class for Mars histograms
84};
85
86#endif
87
Note: See TracBrowser for help on using the repository browser.