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 DrawCorrAcc(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("DrawCorrAcc", "Failed to open %s", fname);
55 pname.ReplaceAll(".root", ".pdf");
58 AliForwardCorrectionManager::Instance()
59 .GetObjectName(AliForwardCorrectionManager::kAcceptance);
60 AliFMDCorrAcceptance* corr =
61 static_cast<AliFMDCorrAcceptance*>(file->Get(objName));
63 Error("DrawCorrAcc", "Object '%s' not found in %s", objName, fname);
67 //__________________________________________________________________
69 TCanvas* c = new TCanvas("c", "c", 800 / TMath::Sqrt(2), 800);
73 c->Print(Form("%s[", pname.Data()));
75 gStyle->SetOptStat(0);
76 gStyle->SetTitleColor(0);
77 gStyle->SetTitleStyle(0);
78 gStyle->SetTitleBorderSize(0);
79 gStyle->SetTitleX(.1);
81 gStyle->SetTitleW(.8);
82 gStyle->SetTitleH(.09);
83 gStyle->SetFrameFillColor(kWhite);
84 gStyle->SetFrameBorderSize(1);
85 gStyle->SetFrameBorderMode(1);
86 gStyle->SetPalette(1);
89 //__________________________________________________________________
90 // Create a title page
91 TLatex* ll = new TLatex(.5,.8, fname);
93 ll->SetTextSize(0.03);
97 TLatex* l = new TLatex(.5,.8, fname);
102 l->DrawLatex(0.2, 0.70, "Acceptance due to dead channels");
104 l->DrawLatex(0.5, 0.60, "c_{v,r}(#eta,#phi)=#frac{"
105 "#sum active strips#in(#eta,#phi)}{"
106 "#sum strips#in(#eta,#phi)}");
108 c->Print(pname.Data(), "Title:Title page");
112 //__________________________________________________________________
113 // Draw all corrections
114 const TAxis& vtxAxis = corr->GetVertexAxis();
115 Int_t nVtx = vtxAxis.GetNbins();
116 for (UShort_t d = 1; d <= 3; d++) {
117 UShort_t nQ = (d == 1 ? 1 : 2);
118 for (UShort_t q = 0; q < nQ; q++) {
119 Char_t r = (q == 0 ? 'I' : 'O');
122 c->Divide(2, (nVtx+1)/2);
123 for (UShort_t v=1; v <= nVtx; v++) {
124 TVirtualPad* p = c->cd(v);
127 TH2* h1 = corr->GetCorrection(d, r, v);
129 Warning("DrawCorrAcc", "No correction for r=%c, v=%d", r, v);
134 c->Print(pname.Data(), Form("Title:FMD%d%c", d, r));
138 //__________________________________________________________________
140 c->Print(Form("%s]", pname.Data()));