2 |
|
#include <sstream> |
3 |
|
#include <TPaveText.h> |
4 |
|
#include <TLatex.h> |
5 |
+ |
#include <iostream> |
6 |
+ |
using namespace std; |
7 |
|
|
8 |
|
void Layout::DrawInit() |
9 |
|
{ |
19 |
|
gStyle->SetFrameBorderMode(0); |
20 |
|
gStyle->SetFrameBorderSize(0); |
21 |
|
gStyle->SetFrameFillColor(0); |
22 |
< |
gStyle->SetOptStat(0); |
22 |
> |
// gStyle->SetOptStat(0); |
23 |
|
|
24 |
|
gStyle->SetLabelOffset(0.005,"X"); |
25 |
|
gStyle->SetLabelSize(0.03,"X"); |
89 |
|
TCanvas* mycanvas = new TCanvas((std::string(histos[0].histo->GetName())+ |
90 |
|
"_canvas").c_str(), |
91 |
|
histos[0].histo->GetTitle()); |
90 |
– |
|
92 |
|
// SetLineColor |
93 |
|
for (unsigned int i=0;i<histos.size();i++) |
94 |
|
{ |
127 |
|
std::vector<double> errors; |
128 |
|
for (unsigned int i=0;i<histos.size();i++) |
129 |
|
{ |
130 |
< |
TF1* fitter = new TF1(dummy().c_str(),"gaus",xmin,xmax); |
130 |
> |
TF1* fitter = new TF1(dummy().c_str(),"gaus",-900,900); //or xmin, xmax... |
131 |
|
fitter->SetParameter(0,K); |
132 |
|
fitter->SetParameter(1,MU); |
133 |
|
fitter->SetParameter(2,SIG); |
144 |
|
{ |
145 |
|
std::stringstream str; |
146 |
|
str << "#sigma_{" << histos[i].shortName <<"} = "; |
147 |
< |
str.precision(3); str << sigmas[i]; |
147 |
> |
str.precision(2); str.setf(ios_base::scientific); str << sigmas[i]; |
148 |
|
str << " #pm "; |
149 |
< |
str.precision(3); str << errors[i]; |
149 |
> |
str.precision(1); str.setf(ios_base::scientific); str << errors[i]; |
150 |
|
TText* mytext = myblock->AddText(str.str().c_str()); |
151 |
|
mytext->SetTextColor(histos[i].linecolor); |
152 |
|
mytext->SetTextAlign(11); |