-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhDraw.h
More file actions
executable file
·111 lines (84 loc) · 3.79 KB
/
Copy pathhDraw.h
File metadata and controls
executable file
·111 lines (84 loc) · 3.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#ifndef hDraws_H
#define hDraws_H
#include <TObject.h>
#include <TMath.h>
#include <TString.h>
#include <TStyle.h>
#include <TF1.h>
#include <TH1D.h>
#include <TH2D.h>
#include <TGraph.h>
#include <TGraphErrors.h>
#include <TGraphAsymmErrors.h>
#include <TLatex.h>
#include <TPaveText.h>
#include <TLegend.h>
#include <TCanvas.h>
#include <TSystem.h>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
#include "AnaInput.h"
using namespace std;
class hDraw {
public:
hDraw( ) ;
hDraw( string hfolder, string plotType ) ;
~hDraw() ;
void Draw ( TH1D* h1, string plotName, string xTitle, string yTitle, string logY, float statY, int color = 1, double scale = 1, TLegend* leg = NULL ) ;
void DrawAppend ( TH1D* h1, string plotName, float statY, int color = 4, double scale = 1, TLegend* leg = NULL ) ;
void Draw2D( TH2D* h2, string plotName, string xTitle, string yTitle, string logZ, int nColor = 5 , float titleFontSize =0.05, float statFontSize = 0.05 ) ;
void CreateNxM( string plotName , int N, int M ) ;
void DrawNxM( int id, TH1D* h1, string xTitle, string yTitle, string logY, int color = 1, bool close = true ) ;
void DrawNxM( int id, TH2D* h2, string xTitle, string yTitle, string logZ, int nColor = 5, float titleFontSize =0.05, float statFontSize = 0.05, bool close = true ) ;
void FitNDraw( TH1D* h1, TF1* ffn, string plotName, string xTitle, string yTitle, string logY, float statY, int color = 1, TLegend* leg=NULL ) ;
void FitNDraw( TH1D* h1, string plotName, string xTitle, string yTitle, string logY, float statY, int color = 1, TLegend* leg=NULL ) ;
void FitNDrawAppend ( TH1D* h1, string plotName, float statY, int color = 4, TLegend* leg = NULL ) ;
void FitNDrawAppend ( TH1D* h1, TF1* ffn, string plotName, float statY, int color = 4, TLegend* leg = NULL ) ;
void SetFitParameter( string fitFunc_ , double fitMin_, double fitMax_ , int nFitPara_, double* initVals, int color = 2 ) ;
void SetFitParameter( string fitFunc_ , TH1D* h1, double fitMin_, double fitMax_ , int nFitPara_, int color = 2 ) ;
void EffPlot( TH1D* hCut, TH1D* hAll, string xlable, double minBinContent, int beginBin = 1, int endBin = -1 , string graphName = "Efficiency", TPaveText* pavetex = NULL ) ;
/*
pair<double,double> EffError( double N_all, double N_pass ) ;
pair<double,double> ErrAxB( double A, double B, double u_A = -1, double d_A = -1, double u_B = -1, double d_B = -1 ) ;
pair<double,double> ErrAovB( double A, double B, double u_A = -1, double d_A = -1, double u_B = -1, double d_B = -1 ) ;
pair<double,double> ErrApnB( double A, double B, double u_A = -1, double d_A = -1, double u_B = -1, double d_B = -1 ) ;
pair<double,double> StatErr( double m ) ;
static Double_t BinomialErr( Double_t* x, Double_t* par ) ;
static Double_t fExp(Double_t *v, Double_t *par) ;
static Double_t fitGS(Double_t *v, Double_t *par) ;
*/
void EffProbPlot( double N_all, string graphName = "EffErrFunction" ) ;
void SetHistoAtt( string axis, float labelSize, float tickLength, float titleSize, float titleOffset ) ;
void SetHistoAtt( TH1D* h1 ) ;
void SetHistoAtt( TH2D* h2 ) ;
void SetPlotStyle( bool StatBoxON_, float tMargin=0.1 , float bMargin=0.1 , float lMargin=0.1 , float rMargin=0.1 ) ;
void SetPath( string newpath ) { hfolder = newpath ; }
private:
string fitFunc ;
double fitMin, fitMax ;
int nFitPara ;
AnaInput* Input;
string hfolder ;
string plotType ;
TF1* func1 ;
TCanvas* c1 ;
TCanvas* c2 ;
TCanvas* c3 ;
TString plotname2 ;
// histogram attributions
float labelSize_x ;
float tickLength_x ;
float titleSize_x ;
float titleOffset_x ;
float labelSize_y ;
float tickLength_y ;
float titleSize_y ;
float titleOffset_y ;
int lineWidth ;
int fillColor ;
bool StatBoxOn ;
};
#endif