# Dict_samples = {"4tops.root":"background",
#                 "ttZ.root":"background",
#                 "ttll.root":"background",
#                 "ttW.root":"background",
#                 "ttWW.root":"background",
#                 "vjets.root":"background",
#                 "vvv.root":"background",
#                 "single-top.root":"background",
#                 "single-top.root,410658":"background",
#                 "single-top.root,410659":"background",
#                 "single-top.root,410646":"background",
#                 "single-top.root,410647":"background",
#                 "single-top.root,410644":"background",
#                 "single-top.root,410645":"background",
#                 "single-top.root,410560":"background",
#                 "single-top.root,410408":"background",
#                 "ttbar.root":"background",
#                 "ttbar.root,410470":"background",
#                 "ttbar.root,407342":"background",
#                 "ttbar.root,407343":"background",
#                 "ttbar.root,407344":"background",
#                 "ttH.root":"background",
#                 "ttt.root":"background",
#                 "vh.root":"background",
#                 "vv.root":"background",
#                 "BSM4tops.root,400":"signal",
#                 "BSM4tops.root,500":"signal",
#                 "BSM4tops.root,600":"signal",
#                 "BSM4tops.root,700":"signal",
#                 "BSM4tops.root,800":"signal",
#                 "BSM4tops.root,900":"signal",
#                 "BSM4tops.root,1000":"signal",
#                 "data15.root":"data",
#                 "data16.root":"data",
#                 "data17.root":"data",
#                 "data18.root":"data",
#                 "data.root":"data",
#                 "vjets.root,364170":"background",
#                 "vjets.root,364171":"background",
#                 "vjets.root,364172":"background",
#                 "vjets.root,364173":"background",
#                 "vjets.root,364174":"background",
#                 "vjets.root,364175":"background",
#                 "vjets.root,364176":"background",
#                 "vjets.root,364177":"background",
#                 "vjets.root,364178":"background",
#                 "vjets.root,364179":"background",
#                 "vjets.root,364180":"background",
#                 "vjets.root,364181":"background",
#                 "vjets.root,364182":"background",
#                 "vjets.root,364183":"background",
#                 "vjets.root,364156":"background",
#                 "vjets.root,364157":"background",
#                 "vjets.root,364158":"background",
#                 "vjets.root,364159":"background",
#                 "vjets.root,364160":"background",
#                 "vjets.root,364161":"background",
#                 "vjets.root,364162":"background",
#                 "vjets.root,364163":"background",
#                 "vjets.root,364164":"background",
#                 "vjets.root,364165":"background",
#                 "vjets.root,364166":"background",
#                 "vjets.root,364167":"background",
#                 "vjets.root,364168":"background",
#                 "vjets.root,364169":"background",
#                 "vjets.root,364184":"background",
#                 "vjets.root,364185":"background",
#                 "vjets.root,364186":"background",
#                 "vjets.root,364187":"background",
#                 "vjets.root,364188":"background",
#                 "vjets.root,364189":"background",
#                 "vjets.root,364190":"background",
#                 "vjets.root,364191":"background",
#                 "vjets.root,364192":"background",
#                 "vjets.root,364193":"background",
#                 "vjets.root,364194":"background",
#                 "vjets.root,364195":"background",
#                 "vjets.root,364196":"background",
#                 "vjets.root,364197":"background",
#                 "vjets.root,364114":"background",
#                 "vjets.root,364115":"background",
#                 "vjets.root,364116":"background",
#                 "vjets.root,364117":"background",
#                 "vjets.root,364118":"background",
#                 "vjets.root,364119":"background",
#                 "vjets.root,364120":"background",
#                 "vjets.root,364121":"background",
#                 "vjets.root,364122":"background",
#                 "vjets.root,364123":"background",
#                 "vjets.root,364124":"background",
#                 "vjets.root,364125":"background",
#                 "vjets.root,364126":"background",
#                 "vjets.root,364127":"background",
#                 "vjets.root,364100":"background",
#                 "vjets.root,364101":"background",
#                 "vjets.root,364102":"background",
#                 "vjets.root,364103":"background",
#                 "vjets.root,364104":"background",
#                 "vjets.root,364105":"background",
#                 "vjets.root,364106":"background",
#                 "vjets.root,364107":"background",
#                 "vjets.root,364108":"background",
#                 "vjets.root,364109":"background",
#                 "vjets.root,364110":"background",
#                 "vjets.root,364111":"background",
#                 "vjets.root,364112":"background",
#                 "vjets.root,364113":"background",
#                 "vjets.root,364128":"background",
#                 "vjets.root,364129":"background",
#                 "vjets.root,364130":"background",
#                 "vjets.root,364131":"background",
#                 "vjets.root,364132":"background",
#                 "vjets.root,364133":"background",
#                 "vjets.root,364134":"background",
#                 "vjets.root,364135":"background",
#                 "vjets.root,364136":"background",
#                 "vjets.root,364137":"background",
#                 "vjets.root,364138":"background",
#                 "vjets.root,364139":"background",
#                 "vjets.root,364140":"background",
#                 "vjets.root,364141":"background",
#                 "vjets.root,364204":"background",
#                 "vjets.root,364205":"background",
#                 "vjets.root,364206":"background",
#                 "vjets.root,364207":"background",
#                 "vjets.root,364208":"background",
#                 "vjets.root,364209":"background",
#                 "vjets.root,364198":"background",
#                 "vjets.root,364199":"background",
#                 "vjets.root,364200":"background",
#                 "vjets.root,364201":"background",
#                 "vjets.root,364202":"background",
#                 "vjets.root,364203":"background",
#                 "vjets.root,364210":"background",
#                 "vjets.root,364211":"background",
#                 "vjets.root,364212":"background",
#                 "vjets.root,364213":"background",
#                 "vjets.root,364214":"background",
#                 "vjets.root,364215":"background"
#
#                 }


