15 # include <TFitResult.h> 46 TList* dL =
static_cast<TList*
>(ef->FindObject(Form(
"FMD%d%c",d,r)));
48 Error(
"GetEDist",
"Couldn't find list FMD%d%c",d,r);
53 TH1* hist =
static_cast<TH1*
>(dL->FindObject(Form(
"FMD%d%c_edist",d,r)));
55 Error(
"GetEDist",
"Couldn't find EDists histogram for FMD%d%c",d,r);
60 TList* edL =
static_cast<TList*
>(dL->FindObject(
"EDists"));
62 Error(
"GetEDist",
"Couldn't find list EDists for FMD%d%c",d,r);
66 TH1* hist =
static_cast<TH1*
>(edL->FindObject(Form(
"FMD%d%c_etabin%03d",
69 Error(
"GetEDist",
"Couldn't find histogra FMD%d%c_etabin%03d",
96 Error(
"GetEDist",
"EF not set");
99 TAxis* etaAxis =
static_cast<TAxis*
>(ef->FindObject(
"etaAxis"));
101 Error(
"GetEDist",
"Couldn't find eta axis in list");
105 UShort_t bin = etaAxis->FindBin(eta);
106 if (bin <= 0 || bin > etaAxis->GetNbins()) {
107 Error(
"GetEDist",
"eta=%f out of range [%f,%f] - getting ring histo",
108 eta, etaAxis->GetXmin(), etaAxis->GetXmax());
130 TList* forward =
static_cast<TList*
>(file->Get(
"PWGLFforwardDnDeta/Forward"));
132 Error(
"GetEF",
"Failed to get list PWGLFforwardDnDeta/Forward from file");
135 TList*
ef =
static_cast<TList*
>(forward->FindObject(
"fmdEnergyFitter"));
137 Error(
"GetEF",
"Failed to get energy fitter list");
163 TFile*
file = TFile::Open(
"AnalysisResults.root",
"READ");
165 Error(
"Fit1",
"Failed to open file");
190 gStyle->SetOptFit(1111);
191 gStyle->SetCanvasColor(0);
192 gStyle->SetCanvasBorderSize(0);
193 gStyle->SetCanvasBorderMode(0);
194 gStyle->SetCanvasDefW(800);
195 gStyle->SetCanvasDefH(800);
196 gStyle->SetPadTopMargin(0.05);
197 gStyle->SetPadRightMargin(0.05);
198 gStyle->SetTitleBorderSize(0);
199 gStyle->SetTitleFillColor(0);
200 gStyle->SetTitleStyle(0);
201 gStyle->SetStatBorderSize(1);
202 gStyle->SetStatColor(0);
203 gStyle->SetStatStyle(0);
204 gStyle->SetStatX(0.95);
205 gStyle->SetStatY(0.95);
206 gStyle->SetStatW(0.15);
207 gStyle->SetStatH(0.15);
209 c =
new TCanvas(
"c",
"c");
228 Int_t nu = f->GetNDF();
230 Double_t chi2nu = (nu > 0 ? chi2/nu : 0);
231 Printf(
"%s: chi^2/nu=%f/%d=%f [%f,%f]",
232 f->GetName(), chi2, nu, chi2nu,
233 f->GetXmin(), f->GetXmax());
234 for (
Int_t i = 0; i < f->GetNpar(); i++) {
237 Double_t r = 100*(v == 0 ? 1 : e / v);
238 Printf(
"%32s = %14.7f +/- %14.7f (%5.1f%%)",f->GetParName(i),v,e,r);
266 AliForwardUtil::ELossFitter f(0.4, 10, 4);
267 TF1* landau1 =
new TF1(*f.Fit1Particle(dist, 0));
268 landau1->SetName(
"Landau1");
270 TF1* landaun =
new TF1(*f.FitNParticle(dist, n, 0));
271 landau1->SetName(Form(
"Landau%d", n));
273 landau1->SetRange(0,10);
274 landaun->SetRange(0,10);
275 landau1->SetLineWidth(4);
276 landaun->SetLineWidth(4);
277 landau1->SetLineColor(kBlack);
278 landaun->SetLineColor(kBlack);
280 dist->GetListOfFunctions()->Clear();
281 dist->GetListOfFunctions()->Add(landau1);
282 dist->GetListOfFunctions()->Add(landaun);
283 dist->GetListOfFunctions()->ls();
285 landau1->Draw(
"same");
286 landaun->Draw(
"same");
288 Double_t mp = landaun->GetParameter(1);
289 Double_t xi = landaun->GetParameter(2);
290 for (
Int_t i = 1; i <= n; i++) {
291 Double_t x = i * (mp + xi * TMath::Log(i));
294 TArrow* a =
new TArrow(x,y1,x,y,0.03,
"|>");
295 Info(
"FitSteer",
"Delta_{p,%d}=%f", i, x);
TList * GetEF(TFile *file)
void TestFitELoss(Int_t n, UShort_t d, Char_t r, Float_t eta)
Various utilities used in PWGLF/FORWARD.
TFile * file
TList with histograms for a given trigger.
TH1 * GetEDist(TList *ef, UShort_t d, Char_t r, UShort_t etabin)