3 * @author Christian Holm Christensen <cholm@nbi.dk>
4 * @date Thu Nov 17 11:07:15 2011
6 * @brief This scripts draws the energy loss distribution for single,
7 * double, and triple hits in the FMD as resolved by the sharing
10 * @ingroup pwglf_forward_scripts_qa
30 * Draw the energy loss spectra of single, double, and triple hits in
33 * @param p Parent list
37 * @deprecated Use the QATrender instead
38 * @ingroup pwglf_forward_scripts_qa
41 DrawRing123(TList* p, UShort_t d, Char_t r)
45 TList* ring = static_cast<TList*>(p->FindObject(Form("FMD%d%c",d,r)));
47 Error("Draw123", "List FMD%d%c not found in %s",d,r,p->GetName());
51 TH1* one = static_cast<TH1*>(ring->FindObject("singleEloss"));
52 TH1* two = static_cast<TH1*>(ring->FindObject("doubleEloss"));
53 TH1* three = static_cast<TH1*>(ring->FindObject("tripleEloss"));
54 if (!one || !two || !three) {
55 Error("DrawRing123", "Histograms of Eloss not found in FMD%d%c", d, r);
59 one->SetTitle(Form("FMD%d%c", d, r));
60 one->GetXaxis()->SetRangeUser(0, 8);
63 gPad->SetFillColor(0);
66 if (two) two->Draw("same");
67 if (three) three->Draw("same");
69 TLegend* l = new TLegend(.6, .6, .95, 1);
73 if (two) l->AddEntry(two);
74 if (three) l->AddEntry(three);
82 * Draw the energy loss distribution of singles, doubles, and triples
83 * as given by the sharing filter
85 * @param filename Input file name
86 * @param folder Input folder (TList) in input file
88 * @deprecated Use the QATrender instead
89 * @ingroup pwglf_forward_scripts_qa
92 Draw123(const char* filename="forward.root",
93 const char* folder="ForwardResults")
95 gStyle->SetPalette(1);
97 gStyle->SetOptStat(0);
98 gStyle->SetOptTitle(1);
99 gStyle->SetTitleW(.4);
100 gStyle->SetTitleH(.1);
101 gStyle->SetTitleColor(0);
102 gStyle->SetTitleStyle(0);
103 gStyle->SetTitleBorderSize(0);
104 gStyle->SetTitleX(.6);
106 TFile* file = TFile::Open(filename, "READ");
108 Error("Draw123", "failed to open %s", filename);
112 TList* forward = static_cast<TList*>(file->Get(folder));
114 Error("Draw123", "List %s not found in %s", folder, filename);
118 TList* sf = static_cast<TList*>(forward->FindObject("fmdSharingFilter"));
120 Error("Draw123", "List fmdSharingFilter not found in Forward");
124 TCanvas* c = new TCanvas("123",
125 "singles, doubles, and tripples", 900, 700);
128 c->SetLeftMargin(0.15);
129 c->SetRightMargin(0.02);
130 c->SetTopMargin(0.02);
131 c->Divide(3, 2, 0, 0);
133 c->cd(1); DrawRing123(sf, 1, 'I');
134 c->cd(2); DrawRing123(sf, 2, 'I');
135 c->cd(5); DrawRing123(sf, 2, 'O');
136 c->cd(3); DrawRing123(sf, 3, 'I');
137 c->cd(6); DrawRing123(sf, 3, 'O');
138 TVirtualPad* p = c->cd(4);
139 // p->SetTopMargin(0.05);
140 p->SetRightMargin(0.15);
142 TH2D* highCuts = static_cast<TH2D*>(sf->FindObject("highCuts"));
143 if (highCuts) highCuts->Draw("colz");
145 c->SaveAs("123.png");