Dict_samples = {
                "vjets.root,364170":"background",
                "vjets.root,364171":"background",
                "vjets.root,364172":"background",
                "vjets.root,364173":"background",
                "vjets.root,364174":"background",
                "vjets.root,364175":"background",
                "vjets.root,364176":"background",
                "vjets.root,364177":"background",
                "vjets.root,364178":"background",
                "vjets.root,364179":"background",
                "vjets.root,364180":"background",
                "vjets.root,364181":"background",
                "vjets.root,364182":"background",
                "vjets.root,364183":"background",
                "vjets.root,364156":"background",
                "vjets.root,364157":"background",
                "vjets.root,364158":"background",
                "vjets.root,364159":"background",
                "vjets.root,364160":"background",
                "vjets.root,364161":"background",
                "vjets.root,364162":"background",
                "vjets.root,364163":"background",
                "vjets.root,364164":"background",
                "vjets.root,364165":"background",
                "vjets.root,364166":"background",
                "vjets.root,364167":"background",
                "vjets.root,364168":"background",
                "vjets.root,364169":"background",
                "vjets.root,364184":"background",
                "vjets.root,364185":"background",
                "vjets.root,364186":"background",
                "vjets.root,364187":"background",
                "vjets.root,364188":"background",
                "vjets.root,364189":"background",
                "vjets.root,364190":"background",
                "vjets.root,364191":"background",
                "vjets.root,364192":"background",
                "vjets.root,364193":"background",
                "vjets.root,364194":"background",
                "vjets.root,364195":"background",
                "vjets.root,364196":"background",
                "vjets.root,364197":"background",
                "vjets.root,364114":"background",
                "vjets.root,364115":"background",
                "vjets.root,364116":"background",
                "vjets.root,364117":"background",
                "vjets.root,364118":"background",
                "vjets.root,364119":"background",
                "vjets.root,364120":"background",
                "vjets.root,364121":"background",
                "vjets.root,364122":"background",
                "vjets.root,364123":"background",
                "vjets.root,364124":"background",
                "vjets.root,364125":"background",
                "vjets.root,364126":"background",
                "vjets.root,364127":"background",
                "vjets.root,364100":"background",
                "vjets.root,364101":"background",
                "vjets.root,364102":"background",
                "vjets.root,364103":"background",
                "vjets.root,364104":"background",
                "vjets.root,364105":"background",
                "vjets.root,364106":"background",
                "vjets.root,364107":"background",
                "vjets.root,364108":"background",
                "vjets.root,364109":"background",
                "vjets.root,364110":"background",
                "vjets.root,364111":"background",
                "vjets.root,364112":"background",
                "vjets.root,364113":"background",
                "vjets.root,364128":"background",
                "vjets.root,364129":"background",
                "vjets.root,364130":"background",
                "vjets.root,364131":"background",
                "vjets.root,364132":"background",
                "vjets.root,364133":"background",
                "vjets.root,364134":"background",
                "vjets.root,364135":"background",
                "vjets.root,364136":"background",
                "vjets.root,364137":"background",
                "vjets.root,364138":"background",
                "vjets.root,364139":"background",
                "vjets.root,364140":"background",
                "vjets.root,364141":"background",
                "vjets.root,364204":"background",
                "vjets.root,364205":"background",
                "vjets.root,364206":"background",
                "vjets.root,364207":"background",
                "vjets.root,364208":"background",
                "vjets.root,364209":"background",
                "vjets.root,364198":"background",
                "vjets.root,364199":"background",
                "vjets.root,364200":"background",
                "vjets.root,364201":"background",
                "vjets.root,364202":"background",
                "vjets.root,364203":"background",
                "vjets.root,364210":"background",
                "vjets.root,364211":"background",
                "vjets.root,364212":"background",
                "vjets.root,364213":"background",
                "vjets.root,364214":"background",
                "vjets.root,364215":"background"

                }








