23 const char* n1=0,
const char* n2=0,
29 gROOT->Macro(
"$ALICE_PHYSICS/PWGLF/FORWARD/analysis2/scripts/LoadLibs.C");
41 o1 = file1.Get(task.
GetManager().GetSecMapName());
42 o2 = file2.Get(task.
GetManager().GetSecMapName());
43 if (!o1 || !o2)
return;
61 TCanvas* c2D =
new TCanvas(
"2Dcomparison",
"2Dcomparison",800,1000);
62 TCanvas* c1D =
new TCanvas(
"1Dcomparison",
"1Dcomparison",800,1000);
90 static_cast<TH2*
>(h1->Clone(Form(
"tmpSPD_%3d",v)));
91 ratio->SetName(Form(
"SPD_vtx%03d_ratio", v));
92 ratio->SetTitle(Form(
"%+5.1f<v_{z}<%-+5.1f", vl, vh));
95 ratio->SetDirectory(0);
96 ratio->SetZTitle(
"ratio");
101 ratio->DrawCopy(
"colz");
102 hists.AddAt(ratio, v-1);
111 for (
UShort_t v=1; v <= nVtx; v++) {
114 TH2* hist =
static_cast<TH2*
>(hists.At(v-1));
115 TH1D* prof = hist->ProjectionX();
117 for(
Int_t i=1; i<=hist->GetNbinsX();i++) {
122 for(
Int_t j=1; j<=hist->GetNbinsY();j++) {
123 if(hist->GetBinContent(i,j) > 0) {
124 sum = sum+hist->GetBinContent(i,j);
125 error = error + TMath::Power(hist->GetBinError(i,j),2);
132 error = TMath::Sqrt(error) / (
Float_t)n;
133 prof->SetBinContent(i,sum);
134 prof->SetBinError(i,error);
140 prof->SetMinimum(0.8);
141 prof->SetMaximum(1.2);
144 prof->Fit(
"pol0",
"Q");
147 TF1* f = prof->GetFunction(
"pol0");
149 TLatex* l =
new TLatex(0.5, 0.4, Form(
"A = %f #pm %f",
155 l->DrawLatex(0.5, 0.3, Form(
"#chi^2/NDF = %f / %d = %f",
158 f->GetChisquare() / f->GetNDF()));
159 Double_t dist = TMath::Abs(1 - f->GetParameter(0));
160 l->DrawLatex(0.5, 0.35, Form(
"|1 - A| = %f %s #deltaA",
161 dist, dist <= f->GetParError(0) ?
164 TLine* l1 =
new TLine(-4, 1, 6, 1);
165 l1->SetLineColor(kRed);
172 c2D->Print(
"comparisonSPD.pdf(");
173 c1D->Print(
"comparisonSPD.pdf)");
virtual AliCorrectionManagerBase * GetManager() const
TH2D * GetCorrection(Double_t v) const
void CompareCentralSecMaps(const char *fn1, const char *fn2, const char *n1=0, const char *n2=0, bool load=true)
const TAxis & GetVertexAxis() const