HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MakeNiceHisto.h
Go to the documentation of this file.
1 
2 #ifndef MAKENICEHISTO_H
3 #define MAKENICEHISTO_H
4 
5 
6 #include "TStyle.h"
7 #ifndef ROOT_TFile
8 #include "TFile.h"
9 #endif
10 #ifndef ROOT_TROOT
11 #include "TROOT.h"
12 #endif
13 #ifndef ROOT_TMath
14 #include "TMath.h"
15 #endif
16 #ifndef ROOT_TH1
17 #include "TH1.h"
18 #endif
19 #ifndef ROOT_TH2
20 #include "TH2.h"
21 #endif
22 #ifndef ROOT_TVirtualPad
23 #include "TVirtualPad.h"
24 #endif
25 #ifndef ROOT_TCanvas
26 #include "TCanvas.h"
27 #endif
28 #ifndef ROOT_TF1
29 #include "TF1.h"
30 #endif
31 #ifndef ROOT_TObject
32 #include "TObject.h"
33 #endif
34 /* #ifndef ROOT_TMinuit */
35 /* #include "TMinuit.h" */
36 /* #endif */
37 #ifndef ROOT_TGraphErrors
38 #include "TGraphErrors.h"
39 #endif
40 #ifndef ROOT_TError
41 #include "TError.h"
42 #endif
43 #ifndef ROOT_TClonesArray
44 #include "TClonesArray.h"
45 #endif
46 
47 #ifndef __IOSTREAM__
48 #include <iostream>
49 #endif
50 
51 using std::cout;
52 using std::endl;
53 
54 TH1F* HistLog(const char* name, const char* title, Int_t nBins, Double_t xMin, Double_t xMax);
55 TH2F* HistLogLog(const char* name, const char* title, Int_t nBinsX, Double_t xMinX, Double_t xMaxX, Int_t nBinsY, Double_t xMinY, Double_t xMaxY);
56 TH2F* HistLogLin(const char* name, const char* title, Int_t nBinsX, Double_t xMinX, Double_t xMaxX, Int_t nBinsY, Double_t xMinY, Double_t xMaxY);
57 TH2F* HistLinLog(const char* name, const char* title, Int_t nBinsX, Double_t xMinX, Double_t xMaxX, Int_t nBinsY, Double_t xMinY, Double_t xMaxY);
58 TH1F* HistInvert(TH1* hist);
59 const Double_t *MakeLogBinning(Int_t nbins, Double_t xmin, Double_t xmax);
60 TH1F* MakeNiceGraph(TGraph* hist, TVirtualPad* c1 = 0, const char* opt = "*");
61 TVirtualPad* MakeNiceHisto(TH1* hist, TVirtualPad* c1 = 0, const char* opt = "", Bool_t copy = 1);
62 void MakeNice1dHisto(TH1* hist, TVirtualPad* c1 = 0, const char* opt = "", Bool_t copy = 1);
63 void MakeNice2dHisto(TH2* hist, TVirtualPad* c1 = 0, const char* opt = "", Bool_t copy = 1);
64 void MakeNiceHistoPad(TH1* hist, TVirtualPad* c1 = 0, Double_t scaleX = 1, Double_t scaleY = 1, const char* opt = "", Bool_t copy = 1);
65 void MakeNiceHistoPad(TH1* hist, TVirtualPad* c, Int_t i, Int_t j, Double_t scaleX = 1, Double_t scaleY = 1, const char* opt = "", Bool_t copy = 1);
66 void MakeNice1dHistoPad(TH1* hist, TVirtualPad* c1 = 0, Double_t scaleX = 1, Double_t scaleY = 1, const char* opt = "", Bool_t copy = 1);
67 void MakeNice2dHistoPad(TH2* hist, TVirtualPad* c1 = 0, Double_t scaleX = 1, Double_t scaleY = 1, const char* opt = "", Bool_t copy = 1);
68 TCanvas* FindCanvas(const char* canvasName,
69  Int_t xwidth = 700, Int_t ywidth = 500);
70 #ifdef ROOT_TMinuit
71 void IntegralWithError(TF1* func, Double_t &integral, Double_t &error,
72  Double_t xlow, Double_t xhigh,
73  Double_t stepsize = 0.000001);
74 void FunctionWithError(TF1* func, Double_t x, Double_t &value,
75  Double_t &error);
76 #endif
77 Double_t IntegralDerivative(TF1* func, Double_t xlow, Double_t xhigh,
78  Double_t stepsize, Int_t parameter,
79  Double_t epsilon);
80 Double_t FunctionDerivative(TF1* func, Double_t x,
81  Int_t parameter, Double_t epsilon);
82 void SetHistMaximum(TH1* hist, Float_t factor);
83 TH1F* GetHistogramFromGraph(TGraphErrors* graph, const char* histName);
84 TGraph* GetGraphFromHistogram(TH1* hist);
85 TClonesArray* CanvasPartition(TVirtualPad *C,const Int_t Nx = 2,const Int_t Ny = 1,
86  Float_t lMargin = 0.15, Float_t rMargin = 0.03,
87  Float_t bMargin = 0.15, Float_t tMargin = 0.03);
88 void SetHistStyle(TH1* hist);
89 
90 
91 void ForceScale(TH1* h, Double_t scale);
92 TH1F* ForceRatio(TH1F* h1, TH1F* h2);
93 
94 void NormaliseBins(TH1* h);
95 
96 TGraphErrors* ScaleGraph(TGraph* g, Double_t scale);
97 TGraphErrors* DistGraph(TGraph* g1, TGraph* g2);
98 TGraphErrors* DivideGraph(TGraph* g1, TGraph* g2);
99 TGraphErrors* ExtrapolateGraph(TGraph* g1, TGraph* g2);
100 TGraphErrors* AddGraph(TGraph* g1, TGraph* g2, Double_t val = 1);
101 
102 #endif
void NormaliseBins(TH1 *h)
TGraph * GetGraphFromHistogram(TH1 *hist)
void MakeNice1dHisto(TH1 *hist, TVirtualPad *c1=0, const char *opt="", Bool_t copy=1)
TGraphErrors * DistGraph(TGraph *g1, TGraph *g2)
TGraphErrors * AddGraph(TGraph *g1, TGraph *g2, Double_t val=1)
TH1F * GetHistogramFromGraph(TGraphErrors *graph, const char *histName)
TH2F * HistLogLin(const char *name, const char *title, Int_t nBinsX, Double_t xMinX, Double_t xMaxX, Int_t nBinsY, Double_t xMinY, Double_t xMaxY)
TGraphErrors * DivideGraph(TGraph *g1, TGraph *g2)
void MakeNice1dHistoPad(TH1 *hist, TVirtualPad *c1=0, Double_t scaleX=1, Double_t scaleY=1, const char *opt="", Bool_t copy=1)
void MakeNice2dHisto(TH2 *hist, TVirtualPad *c1=0, const char *opt="", Bool_t copy=1)
void SetHistMaximum(TH1 *hist, Float_t factor)
TVirtualPad * MakeNiceHisto(TH1 *hist, TVirtualPad *c1=0, const char *opt="", Bool_t copy=1)
TGraphErrors * ExtrapolateGraph(TGraph *g1, TGraph *g2)
TH1F * ForceRatio(TH1F *h1, TH1F *h2)
const Double_t * MakeLogBinning(Int_t nbins, Double_t xmin, Double_t xmax)
void ForceScale(TH1 *h, Double_t scale)
Double_t IntegralDerivative(TF1 *func, Double_t xlow, Double_t xhigh, Double_t stepsize, Int_t parameter, Double_t epsilon)
void MakeNice2dHistoPad(TH2 *hist, TVirtualPad *c1=0, Double_t scaleX=1, Double_t scaleY=1, const char *opt="", Bool_t copy=1)
TGraphErrors * ScaleGraph(TGraph *g, Double_t scale)
TH2F * HistLogLog(const char *name, const char *title, Int_t nBinsX, Double_t xMinX, Double_t xMaxX, Int_t nBinsY, Double_t xMinY, Double_t xMaxY)
TH1F * HistInvert(TH1 *hist)
TH1F * HistLog(const char *name, const char *title, Int_t nBins, Double_t xMin, Double_t xMax)
TCanvas * FindCanvas(const char *canvasName, Int_t xwidth=700, Int_t ywidth=500)
TH2F * HistLinLog(const char *name, const char *title, Int_t nBinsX, Double_t xMinX, Double_t xMaxX, Int_t nBinsY, Double_t xMinY, Double_t xMaxY)
Double_t FunctionDerivative(TF1 *func, Double_t x, Int_t parameter, Double_t epsilon)
TH1F * MakeNiceGraph(TGraph *hist, TVirtualPad *c1=0, const char *opt="*")
void MakeNiceHistoPad(TH1 *hist, TVirtualPad *c1=0, Double_t scaleX=1, Double_t scaleY=1, const char *opt="", Bool_t copy=1)
void SetHistStyle(TH1 *hist)
TClonesArray * CanvasPartition(TVirtualPad *C, const Int_t Nx=2, const Int_t Ny=1, Float_t lMargin=0.15, Float_t rMargin=0.03, Float_t bMargin=0.15, Float_t tMargin=0.03)