Dict_new_selection = {"SS3L1b":"(SSee_passECIDS||SSem_passECIDS||SSmm||eee_Zveto||eem_Zveto||emm_Zveto||mmm_Zveto)*",
                      "SR_6j":"((SSee_passECIDS||SSem_passECIDS||SSmm||eee_Zveto||eem_Zveto||emm_Zveto||mmm_Zveto) && nJets>=6)*",
                      "SR_6j_2b":"((SSee_passECIDS||SSem_passECIDS||SSmm||eee_Zveto||eem_Zveto||emm_Zveto||mmm_Zveto) && nJets>=6 && nBTags_DL1r_77>=2)*",
                      "SR":"((SSee_passECIDS||SSem_passECIDS||SSmm||eee_Zveto||eem_Zveto||emm_Zveto||mmm_Zveto) && HT_all>500000. && nBTags_DL1r_77>=2     && nJets>=6 )*",
                     }



NewOld_var = {

"nJets":"nJets",
"HT_all":"HT_all",
"nBTags_DL1r_77":"nBTags_MV2c10_77",
"met_met":"met_met",
"jet_pt[0]":"jet_pt[0]",
"jet_pt[1]":"jet_pt[1]",
"jet_pt[2]":"jet_pt[2]",
"jet_pt[3]":"jet_pt[3]",
"jet_pt[4]":"jet_pt[4]",
"jet_pt[5]":"jet_pt[5]",
"jet_eta[0]":"jet_eta[0]",
"jet_eta[1]":"jet_eta[1]",
"jet_eta[2]":"jet_eta[2]",
"jet_eta[3]":"jet_eta[3]",
"jet_eta[4]":"jet_eta[4]",
"jet_eta[5]":"jet_eta[5]",
"lep_0_pt":"lep_0_pt",
"lep_1_pt":"lep_1_pt",
"lep_2_pt":"lep_2_pt",
"lep_0_eta":"lep_0_eta",
"lep_1_eta":"lep_1_eta",
"lep_2_eta":"lep_2_eta",
"jet_sum_DL1r_Continuous":"jet_sum_mv2c10_Continuous",
"Evt_Channel":"Evt_Channel",
"GenFiltHT":"GenFiltHT",
"Tlepton_0_ID":"lepton_0_tightId",
"Tlepton_0_truthClassificationSM4t_bkgFlag":"lepton_0_truthClassificationSM4t_bkgFlag",
"Tlepton_1_ID":"lepton_1_tightId",
"Tlepton_1_truthClassificationSM4t_bkgFlag":"lepton_1_truthClassificationSM4t_bkgFlag",
"Tlepton_2_ID":"lepton_2_tightId",
"Tlepton_2_truthClassificationSM4t_bkgFlag":"lepton_2_truthClassificationSM4t_bkgFlag",
"event_BkgCategory":"event_BkgCategory",


"jet_pt":"jet_pt",
"jet_eta":"jet_eta",
"el_pt[0]":"el_pt[0]",
"el_pt[1]":"el_pt[1]",
"el_pt[2]":"el_pt[2]",
"el_eta[0]":"el_eta[0]",
"el_eta[1]":"el_eta[1]",
"el_eta[2]":"el_eta[2]",
"mu_pt[0]":"mu_pt[0]",
"mu_pt[1]":"mu_pt[1]",
"mu_pt[2]":"mu_pt[2]",
"mu_eta[0]":"mu_eta[0]",
"mu_eta[1]":"mu_eta[1]",
"mu_eta[2]":"mu_eta[2]",
"leading_bjet_pT":"leading_bjet_pT",

"Tlepton_0_mll_atConV":"lepton_0_mll_atConV",
"Tlepton_1_mll_atConV":"lepton_1_mll_atConV",
"Tlepton_0_mll_atPV":"lepton_0_mll_atPV",
"Tlepton_1_mll_atPV":"lepton_1_mll_atPV",



}



