1 void testOut(const char *file = "test.root", Int_t p1 = 0, Int_t p2 = -1)
3 TFile *f = TFile::Open(file);
4 TList *l = (TList*)f->Get("RsnOut");
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");
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);
18 hPM->SetLineColor(kBlack);
21 hPP->SetLineColor(kGreen);
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);
32 TCanvas *c1 = new TCanvas("c1", "", 0, 0, 1100, 600);
34 if (hPP) hPP->Draw("same");
35 if (hMX) hMX->Draw("same");
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");
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]);
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);
52 TCanvas *c3 = new TCanvas("c3", "", 500, 500, 600, 600);
53 TH1D *hRes = hhRes->ProjectionX();