]>
Commit | Line | Data |
---|---|---|
0919aa56 | 1 | void |
2 | DrawRingRecAnaEloss(TList* p, UShort_t d, Char_t r) | |
3 | { | |
4 | if (!p) return; | |
5 | ||
6 | TList* ring = static_cast<TList*>(p->FindObject(Form("FMD%d%c",d,r))); | |
7 | if (!ring) { | |
8 | Error("DrawRecAnaEloss", "List FMD%d%c not found in %s",d,r,p->GetName()); | |
9 | return; | |
10 | } | |
11 | ||
12 | TH1* before = static_cast<TH2D*>(ring->FindObject("esdEloss")); | |
13 | if (!before) { | |
14 | Error("DrawRingRecAnaEloss", "Histogram esdEloss not found in FMD%d%c", | |
15 | d, r); | |
16 | return; | |
17 | } | |
18 | TH1* after = static_cast<TH2D*>(ring->FindObject("anaEloss")); | |
19 | if (!after) { | |
20 | Error("DrawRingRecAnaEloss", "Histogram anaEloss not found in FMD%d%c", | |
21 | d, r); | |
22 | return; | |
23 | } | |
24 | gPad->SetLogy(); | |
25 | gPad->SetFillColor(0); | |
26 | before->SetTitle(Form("FMD%d%c",d,r)); | |
27 | before->Draw(""); | |
28 | after->Draw("same"); | |
29 | ||
30 | before->GetXaxis()->SetRangeUser(0, 2); | |
31 | gPad->cd(); | |
32 | } | |
33 | ||
34 | ||
35 | void | |
36 | DrawRecAnaEloss(const char* filename="forward.root") | |
37 | { | |
38 | gStyle->SetPalette(1); | |
39 | gStyle->SetOptFit(0); | |
40 | gStyle->SetOptStat(0); | |
41 | gStyle->SetTitleW(.4); | |
42 | gStyle->SetTitleH(.1); | |
43 | gStyle->SetTitleColor(0); | |
44 | gStyle->SetTitleStyle(0); | |
45 | gStyle->SetTitleBorderSize(0); | |
46 | gStyle->SetTitleX(.6); | |
47 | ||
48 | TFile* file = TFile::Open(filename, "READ"); | |
49 | if (!file) { | |
50 | Error("DrawRecAnaEloss", "failed to open %s", filename); | |
51 | return; | |
52 | } | |
53 | ||
54 | TList* forward = static_cast<TList*>(file->Get("Forward")); | |
55 | if (!forward) { | |
56 | Error("DrawRecAnaEloss", "List Forward not found in %s", filename); | |
57 | return; | |
58 | } | |
59 | ||
60 | TList* sf = static_cast<TList*>(forward->FindObject("fmdSharingFilter")); | |
61 | if (!sf) { | |
62 | Error("DrawRecAnaEloss", "List fmdSharingFilter not found in Forward"); | |
63 | return; | |
64 | } | |
65 | ||
66 | TCanvas* c = new TCanvas("recAnaELoss", | |
67 | "Reconstructed and Analysed energy loss", 900, 700); | |
68 | c->SetFillColor(0); | |
69 | c->SetBorderSize(0); | |
70 | c->Divide(3, 2, 0, 0); | |
71 | ||
72 | c->cd(1); DrawRingRecAnaEloss(sf, 1, 'I'); | |
73 | c->cd(2); DrawRingRecAnaEloss(sf, 2, 'I'); | |
74 | c->cd(5); DrawRingRecAnaEloss(sf, 2, 'O'); | |
75 | c->cd(3); DrawRingRecAnaEloss(sf, 3, 'I'); | |
76 | c->cd(6); DrawRingRecAnaEloss(sf, 3, 'O'); | |
77 | TVirtualPad* p = c->cd(4); | |
78 | // p->SetTopMargin(0.05); | |
79 | p->SetRightMargin(0.15); | |
80 | p->SetFillColor(0); | |
81 | TH2D* highCuts = static_cast<TH2D*>(sf->FindObject("highCuts")); | |
82 | if (highCuts) highCuts->Draw("colz"); | |
83 | c->cd(); | |
84 | ||
85 | } | |
86 | ||
87 | ||
88 | ||
89 |