4 * Scripts to draw energy loss fits from correction object file
6 * @ingroup pwg2_forward_analysis_scripts
11 * @param c Canvas to clear
13 * @ingroup pwg2_forward_analysis_scripts
16 ClearCanvas(TCanvas* c)
19 c->SetRightMargin(.05);
20 c->SetBottomMargin(.1);
26 * Draw energy loss fits to a multi-page PDF.
29 * The input file is expected to contain a AliFMDCorrELossFit object
30 * named @i elossfits in the top level directory.
33 * A multi-page PDF. Note, that the PDF generated by ROOT in this way
34 * is broken (cannot be read by Acrobat Reader on Windows and MacOSX)
35 * and one should pass it through a filter to correct these problems.
37 * @param fname File name
38 * @param option Drawing options
40 * @ingroup pwg2_forward_analysis_scripts
43 DrawCorrCentralSecMap2(const char* fname, const char* option="colz")
45 //__________________________________________________________________
46 // Load libraries and object
47 gROOT->Macro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadLibs.C");
49 TFile* file = TFile::Open(fname, "READ");
51 Error("DrawCorrSecMap", "Failed to open %s", fname);
55 pname.ReplaceAll(".root", ".png");
56 pname = gSystem->BaseName(pname);
58 AliCentralMultiplicityTask::Manager* mgr =
59 new AliCentralMultiplicityTask::Manager;
60 const char* objName = mgr->GetObjectName(0);
61 AliCentralCorrSecondaryMap* corr =
62 static_cast<AliCentralCorrSecondaryMap*>(file->Get(objName));
64 Error("DrawCorrCentralSecMap", "Object '%s' not found in %s",
69 //__________________________________________________________________
72 TCanvas* c = new TCanvas("c", "c", w, w / TMath::Sqrt(2));
76 // c->Print(Form("%s[", pname.Data()));
78 gStyle->SetOptStat(0);
79 gStyle->SetTitleColor(0);
80 gStyle->SetTitleStyle(0);
81 gStyle->SetTitleBorderSize(0);
82 gStyle->SetTitleX(.1);
84 gStyle->SetTitleW(.8);
85 gStyle->SetTitleH(.09);
86 gStyle->SetFrameFillColor(kWhite);
87 gStyle->SetFrameBorderSize(1);
88 gStyle->SetFrameBorderMode(1);
89 gStyle->SetPalette(1);
92 //__________________________________________________________________
93 // Draw all corrections
94 const TAxis& vtxAxis = corr->GetVertexAxis();
95 Int_t nVtx = vtxAxis.GetNbins();
96 c->Divide((nVtx+2)/3, 3, 0, 0);
98 for (UShort_t v=1; v <= nVtx; v++) {
102 TLatex* l = new TLatex(.5, .5,
103 "#frac{#sum N_{ch,SPD0}}{#sum N_{ch,primary}}");
110 if (ipad == 12) ipad++;
112 TVirtualPad* p = c->cd(ipad);
113 p->SetFillColor(kWhite);
117 TH2* h1 = corr->GetCorrection(v);
118 TH1D* pr = h1->ProjectionX(Form("vtxbin%02d", v), -1, -1, "e");
120 pr->SetTitle(Form("%+5.1f<v_{z}<%+5.1f",
121 vtxAxis.GetBinLowEdge(v),
122 vtxAxis.GetBinUpEdge(v)));
123 pr->Scale(1. / h1->GetNbinsY());
124 pr->SetMarkerColor(kRed+1);
125 pr->SetFillColor(kRed+1);
126 pr->SetFillStyle(3001);
127 pr->SetMaximum(1.65);
128 pr->GetXaxis()->SetRangeUser(-3.1,3.1);
134 //__________________________________________________________________
136 c->SaveAs(pname.Data());