In [26]:
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
In [27]:
# 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
In [28]:
import ROOT
import uproot
In [29]:
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
In [30]:
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

w/ corrections

TODO

  1. Easiest: correction on Lund plane not taking into account pT distribution (then compare for various pT ranges)
    • efficiency
    • contamination
  2. Plot Lund Plane with pt-weighting?

Number of splitting in LHC15n:

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)

define functions

In [31]:
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
In [32]:
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
In [ ]:
%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
    
    

2015 VS 2017

In [36]:
%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)
--- bin (10, 15)
Working point: 0.0100 0.2885 0.9835
  Entries:
	 h_b_true 307862.0 
	 h_b_tagged 183197.0 
	 h_correction 40293.461444274595 
	 h_b_data 2844.0 
	 h_incl_data 182317.0

--- bin (15, 20)
Working point: 0.0100 0.3891 0.9787
  Entries:
	 h_b_true 341511.0 
	 h_b_tagged 215490.0 
	 h_correction 80034.0438665494 
	 h_b_data 1179.0 
	 h_incl_data 58831.0

--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 321497.0 
	 h_b_tagged 217496.0 
	 h_correction 94765.09155730066 
	 h_b_data 513.0 
	 h_incl_data 21266.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 281960.0 
	 h_b_tagged 200829.0 
	 h_correction 95241.00592089443 
	 h_b_data 253.0 
	 h_incl_data 9114.0

--- bin (30, 50)
Working point: 0.0100 0.5320 0.9706
  Entries:
	 h_b_true 687410.0 
	 h_b_tagged 524533.0 
	 h_correction 256930.88040852538 
	 h_b_data 244.0 
	 h_incl_data 8269.0
Out[36]:
(<ROOT.TCanvas object ("c") at 0x192a40f0>,
 <ROOT.TCanvas object ("myCanvasName") at 0x13bd9510>)
