]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/totEt/macros/emEt/hadCorr/PlotMatchedTracksFromData.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / totEt / macros / emEt / hadCorr / PlotMatchedTracksFromData.C
1 void PlotMatchedTracksFromData(TString datafilename="rootFiles/LHC11a4_bis/Et.ESD.simPbPb.EMCAL.LHC11a4_bis.root",TString simfilename="rootFiles/LHC11a4_bis/Et.ESD.simPbPb.EMCAL.LHC11a4_bis.root", int bin = 10, int binLast = 10, TString det = "EMCal"){
2   gStyle->SetOptTitle(0);
3   gStyle->SetOptStat(0);
4   gStyle->SetOptFit(0);
5   TString outname = "";
6   TString outnamebin = Form("%iTo%i",bin,binLast);
7
8   TFile *fsim = TFile::Open(simfilename, "READ");
9   TList *lsim = (TList*)fsim->Get("out1");
10   TH3F  *fHistMatchedTracksEvspTBkgdvsMult = lsim->FindObject("fHistMatchedTracksEvspTBkgdMult");
11   fHistMatchedTracksEvspTBkgdvsMult->GetZaxis()->SetRange(bin,binLast);
12   TH2D *hBkgd2D = (TProfile2D*) fHistMatchedTracksEvspTBkgdvsMult->Project3D("yx");
13   TProfile * profBkgd2D = hBkgd2D->ProfileX();
14   profBkgd2D->SetLineColor(2);
15   profBkgd2D->SetLineWidth(2);
16
17   TFile *f = TFile::Open(datafilename, "READ");
18
19   f->cd();  
20
21   TList *l = (TList*)f->Get("out1");
22   TH3F  *fHistMatchedTracksEvspTvsMult = l->FindObject("fHistMatchedTracksEvspTvsMult");
23   fHistMatchedTracksEvspTvsMult->GetZaxis()->SetRange(bin,binLast);
24   TH2D *hMatchedTracks2D = (TProfile2D*) fHistMatchedTracksEvspTvsMult->Project3D("yx");
25   TProfile * profMatchedTracks2D = hMatchedTracks2D->ProfileX();
26   hMatchedTracks2D->GetXaxis()->SetTitle("p");
27   hMatchedTracks2D->GetYaxis()->SetTitle("E^{cluster}");
28   profMatchedTracks2D->SetLineWidth(2);
29   TCanvas *c1 = new TCanvas("c1","c1",600,400);
30   c1->SetTopMargin(0.02);
31   c1->SetRightMargin(0.02);
32   c1->SetBorderSize(0);
33   c1->SetFillColor(0);
34   c1->SetFillColor(0);
35   c1->SetBorderMode(0);
36   c1->SetFrameFillColor(0);
37   c1->SetFrameBorderMode(0);
38   hMatchedTracks2D->Draw("colz");
39   profMatchedTracks2D->Draw("same");
40   profBkgd2D->Draw("same");
41   outname = "/tmp/TrackMatchingData2D"+det+outnamebin+".png";
42   c1->SaveAs(outname.Data());
43 }