1 //void StyleSettingsThesis();
4 class TGradientParFunction {
8 TGradientParFunction(int ipar, TF1 * f) :
13 double operator() (double * x, double *) const
15 // evaluate gradient vector of functions at point x
16 return fFunc->GradientPar(fPar,x);
26 void DrawGammaHisto(TH1*,TString, TString, TString, TString, Bool_t, Float_t, Float_t, Bool_t, Float_t, Float_t, Bool_t, Float_t, Float_t,Int_t);
28 void StyleSettingsThesis(){
29 //gStyle->SetOptTitle(kFALSE);
30 gStyle->SetOptDate(0); //show day and time
31 gStyle->SetOptStat(0); //show statistic
32 gStyle->SetPalette(1,0);
33 gStyle->SetFrameBorderMode(0);
34 gStyle->SetFrameFillColor(0);
35 gStyle->SetTitleFillColor(0);
36 gStyle->SetTextSize(0.5);
37 gStyle->SetLabelSize(0.03,"xyz");
38 gStyle->SetLabelOffset(0.002,"xyz");
39 gStyle->SetTitleFontSize(0.04);
40 gStyle->SetTitleOffset(1,"y");
41 gStyle->SetTitleOffset(0.7,"x");
42 gStyle->SetCanvasColor(0);
43 gStyle->SetPadTickX(1);
44 gStyle->SetPadTickY(1);
45 gStyle->SetLineWidth(0.01);
47 gStyle->SetPadTopMargin(0.03);
48 gStyle->SetPadBottomMargin(0.09);
49 gStyle->SetPadRightMargin(0.03);
50 gStyle->SetPadLeftMargin(0.13);
53 TGaxis::SetMaxDigits(3);
59 //gStyle->SetOptTitle(kFALSE);
60 gStyle->SetOptDate(0); //show day and time
61 gStyle->SetOptStat(0); //show statistic
62 gStyle->SetPalette(1,0);
63 gStyle->SetFrameBorderMode(0);
64 gStyle->SetFrameFillColor(0);
65 gStyle->SetTitleFillColor(0);
66 gStyle->SetTextSize(0.5);
67 gStyle->SetLabelSize(0.03,"xyz");
68 gStyle->SetLabelOffset(0.002,"xyz");
69 gStyle->SetTitleFontSize(0.04);
70 gStyle->SetTitleOffset(1,"y");
71 gStyle->SetTitleOffset(0.7,"x");
72 gStyle->SetCanvasColor(0);
73 gStyle->SetPadTickX(1);
74 gStyle->SetPadTickY(1);
75 gStyle->SetLineWidth(0.01);
77 gStyle->SetPadTopMargin(0.1);
78 gStyle->SetPadBottomMargin(0.1);
79 gStyle->SetPadRightMargin(0.08);
80 gStyle->SetPadLeftMargin(0.12);
83 // TGaxis::SetMaxDigits(3);
87 /* DrawAutoGammaHisto is function used for styling a histograma of the gamma conversion group with standart settings
88 * histo1 - first histogram (Data)
89 * Title - histogram title
90 * XTitle - X-axis title
91 * YTitle - Y-axis title
92 * YRangeMax = kTRUE will scale by Maximum and Minimum Range in Y
93 *YMaxFactor - will MaximumY by this factor if YRangeMay = kTRUE
94 *YMinimum - this will be used if YRangeMax is set
95 *YRange = kTRUE will Cut y-axis by YMin and YMax
96 - will be set to kFAlSE if YRangeMax is set
99 *XRange = kTRUE will Cut x-axis by XMin and XMax
103 void DrawGammaHisto( TH1* histo1,
104 TString CutSelection,TString Title, TString XTitle, TString YTitle,
105 Bool_t YRangeMax, Float_t YMaxFactor, Float_t YMinimum,
106 Bool_t YRange, Float_t YMin ,Float_t YMax,
107 Bool_t XRange, Float_t XMin, Float_t XMax,Int_t bck) {
113 if (YRangeMax && !XRange){
115 Double_t maxRange_R = histo1->GetMaximum();
116 Double_t minRange_R = histo1->GetMinimum();
117 if(YMinimum > minRange_R){minRange_R = YMinimum;}
118 histo1->GetYaxis()->SetRangeUser(minRange_R, maxRange_R*YMaxFactor);
120 if (YRangeMax && XRange){
122 Double_t maxRange_R = histo1->GetMaximum();
123 Double_t minRange_R = histo1->GetMinimum();
124 if(YMinimum > minRange_R){minRange_R = YMinimum;}
125 histo1->GetYaxis()->SetRangeUser(minRange_R, maxRange_R*YMaxFactor);
126 histo1->GetXaxis()->SetRangeUser(XMin, XMax);
128 if (YRange && XRange){
129 histo1->GetYaxis()->SetRangeUser(YMin, YMax);
130 histo1->GetXaxis()->SetRangeUser(XMin, XMax);
132 if (!YRangeMax && !YRange && XRange){
133 histo1->GetXaxis()->SetRangeUser(XMin, XMax);
136 if (YRange && !XRange){
137 histo1->GetYaxis()->SetRangeUser(YMin, YMax);
140 // histo1->GetYaxis()->SetRangeUser(YMin, YMax);
141 histo1->GetXaxis()->SetRangeUser(XMin, XMax);
142 if(Title.Length() > 0){
143 histo1->SetTitle(Form("%s_%s",Title.Data(),CutSelection.Data()));
145 if(XTitle.Length() > 0){
146 histo1->SetXTitle(XTitle.Data());
148 if(YTitle.Length() > 0){
149 histo1->SetYTitle(YTitle.Data());
151 histo1->GetYaxis()->SetLabelSize(0.02);
152 histo1->GetYaxis()->SetTitleSize(0.025);
153 histo1->GetYaxis()->SetDecimals();
154 histo1->GetYaxis()->SetTitleOffset(1.8);
155 histo1->GetXaxis()->SetTitleSize(0.025);
156 histo1->GetXaxis()->SetLabelSize(0.02);
157 histo1->SetMarkerStyle(20);
158 histo1->SetMarkerColor(1);
159 histo1->SetLineColor(1);
160 histo1->SetMarkerSize(0.8);
161 histo1->SetTitleOffset(1.2,"xy");
162 histo1->SetTitleSize(0.05,"xy");
163 histo1->GetYaxis()->SetLabelSize(0.05);
164 histo1->GetXaxis()->SetLabelSize(0.05);
165 histo1->GetXaxis()->SetNdivisions(507,kTRUE);
167 histo1->SetLineStyle(1);
168 histo1->SetLineColor(4);
169 histo1->SetLineWidth(2);
170 histo1->DrawCopy("hist,same");
172 histo1->DrawCopy("e1,p");