-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolorhists.C
38 lines (36 loc) · 1.28 KB
/
colorhists.C
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
void makeItBlue(TH1 *hist, TString title=""){
hist->SetLineColor(kBlue);
hist->SetLineWidth(2);
hist->SetTitle(title);
}
void makeItRed(TH1 *hist, TString title=""){
hist->SetLineColor(kRed);
hist->SetLineWidth(2);
hist->SetTitle(title);
}
void comparePlots(TString plotPath, TString file0_title,TString file1_title){
TCanvas *c1 = new TCanvas();
TH1D *h1 = new TH1D(*(TH1D*)_file0->Get(plotPath)); // "multiRPPlots/arm0/h_xi"
TH1D *h2 = new TH1D(*(TH1D*)_file1->Get(plotPath));
makeItRed(h1,file0_title);
makeItBlue(h2,file1_title);
h1->GetXaxis()->SetTitle(plotPath+": "+h1->GetXaxis()->GetTitle());
h1->Draw("ehist");
h2->Draw("ehistsame");
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
c1->BuildLegend(0.6,0.7,0.89,0.89)->SetBorderSize(0);
}
void comparePlotsNormalized(TString plotPath, TString file0_title,TString file1_title){
TCanvas *c1 = new TCanvas();
TH1D *h1 = new TH1D(*(TH1D*)_file0->Get(plotPath)); // "multiRPPlots/arm0/h_xi"
TH1D *h2 = new TH1D(*(TH1D*)_file1->Get(plotPath));
makeItRed(h1,file0_title);
makeItBlue(h2,file1_title);
h1->GetXaxis()->SetTitle(plotPath+": "+h1->GetXaxis()->GetTitle());
h1->DrawNormalized("ehist");
h2->DrawNormalized("ehistsame");
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
c1->BuildLegend(0.6,0.7,0.89,0.89)->SetBorderSize(0);
}