]>
Commit | Line | Data |
---|---|---|
17dae597 | 1 | void 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 | } | |
9 | void PlotMinEtFromSim(Bool_t isPhos = kFALSE){ | |
10 | gStyle->SetOptTitle(0); | |
11 | gStyle->SetOptStat(0); | |
12 | gStyle->SetOptFit(0); | |
13 | Float_t min = 0; | |
14 | float max = 1; | |
15 | TString filename, detname; | |
16 | if(isPhos){ | |
17 | min = 0.655; | |
18 | max = 0.785; | |
19 | detname = "PHOS"; | |
20 | filename = "rootFiles/LHC11a10a_bis/Et.ESD.simPbPb.PHOS.LHC11a10a_bis.Run139465.root"; | |
21 | } | |
22 | else{ | |
23 | min = 0.58; | |
24 | max = 0.725; | |
25 | filename = "rootFiles/LHC11a10a_bis/Et.ESD.simPbPb.EMCal.LHC11a10a_bis.Run139465.root"; | |
26 | detname = "EMCal"; | |
27 | } | |
28 | ||
29 | TFile *f = TFile::Open(filename, "READ"); | |
30 | TList *l = dynamic_cast<TList*>(f->Get("out1")); | |
31 | TH1F *fHistSimulatedGammaEnergyAboveThreshold = l->FindObject("fHistSimulatedGammaEnergyAboveThreshold"); | |
32 | TH1F *fHistSimulatedGammaEnergy = l->FindObject("fHistSimulatedGammaEnergy"); | |
33 | SetStyles(fHistSimulatedGammaEnergyAboveThreshold,20,TColor::kRed); | |
34 | fHistSimulatedGammaEnergyAboveThreshold->Divide(fHistSimulatedGammaEnergy); | |
35 | ||
36 | TCanvas *c1 = new TCanvas("c1","Simulation",600,400); | |
37 | c1->SetTopMargin(0.02); | |
38 | c1->SetRightMargin(0.03); | |
39 | c1->SetLeftMargin(0.11745); | |
40 | c1->SetBottomMargin(0.11745); | |
41 | c1->SetBorderSize(0); | |
42 | c1->SetFillColor(0); | |
43 | c1->SetFillColor(0); | |
44 | c1->SetBorderMode(0); | |
45 | c1->SetFrameFillColor(0); | |
46 | c1->SetFrameBorderMode(0); | |
47 | fHistSimulatedGammaEnergyAboveThreshold->SetMaximum(max +0.1); | |
48 | fHistSimulatedGammaEnergyAboveThreshold->SetMinimum(min-0.1); | |
49 | fHistSimulatedGammaEnergyAboveThreshold->GetXaxis()->SetTitle("Centrality bin"); | |
50 | fHistSimulatedGammaEnergyAboveThreshold->GetYaxis()->SetTitle("f_{minEt}"); | |
51 | fHistSimulatedGammaEnergyAboveThreshold->GetYaxis()->SetLabelSize(0.06); | |
52 | fHistSimulatedGammaEnergyAboveThreshold->GetXaxis()->SetLabelSize(0.06); | |
53 | fHistSimulatedGammaEnergyAboveThreshold->GetYaxis()->SetTitleSize(0.06); | |
54 | fHistSimulatedGammaEnergyAboveThreshold->GetXaxis()->SetTitleSize(0.06); | |
55 | fHistSimulatedGammaEnergyAboveThreshold->Draw(); | |
56 | TLine *lineMin = new TLine(-0.5,min,19.5,min); | |
57 | lineMin->Draw(); | |
58 | TLine *lineMax = new TLine(-0.5,max,19.5,max); | |
59 | lineMax->Draw(); | |
60 | lineMin->SetLineColor(TColor::kBlue); | |
61 | lineMax->SetLineColor(TColor::kBlue); | |
62 | lineMin->SetLineStyle(2); | |
63 | lineMax->SetLineStyle(2); | |
64 | ||
65 | TString outfile = "/tmp/MinEtFromSim"+detname+".png"; | |
66 | c1->SaveAs(outfile.Data()); | |
67 | } |