import sys
sys.path.insert(0, "/eos/user/s/sbysiak/.local/lib/python3.7/site-packages/")
from comet_ml import Experiment
import comet_ml
# sklearn 0.22 needed for permutation importance
sys.path.insert(0, "../")
import sklearn
sklearn.__version__
import pickle
import os
from functools import partial
import uproot
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score as acc, f1_score, roc_curve, roc_auc_score, classification_report, confusion_matrix, auc
from xgboost import XGBClassifier
from scipy.optimize import curve_fit
from scipy.stats import pearsonr, spearmanr
import matplotlib as mlp
from helper.preprocessing import add_sorting_index, add_sorted_col, add_nth_val, apply_cut
# def get_model_from_exp(exp_id, model_type=XGBClassifier, featnames_type=(pd.Index, pd.Series, np.array, list), scaler_type=StandardScaler, api=comet_ml.API()):
# exp = api.get(exp_id)
# assets = exp.get_model_asset_list(exp.get_model_names()[0])
# asset_id_model = assets[ ['model' in a['fileName'] for a in assets].index(True) ]['assetId']
# asset_id_featnames = assets[ ['feat' in a['fileName'] for a in assets].index(True) ]['assetId']
# asset_id_scaler = assets[ ['scaler' in a['fileName'] for a in assets].index(True) ]['assetId']
# model_bin = exp.get_asset(asset_id_model)
# model = pickle.loads(model_bin)
# assert isinstance(model, model_type)
# featnames_bin = exp.get_asset(asset_id_featnames)
# featnames = pickle.loads(featnames_bin)
# assert isinstance(featnames, featnames_type)
# scaler_bin = exp.get_asset(asset_id_scaler)
# scaler = pickle.loads(scaler_bin)
# assert isinstance(scaler, scaler_type)
# return model, np.array(featnames), scaler
# def transform_jet(root_jets):
# jets = add_features(root_jets)
# return jets
import ROOT
import uproot
def get_threshold(fpath, pred_branch, jet_pt_cut=(0,9999), fpr_target=None, tpr_target=None):
if fpr_target is None and tpr_target is None: raise ValueError('Give either FPR or TPR. You gave NONE OF THEM')
if fpr_target is not None and tpr_target is not None: raise ValueError('Give either FPR or TPR. You gave BOTH')
tree_name_b = 'JetTree_AliAnalysisTaskJetExtractor_Jet_AKTChargedR040_tracks_pT0150_E_scheme_bJets'
tree_name_c = 'JetTree_AliAnalysisTaskJetExtractor_Jet_AKTChargedR040_tracks_pT0150_E_scheme_cJets'
tree_name_udsg = 'JetTree_AliAnalysisTaskJetExtractor_Jet_AKTChargedR040_tracks_pT0150_E_scheme_udsgJets'
is_train_branch = pred_branch.replace('pred', 'isTrainSample')
q_is_not_train = f'{is_train_branch} == 0'
q_pt_cut = f'{jet_pt_cut[0]} < Jet_Pt < {jet_pt_cut[1]}'
y_proba_b = uproot.open(fpath).get(tree_name_b).pandas.df(branches=['Jet_Pt', pred_branch, is_train_branch]).query(q_pt_cut).query(q_is_not_train)[pred_branch]
y_proba_c = uproot.open(fpath).get(tree_name_c).pandas.df(branches=['Jet_Pt', pred_branch, is_train_branch]).query(q_pt_cut).query(q_is_not_train)[pred_branch]
y_proba_udsg = uproot.open(fpath).get(tree_name_udsg).pandas.df(branches=['Jet_Pt', pred_branch, is_train_branch]).query(q_pt_cut).query(q_is_not_train)[pred_branch]
y_proba = np.hstack([y_proba_b, y_proba_c, y_proba_udsg])
y_true = np.hstack([np.ones_like(y_proba_b), np.zeros_like(y_proba_c), np.zeros_like(y_proba_udsg)])
for fpr_i, tpr_i, threshold_i in zip(*roc_curve(y_true, y_proba)):
if fpr_target is not None and fpr_i >= fpr_target or tpr_target is not None and tpr_i >= tpr_target:
print(f'Working point: {fpr_i:.4f} {tpr_i:.4f} {threshold_i:.4f}')
break
return threshold_i
def calc_ratio(tree, kt_cut_lam=None, E_rad=None, jet_pt = (5,50), proba_threshold = 0.8, pred_branch=None):
lambda_qcd = 0.2
kt_cut = kt_cut_lam * lambda_qcd
if pred_branch is None:
pred_branches = [br.GetName() for br in tree.GetListOfBranches() if 'pred' in br.GetName()]
if len(pred_branches) == 1:
pred_branch = pred_branches[0]
else:
pred_branch = None
raise ValueError(f'Number of branches containing \'pred\' is equal {len(pred_branches)} != 1 -- deal with it,\n select manually one of these: {pred_branches}')
selection_incl = f'Jet_Pt > {jet_pt[0]} && Jet_Pt < {jet_pt[1]} && Jet_Splitting_RadiatorE > {E_rad[0]} && Jet_Splitting_RadiatorE < {E_rad[1]}'
selection_b = f'{selection_incl} && {pred_branch} > {proba_threshold}'
selection_incl_kt = f'{selection_incl} && Jet_Splitting_kT > {kt_cut}'
selection_b_kt = f'{selection_b} && Jet_Splitting_kT > {kt_cut}'
incl_name = f"h_b_kt{kt_cut_lam}_Erad{E_rad[0]}_{E_rad[1]}"
h_incl = ROOT.TH1F(incl_name, incl_name, 10, 1, 3)
tree.Draw(f"log(1/Jet_Splitting_Theta) >> {incl_name}", selection_incl_kt, "goff")
h_incl.Scale(1/h_incl.GetEntries())
h_incl.SetLineColor(ROOT.kRed)
b_name = f"h_b_kt{kt_cut_lam}_Erad{E_rad[0]}_{E_rad[1]}"
h_b = ROOT.TH1F(b_name, b_name, 10, 1, 3)
tree.Draw(f"log(1/Jet_Splitting_Theta) >> {b_name}", selection_b_kt, "goff")
h_b.Scale(1/h_b.GetEntries())
h_b.SetMaximum(1.2)
h_b.SetMinimum(0.5)
legend = ROOT.TLegend(0.1,0.7,0.48,0.9)
legend.AddEntry(h_incl,"inclusive jets","l")
legend.AddEntry(h_b,"b-jets","l")
legend.Draw()
h_b.Divide(h_incl)
return h_b
n_splittings (nsplittings, kT > 1 x $\Lambda{QCD}$)
inclusive: 4626651 (2667899)
pt > 20: 56894 (41012)
pt < 10: 4065195 (2292177)
pt > 50: 1780 (1352)
Erad > 5:
incl: 3261322 (2285308)
pt > 20: 56653 (41009)
pt < 10: 2727484 (1912821)
Erad > 10:
incl: 438920 (347818)
pt > 20: 53115 (40140)
pt < 10: 80616 (66530)
Erad > 15:
incl: 111870 (90300)
pt > 20: 44881 (35499)
pt < 10: 0
pt < 15: 18029 (15143)
pt < 20: 66989 (54801)
def calc_corr(fpath, kt_cut_lam=None, E_rad=None, jet_pt = (5,50), proba_threshold = 0.8, pred_branch=None, binning=(10,1,3)):
lambda_qcd = 0.2
kt_cut = kt_cut_lam * lambda_qcd
if pred_branch is None:
pred_branches = [br.GetName() for br in tree.GetListOfBranches() if 'pred' in br.GetName()]
if len(pred_branches) == 1:
pred_branch = pred_branches[0]
else:
pred_branch = None
raise ValueError(f'Number of branches containing \'pred\' is equal {len(pred_branches)} != 1 -- deal with it,\n select manually one of these: {pred_branches}')
selection_incl = f'Jet_Pt > {jet_pt[0]} && Jet_Pt < {jet_pt[1]} && Jet_Splitting_RadiatorE > {E_rad[0]} && Jet_Splitting_RadiatorE < {E_rad[1]}'
selection_b = f'{selection_incl} && {pred_branch} > {proba_threshold}'
selection_incl_kt = f'{selection_incl} && Jet_Splitting_kT > {kt_cut}'
selection_b_kt = f'{selection_b} && Jet_Splitting_kT > {kt_cut}'
tree_name = 'JetTree_AliAnalysisTaskJetExtractor_Jet_AKTChargedR040_tracks_pT0150_E_scheme_bJets'
froot = ROOT.TFile(fpath)
jets_b_true = froot.Get(tree_name)
jets_incl = ROOT.TChain();
jets_incl.Add(f'{fpath}/{tree_name.replace("bJets","udsgJets")}')
jets_incl.Add(f'{fpath}/{tree_name.replace("bJets","cJets")}')
jets_incl.Add(f'{fpath}/{tree_name.replace("bJets","bJets")}')
b_true_name = f"h_trueb_kt{kt_cut_lam}_Erad{E_rad[0]}_{E_rad[1]}"
h_b_true = ROOT.TH1F(b_true_name, b_true_name, *binning)
jets_b_true.Draw(f"log(1/Jet_Splitting_Theta) >> {b_true_name}", selection_incl_kt, "goff")
# h_b_true.Scale(1/h_incl.GetEntries())
# h_b_true.SetLineColor(ROOT.kRed)
b_tagged_name = f"h_taggedb_kt{kt_cut_lam}_Erad{E_rad[0]}_{E_rad[1]}"
h_b_tagged = ROOT.TH1F(b_tagged_name, b_tagged_name, *binning)
jets_incl.Draw(f"log(1/Jet_Splitting_Theta) >> {b_tagged_name}", selection_b_kt, "goff")
# h_b_tagged.Scale(1/h_b.GetEntries())
# h_b_tagged.SetMaximum(1.2)
# h_b_tagged.SetMinimum(0.5)
# print(jets_b_true.GetEntries())
# print(jets_incl.GetEntries())
# print(h_b_true.GetEntries())
# print(h_b_tagged.GetEntries())
h_b_true.Divide(h_b_tagged)
h_b_true.SetDirectory(0)
return h_b_true
def calc_ratio_corrected(tree, h_corr, kt_cut_lam=None, E_rad=None, jet_pt = (5,50), proba_threshold = 0.8, pred_branch=None, binning=(10,1,3)):
lambda_qcd = 0.2
kt_cut = kt_cut_lam * lambda_qcd
if pred_branch is None:
pred_branches = [br.GetName() for br in tree.GetListOfBranches() if 'pred' in br.GetName()]
if len(pred_branches) == 1:
pred_branch = pred_branches[0]
else:
pred_branch = None
raise ValueError(f'Number of branches containing \'pred\' is equal {len(pred_branches)} != 1 -- deal with it,\n select manually one of these: {pred_branches}')
selection_incl = f'Jet_Pt > {jet_pt[0]} && Jet_Pt < {jet_pt[1]} && Jet_Splitting_RadiatorE > {E_rad[0]} && Jet_Splitting_RadiatorE < {E_rad[1]}'
selection_b = f'{selection_incl} && {pred_branch} > {proba_threshold}'
selection_incl_kt = f'{selection_incl} && Jet_Splitting_kT > {kt_cut}'
selection_b_kt = f'{selection_b} && Jet_Splitting_kT > {kt_cut}'
incl_name = f"h_incl_kt{kt_cut_lam}_Erad{E_rad[0]}_{E_rad[1]}"
h_incl = ROOT.TH1F(incl_name, incl_name, *binning)
tree.Draw(f"log(1/Jet_Splitting_Theta) >> {incl_name}", selection_incl_kt, "goff")
h_incl.Scale(1/h_incl.GetEntries())
h_incl.SetLineColor(ROOT.kRed)
b_name = f"h_b_kt{kt_cut_lam}_Erad{E_rad[0]}_{E_rad[1]}"
h_b = ROOT.TH1F(b_name, b_name, *binning)
tree.Draw(f"log(1/Jet_Splitting_Theta) >> {b_name}", selection_b_kt, "goff")
h_b.Multiply(h_corr) ## !!!
h_b.Scale(1/h_b.GetEntries())
h_b.SetMaximum(1.5)
h_b.SetMinimum(0.)
h_b.Divide(h_incl)
return h_b
%jsroot off
def plot_corrected_ratio(E_rad, pred_branch, fpath_mc, fpath_data, kt_cut_lam=1, fpr_target=1e-2, pt_bins=[10,20,50], binning=(10,1,3), plot_bins=True):
# # def calc_ratio_corrected(tree, h_corr, kt_cut_lam=None, E_rad=None, jet_pt = (5,50), proba_threshold = 0.8, pred_branch=None, binning=(10,1,3)):
# kt_cut_lam = 1
# # jet_pt = (5,50)
# E_rad = 5,50
# pred_branch = 'pred_f04e52'
# fpr_target = 1e-2
# # fpath_data = 'AnalysisResults_LHC15n.root'
# fpath_mc = 'AnalysisResults_LHC16h3_ptbin5.root'
# binning = (10,1,3)
# pt_bins = [10,20,50]
#####################
lambda_qcd = 0.2
kt_cut = kt_cut_lam * lambda_qcd
tree_name = 'JetTree_AliAnalysisTaskJetExtractor_Jet_AKTChargedR040_tracks_pT0150_E_scheme_allJets'
jets_data = ROOT.TChain(tree_name)
for f in fpath_data:
jets_data.Add(f)
jets_mc = ROOT.TChain();
jets_mc.Add(f'{fpath_mc}/{tree_name.replace("allJets","udsgJets")}')
jets_mc.Add(f'{fpath_mc}/{tree_name.replace("allJets","cJets")}')
jets_mc.Add(f'{fpath_mc}/{tree_name.replace("allJets","bJets")}')
h_incl_merged = ROOT.TH1D("h_incl_merged", "h_incl_merged", *binning)
h_bcorr_merged = ROOT.TH1D("h_bcorr_merged", "h_bcorr_merged", *binning)
if plot_bins:
c_bins = ROOT.TCanvas(f"c",f"c",1400,250*(len(pt_bins)-1))
c_bins.Divide(5,(len(pt_bins)-1))
i_pad = 1
for jet_pt in zip(pt_bins[:-1], pt_bins[1:]):
print(f'\n--- bin {jet_pt}')
proba_threshold = get_threshold(fpath_mc, pred_branch, jet_pt_cut=jet_pt, fpr_target=fpr_target)
selection_incl = f'Jet_Pt > {jet_pt[0]} && Jet_Pt < {jet_pt[1]} && Jet_Splitting_RadiatorE > {E_rad[0]} && Jet_Splitting_RadiatorE < {E_rad[1]}'
selection_incl_kt = f'{selection_incl} && Jet_Splitting_kT > {kt_cut}'
selection_btagged_kt = f'{selection_incl_kt} && {pred_branch} > {proba_threshold}'
selection_btrue_kt = f'{selection_incl_kt} && Jet_MC_MotherHadron == 5'
#
### calc correction
#
b_true_name = f"h_trueb_kt{kt_cut_lam}_Erad{E_rad[0]}_{E_rad[1]}"
h_b_true = ROOT.TH1F(b_true_name, b_true_name, *binning)
jets_mc.Draw(f"log(1/Jet_Splitting_Theta) >> {b_true_name}", selection_btrue_kt, "goff")
h_b_true.Sumw2()
b_tagged_name = f"h_taggedb_kt{kt_cut_lam}_Erad{E_rad[0]}_{E_rad[1]}"
h_b_tagged = ROOT.TH1F(b_tagged_name, b_tagged_name, *binning)
jets_mc.Draw(f"log(1/Jet_Splitting_Theta) >> {b_tagged_name}", selection_btagged_kt, "goff")
h_b_tagged.Sumw2()
h_correction = h_b_true.Clone()
h_correction.Sumw2()
h_correction.SetTitle(f"h_correction_kt{kt_cut_lam}_Erad{E_rad[0]}_{E_rad[1]}")
h_correction.Divide(h_b_tagged)
#
### get raw b- and incl jets from data
#
b_data_name = f"h_bdata_kt{kt_cut_lam}_Erad{E_rad[0]}_{E_rad[1]}"
h_b_data = ROOT.TH1F(b_data_name, b_data_name, *binning)
h_b_data.Sumw2()
incl_data_name = f"h_incldata_kt{kt_cut_lam}_Erad{E_rad[0]}_{E_rad[1]}"
h_incl_data = ROOT.TH1F(incl_data_name, incl_data_name, *binning)
h_incl_data.Sumw2()
jets_data.Draw(f"log(1/Jet_Splitting_Theta) >> {b_data_name}", selection_btagged_kt, "goff")
jets_data.Draw(f"log(1/Jet_Splitting_Theta) >> {incl_data_name}", selection_incl_kt, "goff")
print(f' Entries:\n\t h_b_true {h_b_true.GetEntries()} \n\t h_b_tagged {h_b_tagged.GetEntries()} \n\t h_correction {h_correction.GetEntries()} \n\t h_b_data {h_b_data.GetEntries()} \n\t h_incl_data {h_incl_data.GetEntries()}')
#
### apply correction
#
h_corrected = h_b_data.Clone()
h_corrected.SetTitle('b-corrected')
h_corrected.Multiply(h_correction)
#
### add to merged histos
#
h_bcorr_merged.Add(h_corrected)
h_incl_merged.Add(h_incl_data)
if plot_bins:
#
### calc ratio in this pt bin
#
h_ratio_bin = h_corrected.Clone()
h_ratio_bin.SetTitle(f'ratio b/incl pT={jet_pt}')
h_ratio_bin.Divide(h_incl_data)
h_ratio_bin.Scale(h_incl_data.Integral()/h_corrected.Integral() )
h_ratio_bin.SetMinimum(0)
h_ratio_bin.SetMaximum(1.5)
for h in (h_correction, h_b_data, h_corrected, h_incl_data, h_ratio_bin):
c_bins.cd(i_pad)
h.DrawCopy("E1")
i_pad += 1
if plot_bins:
c_bins.Draw()
##########################
c = ROOT.TCanvas("myCanvasName","The Canvas Title",1200,400)
c.Divide(3,1)
c.cd(1)
h_bcorr_merged.Scale(1/h_bcorr_merged.Integral())
h_bcorr_merged.DrawCopy("E1")
c.cd(2)
h_incl_merged.Scale(1/h_incl_merged.Integral())
h_incl_merged.DrawCopy("E1")
c.cd(3)
h_ratio = h_bcorr_merged.Clone()
h_ratio.SetTitle('b / incl')
h_ratio.Divide(h_incl_merged)
h_ratio.SetMinimum(0)
h_ratio.SetMaximum(1.5)
h_ratio.DrawCopy("E1")
c.Draw()
if plot_bins:
return c_bins, c
else:
return c
%jsroot off
plot_corrected_ratio(E_rad=(10,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
# fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
fpath_data=('AnalysisResults_LHC15n.root',),
kt_cut_lam=1, fpr_target=1e-2, pt_bins=[10,15,20,25,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(10,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=1, fpr_target=1e-2, pt_bins=[10,15,20,25,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(10,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=0.5, fpr_target=1e-2, pt_bins=[10,15,20,25,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(10,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=1, fpr_target=1e-2, pt_bins=[10,15,20,25,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(10,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=2, fpr_target=1e-2, pt_bins=[10,15,20,25,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(10,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=3, fpr_target=1e-2, pt_bins=[10,15,20,25,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(10,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=5, fpr_target=1e-2, pt_bins=[10,15,20,25,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(10,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=1, fpr_target=3e-3, pt_bins=[10,15,20,25,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(10,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=1, fpr_target=3e-2, pt_bins=[10,15,20,25,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(10,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=2, fpr_target=1e-2, pt_bins=[10,12,14,17,20,25,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(5,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=3, fpr_target=1e-2, pt_bins=[10,25,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(5,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=3, fpr_target=1e-2, pt_bins=[10,12,14,17,20,25,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(5,10), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=0.5, fpr_target=1e-2, pt_bins=[10,15,25,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(5,15), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=1, fpr_target=1e-2, pt_bins=[10,15,25,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(5,15), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=2, fpr_target=1e-2, pt_bins=[10,15,25,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(15,25), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=2, fpr_target=1e-2, pt_bins=[15,20,25,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(25,40), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=2, fpr_target=1e-2, pt_bins=[20,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(25,40), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=1, fpr_target=1e-2, pt_bins=[20,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(20,30), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=2, fpr_target=1e-2, pt_bins=[20,25,30,60], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(20,30), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=1, fpr_target=1e-2, pt_bins=[20,25,30,60], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(20,30), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=2, fpr_target=1e-2, pt_bins=[20,25,30,60], binning=(12,1,3.6), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(30,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=2, fpr_target=1e-2, pt_bins=[30,35,50], binning=(13,1,3.6), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(30,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=2, fpr_target=1e-2, pt_bins=[30,40,100], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(30,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=1, fpr_target=1e-2, pt_bins=[30,40,100], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(20,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=1, fpr_target=1e-2, pt_bins=[20,25,30,40,60], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(20,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=2, fpr_target=1e-2, pt_bins=[20,25,30,40,60], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(20,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=5, fpr_target=1e-2, pt_bins=[20,25,30,40,60], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(20,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=2, fpr_target=3e-3, pt_bins=[20,25,30,40,60], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(20,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=2, fpr_target=3e-2, pt_bins=[20,25,30,40,60], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(10,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=2, fpr_target=1e-2, pt_bins=[15,20,25,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(10,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=2, fpr_target=3e-3, pt_bins=[10,15,20,25,30,50], binning=(10,1,3), plot_bins=True)
%jsroot off
plot_corrected_ratio(E_rad=(15,50), pred_branch='pred_f04e52',
fpath_mc='AnalysisResults_LHC16h3_ptbin1-12.root',
fpath_data=('AnalysisResults_LHC15n.root', 'AnalysisResults_LHC17p_CENT_wSDD.root', 'AnalysisResults_LHC17q_CENT_wSDD.root'),
kt_cut_lam=1, fpr_target=1e-2, pt_bins=[10,25,50], binning=(14,1,4.2), plot_bins=True)