37 #include "TGraphErrors.h"
47 TCanvas(name, title, ww, wh),
49 fDisabledMargin(kFALSE),
51 fStatus(kWorkInProgress),
52 fDateFormat(
"%d/%m/%Y"),
79 fLogoFilename[
kPreliminary] =
"$ALICE_PHYSICS/PWG/Tools/fig/2011-Nov-24-ALICE_PRELIMINARY_logo_BLACK_small_usage_design.eps";
82 this->SetLeftMargin(0.15);
83 this->SetRightMargin(0.04);
84 this->SetRightMargin(0.04);
85 this->SetBottomMargin(0.15);
89 time_t t = (time_t) now.Convert();
90 struct tm* loctis = localtime(&t);
93 fCollSystem =
new TLatex(0.96, 0.95,
"pp #sqrt{s} = 7 TeV");
94 fCollSystem->SetNDC();
96 fCollSystem->SetTextFont(43);
97 fCollSystem->SetTextAlign(33);
100 fDataSample =
new TLatex(0.15, 0.05,
"Run ######");
107 fDate =
new TText(0.5, 0., date);
110 fDate->SetTextFont(43);
111 fDate->SetTextAlign(22);
121 fTag =
new TText(0.5, 0.,
"");
124 fTag->SetTextFont(43);
125 fTag->SetTextAlign(22);
136 fLogoPad =
new TPad(
"aliceLogo",
"Pad for ALICE Logo", .2, .2, .4, .4);
162 TCanvas::Paint(option);
170 TList *listOfPrimitives = this->GetListOfPrimitives();
171 TIter iter(listOfPrimitives);
174 while ((obj = iter())) {
176 listOfPrimitives->Remove(obj);
180 TCanvas::Clear(option);
195 this->GetListOfPrimitives()->Add(
fLogoPad);
202 this->GetListOfPrimitives()->Add(
fTag);
204 this->Modified(kTRUE);
218 this->Modified(kTRUE);
238 if (
fLogo->IsValid()) {
239 fLogo->SetImageQuality(TASImage::kImgBest);
293 this->Error(__FUNCTION__,
"Unknown position specifier");
337 fgStyle->SetTitle(
"ALICE figure style");
340 fgStyle->SetFrameBorderMode(0);
342 fgStyle->SetCanvasBorderMode(0);
347 fgStyle->SetTitleFillColor(10);
348 fgStyle->SetTitleBorderSize(0);
349 if ((font % 10) == 3)
352 fgStyle->SetTitleFontSize(0.08);
363 fgStyle->SetStatFontSize(0.05);
368 fgStyle->SetTickLength(0.02,
"y");
370 if ((font % 10) == 3)
371 fgStyle->SetLabelSize(30,
"xyz");
373 fgStyle->SetLabelSize(0.05,
"xyz");
374 fgStyle->SetLabelFont(font,
"xyz");
375 fgStyle->SetLabelOffset(0.01,
"xyz");
376 fgStyle->SetTitleFont(font,
"xyz");
377 fgStyle->SetTitleOffset(1.,
"xyz");
378 if ((font % 10) == 3)
379 fgStyle->SetTitleSize(34,
"xyz");
381 fgStyle->SetTitleSize(0.06,
"xyz");
419 ratio =
fLogo->GetWidth();
421 ratio *= (
Float_t) this->GetWh();
422 ratio /= (
Float_t) this->GetWw();
424 width = height*ratio;
460 pad->SetLeftMargin(0.15);
461 pad->SetRightMargin(0.04);
462 pad->SetBottomMargin(0.15);
468 TList *listOfPrimitives = pad->GetListOfPrimitives();
469 TIter iter(listOfPrimitives);
472 while ((obj = iter())) {
474 listOfPrimitives->Remove(obj);
487 if (obj->InheritsFrom(
"TPad")) {
490 else if (obj->InheritsFrom(
"TH2")) {
491 const TString drawOption = ((
TH2*) obj)->GetDrawOption();
492 if (drawOption.Contains(
"surf")) {
493 pad->SetLeftMargin(.2);
494 ((
TH2*) obj)->SetTitleOffset(1.3,
"z");
495 ((
TH2*) obj)->SetTitleOffset(1.3,
"y");
496 ((
TH2*) obj)->GetXaxis()->CenterTitle();
497 ((
TH2*) obj)->GetYaxis()->CenterTitle();
500 pad->SetRightMargin(.18);
504 else if (obj->InheritsFrom(
"TLegend")) {
505 TLegend *leg = (TLegend*) obj;
506 leg->SetTextFont(43);
507 leg->SetBorderSize(1);
508 leg->SetFillStyle(0);
509 leg->SetFillColor(1);
510 leg->SetShadowColor(0);
511 leg->SetMargin(0.25);
513 leg->SetEntrySeparation(0.25);
void SetCollSystemPos(Float_t x, Float_t y)
TString fLogoFilename[kStatusLast]
AliCanvas(const char *name="", const char *title="", Int_t ww=800, Int_t wh=600)
void Draw(const char *filename, const char *title="", const char *others="ALL", const char *options="DEFAULT", const char *outFlg="ALL", UShort_t rebin=5, Float_t eff=0, const char *base="")
void SetTextSize(Float_t size)
void SetLogoPos(Float_t x, Float_t y)
void SetCollSystem(TString txt)
void Clear(Option_t *option="")
void Draw(Option_t *option="")
void SetLogoSize(Float_t size)
void SetDataSample(TString txt)
void UpdatePad(TPad *pad)
void SetStatus(Status_t status)
void Paint(Option_t *option="")
const char * fStatusString[kStatusLast]
void SetLogoFilename(Status_t status, TString filename)