22 #include <TParameter.h>
43 y -= 1.2*l->GetTextSize();
44 l->DrawLatex(x, y, c1);
45 l->DrawLatex(x+.4, y, c2);
64 TList* ring =
static_cast<TList*
>(p->FindObject(Form(
"FMD%d%c",d,r)));
66 Error(
"DrawRecAnaEloss",
"List FMD%d%c not found in %s",d,r,p->GetName());
69 TList* ring2 =
static_cast<TList*
>(p2->FindObject(Form(
"FMD%d%c",d,r)));
71 Error(
"DrawRecAnaEloss",
"List FMD%d%c not found in %s",d,r,p2->GetName());
75 TH1* before =
static_cast<TH1D*
>(ring->FindObject(
"esdEloss"));
77 Error(
"DrawRingRecAnaEloss",
"Histogram esdEloss not found in FMD%d%c",
81 TH1* after =
static_cast<TH1D*
>(ring->FindObject(
"anaEloss"));
83 Error(
"DrawRingRecAnaEloss",
"Histogram anaEloss not found in FMD%d%c",
87 TH1* presented =
static_cast<TH1D*
>(ring2->FindObject(
"eloss"));
89 Error(
"DrawRingRecAnaEloss",
"Histogram eloss not found in FMD%d%c",
93 TH1* used =
static_cast<TH1D*
>(ring2->FindObject(
"elossUsed"));
95 Error(
"DrawRingRecAnaEloss",
"Histogram elossUsed not found in FMD%d%c",
101 Int_t low = before->GetXaxis()->FindBin(lowCut);
102 Int_t ib =
Int_t(before->Integral(low,before->GetNbinsX()));
103 Int_t ia =
Int_t(after->Integral(low,after->GetNbinsX()));
104 Int_t ip =
Int_t(presented->Integral(low,presented->GetNbinsX()));
105 Int_t iu =
Int_t(used->Integral(low,used->GetNbinsX()));
112 gPad->SetFillColor(0);
113 before->SetTitle(Form(
"FMD%d%c",d,r));
116 presented->Draw(
"same");
124 Double_t x = gPad->GetLeftMargin() + .25;
125 Double_t y = 1-gPad->GetTopMargin()-gStyle->GetTitleH()+ts;
126 TLatex* ltx =
new TLatex(x, y, Form(
"FMD%d%c", d, r));
128 ltx->SetTextAlign(13);
129 ltx->SetTextSize(ts);
132 TString inte(Form(
"Integral [%4.2f,#infty]", lowCut));
133 DrawText(ltx, x, y, Form(
"%s before:", inte.Data()), Form(
"%9d", ib));
134 DrawText(ltx, x, y, Form(
"%s after:", inte.Data()), Form(
"%9d", ia));
135 DrawText(ltx, x, y, Form(
"%s input:", inte.Data()), Form(
"%9d", ip));
136 DrawText(ltx, x, y, Form(
"%s user:", inte.Data()), Form(
"%9d", iu));
137 TLine* l =
new TLine;
139 l->DrawLineNDC(x, y-0.9*ts, 1-gPad->GetRightMargin()-0.01, y-0.9*ts);
140 if (ib != 0 && ia != 0) {
141 DrawText(ltx, x, y,
"Change (merging)", Form(
"%5.1f%%", (100.*(ia-ib))/ib));
142 DrawText(ltx, x, y,
"Change (input)", Form(
"%5.1f%% (%5.1f%%)",
145 DrawText(ltx, x, y,
"Change (use)", Form(
"%5.1f%% (%5.1f%%)",
149 before->GetXaxis()->SetRangeUser(0, 4);
164 const char* folder=
"ForwardResults")
166 gStyle->SetPalette(1);
167 gStyle->SetOptFit(0);
168 gStyle->SetOptStat(0);
169 gStyle->SetOptTitle(1);
170 gStyle->SetTitleW(.4);
171 gStyle->SetTitleH(.1);
172 gStyle->SetTitleColor(0);
173 gStyle->SetTitleStyle(0);
174 gStyle->SetTitleBorderSize(0);
175 gStyle->SetTitleX(.6);
179 Error(
"DrawRecAnaEloss",
"failed to open %s",
filename);
183 TList* forward =
static_cast<TList*
>(file->Get(folder));
185 Error(
"DrawRecAnaEloss",
"List %s not found in %s", folder,
filename);
189 TList* sf =
static_cast<TList*
>(forward->FindObject(
"fmdSharingFilter"));
191 Error(
"DrawRecAnaEloss",
"List fmdSharingFilter not found in Forward");
194 TList* dc =
static_cast<TList*
>(forward->FindObject(
"fmdDensityCalculator"));
196 Error(
"DrawRecAnaEloss",
"List fmdDensityCalculator not found in Forward");
202 Double_t low = (lowCut ? lowCut->GetVal() : 0.15);
204 Warning(
"DrawRecAnaEloss",
"Low cut not found in %s, assuming %f",
206 TCanvas*
c =
new TCanvas(
"recAnaELoss",
207 "Reconstructed and Analysed energy loss", 900, 700);
210 c->SetLeftMargin(0.15);
211 c->SetRightMargin(0.02);
212 c->SetTopMargin(0.02);
213 c->Divide(3, 2, 0, 0);
220 TVirtualPad* p = c->cd(4);
222 p->SetRightMargin(0.15);
224 TH2D* highCuts =
static_cast<TH2D*
>(sf->FindObject(
"highCuts"));
225 if (highCuts) highCuts->Draw(
"colz");
227 c->SaveAs(
"recAnaELoss.png");
void DrawRecAnaEloss(const char *filename="forward.root", const char *folder="ForwardResults")
void DrawText(TLatex *l, Double_t x, Double_t &y, const char *c1, const char *c2)
void DrawRingRecAnaEloss(TList *p, TList *p2, Double_t lowCut, UShort_t d, Char_t r)