3 #include "TEfficiency.h"
5 #include "TGraphErrors.h"
13 #include "TRatioPlot.h"
33 gStyle->SetOptStat(0);
36 TCanvas *pad =
new TCanvas(
"pad",
"", 800, 600);
37 TLegend *legend =
nullptr;
38 TH1F *htemplate =
nullptr;
40 std::vector<TString> input_folders = {
"dataset_ip3dtagger",
"dataset_ktagger",
"dataset_etagger",
"dataset_mutagger" };
41 std::vector<TString> input_vars = {
"jet_t1_pt",
"jet_t1_sIP3D",
"jet_t2_pt",
"jet_t2_sIP3D",
"jet_t3_pt",
"jet_t3_sIP3D",
"jet_t4_pt",
"jet_t4_sIP3D",
"jet_k1_pt",
"jet_k1_sIP3D",
"jet_k2_pt",
"jet_k2_sIP3D",
"jet_e1_pt",
"jet_e1_sIP3D",
"jet_e2_pt",
"jet_e2_sIP3D",
"jet_mu1_pt",
"jet_mu1_sIP3D",
"jet_mu2_pt",
"jet_mu2_sIP3D" };
43 for (
auto input_folder : input_folders) {
44 std::cout << input_folder.Data() << std::endl;
46 for (
auto input_var : input_vars) {
47 std::cout << input_var.Data() << std::endl;
49 TChain testing_data(Form(
"%s/TestTree", input_folder.Data()));
50 TChain training_data(Form(
"%s/TrainTree", input_folder.Data()));
52 testing_data.Add(
"CharmJetClassification_Results.root");
53 training_data.Add(
"CharmJetClassification_Results.root");
60 TH1F *h_signal =
nullptr;
61 TH1F *h_background =
nullptr;
63 if (input_var.Contains(
"pt") == kTRUE) {
64 h_signal =
new TH1F(
"h_signal",
"signal distribution", 100, 0, 15);
69 if (input_var.Contains(
"sIP3D") == kTRUE) {
70 h_signal =
new TH1F(
"h_signal",
"signal distribution", 200, -100, 100);
75 if (h_signal ==
nullptr) {
79 h_background =
static_cast<TH1F *
>(h_signal->Clone(
"h_background"));
80 training_data.Project(h_signal->GetName(), input_var.Data(),
"jet_flavor==4");
81 training_data.Project(h_background->GetName(), input_var.Data(),
"jet_flavor<4 || jet_flavor==22");
83 if ((h_signal->GetEntries() == 0) || (h_background->GetEntries() == 0)) {
94 auto h_signal_norm = h_signal->DrawNormalized(
"HIST");
95 auto h_background_norm = h_background->DrawNormalized(
"HIST SAME");
97 h_signal_norm->SetLineWidth(2);
98 h_signal_norm->SetLineColor(kBlue);
100 h_background_norm->SetLineWidth(2);
101 h_background_norm->SetLineColor(kRed);
102 h_background_norm->SetLineStyle(kDashed);
104 Float_t max_value = TMath::Max(h_signal_norm->GetMaximum(), h_background_norm->GetMaximum());
106 Float_t min_value = 0.0;
108 if (input_var.Contains(
"sIP3D") == kTRUE) {
112 h_signal_norm->SetMaximum(max_value * 1.25);
113 h_background_norm->SetMaximum(max_value * 1.25);
114 h_signal_norm->SetMinimum(min_value);
115 h_background_norm->SetMinimum(min_value);
118 h_signal_norm->SetYTitle(
"Probability");
120 if (input_var.Contains(
"sIP3D") == kTRUE) {
121 h_signal_norm->SetXTitle(
"Track sIP_{3D}");
124 if (input_var.Contains(
"pt") == kTRUE) {
125 h_signal_norm->SetXTitle(
"Track p_{T}");
132 legend->SetFillStyle(0);
133 legend->SetBorderSize(0);
134 legend->AddEntry(h_signal_norm,
"True Charm Jets",
"lf");
135 legend->AddEntry(h_background_norm,
"True Light Jets",
"lp");
139 pad->SaveAs(Form(
"%s.pdf", input_var.Data()));