76 if (&o ==
this)
return *
this;
101 if (b <= 0)
return 0;
138 if (b <= 0)
return 0;
177 AliWarning(
"No vertex array defined");
182 AliWarning(Form(
"vertex %+8.4f out of range [%+8.4f,%+8.4f]",
203 case 2:
return (r ==
'I' || r ==
'i' ? 1 : 2);
break;
204 case 3:
return (r ==
'I' || r ==
'i' ? 3 : 4);
break;
207 AliWarning(Form(
"Index for FMD%d%c not found", d, r));
229 if (!ringArray)
return 0;
231 if (b <= 0 || b > ringArray->GetEntriesFast()) {
232 AliWarning(Form(
"vertex bin %d out of range [1,%d]",
233 b, ringArray->GetEntriesFast()));
237 TObject* o = ringArray->At(b-1);
240 AliWarning(Form(
"No dead channels map found for FMD%d%c in vertex bin %d",
260 if (idx < 0)
return 0;
264 AliWarning(Form(
"No array found for FMD%d%c", d, r));
286 if (idx < 0)
return 0;
291 a->SetName(Form(
"FMD%d%c", d, r));
293 m.AddAtAndExpand(a, idx);
297 return static_cast<TObjArray*
>(m.At(idx));
320 if (!ringArray)
return false;
323 AliWarning(Form(
"Vertex bin %3d out of range [1,%3d]",
327 h->SetName(Form(
"FMD%d%c_vtxbin%03d", d, r, b));
328 h->SetTitle(Form(
"Acceptance correction for FMD%d%c " 329 "in vertex bin %d [%+8.4f,%+8.4f]",
332 h->SetXTitle(
"#eta");
333 h->SetYTitle(
"N_{strips,OK}/N_{strips}");
334 h->SetFillStyle(3001);
337 ringArray->AddAtAndExpand(h, b-1);
360 AliWarning(Form(
"Vertex %+8.4f out of range [%+8.4f,%+8.4f]",
378 for (
UShort_t v = 1; v <= nV; v++) {
382 Char_t r = (q == 0 ?
'I' :
'O');
389 Int_t nY = corr->GetNbinsY();
390 TH1D* h = corr->ProjectionX(
"tmp", nY+1, nY+1,
"");
391 h->SetName(Form(
"FMD%d%c_vtxbin%03d", d, r, v));
392 h->SetTitle(Form(
"#phi acceptance correction for FMD%d%c " 393 "in vertex bin %d [%+8.4f,%+8.4f]",
396 h->SetXTitle(
"#eta");
397 h->SetYTitle(
"N_{strips}/N_{strips,OK}");
398 h->SetFillStyle(3001);
401 a->AddAtAndExpand(h,v-1);
406 Int_t nX = corr->GetNbinsX();
407 for (
Int_t eta = 1; eta <= nX; eta++) {
409 for (
Int_t phi = 1; phi <= nY; phi++)
410 sum += corr->GetBinContent(eta, phi);
411 if (nY <= 0)
continue;
412 h->SetBinContent(eta, nY/sum);
442 std::cout <<
"Acceptance correction due to dead channels" << std::endl;
457 gROOT->IncreaseDirLevel();
460 gROOT->DecreaseDirLevel();
467 c->SetLeftMargin(.1);
468 c->SetRightMargin(.05);
469 c->SetBottomMargin(.1);
470 c->SetTopMargin(.05);
483 if (!fileName.EndsWith(
".pdf")) {
484 TObject::SaveAs(fileName, option);
488 TVirtualPad*
c =
new TCanvas(
filename, GetTitle(), 800/TMath::Sqrt(2), 800);
496 TLatex* ll =
new TLatex(.5,.8,
filename);
497 ll->SetTextAlign(22);
498 ll->SetTextSize(0.03);
502 TLatex* l =
new TLatex(.5,.8,
filename);
504 l->SetTextSize(0.03);
507 l->DrawLatex(0.2, 0.70,
"Acceptance due to dead channels");
509 l->DrawLatex(0.5, 0.60,
"c_{v,r}(#eta,#phi)=#frac{" 510 "#sum active strips#in(#eta,#phi)}{" 511 "#sum strips#in(#eta,#phi)}");
513 c->Print(
filename,
"Title:Title page");
518 Int_t nVtx = vtxAxis.GetNbins();
524 Char_t r = (q == 0 ?
'I' :
'O');
527 c->Divide(2, (nVtx+1)/2);
528 for (
UShort_t v=1; v <= nVtx; v++) {
529 TVirtualPad* p = c->cd(v);
530 p->SetFillColor(kWhite);
534 Warning(
"DrawCorrAcc",
"No correction for r=%c, v=%d", r, v);
539 c->Print(
filename, Form(
"Title:FMD%d%c", d, r));
544 c->Print(
filename,
"Title:Phi Acceptance");
547 c->Print(
filename,
"Title:Summary");
562 Bool_t over = opt.Contains(
"phi");
563 opt.ReplaceAll(
"phi",
"");
565 TVirtualPad*
c = gPad;
566 if (!c) c =
new TCanvas(GetName(), GetTitle());
569 Int_t nVtx = vtxAxis.GetNbins();
571 c->SetLeftMargin(.1);
572 c->SetRightMargin(.05);
573 c->SetBottomMargin(.1);
574 c->SetTopMargin(.05);
576 c->Divide((nVtx+2)/3, 3, 0, 0);
579 for (
UShort_t v = 1; v <= nVtx; v++) {
581 if (ipad == 1 || ipad == 12) ipad++;
583 TVirtualPad* p = c->cd(ipad);
584 p->SetFillColor(kWhite);
586 THStack*
stack =
new THStack(Form(
"vtx%02d", v),
587 Form(
"%+5.1f<v_{z}<%+5.1f",
588 vtxAxis.GetBinLowEdge(v),
589 vtxAxis.GetBinUpEdge(v)));
593 Char_t r = (q == 0 ?
'I' :
'O');
598 Error(
"",
"No phi acceptance at v=%d", v-1);
605 hp->SetFillStyle(3001);
613 Warning(
"Draw",
"No correction for r=%c, v=%d", r, v);
616 Int_t nY = h1->GetNbinsY();
617 TH1* hh = h1->ProjectionX(Form(
"FMD%d%c", d, r), 1, nY);
623 hh->SetFillStyle(3004);
628 stack->SetMaximum(1.2);
629 stack->Draw(Form(
"nostack %s", opt.Data()));
TH2D * GetCorrection(UShort_t d, Char_t r, Double_t v) const
Int_t GetRingIndex(UShort_t d, Char_t r) const
void Draw(const char *filename, const char *title="", const char *others="ALL", const char *options="DEFAULT", const char *outFlg="ALL", UShort_t rebin=5, Float_t eff=0, const char *base="")
void ls(Option_t *option="") const
AliFMDCorrAcceptance & operator=(const AliFMDCorrAcceptance &o)
TAxis fVertexAxis
Array of per-ring, per-vertex 1d factors.
TH1D * GetPhiAcceptance(UShort_t d, Char_t r, Double_t v) const
TObjArray * GetRingArray(const TObjArray &m, UShort_t d, Char_t r) const
void SetVertexAxis(const TAxis &axis)
static Color_t RingColor(UShort_t d, Char_t r)
Bool_t HasOverflow() const
TObject * GetObject(const TObjArray &m, UShort_t d, Char_t r, UShort_t b) const
Various utilities used in PWGLF/FORWARD.
const TAxis & GetVertexAxis() const
virtual ~AliFMDCorrAcceptance()
void Print(Option_t *option="R") const
void ClearCanvas(TCanvas *c)
Int_t FindVertexBin(Double_t vertex) const
TObjArray * GetOrMakeRingArray(TObjArray &m, UShort_t d, Char_t r) const
Bool_t SetCorrection(UShort_t d, Char_t r, Double_t v, TH2D *h)