-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_ndfd_merged.C
76 lines (65 loc) · 2.66 KB
/
plot_ndfd_merged.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
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
#include "TCanvas.h"
#include "TH1.h"
#include "TH1F.h"
#include "TTree.h"
#include "TFile.h"
#include "TLegend.h"
void plot_ndfd_merged()
{
gStyle->SetOptStat(0);
const std::string fname = "/dune/app/users/awilkins/nd-sim-tools/merge_nd-fd_test_moremore.root";
TFile* f = TFile::Open(fname.c_str());
TTree* t = (TTree*)f->Get("nd_fd_reco");
std::cout << t->GetEntries() << " events in file. Tree looks like:\n";
t->Show(0);
TH1F* hFDNumuNuE = new TH1F("hFDNumuNuE", "FD ND Ev Reco", 50, 0, 10);
TH1F* hEvReco = new TH1F("hEvReco", "FD ND Ev Reco", 50, 0, 10);
t->Draw("Ev_reco>>+hEvReco", "", "goff");
t->Draw("fd_numu_nu_E>>+hFDNumuNuE", "", "goff");
TCanvas* c = new TCanvas();
auto leg = new TLegend(0.50, 0.7, 0.85, 0.85);
leg->SetTextSize(0.03);
hEvReco->SetLineColor(kRed);
leg->AddEntry(hEvReco, "ND EvReco");
hEvReco->Draw("hist");
hFDNumuNuE->SetLineColor(kBlue);
leg->AddEntry(hFDNumuNuE, "FD EvReco");
hFDNumuNuE->Draw("hist same");
leg->Draw();
// hFDNumuNuE = new TH1F("hFDNumuNuE", "FD ND Ev Reco muon_contained", 50, 0, 10);
// hEvReco = new TH1F("hEvReco", "FD ND Ev Reco muon_contained", 50, 0, 10);
// t->Draw("Ev_reco>>+hEvReco", "muon_contained==1", "goff");
// t->Draw("fd_numu_nu_E>>+hFDNumuNuE", "muon_contained==1", "goff");
// c = new TCanvas();
// leg = new TLegend(0.50, 0.7, 0.85, 0.85);
// leg->SetTextSize(0.03);
// hEvReco->SetLineColor(kRed);
// leg->AddEntry(hEvReco, "ND EvReco");
// hEvReco->Draw("hist");
// hFDNumuNuE->SetLineColor(kBlue);
// leg->AddEntry(hFDNumuNuE, "FD EvReco");
// hFDNumuNuE->Draw("hist same");
// leg->Draw();
TH1F* hEvDiff = new TH1F("hEvDiff", "ND - FD Ev Reco", 100, -3, 3);
t->Draw("Ev_reco - fd_numu_nu_E>>+hEvDiff", "", "goff");
c = new TCanvas();
hEvDiff->Draw("hist");
TH1F* hEvDiffFrac = new TH1F("hEvDiffFrac", "(ND - FD)/ND Ev Reco ", 100, -1.5, 1.5);
t->Draw("(Ev_reco - fd_numu_nu_E)/Ev_reco>>+hEvDiffFrac", "Ev_reco", "goff");
c = new TCanvas();
hEvDiffFrac->Draw("hist");
TH1F* hNumuCVNNDReco = new TH1F("hNumuCVNNDReco", "CVN Nnumu Score", 50, 0, 1);
TH1F* hNumuCVNNDNoReco = new TH1F("hNumuCVNNDNoReco", "CVN Numu Score", 50, 0, 1);
t->Draw("fd_numu_score>>+hNumuCVNNDReco", "reco_numu==1", "goff");
t->Draw("fd_numu_score>>+hNumuCVNNDNoReco", "reco_numu==0", "goff");
c = new TCanvas();
leg = new TLegend(0.50, 0.7, 0.85, 0.85);
leg->SetTextSize(0.03);
hNumuCVNNDNoReco->SetLineColor(kBlue);
leg->AddEntry(hNumuCVNNDNoReco, "reco_numu==0 at ND");
hNumuCVNNDNoReco->Draw("hist");
hNumuCVNNDReco->SetLineColor(kRed);
leg->AddEntry(hNumuCVNNDReco, "reco_numu==1 at ND");
hNumuCVNNDReco->Draw("hist same");
leg->Draw();
}