18 TStyle *atlasStyle=
new TStyle(
"ATLAS",
"Atlas style");
22 atlasStyle->SetFrameBorderMode(icol);
23 atlasStyle->SetFrameFillColor(icol);
24 atlasStyle->SetCanvasBorderMode(icol);
25 atlasStyle->SetPadBorderMode(icol);
26 atlasStyle->SetPadColor(icol);
27 atlasStyle->SetCanvasColor(icol);
28 atlasStyle->SetStatColor(icol);
32 atlasStyle->SetPaperSize(20,26);
33 atlasStyle->SetPadTopMargin(0.05);
34 atlasStyle->SetPadRightMargin(0.05);
35 atlasStyle->SetPadBottomMargin(0.16);
36 atlasStyle->SetPadLeftMargin(0.12);
42 atlasStyle->SetTextFont(font);
45 atlasStyle->SetTextSize(tsize);
46 atlasStyle->SetLabelFont(font,
"x");
47 atlasStyle->SetTitleFont(font,
"x");
48 atlasStyle->SetLabelFont(font,
"y");
49 atlasStyle->SetTitleFont(font,
"y");
50 atlasStyle->SetLabelFont(font,
"z");
51 atlasStyle->SetTitleFont(font,
"z");
53 atlasStyle->SetLabelSize(tsize,
"x");
54 atlasStyle->SetTitleSize(tsize,
"x");
55 atlasStyle->SetLabelSize(tsize,
"y");
56 atlasStyle->SetTitleSize(tsize,
"y");
57 atlasStyle->SetLabelSize(tsize,
"z");
58 atlasStyle->SetTitleSize(tsize,
"z");
62 atlasStyle->SetMarkerStyle(20);
63 atlasStyle->SetMarkerSize(1.2);
64 atlasStyle->SetHistLineWidth(2);
65 atlasStyle->SetLineStyleString(2,
"[12 12]");
71 atlasStyle->SetOptTitle(0);
73 atlasStyle->SetOptStat(0);
75 atlasStyle->SetOptFit(0);
78 atlasStyle->SetPadTickX(1);
79 atlasStyle->SetPadTickY(1);
81 gROOT->SetStyle(
"ATLAS");
100 float textsize = 0.04){
104 TitleLabel.SetTextSize(textsize);
105 TitleLabel.SetTextColor(
color);
111 for(
int i = 2; ; i++ ){
112 if(chartitle[i-2] ==
' ' && chartitle[i-1] ==
'-' && chartitle[i] ==
' '){
113 strncpy(
swap, chartitle + offset, (i-2 - offset)*
sizeof(
char));
114 swap[(i-2 - offset)] = null ;
115 TitleLabel.DrawLatex(
x,
y-counter*(1.25)*textsize,
swap);
118 }
else if(chartitle[i] == null ){
119 TitleLabel.DrawLatex(
x,
y-counter*(1.25)*textsize, chartitle + offset);
145 double &rms,
double &rms_error,
double &nentries){
153 double axmin = hist->GetMean() - 3 * hist->GetRMS();
154 double axmax = hist->GetMean() + 3 * hist->GetRMS();
155 int nbins = hist->GetNbinsX();
157 for (
int i = 0 ; i < nbins; i++){
158 double value = hist->GetBinCenter(i+1);
159 double ientries = hist->GetBinContent(i+1);
160 if (value <= axmin)
continue;
161 if (value >= axmax)
break;
162 mean += value*ientries;
163 rms += value*value*ientries;
164 nentries += ientries;
170 mean_error = rms / sqrt(nentries);
171 if(nentries > 1) rms_error = rms / sqrt(2*(nentries-1));
178TH1 *
DrawHisto(
const char *name,
const char* options =
"",
int color = 1,
int marker = 20,
float offset = 0){
179 TH1F *histo = (TH1F *)gDirectory->Get(name);
181 histo->SetDirectory(gROOT);
182 histo->UseCurrentStyle();
183 histo->SetLineColor(
color);
185 histo->SetMarkerColor(
color);
186 histo->SetMarkerSize(1.8);
187 histo->SetMarkerStyle(marker);
188 histo->Draw(options);
202 std::string options =
"P";
203 if(offset != 0) options =
"Psame";
204 TH1 *histo =
DrawHisto(name.c_str(),options.c_str(),
color,marker,offset);
206 histo->Scale(1/histo->GetEntries());
207 histo->GetYaxis()->SetTitle(
"Fraction of pixel clusters");
208 histo->GetXaxis()->SetTitle(
"Residual [#mum]");
209 std::ostringstream LegendString1;
210 LegendString1.flags(std::ios::fixed);
211 LegendString1 << name <<
" - ";
212 int precision = 1-int(log10(rms_error));
213 if(precision < 0) precision = 0;
214 LegendString1.precision(precision);
215 LegendString1 <<
"RMS: " << rms <<
" #pm " << rms_error <<
" #mum" <<
" - ";
216 precision = 1-int(log10(mean_error));
217 if(precision < 0) precision = 0;
218 LegendString1.precision(precision);
219 LegendString1 <<
"Mean: " <<
mean <<
" #pm " << mean_error <<
" #mum" <<
" - ";
224 std::string options =
"P";
225 if(offset != 0) options =
"Psame";
226 TH1 *histo =
DrawHisto(name.c_str(),options.c_str(),
color,marker,offset);
227 histo->GetYaxis()->SetTitle(
"RMS of residuals [#mum]");
229 std::ostringstream LegendString1;
void swap(DataVector< T > &a, DataVector< T > &b)
See DataVector<T, BASE>::swap().
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")