]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/RESONANCES/macros/mini/testOut.C
Migration of PWG2/RESONANCES -> PWGLF/RESONANCES
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / macros / mini / testOut.C
CommitLineData
caef2e3c 1void testOut(const char *file = "test.root", Int_t p1 = 0, Int_t p2 = -1)
03d23846 2{
3 TFile *f = TFile::Open(file);
4 TList *l = (TList*)f->Get("RsnOut");
5
6 l->Print();
7
caef2e3c 8 TH2F *hhPM = (TH2F*)RsnOut->FindObject("RSN_phi_Unlike");
9 TH2F *hhPP = (TH2F*)RsnOut->FindObject("RSN_phi_LikePP");
10 TH2F *hhMM = (TH2F*)RsnOut->FindObject("RSN_phi_LikeMM");
11 TH2F *hhMX = (TH2F*)RsnOut->FindObject("RSN_phi_Mixing");
03d23846 12
13 TH1D *hPM = 0x0; if (hhPM) hPM = hhPM->ProjectionX(Form("px1_%d_%d", p1, p2), p1, p2);
14 TH1D *hPP = 0x0; if (hhPP) hPP = hhPP->ProjectionX(Form("px2_%d_%d", p1, p2), p1, p2);
15 TH1D *hMM = 0x0; if (hhMM) hMM = hhMM->ProjectionX(Form("px3_%d_%d", p1, p2), p1, p2);
16 TH1D *hMX = 0x0; if (hhMX) hMX = hhMX->ProjectionX(Form("px4_%d_%d", p1, p2), p1, p2);
17
18 hPM->SetLineColor(kBlack);
19
caef2e3c 20 if (hPP) {
21 hPP->SetLineColor(kGreen);
22 hPP->Add(hMM);
23 }
03d23846 24
caef2e3c 25 if (hMX) {
26 hMX->SetLineColor(kRed);
27 Double_t intS = hPM->Integral(hPM->GetXaxis()->FindBin(1.1), hPM->GetXaxis()->FindBin(1.2));
28 Double_t intM = hMX->Integral(hMX->GetXaxis()->FindBin(1.1), hMX->GetXaxis()->FindBin(1.2));
29 hMX->Scale(intS / intM);
30 }
03d23846 31
caef2e3c 32 TCanvas *c1 = new TCanvas("c1", "", 0, 0, 1100, 600);
03d23846 33 hPM->Draw();
caef2e3c 34 if (hPP) hPP->Draw("same");
35 if (hMX) hMX->Draw("same");
36
37 TH3F *hhRes = (TH3F*)RsnOut->FindObject("RSN_phi_Res");
38 TH3F *hhNum = (TH3F*)RsnOut->FindObject("RSN_phi_Trues");
39 TH3F *hhDen = (TH3F*)RsnOut->FindObject("RSN_phi_TrueMC");
40 if (hhNum && hhDen) {
41 TCanvas *c2 = new TCanvas("c2", "EFF", 0, 650, 800, 600);
42 Double_t pt[] = {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 3.0, 4.0, 5.0, 7.5, 10.0};
43 Int_t npt = sizeof(pt) / sizeof(pt[0]);
44
45 TH1D *hNum = hhNum->ProjectionY("num");
46 TH1D *hDen = hhDen->ProjectionY("den");
47 TH1D *hrNum = hNum->Rebin(npt - 1, "neff", pt);
48 TH1D *hrDen = hDen->Rebin(npt - 1, "deff", pt);
49 hrNum->Divide(hrDen);
50 hrNum->Draw();
51
52 TCanvas *c3 = new TCanvas("c3", "", 500, 500, 600, 600);
53 TH1D *hRes = hhRes->ProjectionX();
54 hRes->Draw();
55 }
03d23846 56}