-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakeVsSuperimposePlot.C
More file actions
66 lines (51 loc) · 2.04 KB
/
makeVsSuperimposePlot.C
File metadata and controls
66 lines (51 loc) · 2.04 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
#include <iostream>
#include <string>
#include "TLorentzVector.h"
#include "TRatioPlot.h"
#include "THStack.h"
using namespace std;
void makeVsSuperimposePlot()
{
TFile *f1 = new TFile("/home/ethan/Documents/clustAlg_Suu8TeV_chi3TeV_processed.root");
TFile *f2 = new TFile("/home/ethan/Documents/clustAlg_QCD2000toInf_processed.root");
TCanvas *c1 = new TCanvas("c1","",400,20, 2000,2000);
//gPad->SetLogy();
gStyle->SetOptStat(0);
TGraph *h_MC_SJ_mass_versus = (TGraph*)f1->Get("h_SJ_mass_versus");
TGraph *h_QCD_SJ_mass_versus = (TGraph*)f2->Get("h_SJ_mass_versus");
h_MC_SJ_mass_versus->SetMarkerStyle(22);
h_MC_SJ_mass_versus->SetMarkerColor(kBlue);
h_MC_SJ_mass_versus->SetMarkerSize(2.5);
h_MC_SJ_mass_versus->SetDrawOption("P");
//h_MC_SJ_mass_versus->GetXaxis()->SetLimits(0.0,6000.);
//h_MC_SJ_mass_versus->GetYaxis()->SetLimits(0.0,6000.);
//h_MC_SJ_mass_versus->Draw("AP*");
h_QCD_SJ_mass_versus->SetMarkerStyle(22);
h_QCD_SJ_mass_versus->SetMarkerSize(2.5);
h_QCD_SJ_mass_versus->SetMarkerColor(kRed);
h_QCD_SJ_mass_versus->SetDrawOption("P");
//h_QCD_SJ_mass_versus->GetXaxis()->SetLimits(0.0,6000.);
//h_QCD_SJ_mass_versus->GetYaxis()->SetLimits(0.0,6000.);
//h_QCD_SJ_mass_versus->Draw("P* same");
auto mg = new TMultiGraph();
mg->SetTitle("SuperJet 1 Mass vs SuperJet 2 Mass");
mg->Add(h_QCD_SJ_mass_versus);
mg->Add(h_MC_SJ_mass_versus);
mg->Draw("AP");
mg->GetXaxis()->SetLimits(0,6000.);
mg->SetMinimum(0.);
mg->SetMaximum(6000.);
mg->GetXaxis()->SetTitle("SuperJet 2 Mass [GeV]");
mg->GetYaxis()->SetTitle("SuperJet 1 Mass [GeV]");
mg->GetYaxis()->SetTitleOffset(2.2);
mg->GetYaxis()->SetTitleSize(0.025);
mg->GetXaxis()->SetTitleOffset(2.0);
mg->GetXaxis()->SetTitleSize(0.025);
gPad->Modified();
gPad->Update();
TLegend *legend3 = new TLegend(1.0,0.8,0.48,0.9);
legend3->AddEntry(h_MC_SJ_mass_versus,"S_{uu} -> Chi Chi","p");
legend3->AddEntry(h_QCD_SJ_mass_versus,"2018 UL QCD MC (HT > 2000 GeV)","p");
legend3->Draw();
c1->SaveAs("superJet_vs_superposition.png");
}