-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataPlayWithMass.cxx
92 lines (72 loc) · 2.7 KB
/
DataPlayWithMass.cxx
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{
gStyle->SetOptStat(0);
gStyle->SetHistLineWidth(2);
TFile* fAuAu = new TFile("Results/Groom_SmallAuAu.root");
TTree* AuAuResultTree = (TTree*) fAuAu->Get("ResultTree");
AuAuResultTree->SetName("AuAuResultTree");
TFile* fPp = new TFile("Results/Groom_PpEmb.root");
TTree* PpResultTree = (TTree*) fPp->Get("ResultTree");
PpResultTree->SetName("AuAuResultTree");
TH1::SetDefaultSumw2(true);
TH2::SetDefaultSumw2(true);
TH1D* Mass = new TH1D( "Mass", "Mass", 60, -5, 25);
Mass->SetLineColor(kBlack);
TH1D* GroomedMass = new TH1D( "GroomedMass", "Groomed Mass", 60, -5, 25);
GroomedMass->SetLineColor(kRed);
TH1D* EmbMass = new TH1D( "EmbMass", "EmbMass", 60, -5, 25);
EmbMass->SetLineColor(kBlue);
TH1D* GroomedEmbMass = new TH1D( "GroomedEmbMass", "Groomed EmbMass", 60, -5, 25);
GroomedEmbMass->SetLineColor(kMagenta);
TString minPt = "20";
TString maxPt = "40";
TString CondString = "weight";
CondString += " *( ";
CondString += " Jets[0].Pt()>" +minPt;
CondString += " || ";
CondString += " Jets[0].Pt()<" +maxPt;
CondString += " ) ";
new TCanvas;
gPad->SetLogy();
TString title = "DATA, Mass for " + minPt + "<p_{T,Jet}<"+maxPt;
title += ";M;counts";
Mass->SetTitle( title );
GroomedMass->SetTitle( title );
EmbMass->SetTitle( title );
GroomedEmbMass->SetTitle( title );
AuAuResultTree->Draw("Jets[0].M() >> Mass",CondString);
AuAuResultTree->Draw("GroomedJets[0].M() >> GroomedMass",CondString, "same");
PpResultTree->Draw("EmbJets[0].M() >> EmbMass",CondString,"same");
PpResultTree->Draw("EmbGroomedJets[0].M() >> GroomedEmbMass",CondString, "same");
TLegend* leg = new TLegend( 0.55, 0.55, 0.89, 0.9, "Leading jet" );
leg->SetBorderSize(0);
leg->SetLineWidth(10);
leg->SetFillStyle(0);
leg->SetMargin(0.1);
leg->AddEntry( Mass, "AuAu Jet");
leg->AddEntry( GroomedMass, "Groomed AuAu Jet");
leg->AddEntry( EmbMass, "pp Emb. Jet");
leg->AddEntry( GroomedEmbMass, "Groomed pp Emb. Jet");
leg->Draw();
gPad->SaveAs("DataMass.png");
new TCanvas;
// gPad->SetLogy();
TH1D* Ratio = GroomedMass->Clone("Ratio");
Ratio->Divide( Mass );
TH1D* EmbRatio = GroomedEmbMass->Clone("EmbRatio");
EmbRatio->Divide( EmbMass );
title = "DATA, GroomedMass/Mass for " + minPt + "<p_{T,Jet}<"+maxPt;
title += ";M";
Ratio->SetTitle( title );
// Ratio->SetAxisRange( 1e-5, 1e5, "y");
Ratio->Draw();
EmbRatio->Draw("same");
TLegend* leg = new TLegend( 0.55, 0.65, 0.89, 0.9, "Leading jet" );
leg->SetBorderSize(0);
leg->SetLineWidth(10);
leg->SetFillStyle(0);
leg->SetMargin(0.1);
leg->AddEntry( Ratio, "AuAu Jet");
leg->AddEntry( EmbRatio, "pp Emb. Jet");
leg->Draw();
gPad->SaveAs("DataMassRatio.png");
}