2 * Draw the correlation of neighboring strips before/after merging
8 * @ingroup pwg2_forward_scripts_qa
11 DrawRingNeighbors(TList* p, UShort_t d, Char_t r)
15 TList* ring = static_cast<TList*>(p->FindObject(Form("FMD%d%c",d,r)));
17 Error("DrawNeighbors", "List FMD%d%c not found in %s",d,r,p->GetName());
21 TH2* before = static_cast<TH2D*>(ring->FindObject("neighborsBefore"));
23 Error("DrawRingNeighbors", "Histogram neighborsBefore not found in FMD%d%c",
27 TH2* after = static_cast<TH2D*>(ring->FindObject("neighborsAfter"));
29 Error("DrawRingNeighbors", "Histogram neighborsAfter not found in FMD%d%c",
34 gPad->SetFillColor(0);
35 TPad* pad = (TPad*)gPad;
37 pad->SetPad(pad->GetXlowNDC(), pad->GetYlowNDC(), .99,
38 pad->GetYlowNDC()+pad->GetHNDC());
39 pad->SetRightMargin(0.15);
41 // gStyle->SetTitleY(gPad->GetBottomMargin());
43 before->SetTitle(Form("FMD%d%c",d,r));
45 after->Draw("same box");
47 before->GetXaxis()->SetRangeUser(-.5, 2);
48 before->GetYaxis()->SetRangeUser(-.5, 2);
50 TLatex* ltx = new TLatex(gPad->GetLeftMargin()+.01,
51 gPad->GetBottomMargin()+.01,
54 ltx->SetTextSize(.07);
61 * Draw the correlation of neighboring strips before/after merging
65 * @ingroup pwg2_forward_scripts_qa
68 DrawNeighbors(const char* filename="forward.root")
70 gStyle->SetPalette(1);
72 gStyle->SetOptStat(0);
73 gStyle->SetTitleW(.4);
74 gStyle->SetTitleH(.1);
75 gStyle->SetTitleX(.1);
76 gStyle->SetTitleY(.1);
77 gStyle->SetTitleColor(0);
78 gStyle->SetTitleStyle(0);
79 gStyle->SetTitleBorderSize(0);
80 gStyle->SetOptTitle(0);
82 TFile* file = TFile::Open(filename, "READ");
84 Error("DrawNeighbors", "failed to open %s", filename);
88 TList* forward = static_cast<TList*>(file->Get("Forward"));
90 Error("DrawNeighbors", "List Forward not found in %s", filename);
94 TList* sf = static_cast<TList*>(forward->FindObject("fmdSharingFilter"));
96 Error("DrawNeighbors", "List fmdSharingFilter not found in Forward");
100 TCanvas* c = new TCanvas("neighbors", "Correlation of Neighbor strips",
104 c->Divide(3, 2, 0, 0);
106 c->cd(1); DrawRingNeighbors(sf, 1, 'I');
107 c->cd(2); DrawRingNeighbors(sf, 2, 'I');
108 c->cd(5); DrawRingNeighbors(sf, 2, 'O');
109 c->cd(3); DrawRingNeighbors(sf, 3, 'I');
110 c->cd(6); DrawRingNeighbors(sf, 3, 'O');
111 c->cd(4)->SetFillColor(0);