plot_dict = {
"6p_both_basic":["Evt_Channel","nJets","nBTags_DL1r_77","HT_all","met_met","jet_sum_DL1r_Continuous"],
"6p_both_jet_pt":["jet_pt[0]","jet_pt[1]","jet_pt[2]","jet_pt[3]","jet_pt[4]","jet_pt[5]"],
"6p_both_jet_eta":["jet_eta[0]","jet_eta[1]","jet_eta[2]","jet_eta[3]","jet_eta[4]","jet_eta[5]"],
"6p_both_lep_pt_eta":["lep_0_pt","lep_1_pt","lep_2_pt","lep_0_eta","lep_1_eta","lep_2_eta"],
"6p_mconly_truth":["Tlepton_0_ID","Tlepton_0_truthClassificationSM4t_bkgFlag","Tlepton_1_ID","Tlepton_1_truthClassificationSM4t_bkgFlag","Tlepton_2_ID","Tlepton_2_truthClassificationSM4t_bkgFlag"],
"2p_mconly_truth":["GenFiltHT","event_BkgCategory"],
"6p_both_el_pt_eta":["el_pt[0]","el_pt[1]","el_pt[2]","el_eta[0]","el_eta[1]","el_eta[2]"],
"6p_both_mu_pt_eta":["mu_pt[0]","mu_pt[1]","mu_pt[2]","mu_eta[0]","mu_eta[1]","mu_eta[2]"],
"3p_both_jet_pt_eta":["jet_pt","jet_eta","leading_bjet_pT"],


}



Dict_NewVar = {"nJets": "both",
                "HT_all": "both",
                "nBTags_DL1r_77": "both",
                "met_met": "both",
                "jet_pt[0]": "both",
                "jet_pt[1]": "both",
                "jet_pt[2]": "both",
                "jet_pt[3]": "both",
                "jet_pt[4]": "both",
                "jet_pt[5]": "both",
                "jet_eta[0]": "both",
                "jet_eta[1]": "both",
                "jet_eta[2]": "both",
                "jet_eta[3]": "both",
                "jet_eta[4]": "both",
                "jet_eta[5]": "both",
                "lep_0_pt": "both",
                "lep_1_pt": "both",
                "lep_2_pt": "both",
                "lep_0_eta": "both",
                "lep_1_eta": "both",
                "lep_2_eta": "both",
                "jet_sum_DL1r_Continuous": "both",
                "Evt_Channel": "both",
                "GenFiltHT": "mc",
                "Tlepton_0_ID": "mc",
                "Tlepton_0_truthClassificationSM4t_bkgFlag": "mc",
                "Tlepton_1_ID": "mc",
                "Tlepton_1_truthClassificationSM4t_bkgFlag": "mc",
                "Tlepton_2_ID": "mc",
                "Tlepton_2_truthClassificationSM4t_bkgFlag": "mc",
                "event_BkgCategory": "mc",

                "jet_pt": "both",
                "jet_eta": "both",
                "el_pt[0]": "both",
                "el_pt[1]": "both",
                "el_pt[2]": "both",
                "el_eta[0]": "both",
                "el_eta[1]": "both",
                "el_eta[2]": "both",
                "mu_pt[0]": "both",
                "mu_pt[1]": "both",
                "mu_pt[2]": "both",
                "mu_eta[0]": "both",
                "mu_eta[1]": "both",
                "mu_eta[2]": "both",
                "leading_bjet_pT": "both",

                "Tlepton_0_mll_atConV": "mc",
                "Tlepton_1_mll_atConV": "mc",
                "Tlepton_0_mll_atPV": "mc",
                "Tlepton_1_mll_atPV": "mc",


            }
