/** * Draw the Poisson estimate of the occupancy in a given ring. * * @param p List * @param d Detector * @param r Ring * * @return The occupancy (in percent) * * @deprecated Use QATrender instead * @ingroup pwglf_forward_scripts_qa */ Double_t DrawRingOccupancy(TList* p, UShort_t d, Char_t r) { if (!p) return 0; TList* ring = static_cast<TList*>(p->FindObject(Form("FMD%d%c",d,r))); if (!ring) { Error("DrawOccupancy", "List FMD%d%c not found in %s",d,r,p->GetName()); return 0; } TH1* corr = static_cast<TH1*>(ring->FindObject("occupancy")); if (!corr) { Error("DrawRingOccupancy", "Histogram occupancy not found in FMD%d%c", d, r); return 0; } corr->Rebin(4); TPad* pad = static_cast<TPad*>(gPad); pad->SetGridy(); pad->SetGridx(); pad->SetLogy(); pad->SetFillColor(0); pad->SetRightMargin(0.01); #if 0 if (d == 3) { pad->SetPad(pad->GetXlowNDC(), pad->GetYlowNDC(), .99, pad->GetYlowNDC()+pad->GetHNDC()); pad->SetRightMargin(0.15); } #endif corr->Draw("hist"); TLatex* ltx = new TLatex(.95, .95, Form("FMD%d%c", d, r)); ltx->SetNDC(); ltx->SetTextAlign(33); ltx->SetTextSize(.08); ltx->Draw(); return corr->GetMean(); }