17 * Draw the correlation of neighboring strips before/after merging
23 * @ingroup pwg2_forward_scripts_qa
26 DrawRingNeighbors(TList* p, UShort_t d, Char_t r)
30 TList* ring = static_cast<TList*>(p->FindObject(Form("FMD%d%c",d,r)));
32 Error("DrawNeighbors", "List FMD%d%c not found in %s",d,r,p->GetName());
36 TH2* before = static_cast<TH2D*>(ring->FindObject("neighborsBefore"));
38 Error("DrawRingNeighbors", "Histogram neighborsBefore not found in FMD%d%c",
42 TH2* after = static_cast<TH2D*>(ring->FindObject("neighborsAfter"));
44 Error("DrawRingNeighbors", "Histogram neighborsAfter not found in FMD%d%c",
49 gPad->SetFillColor(0);
50 TPad* pad = (TPad*)gPad;
52 pad->SetPad(pad->GetXlowNDC(), pad->GetYlowNDC(), .99,
53 pad->GetYlowNDC()+pad->GetHNDC());
54 pad->SetRightMargin(0.15);
56 // gStyle->SetTitleY(gPad->GetBottomMargin());
58 before->SetTitle(Form("FMD%d%c",d,r));
60 after->Draw("same box");
62 before->GetXaxis()->SetRangeUser(-.5, 2);
63 before->GetYaxis()->SetRangeUser(-.5, 2);
65 TLatex* ltx = new TLatex(gPad->GetLeftMargin()+.01,
66 gPad->GetBottomMargin()+.01,
69 ltx->SetTextSize(.07);
76 * Draw the correlation of neighboring strips before/after merging
80 * @ingroup pwg2_forward_scripts_qa
83 DrawNeighbors(const char* filename="forward.root",
84 const char* folder="ForwardResults")
86 gStyle->SetPalette(1);
88 gStyle->SetOptStat(0);
89 gStyle->SetTitleW(.4);
90 gStyle->SetTitleH(.1);
91 gStyle->SetTitleX(.1);
92 gStyle->SetTitleY(.1);
93 gStyle->SetTitleColor(0);
94 gStyle->SetTitleStyle(0);
95 gStyle->SetTitleBorderSize(0);
96 gStyle->SetOptTitle(0);
98 TFile* file = TFile::Open(filename, "READ");
100 Error("DrawNeighbors", "failed to open %s", filename);
104 TList* forward = static_cast<TList*>(file->Get(folder));
106 Error("DrawNeighbors", "List %s not found in %s", folder, filename);
110 TList* sf = static_cast<TList*>(forward->FindObject("fmdSharingFilter"));
112 Error("DrawNeighbors", "List fmdSharingFilter not found in Forward");
116 TCanvas* c = new TCanvas("neighbors", "Correlation of Neighbor strips",
120 c->Divide(3, 2, 0, 0);
122 c->cd(1); DrawRingNeighbors(sf, 1, 'I');
123 c->cd(2); DrawRingNeighbors(sf, 2, 'I');
124 c->cd(5); DrawRingNeighbors(sf, 2, 'O');
125 c->cd(3); DrawRingNeighbors(sf, 3, 'I');
126 c->cd(6); DrawRingNeighbors(sf, 3, 'O');
127 c->cd(4)->SetFillColor(0);
129 c->SaveAs("neighbors.png");