Warning in <TROOT::Append>: Replacing existing TH1: h_incl_merged (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bcorr_merged (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [37]:
%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)
--- bin (10, 15)
Working point: 0.0100 0.2885 0.9835
  Entries:
	 h_b_true 307862.0 
	 h_b_tagged 183197.0 
	 h_correction 40293.461444274595 
	 h_b_data 10440.0 
	 h_incl_data 620746.0

--- bin (15, 20)
Working point: 0.0100 0.3891 0.9787
  Entries:
	 h_b_true 341511.0 
	 h_b_tagged 215490.0 
	 h_correction 80034.0438665494 
	 h_b_data 4099.0 
	 h_incl_data 198615.0

--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 321497.0 
	 h_b_tagged 217496.0 
	 h_correction 94765.09155730066 
	 h_b_data 1847.0 
	 h_incl_data 73273.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 281960.0 
	 h_b_tagged 200829.0 
	 h_correction 95241.00592089443 
	 h_b_data 957.0 
	 h_incl_data 31653.0

--- bin (30, 50)
Working point: 0.0100 0.5320 0.9706
  Entries:
	 h_b_true 687410.0 
	 h_b_tagged 524533.0 
	 h_correction 256930.88040852538 
	 h_b_data 895.0 
	 h_incl_data 28542.0
Out[37]:
(<ROOT.TCanvas object ("c") at 0xb6cbb70>,
 <ROOT.TCanvas object ("myCanvasName") at 0x88ba0c0>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName

Erad = 10-50

different kT cuts: 0.5, 1, 2, 3, 5 $\Lambda_{QCD}$

In [40]:
%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)
--- bin (10, 15)
Working point: 0.0100 0.2885 0.9835
  Entries:
	 h_b_true 359027.0 
	 h_b_tagged 218451.0 
	 h_correction 52358.5649502998 
	 h_b_data 15895.0 
	 h_incl_data 930266.0

--- bin (15, 20)
Working point: 0.0100 0.3891 0.9787
  Entries:
	 h_b_true 402532.0 
	 h_b_tagged 258232.0 
	 h_correction 98180.93102904772 
	 h_b_data 6345.0 
	 h_incl_data 303290.0

--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 382154.0 
	 h_b_tagged 261651.0 
	 h_correction 114606.90860821851 
	 h_b_data 2827.0 
	 h_incl_data 112316.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 336145.0 
	 h_b_tagged 241619.0 
	 h_correction 112670.97900989583 
	 h_b_data 1434.0 
	 h_incl_data 48749.0

--- bin (30, 50)
Working point: 0.0100 0.5320 0.9706
  Entries:
	 h_b_true 815923.0 
	 h_b_tagged 627868.0 
	 h_correction 294042.5355942776 
	 h_b_data 1386.0 
	 h_incl_data 43885.0
Out[40]:
(<ROOT.TCanvas object ("c") at 0x9952e70>,
 <ROOT.TCanvas object ("myCanvasName") at 0x7b7e880>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt0.5_Erad10_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [38]:
%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)
--- bin (10, 15)
Working point: 0.0100 0.2885 0.9835
  Entries:
	 h_b_true 307862.0 
	 h_b_tagged 183197.0 
	 h_correction 40293.461444274595 
	 h_b_data 13284.0 
	 h_incl_data 803063.0

--- bin (15, 20)
Working point: 0.0100 0.3891 0.9787
  Entries:
	 h_b_true 341511.0 
	 h_b_tagged 215490.0 
	 h_correction 80034.0438665494 
	 h_b_data 5278.0 
	 h_incl_data 257446.0

--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 321497.0 
	 h_b_tagged 217496.0 
	 h_correction 94765.09155730066 
	 h_b_data 2360.0 
	 h_incl_data 94539.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 281960.0 
	 h_b_tagged 200829.0 
	 h_correction 95241.00592089443 
	 h_b_data 1210.0 
	 h_incl_data 40767.0

--- bin (30, 50)
Working point: 0.0100 0.5320 0.9706
  Entries:
	 h_b_true 687410.0 
	 h_b_tagged 524533.0 
	 h_correction 256930.88040852538 
	 h_b_data 1139.0 
	 h_incl_data 36811.0
Out[38]:
(<ROOT.TCanvas object ("c") at 0x9ff5200>,
 <ROOT.TCanvas object ("myCanvasName") at 0x13bf7820>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [39]:
%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)
--- bin (10, 15)
Working point: 0.0100 0.2885 0.9835
  Entries:
	 h_b_true 221438.0 
	 h_b_tagged 125442.0 
	 h_correction 945.9153483212424 
	 h_b_data 9171.0 
	 h_incl_data 578484.0

--- bin (15, 20)
Working point: 0.0100 0.3891 0.9787
  Entries:
	 h_b_true 239032.0 
	 h_b_tagged 146313.0 
	 h_correction 32943.275339739565 
	 h_b_data 3599.0 
	 h_incl_data 178928.0

--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 223252.0 
	 h_b_tagged 147635.0 
	 h_correction 50131.324650871524 
	 h_b_data 1625.0 
	 h_incl_data 64274.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 196379.0 
	 h_b_tagged 136716.0 
	 h_correction 55892.96203002635 
	 h_b_data 817.0 
	 h_incl_data 27754.0

--- bin (30, 50)
Working point: 0.0100 0.5320 0.9706
  Entries:
	 h_b_true 484161.0 
	 h_b_tagged 361585.0 
	 h_correction 179240.6417793614 
	 h_b_data 773.0 
	 h_incl_data 25209.0
Out[39]:
(<ROOT.TCanvas object ("c") at 0x847eb20>,
 <ROOT.TCanvas object ("myCanvasName") at 0xa3bd500>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [45]:
%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)
--- bin (10, 15)
Working point: 0.0100 0.2885 0.9835
  Entries:
	 h_b_true 156910.0 
	 h_b_tagged 85698.0 
	 h_correction 301.2746103301778 
	 h_b_data 6422.0 
	 h_incl_data 408999.0

--- bin (15, 20)
Working point: 0.0100 0.3891 0.9787
  Entries:
	 h_b_true 167721.0 
	 h_b_tagged 99640.0 
	 h_correction 5583.788292279545 
	 h_b_data 2483.0 
	 h_incl_data 122985.0

--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 156830.0 
	 h_b_tagged 101133.0 
	 h_correction 10669.88178737719 
	 h_b_data 1143.0 
	 h_incl_data 44270.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 139433.0 
	 h_b_tagged 94722.0 
	 h_correction 24427.33350502056 
	 h_b_data 561.0 
	 h_incl_data 19289.0

--- bin (30, 50)
Working point: 0.0100 0.5320 0.9706
  Entries:
	 h_b_true 348397.0 
	 h_b_tagged 254697.0 
	 h_correction 111597.90161178513 
	 h_b_data 561.0 
	 h_incl_data 17519.0
Out[45]:
(<ROOT.TCanvas object ("c") at 0xa15f1c0>,
 <ROOT.TCanvas object ("myCanvasName") at 0xbd7dea0>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt3_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt3_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt3_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt3_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt3_Erad10_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [44]:
%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)
--- bin (10, 15)
Working point: 0.0100 0.2885 0.9835
  Entries:
	 h_b_true 75503.0 
	 h_b_tagged 37921.0 
	 h_correction 2829.8416690664026 
	 h_b_data 2887.0 
	 h_incl_data 194041.0

--- bin (15, 20)
Working point: 0.0100 0.3891 0.9787
  Entries:
	 h_b_true 85710.0 
	 h_b_tagged 48101.0 
	 h_correction 151.5717989868874 
	 h_b_data 1246.0 
	 h_incl_data 60201.0

--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 83185.0 
	 h_b_tagged 50778.0 
	 h_correction 1094.878842385574 
	 h_b_data 611.0 
	 h_incl_data 22339.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 75864.0 
	 h_b_tagged 49045.0 
	 h_correction 2142.7781714238163 
	 h_b_data 289.0 
	 h_incl_data 9990.0

--- bin (30, 50)
Working point: 0.0100 0.5320 0.9706
  Entries:
	 h_b_true 195948.0 
	 h_b_tagged 137081.0 
	 h_correction 23245.178468977938 
	 h_b_data 293.0 
	 h_incl_data 9221.0
Out[44]:
(<ROOT.TCanvas object ("c") at 0x9952e70>,
 <ROOT.TCanvas object ("myCanvasName") at 0xbb174a0>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt5_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt5_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt5_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt5_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt5_Erad10_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName

Different FPR

In [41]:
%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)
--- bin (10, 15)
Working point: 0.0030 0.1819 0.9912
  Entries:
	 h_b_true 307862.0 
	 h_b_tagged 86240.0 
	 h_correction 18602.033961504283 
	 h_b_data 5090.0 
	 h_incl_data 803063.0

--- bin (15, 20)
Working point: 0.0030 0.2618 0.9895
  Entries:
	 h_b_true 341511.0 
	 h_b_tagged 116730.0 
	 h_correction 44965.99674444389 
	 h_b_data 2431.0 
	 h_incl_data 257446.0

--- bin (20, 25)
Working point: 0.0030 0.3187 0.9883
  Entries:
	 h_b_true 321497.0 
	 h_b_tagged 125745.0 
	 h_correction 61477.1018094861 
	 h_b_data 1271.0 
	 h_incl_data 94539.0

--- bin (25, 30)
Working point: 0.0030 0.3470 0.9877
  Entries:
	 h_b_true 281960.0 
	 h_b_tagged 119180.0 
	 h_correction 66459.52711404648 
	 h_b_data 681.0 
	 h_incl_data 40767.0

--- bin (30, 50)
Working point: 0.0030 0.3835 0.9872
  Entries:
	 h_b_true 687410.0 
	 h_b_tagged 316214.0 
	 h_correction 187328.06578589283 
	 h_b_data 654.0 
	 h_incl_data 36811.0
Out[41]:
(<ROOT.TCanvas object ("c") at 0xa15f1c0>,
 <ROOT.TCanvas object ("myCanvasName") at 0x138aba10>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [42]:
%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)
--- bin (10, 15)
Working point: 0.0300 0.4149 0.9670
  Entries:
	 h_b_true 307862.0 
	 h_b_tagged 402854.0 
	 h_correction 65751.51295684022 
	 h_b_data 33560.0 
	 h_incl_data 803063.0

--- bin (15, 20)
Working point: 0.0300 0.5316 0.9521
  Entries:
	 h_b_true 341511.0 
	 h_b_tagged 422479.0 
	 h_correction 123055.97216578152 
	 h_b_data 11855.0 
	 h_incl_data 257446.0

--- bin (20, 25)
Working point: 0.0300 0.6024 0.9389
  Entries:
	 h_b_true 321497.0 
	 h_b_tagged 400263.0 
	 h_correction 136339.14363651245 
	 h_b_data 4804.0 
	 h_incl_data 94539.0

--- bin (25, 30)
Working point: 0.0300 0.6413 0.9298
  Entries:
	 h_b_true 281960.0 
	 h_b_tagged 360782.0 
	 h_correction 130834.0246366674 
	 h_b_data 2310.0 
	 h_incl_data 40767.0

--- bin (30, 50)
Working point: 0.0300 0.6852 0.9199
  Entries:
	 h_b_true 687410.0 
	 h_b_tagged 926652.0 
	 h_correction 340026.3007770484 
	 h_b_data 2098.0 
	 h_incl_data 36811.0
Out[42]:
(<ROOT.TCanvas object ("c") at 0x9952e70>,
 <ROOT.TCanvas object ("myCanvasName") at 0x1391ed40>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad10_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName

Smaller pT bins

In [49]:
%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)
--- bin (10, 12)
Working point: 0.0100 0.2568 0.9849
  Entries:
	 h_b_true 81814.0 
	 h_b_tagged 46658.0 
	 h_correction 14.716372319883247 
	 h_b_data 4589.0 
	 h_incl_data 317566.0

--- bin (12, 14)
Working point: 0.0100 0.3106 0.9822
  Entries:
	 h_b_true 92076.0 
	 h_b_tagged 53342.0 
	 h_correction 8377.197062779793 
	 h_b_data 3258.0 
	 h_incl_data 194135.0

--- bin (14, 17)
Working point: 0.0100 0.3578 0.9801
  Entries:
	 h_b_true 143223.0 
	 h_b_tagged 85329.0 
	 h_correction 8865.535252610145 
	 h_b_data 2907.0 
	 h_incl_data 161816.0

--- bin (17, 20)
Working point: 0.0100 0.4062 0.9776
  Entries:
	 h_b_true 143357.0 
	 h_b_tagged 89267.0 
	 h_correction 24913.551390856785 
	 h_b_data 1846.0 
	 h_incl_data 83894.0

--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 223252.0 
	 h_b_tagged 147635.0 
	 h_correction 50131.324650871524 
	 h_b_data 1625.0 
	 h_incl_data 64274.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 196379.0 
	 h_b_tagged 136716.0 
	 h_correction 55892.96203002635 
	 h_b_data 817.0 
	 h_incl_data 27754.0

--- bin (30, 50)
Working point: 0.0100 0.5320 0.9706
  Entries:
	 h_b_true 484161.0 
	 h_b_tagged 361585.0 
	 h_correction 179240.6417793614 
	 h_b_data 773.0 
	 h_incl_data 25209.0
Out[49]:
(<ROOT.TCanvas object ("c") at 0x9952e70>,
 <ROOT.TCanvas object ("myCanvasName") at 0xb81a200>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName

Erad = 5-50

In [65]:
%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)
--- bin (10, 25)
Working point: 0.0100 0.3528 0.9811
  Entries:
	 h_b_true 502643.0 
	 h_b_tagged 285110.0 
	 h_correction 6371.299497044007 
	 h_b_data 11737.0 
	 h_incl_data 642395.0

--- bin (25, 50)
Working point: 0.0100 0.5176 0.9714
  Entries:
	 h_b_true 487943.0 
	 h_b_tagged 348647.0 
	 h_correction 140211.1691332334 
	 h_b_data 1139.0 
	 h_incl_data 36821.0
Out[65]:
(<ROOT.TCanvas object ("c") at 0x7b4f090>,
 <ROOT.TCanvas object ("myCanvasName") at 0x9c32c00>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt3_Erad5_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt3_Erad5_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [59]:
%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)
--- bin (10, 12)
Working point: 0.0100 0.2568 0.9849
  Entries:
	 h_b_true 69014.0 
	 h_b_tagged 36684.0 
	 h_correction 751.8254288037368 
	 h_b_data 3711.0 
	 h_incl_data 274801.0

--- bin (12, 14)
Working point: 0.0100 0.3106 0.9822
  Entries:
	 h_b_true 70593.0 
	 h_b_tagged 38743.0 
	 h_correction 8487.502334337962 
	 h_b_data 2405.0 
	 h_incl_data 148727.0

--- bin (14, 17)
Working point: 0.0100 0.3578 0.9801
  Entries:
	 h_b_true 103983.0 
	 h_b_tagged 59757.0 
	 h_correction 7673.703348048112 
	 h_b_data 2115.0 
	 h_incl_data 116349.0

--- bin (17, 20)
Working point: 0.0100 0.4062 0.9776
  Entries:
	 h_b_true 101839.0 
	 h_b_tagged 61381.0 
	 h_correction 5492.99064342668 
	 h_b_data 1273.0 
	 h_incl_data 58118.0

--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 157214.0 
	 h_b_tagged 101325.0 
	 h_correction 10681.80803601716 
	 h_b_data 1146.0 
	 h_incl_data 44399.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 139520.0 
	 h_b_tagged 94768.0 
	 h_correction 24434.587014340406 
	 h_b_data 562.0 
	 h_incl_data 19299.0

--- bin (30, 50)
Working point: 0.0100 0.5320 0.9706
  Entries:
	 h_b_true 348423.0 
	 h_b_tagged 254710.0 
	 h_correction 111602.92638957384 
	 h_b_data 561.0 
	 h_incl_data 17522.0
Out[59]:
(<ROOT.TCanvas object ("c") at 0xa078e50>,
 <ROOT.TCanvas object ("myCanvasName") at 0x126e3940>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt3_Erad5_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt3_Erad5_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt3_Erad5_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt3_Erad5_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt3_Erad5_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt3_Erad5_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt3_Erad5_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt3_Erad5_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName

Erad = 5-10

In [74]:
%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)
--- bin (10, 15)
Working point: 0.0100 0.2885 0.9835
  Entries:
	 h_b_true 179259.0 
	 h_b_tagged 86873.0 
	 h_correction 39699.364880557456 
	 h_b_data 6824.0 
	 h_incl_data 534109.0

--- bin (15, 25)
Working point: 0.0100 0.4169 0.9773
  Entries:
	 h_b_true 93320.0 
	 h_b_tagged 51828.0 
	 h_correction 6242.139778542146 
	 h_b_data 1179.0 
	 h_incl_data 59195.0

--- bin (25, 50)
Working point: 0.0100 0.5176 0.9714
  Entries:
	 h_b_true 18674.0 
	 h_b_tagged 12294.0 
	 h_correction 199.27181722134452 
	 h_b_data 58.0 
	 h_incl_data 1855.0
Out[74]:
(<ROOT.TCanvas object ("c") at 0xadfc3e0>,
 <ROOT.TCanvas object ("myCanvasName") at 0xbd6c720>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt0.5_Erad5_10 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt0.5_Erad5_10 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt0.5_Erad5_10 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad5_10 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad5_10 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad5_10 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt0.5_Erad5_10 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt0.5_Erad5_10 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt0.5_Erad5_10 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt0.5_Erad5_10 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad5_10 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad5_10 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt0.5_Erad5_10 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt0.5_Erad5_10 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName

Erad = 5-15

In [60]:
%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)
--- bin (10, 15)
Working point: 0.0100 0.2885 0.9835
  Entries:
	 h_b_true 381931.0 
	 h_b_tagged 217396.0 
	 h_correction 58764.95781481994 
	 h_b_data 16964.0 
	 h_incl_data 1108613.0

--- bin (15, 25)
Working point: 0.0100 0.4169 0.9773
  Entries:
	 h_b_true 211084.0 
	 h_b_tagged 122347.0 
	 h_correction 41993.50738759268 
	 h_b_data 2639.0 
	 h_incl_data 133883.0

--- bin (25, 50)
Working point: 0.0100 0.5176 0.9714
  Entries:
	 h_b_true 55893.0 
	 h_b_tagged 37922.0 
	 h_correction 907.754397578504 
	 h_b_data 184.0 
	 h_incl_data 5596.0
Out[60]:
(<ROOT.TCanvas object ("c") at 0xa05dfd0>,
 <ROOT.TCanvas object ("myCanvasName") at 0xb6cb750>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad5_15 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad5_15 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad5_15 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [69]:
%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)
--- bin (10, 15)
Working point: 0.0100 0.2885 0.9835
  Entries:
	 h_b_true 234315.0 
	 h_b_tagged 130633.0 
	 h_correction 18498.657194985924 
	 h_b_data 10403.0 
	 h_incl_data 688538.0

--- bin (15, 25)
Working point: 0.0100 0.4169 0.9773
  Entries:
	 h_b_true 100544.0 
	 h_b_tagged 57382.0 
	 h_correction 1348.2921418325354 
	 h_b_data 1327.0 
	 h_incl_data 67411.0

--- bin (25, 50)
Working point: 0.0100 0.5176 0.9714
  Entries:
	 h_b_true 17340.0 
	 h_b_tagged 11169.0 
	 h_correction 498.1119298488806 
	 h_b_data 68.0 
	 h_incl_data 1862.0
Out[69]:
(<ROOT.TCanvas object ("c") at 0xbd6c1c0>,
 <ROOT.TCanvas object ("myCanvasName") at 0xbd67200>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad5_15 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad5_15 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad5_15 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad5_15 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName

Erad = 15-25

In [62]:
%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)
--- bin (15, 20)
Working point: 0.0100 0.3891 0.9787
  Entries:
	 h_b_true 177950.0 
	 h_b_tagged 112094.0 
	 h_correction 24235.727260867017 
	 h_b_data 2709.0 
	 h_incl_data 129334.0

--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 163126.0 
	 h_b_tagged 110066.0 
	 h_correction 40214.13199096744 
	 h_b_data 1240.0 
	 h_incl_data 49284.0

--- bin (25, 50)
Working point: 0.0100 0.5176 0.9714
  Entries:
	 h_b_true 143935.0 
	 h_b_tagged 100123.0 
	 h_correction 25477.52874561358 
	 h_b_data 407.0 
	 h_incl_data 14158.0
Out[62]:
(<ROOT.TCanvas object ("c") at 0x97ae7c0>,
 <ROOT.TCanvas object ("myCanvasName") at 0xbc9ea80>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad15_25 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad15_25 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad15_25 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad15_25 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad15_25 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad15_25 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad15_25 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad15_25 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad15_25 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad15_25 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad15_25 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad15_25 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad15_25 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad15_25 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName

Erad = 25-40

In [57]:
%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)
--- bin (20, 30)
Working point: 0.0100 0.4699 0.9741
  Entries:
	 h_b_true 150850.0 
	 h_b_tagged 103569.0 
	 h_correction 28856.874004557983 
	 h_b_data 654.0 
	 h_incl_data 23642.0

--- bin (30, 50)
Working point: 0.0100 0.5320 0.9706
  Entries:
	 h_b_true 282736.0 
	 h_b_tagged 211741.0 
	 h_correction 103543.4853324082 
	 h_b_data 519.0 
	 h_incl_data 16618.0
Out[57]:
(<ROOT.TCanvas object ("c") at 0xae026c0>,
 <ROOT.TCanvas object ("myCanvasName") at 0x9feb300>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad25_40 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad25_40 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad25_40 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad25_40 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad25_40 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad25_40 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad25_40 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [67]:
%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)
--- bin (20, 30)
Working point: 0.0100 0.4699 0.9741
  Entries:
	 h_b_true 195201.0 
	 h_b_tagged 138874.0 
	 h_correction 37154.61874776867 
	 h_b_data 886.0 
	 h_incl_data 31310.0

--- bin (30, 50)
Working point: 0.0100 0.5320 0.9706
  Entries:
	 h_b_true 374770.0 
	 h_b_tagged 287317.0 
	 h_correction 136751.67676089425 
	 h_b_data 688.0 
	 h_incl_data 22806.0
Out[67]:
(<ROOT.TCanvas object ("c") at 0x9f077a0>,
 <ROOT.TCanvas object ("myCanvasName") at 0x84a65b0>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad25_40 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad25_40 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad25_40 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad25_40 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad25_40 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad25_40 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad25_40 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName

Erad = 20-30

In [77]:
%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)
--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 144402.0 
	 h_b_tagged 98922.0 
	 h_correction 28596.51047103246 
	 h_b_data 1047.0 
	 h_incl_data 40706.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 127354.0 
	 h_b_tagged 90657.0 
	 h_correction 37169.88836124164 
	 h_b_data 567.0 
	 h_incl_data 19034.0

--- bin (30, 60)
Working point: 0.0100 0.5372 0.9707
  Entries:
	 h_b_true 124145.0 
	 h_b_tagged 90331.0 
	 h_correction 20255.401272476363 
	 h_b_data 198.0 
	 h_incl_data 6813.0
Out[77]:
(<ROOT.TCanvas object ("c") at 0xadfc3e0>,
 <ROOT.TCanvas object ("myCanvasName") at 0xbcba1e0>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad20_30 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad20_30 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad20_30 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [76]:
%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)
--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 188346.0 
	 h_b_tagged 134211.0 
	 h_correction 39411.04235809312 
	 h_b_data 1407.0 
	 h_incl_data 54555.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 169105.0 
	 h_b_tagged 123850.0 
	 h_correction 51738.150085362904 
	 h_b_data 787.0 
	 h_incl_data 26046.0

--- bin (30, 60)
Working point: 0.0100 0.5372 0.9707
  Entries:
	 h_b_true 188590.0 
	 h_b_tagged 139934.0 
	 h_correction 29639.908933145412 
	 h_b_data 322.0 
	 h_incl_data 10361.0
Out[76]:
(<ROOT.TCanvas object ("c") at 0x7b4f090>,
 <ROOT.TCanvas object ("myCanvasName") at 0x8428f90>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad20_30 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad20_30 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad20_30 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [79]:
%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)
--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 144402.0 
	 h_b_tagged 98922.0 
	 h_correction 9799.985855090366 
	 h_b_data 1047.0 
	 h_incl_data 40706.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 127354.0 
	 h_b_tagged 90657.0 
	 h_correction 6837.982599442035 
	 h_b_data 567.0 
	 h_incl_data 19034.0

--- bin (30, 60)
Working point: 0.0100 0.5372 0.9707
  Entries:
	 h_b_true 124145.0 
	 h_b_tagged 90331.0 
	 h_correction 12257.74110012266 
	 h_b_data 198.0 
	 h_incl_data 6813.0
Out[79]:
(<ROOT.TCanvas object ("c") at 0x9feb820>,
 <ROOT.TCanvas object ("myCanvasName") at 0xbcabb00>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad20_30 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad20_30 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_30 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad20_30 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName

Erad = 30-50

In [84]:
%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)
--- bin (30, 35)
Working point: 0.0100 0.5192 0.9711
  Entries:
	 h_b_true 93895.0 
	 h_b_tagged 69655.0 
	 h_correction 9838.169314891895 
	 h_b_data 233.0 
	 h_incl_data 7285.0

--- bin (35, 50)
Working point: 0.0100 0.5398 0.9703
  Entries:
	 h_b_true 241919.0 
	 h_b_tagged 185954.0 
	 h_correction 46958.8495045101 
	 h_b_data 292.0 
	 h_incl_data 9402.0
Out[84]:
(<ROOT.TCanvas object ("c") at 0xadfc3e0>,
 <ROOT.TCanvas object ("myCanvasName") at 0x9c38dc0>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad30_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad30_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [78]:
%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)
--- bin (30, 40)
Working point: 0.0100 0.5235 0.9707
  Entries:
	 h_b_true 192060.0 
	 h_b_tagged 143823.0 
	 h_correction 51108.77245511942 
	 h_b_data 386.0 
	 h_incl_data 12154.0

--- bin (40, 100)
Working point: 0.0100 0.5549 0.9712
  Entries:
	 h_b_true 203693.0 
	 h_b_tagged 157938.0 
	 h_correction 78074.13787917077 
	 h_b_data 176.0 
	 h_incl_data 5591.0
Out[78]:
(<ROOT.TCanvas object ("c") at 0x7b4f090>,
 <ROOT.TCanvas object ("myCanvasName") at 0xb6dd710>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad30_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad30_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [75]:
%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)
--- bin (30, 40)
Working point: 0.0100 0.5235 0.9707
  Entries:
	 h_b_true 249125.0 
	 h_b_tagged 192597.0 
	 h_correction 64688.50690013811 
	 h_b_data 499.0 
	 h_incl_data 16283.0

--- bin (40, 100)
Working point: 0.0100 0.5549 0.9712
  Entries:
	 h_b_true 270431.0 
	 h_b_tagged 214026.0 
	 h_correction 101119.68236161866 
	 h_b_data 241.0 
	 h_incl_data 7716.0
Out[75]:
(<ROOT.TCanvas object ("c") at 0x9feb820>,
 <ROOT.TCanvas object ("myCanvasName") at 0x16973960>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad30_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad30_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad30_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName

UNCLASS

In [85]:
%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)
--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 188398.0 
	 h_b_tagged 134241.0 
	 h_correction 39413.17109083984 
	 h_b_data 1407.0 
	 h_incl_data 54557.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 209289.0 
	 h_b_tagged 152559.0 
	 h_correction 57711.298856166686 
	 h_b_data 913.0 
	 h_incl_data 30668.0

--- bin (30, 40)
Working point: 0.0100 0.5235 0.9707
  Entries:
	 h_b_true 372403.0 
	 h_b_tagged 282057.0 
	 h_correction 127394.92388169878 
	 h_b_data 763.0 
	 h_incl_data 24961.0

--- bin (40, 60)
Working point: 0.0100 0.5529 0.9706
  Entries:
	 h_b_true 308202.0 
	 h_b_tagged 243343.0 
	 h_correction 114164.00227214262 
	 h_b_data 285.0 
	 h_incl_data 8953.0
Out[85]:
(<ROOT.TCanvas object ("c") at 0x7b4f090>,
 <ROOT.TCanvas object ("myCanvasName") at 0xbd668f0>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad20_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [86]:
%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)
--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 144445.0 
	 h_b_tagged 98947.0 
	 h_correction 28598.200612212408 
	 h_b_data 1047.0 
	 h_incl_data 40707.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 158670.0 
	 h_b_tagged 112289.0 
	 h_correction 41904.66759456965 
	 h_b_data 664.0 
	 h_incl_data 22575.0

--- bin (30, 40)
Working point: 0.0100 0.5235 0.9707
  Entries:
	 h_b_true 278049.0 
	 h_b_tagged 205486.0 
	 h_correction 93988.5236876074 
	 h_b_data 555.0 
	 h_incl_data 18005.0

--- bin (40, 60)
Working point: 0.0100 0.5529 0.9706
  Entries:
	 h_b_true 223310.0 
	 h_b_tagged 172846.0 
	 h_correction 86075.93975689441 
	 h_b_data 196.0 
	 h_incl_data 6284.0
Out[86]:
(<ROOT.TCanvas object ("c") at 0xa82c790>,
 <ROOT.TCanvas object ("myCanvasName") at 0xd8c35f0>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad20_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [90]:
%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)
--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 68385.0 
	 h_b_tagged 42431.0 
	 h_correction 1017.3265194759824 
	 h_b_data 502.0 
	 h_incl_data 17904.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 70650.0 
	 h_b_tagged 45969.0 
	 h_correction 2101.930531247303 
	 h_b_data 272.0 
	 h_incl_data 9294.0

--- bin (30, 40)
Working point: 0.0100 0.5235 0.9707
  Entries:
	 h_b_true 120252.0 
	 h_b_tagged 82960.0 
	 h_correction 5097.024505612543 
	 h_b_data 217.0 
	 h_incl_data 6955.0

--- bin (40, 60)
Working point: 0.0100 0.5529 0.9706
  Entries:
	 h_b_true 90174.0 
	 h_b_tagged 65275.0 
	 h_correction 22435.358446633953 
	 h_b_data 80.0 
	 h_incl_data 2434.0
Out[90]:
(<ROOT.TCanvas object ("c") at 0xc87a730>,
 <ROOT.TCanvas object ("myCanvasName") at 0xbc989d0>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt5_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt5_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt5_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt5_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt5_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt5_Erad20_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [88]:
%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)
--- bin (20, 25)
Working point: 0.0030 0.3187 0.9883
  Entries:
	 h_b_true 144445.0 
	 h_b_tagged 56664.0 
	 h_correction 13301.365043795931 
	 h_b_data 564.0 
	 h_incl_data 40707.0

--- bin (25, 30)
Working point: 0.0030 0.3470 0.9877
  Entries:
	 h_b_true 158670.0 
	 h_b_tagged 66464.0 
	 h_correction 23282.404920154902 
	 h_b_data 368.0 
	 h_incl_data 22575.0

--- bin (30, 40)
Working point: 0.0030 0.3771 0.9871
  Entries:
	 h_b_true 278049.0 
	 h_b_tagged 124717.0 
	 h_correction 64974.72250073283 
	 h_b_data 307.0 
	 h_incl_data 18005.0

--- bin (40, 60)
Working point: 0.0030 0.3972 0.9874
  Entries:
	 h_b_true 223310.0 
	 h_b_tagged 104945.0 
	 h_correction 62113.894680625956 
	 h_b_data 120.0 
	 h_incl_data 6284.0
Out[88]:
(<ROOT.TCanvas object ("c") at 0xb81d470>,
 <ROOT.TCanvas object ("myCanvasName") at 0xbbdcd10>)
Warning in <TROOT::Append>: Replacing existing TH1: h_incl_merged (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bcorr_merged (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad20_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [89]:
%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)
--- bin (20, 25)
Working point: 0.0300 0.6024 0.9389
  Entries:
	 h_b_true 144445.0 
	 h_b_tagged 183065.0 
	 h_correction 47287.353718597384 
	 h_b_data 2149.0 
	 h_incl_data 40707.0

--- bin (25, 30)
Working point: 0.0300 0.6413 0.9298
  Entries:
	 h_b_true 158670.0 
	 h_b_tagged 201705.0 
	 h_correction 64156.96605368387 
	 h_b_data 1290.0 
	 h_incl_data 22575.0

--- bin (30, 40)
Working point: 0.0300 0.6745 0.9213
  Entries:
	 h_b_true 278049.0 
	 h_b_tagged 361087.0 
	 h_correction 129580.29917854453 
	 h_b_data 1032.0 
	 h_incl_data 18005.0

--- bin (40, 60)
Working point: 0.0300 0.7092 0.9176
  Entries:
	 h_b_true 223310.0 
	 h_b_tagged 300964.0 
	 h_correction 114644.17754074046 
	 h_b_data 373.0 
	 h_incl_data 6284.0
Out[89]:
(<ROOT.TCanvas object ("c") at 0x169936d0>,
 <ROOT.TCanvas object ("myCanvasName") at 0x84f9b40>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad20_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad20_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad20_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [ ]:
 
In [ ]:
 
In [46]:
%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)
--- bin (15, 20)
Working point: 0.0100 0.3891 0.9787
  Entries:
	 h_b_true 239032.0 
	 h_b_tagged 146313.0 
	 h_correction 32943.275339739565 
	 h_b_data 3599.0 
	 h_incl_data 178928.0

--- bin (20, 25)
Working point: 0.0100 0.4560 0.9750
  Entries:
	 h_b_true 223252.0 
	 h_b_tagged 147635.0 
	 h_correction 50131.324650871524 
	 h_b_data 1625.0 
	 h_incl_data 64274.0

--- bin (25, 30)
Working point: 0.0100 0.4882 0.9727
  Entries:
	 h_b_true 196379.0 
	 h_b_tagged 136716.0 
	 h_correction 55892.96203002635 
	 h_b_data 817.0 
	 h_incl_data 27754.0

--- bin (30, 50)
Working point: 0.0100 0.5320 0.9706
  Entries:
	 h_b_true 484161.0 
	 h_b_tagged 361585.0 
	 h_correction 179240.6417793614 
	 h_b_data 773.0 
	 h_incl_data 25209.0
Out[46]:
(<ROOT.TCanvas object ("c") at 0xdabb5a0>,
 <ROOT.TCanvas object ("myCanvasName") at 0xc8294f0>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [61]:
%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)
--- bin (10, 15)
Working point: 0.0030 0.1819 0.9912
  Entries:
	 h_b_true 221438.0 
	 h_b_tagged 61476.0 
	 h_correction 1495.0524807235902 
	 h_b_data 3724.0 
	 h_incl_data 578484.0

--- bin (15, 20)
Working point: 0.0030 0.2618 0.9895
  Entries:
	 h_b_true 239032.0 
	 h_b_tagged 81427.0 
	 h_correction 11631.801691397297 
	 h_b_data 1739.0 
	 h_incl_data 178928.0

--- bin (20, 25)
Working point: 0.0030 0.3187 0.9883
  Entries:
	 h_b_true 223252.0 
	 h_b_tagged 86940.0 
	 h_correction 24976.90351701598 
	 h_b_data 894.0 
	 h_incl_data 64274.0

--- bin (25, 30)
Working point: 0.0030 0.3470 0.9877
  Entries:
	 h_b_true 196379.0 
	 h_b_tagged 82435.0 
	 h_correction 33782.7371457254 
	 h_b_data 469.0 
	 h_incl_data 27754.0

--- bin (30, 50)
Working point: 0.0030 0.3835 0.9872
  Entries:
	 h_b_true 484161.0 
	 h_b_tagged 220353.0 
	 h_correction 128950.19882918663 
	 h_b_data 444.0 
	 h_incl_data 25209.0
Out[61]:
(<ROOT.TCanvas object ("c") at 0x7b4f090>,
 <ROOT.TCanvas object ("myCanvasName") at 0x8cae950>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt2_Erad10_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt2_Erad10_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt2_Erad10_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName
In [70]:
%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)
--- bin (10, 25)
Working point: 0.0100 0.3528 0.9811
  Entries:
	 h_b_true 546006.0 
	 h_b_tagged 315093.0 
	 h_correction 9781.87059722867 
	 h_b_data 5856.0 
	 h_incl_data 317521.0

--- bin (25, 50)
Working point: 0.0100 0.5176 0.9714
  Entries:
	 h_b_true 920205.0 
	 h_b_tagged 690085.0 
	 h_correction 70288.71931574053 
	 h_b_data 2229.0 
	 h_incl_data 72705.0
Out[70]:
(<ROOT.TCanvas object ("c") at 0x7b4f090>,
 <ROOT.TCanvas object ("myCanvasName") at 0xc87a5d0>)
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad15_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_trueb_kt1_Erad15_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_taggedb_kt1_Erad15_50 (Potential memory leak).
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad15_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad15_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_bdata_kt1_Erad15_50 (Potential memory leak).
Warning in <TROOT::Append>: Replacing existing TH1: h_incldata_kt1_Erad15_50 (Potential memory leak).
Warning in <TCanvas::Constructor>: Deleting canvas with same name: myCanvasName