+
+//____________________________________________________________________
+void
+AliFMDCorrAcceptance::FillCache() const
+{
+ if (fCache) return;
+
+ fCache = new TObjArray;
+ fCache->SetOwner(kTRUE);
+ fCache->SetName("cache");
+
+ Int_t nV = fVertexAxis.GetNbins();
+ for (UShort_t v = 1; v <= nV; v++) {
+ for(UShort_t d = 1; d <= 3;d++) {
+ UShort_t nR = (d == 1 ? 1 : 2);
+ for (UShort_t q = 0; q < nR; q++) {
+ Char_t r = (q == 0 ? 'I' : 'O');
+
+ TObjArray* a = GetOrMakeRingArray(*fCache, d, r);
+
+ TH2D* corr = GetCorrection(d, r, v);
+ if (!corr) continue;
+
+ Int_t nY = corr->GetNbinsY();
+ TH1D* h = corr->ProjectionX("tmp", nY+1, nY+1, "");
+ h->SetName(Form("FMD%d%c_vtxbin%03d", d, r, v));
+ h->SetTitle(Form("#phi acceptance correction for FMD%d%c "
+ "in vertex bin %d [%+8.4f,%+8.4f]",
+ d, r, v, fVertexAxis.GetBinLowEdge(v),
+ fVertexAxis.GetBinUpEdge(v)));
+ h->SetXTitle("#eta");
+ h->SetYTitle("N_{strips}/N_{strips,OK}");
+ h->SetFillStyle(3001);
+ h->SetDirectory(0);
+ h->SetStats(0);
+ a->AddAtAndExpand(h,v-1);
+
+ if (fHasOverflow) continue;
+
+ // Construct the overflow bin from
+ Int_t nX = corr->GetNbinsX();
+ for (Int_t eta = 1; eta <= nX; eta++) {
+ Double_t sum = 0;
+ for (Int_t phi = 1; phi <= nY; phi++)
+ sum += corr->GetBinContent(eta, phi);
+ if (nY <= 0) continue;
+ h->SetBinContent(eta, nY/sum);
+ } // for eta
+ } // for q
+ } // for d
+ } // for v
+}