]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/totEt/macros/emEt/PlotHadCorrLowPtFraction.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / totEt / macros / emEt / PlotHadCorrLowPtFraction.C
CommitLineData
17dae597 1void SetStyles(TH1 *histo,int marker, int color){
2 histo->Sumw2();
3 histo->SetMarkerStyle(marker);
4 histo->SetMarkerColor(color);
5 histo->SetLineColor(color);
6 //histo->GetXaxis()->SetTitle(xtitle);
7 //histo->GetYaxis()->SetTitle(ytitle);
8}
9563e2f7 9void PlotHadCorrLowPtFraction(Bool_t isPhos = kFALSE, Int_t mycase = 0){
17dae597 10 gStyle->SetOptTitle(0);
11 gStyle->SetOptStat(0);
12 gStyle->SetOptFit(0);
13 TString filename, detname;
9563e2f7 14 if(mycase==0){
15 if(isPhos){
16 detname = "PHOS";
17 //filename = "rootFiles/LHC11a10a_bis/Et.ESD.simPbPb.PHOS.LHC11a10a_bis.Run139465.root";
18 filename = "rootFiles/LHC11a10a_bis/Et.ESD.simPbPb.PHOSOldHadMethod.LHC11a10a_bis.root";
19 }
20 else{
21 //filename = "rootFiles/LHC11a10a_bis/Et.ESD.simPbPb.EMCal.LHC11a10a_bis.Run139465.root";
22 filename = "rootFiles/LHC11a10a_bis/Et.ESD.simPbPb.EMCalOldHadMethod.LHC11a10a_bis.root";
23 detname = "EMCal";
24 }
17dae597 25 }
26 else{
9563e2f7 27 if(isPhos){
28 detname = "PHOS";
29 filename = "rootFiles/LHC13e1abcCombined/Et.ESD.simPbPb.PHOS.LHC13e1abc.root";
30 }
31 else{
32 filename = "rootFiles/LHC13e1abcCombined/Et.ESD.simPbPb.EMCal.LHC13e1abc.root";
33 detname = "EMCal";
34 }
17dae597 35 }
36
37 TFile *f = TFile::Open(filename, "READ");
38 TList *l = dynamic_cast<TList*>(f->Get("out1"));
39 TH2F *fHistChargedTrackDepositsAcceptedVsPt = l->FindObject("fHistChargedTrackDepositsAcceptedVsPt");
40 TH2F *fHistChargedTrackDepositsAllVsPt = l->FindObject("fHistChargedTrackDepositsAllVsPt");
41 TCanvas *c1 = new TCanvas("c1","Simulation",600,400);
42 c1->SetTopMargin(0.02);
43 c1->SetRightMargin(0.03);
44 c1->SetLeftMargin(0.11745);
45 c1->SetBottomMargin(0.11745);
46 c1->SetBorderSize(0);
47 c1->SetFillColor(0);
48 c1->SetFillColor(0);
49 c1->SetBorderMode(0);
50 c1->SetFrameFillColor(0);
51 c1->SetFrameBorderMode(0);
52 fHistChargedTrackDepositsAcceptedVsPt->Draw("colz");
53 TH1D *proffHistChargedTrackDepositsAcceptedVsPt = fHistChargedTrackDepositsAcceptedVsPt->ProfileX("acceptedprofx");
54 proffHistChargedTrackDepositsAcceptedVsPt->Draw("same");
55 TCanvas *c2 = new TCanvas("c2","Simulation",600,400);
56 c2->SetTopMargin(0.02);
57 c2->SetRightMargin(0.03);
58 c2->SetLeftMargin(0.11745);
59 c2->SetBottomMargin(0.11745);
60 c2->SetBorderSize(0);
61 c2->SetFillColor(0);
62 c2->SetFillColor(0);
63 c2->SetBorderMode(0);
64 c2->SetFrameFillColor(0);
65 c2->SetFrameBorderMode(0);
66 fHistChargedTrackDepositsAllVsPt->Draw("colz");
67 TH1D *proffHistChargedTrackDepositsAllVsPt = fHistChargedTrackDepositsAllVsPt->ProfileX("allprofx");
68 proffHistChargedTrackDepositsAllVsPt->Draw("same");
69 TCanvas *c3 = new TCanvas("c3","Simulation",600,400);
70 c3->SetTopMargin(0.02);
71 c3->SetRightMargin(0.03);
72 c3->SetLeftMargin(0.11745);
73 c3->SetBottomMargin(0.11745);
74 c3->SetBorderSize(0);
75 c3->SetFillColor(0);
76 c3->SetFillColor(0);
77 c3->SetBorderMode(0);
78 c3->SetFrameFillColor(0);
79 c3->SetFrameBorderMode(0);
80 TH1D *profyfHistChargedTrackDepositsAcceptedVsPt = fHistChargedTrackDepositsAcceptedVsPt->ProfileY("acceptedprofy");
81 TH1D *profyfHistChargedTrackDepositsAllVsPt = fHistChargedTrackDepositsAllVsPt->ProfileY("allprofy");
82 //profyfHistChargedTrackDepositsAllVsPt->Sumw2();
83 //profyfHistChargedTrackDepositsAcceptedVsPt->Sumw2();
84 TH1D *profyfHistChargedTrackDepositsAllVsPtClone = profyfHistChargedTrackDepositsAllVsPt->Clone("clone");
85 profyfHistChargedTrackDepositsAllVsPt->Divide(profyfHistChargedTrackDepositsAcceptedVsPt);
86 profyfHistChargedTrackDepositsAllVsPt->Draw();
87 profyfHistChargedTrackDepositsAllVsPtClone->Add(profyfHistChargedTrackDepositsAcceptedVsPt,-1);
88 profyfHistChargedTrackDepositsAllVsPtClone->Divide(profyfHistChargedTrackDepositsAcceptedVsPt);
89 profyfHistChargedTrackDepositsAllVsPtClone->Draw("same");
90 SetStyles(profyfHistChargedTrackDepositsAllVsPt,20,TColor::kBlue);
91 SetStyles(profyfHistChargedTrackDepositsAllVsPtClone,29,TColor::kRed);
92 Float_t low = 1.0;
93 Float_t high = 0.0;
9563e2f7 94 for(int bin = 1;bin<17;bin++){
17dae597 95 if(profyfHistChargedTrackDepositsAllVsPtClone->GetBinContent(bin)<low) low = profyfHistChargedTrackDepositsAllVsPtClone->GetBinContent(bin);
96 if(profyfHistChargedTrackDepositsAllVsPtClone->GetBinContent(bin)>high) high = profyfHistChargedTrackDepositsAllVsPtClone->GetBinContent(bin);
97 }
9563e2f7 98 //cout<<"low "<<low<<" high "<<high<<" mean "<<(low+high)/2.0<<" +/- "<<(high-low)/2.0<<endl;
99 cout<<"corrfac = "<<(low+high)/2.0<<";"<<endl;
100 cout<<"corrfacerr = "<<(high-low)/2.0<<";"<<endl;
101 cout<<Form("%2.3f $\\pm$ %2.3f",(low+high)/2.0,(high-low)/2.0)<<endl;
17dae597 102}