45 TList* ring =
static_cast<TList*
>(p->FindObject(Form(
"FMD%d%c",d,r)));
47 Error(
"DrawOccupancy",
"List FMD%d%c not found in %s",d,r,p->GetName());
51 TH1* corr =
static_cast<TH1*
>(ring->FindObject(
"occupancy"));
53 Error(
"DrawRingOccupancy",
"Histogram occupancy not found in FMD%d%c",
59 TPad* pad =
static_cast<TPad*
>(gPad);
64 pad->SetRightMargin(0.01);
67 pad->SetPad(pad->GetXlowNDC(), pad->GetYlowNDC(), .99,
68 pad->GetYlowNDC()+pad->GetHNDC());
69 pad->SetRightMargin(0.15);
75 TLatex* ltx =
new TLatex(.95, .95, Form(
"FMD%d%c", d, r));
77 ltx->SetTextAlign(33);
78 ltx->SetTextSize(.08);
81 return corr->GetMean();
95 const char* folder=
"ForwardResults")
97 gStyle->SetPalette(1);
99 gStyle->SetOptStat(0);
100 gStyle->SetOptTitle(0);
101 gStyle->SetTitleW(.4);
102 gStyle->SetTitleH(.1);
103 gStyle->SetTitleX(.4);
105 gStyle->SetTitleColor(0);
106 gStyle->SetTitleStyle(0);
107 gStyle->SetTitleBorderSize(0);
111 Error(
"DrawOccupancy",
"failed to open %s",
filename);
115 TList* forward =
static_cast<TList*
>(file->Get(folder));
117 Error(
"DrawOccupancy",
"List %s not found in %s", folder,
filename);
121 TList* dc =
static_cast<TList*
>(forward->FindObject(
"fmdDensityCalculator"));
123 Error(
"DrawOccupancy",
"List fmdDensityCalculator not found in Forward");
127 TCanvas*
c =
new TCanvas(
"occupancy",
128 "Mean Occupancy", 900, 700);
132 c->SetHighLightColor(0);
133 c->SetBottomMargin(.15);
134 c->SetTopMargin(.02);
135 c->SetRightMargin(.02);
136 c->SetLeftMargin(.15);
137 c->Divide(3, 2, 0, 0);
147 TVirtualPad* p = c->cd(4);
148 p->SetTopMargin(0.05);
149 p->SetRightMargin(0.10);
150 p->SetLeftMargin(0.15);
151 p->SetBottomMargin(0.15);
154 TH1D* hc =
new TH1D(
"occ",
"Mean occupancy", 5, .5, 5.5);
155 hc->SetFillColor(kRed+1);
156 hc->SetFillStyle(3001);
158 hc->GetXaxis()->SetBinLabel(1,
"FMD1i"); hc->SetBinContent(1,corrs[0]);
159 hc->GetXaxis()->SetBinLabel(2,
"FMD2i"); hc->SetBinContent(2,corrs[1]);
160 hc->GetXaxis()->SetBinLabel(3,
"FMD2o"); hc->SetBinContent(3,corrs[2]);
161 hc->GetXaxis()->SetBinLabel(4,
"FMD3i"); hc->SetBinContent(4,corrs[3]);
162 hc->GetXaxis()->SetBinLabel(5,
"FMD3o"); hc->SetBinContent(5,corrs[4]);
163 hc->GetXaxis()->SetLabelSize(0.08);
164 hc->GetYaxis()->SetTitle(
"#bar{occupancy}");
165 hc->SetMarkerSize(1.5);
166 hc->Draw(
"text hist");
167 hc->SetMaximum(hc->GetMaximum()*1.5);
172 c->SaveAs(
"occupancy.png");
Double_t DrawRingOccupancy(TList *p, UShort_t d, Char_t r)
void DrawOccupancy(const char *filename="forward.root", const char *folder="ForwardResults")