-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrawComparisons.C
More file actions
73 lines (72 loc) · 2.34 KB
/
DrawComparisons.C
File metadata and controls
73 lines (72 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "Scripts/BuildCanvas.C"
#include "Scripts/PCCContainer.h"
#include "TLegend.h"
#include "TString.h"
#include "Scripts/CommonFunctions.C"
#include "Scripts/ProcessAxii.C"
using namespace PCCSpace;
PCCContainer *pc18=0;
PCCContainer *pc15=0;
Int_t nrb=1;
void ShapeHist(TH1 *inh) {
ProcessAxisPx(inh->GetYaxis(),25,0.01,30,1.75,507,0.03);
ProcessAxisPx(inh->GetXaxis(),25,0,30,3,507,0.03);
}
TCanvas *DrawComparison(PCCContainer::lFunc sf, Double_t ymin=0.001, Double_t ymax=0.3, TString exName="") {
if(!pc15) {
// pc15 = new PCCContainer("Inputs/LHC15o_pass1.root",1);
// pc18 = new PCCContainer("Inputs/LHC15o_pass2.root",1);//LHC18qr.root",1);
pc15 = new PCCContainer("LHC15o_pass1_mine.root",1);
pc18 = new PCCContainer("Inputs/LHC15o_pass2_tc11.root",1);//LHC18qr.root",1);
};
pc15->RebinMulti(nrb,0);
pc18->RebinMulti(nrb,0);
TCanvas *rc = BuildCanvasForRatios(500,0.33,0.02);
TH1 *h18temp = pc18->Var(sf);
TH1 *h15 = pc15->Var(sf);
TH1 *h18 = getHistRebinned(h18temp,h15);
delete h18temp;
h18->GetXaxis()->SetTitle("V0M %");
h15->GetXaxis()->SetTitle("V0M %");
TPad *tp = (TPad*)rc->FindObject("top");
tp->cd();
TLegend *tleg = 0;
if(sf==kPCC3) tleg = Legend(0.193333,0.671346,0.493333,0.971772);
else tleg = Legend(0.183811,0.0436661,0.48398,0.342775);
if(!exName.IsNull()) tleg->AddEntry((TObject*)0x0,exName.Data(),"");
tleg->AddEntry(h15,"LHC15o pass1","L");
tleg->AddEntry(h18,"LHC15o pass2", "L");//"LHC18qr pass3","L");
h15->SetLineColor(kRed+1);
h18->SetLineColor(kBlue+1);
h15->SetLineWidth(2);
h18->SetLineWidth(2);
h18->GetYaxis()->SetRangeUser(ymin,ymax);
ShapeHist(h18);
ShapeHist(h15);
h18->Draw();
h15->Draw("SAME");
tleg->Draw();
TH1 *hrat = (TH1*)h15->Clone(Form("%s_ratio",h15->GetName()));
hrat->Divide(h18);
hrat->GetYaxis()->SetRangeUser(0.49,1.51);
hrat->GetYaxis()->SetTitle("Ratio, pass1/pass2");
TPad *bt = (TPad*)rc->FindObject("bot");
bt->cd();
hrat->Draw();
return rc;
}
void DrawComparisons() {
TCanvas *c;
c = DrawComparison(kPCC2);
c->Print("Plots20210826/PCC.pdf(");
delete c;
c = DrawComparison(kPCC3Sub,0.001,0.3,"3-sub");
c->Print("Plots20210826/PCC.pdf");
delete c;
c = DrawComparison(kPCC3);
c->Print("Plots20210826/PCC.pdf");
delete c;
c = DrawComparison(kMultiHar,-0.99,0.99);
c->Print("Plots20210826/PCC.pdf)");
delete c;
}