Skip to content
Snippets Groups Projects
Commit 34b9a063 authored by Marco Link's avatar Marco Link :bee:
Browse files

Merge branch 'tmp_dev_mlink' into 'dev_mlink'

merge latest changes from old repository

See merge request ttH/CommonClassifier!48
parents 40b867f7 940a36f2
No related branches found
No related tags found
No related merge requests found
...@@ -56,6 +56,8 @@ class MVAvarsBase ...@@ -56,6 +56,8 @@ class MVAvarsBase
const std::vector<double> &selectedJetCSV, const std::vector<double> &selectedJetCSV,
const std::vector<int> &jets_idx); const std::vector<int> &jets_idx);
virtual void SetTopisleptonic(bool isit){cout << "ERROR: dont call `SetTopisleptonic()` for non MVAvarsJABDTthw-objects!" << endl;}
float GetGlobalDefault(){return globalDefault;} float GetGlobalDefault(){return globalDefault;}
std::vector<std::string> GetRecolabels(){return Recolabels;} std::vector<std::string> GetRecolabels(){return Recolabels;}
......
...@@ -37,7 +37,7 @@ class MVAvarsJABDTthw : public MVAvarsBase ...@@ -37,7 +37,7 @@ class MVAvarsJABDTthw : public MVAvarsBase
void SetTopisleptonic(bool isit){topisleptonic = isit;} void SetTopisleptonic(bool isit){topisleptonic = isit;}
std::map<std::string, TLorentzVector> GetVectors( const TLorentzVector &selectedLeptonP4, std::map<std::string, TLorentzVector> GetVectors( const TLorentzVector &selectedLeptonP4,
const std::vector<TLorentzVector> &selectedJetP4, const std::vector<TLorentzVector> &selectedJetP4,
const TLorentzVector &metP4, const TLorentzVector &metP4,
......
...@@ -11,6 +11,7 @@ MVAvarsJABDTthw::MVAvarsJABDTthw() ...@@ -11,6 +11,7 @@ MVAvarsJABDTthw::MVAvarsJABDTthw()
,"Reco_tHW_whaddau_idx2" ,"Reco_tHW_whaddau_idx2"
,"Reco_tHW_hdau_idx1" ,"Reco_tHW_hdau_idx1"
,"Reco_tHW_hdau_idx2" ,"Reco_tHW_hdau_idx2"
,"Reco_tHW_leptonictop"
,"Reco_tHW_top_m" ,"Reco_tHW_top_m"
,"Reco_tHW_top_pt" ,"Reco_tHW_top_pt"
...@@ -84,6 +85,8 @@ MVAvarsJABDTthw::MVAvarsJABDTthw() ...@@ -84,6 +85,8 @@ MVAvarsJABDTthw::MVAvarsJABDTthw()
,"Reco_JABDT_tHW_log_h_pt" ,"Reco_JABDT_tHW_log_h_pt"
,"Reco_JABDT_tHW_log_wb_m" ,"Reco_JABDT_tHW_log_wb_m"
,"Reco_JABDT_tHW_log_wb_pt" ,"Reco_JABDT_tHW_log_wb_pt"
,"Reco_JABDT_tHW_log_whad_m"
,"Reco_JABDT_tHW_log_whad_pt"
,"Reco_JABDT_tHW_abs_top_eta__M__wb_eta" ,"Reco_JABDT_tHW_abs_top_eta__M__wb_eta"
,"Reco_JABDT_tHW_abs_btop_eta" ,"Reco_JABDT_tHW_abs_btop_eta"
...@@ -124,6 +127,7 @@ void MVAvarsJABDTthw::FillMVAvarMap(const std::vector<TLorentzVector> &selectedL ...@@ -124,6 +127,7 @@ void MVAvarsJABDTthw::FillMVAvarMap(const std::vector<TLorentzVector> &selectedL
variableMap["Reco_tHW_whaddau_idx2"]= jets_idx.at(tHWIndexes::tHW_whaddau2_idx); variableMap["Reco_tHW_whaddau_idx2"]= jets_idx.at(tHWIndexes::tHW_whaddau2_idx);
variableMap["Reco_tHW_hdau_idx1"] = jets_idx.at(tHWIndexes::tHW_hdau1_idx); variableMap["Reco_tHW_hdau_idx1"] = jets_idx.at(tHWIndexes::tHW_hdau1_idx);
variableMap["Reco_tHW_hdau_idx2"] = jets_idx.at(tHWIndexes::tHW_hdau2_idx); variableMap["Reco_tHW_hdau_idx2"] = jets_idx.at(tHWIndexes::tHW_hdau2_idx);
variableMap["Reco_tHW_leptonictop"] = topisleptonic;
variableMap["Reco_tHW_top_m"] = vectors["top"].M(); variableMap["Reco_tHW_top_m"] = vectors["top"].M();
variableMap["Reco_tHW_top_pt"] = vectors["top"].Pt(); variableMap["Reco_tHW_top_pt"] = vectors["top"].Pt();
...@@ -198,6 +202,8 @@ void MVAvarsJABDTthw::FillMVAvarMap(const std::vector<TLorentzVector> &selectedL ...@@ -198,6 +202,8 @@ void MVAvarsJABDTthw::FillMVAvarMap(const std::vector<TLorentzVector> &selectedL
variableMap["Reco_JABDT_tHW_log_h_pt"] = log(vectors["higg"].Pt()); variableMap["Reco_JABDT_tHW_log_h_pt"] = log(vectors["higg"].Pt());
variableMap["Reco_JABDT_tHW_log_wb_m"] = log(vectors["wb"].M()); variableMap["Reco_JABDT_tHW_log_wb_m"] = log(vectors["wb"].M());
variableMap["Reco_JABDT_tHW_log_wb_pt"] = log(vectors["wb"].Pt()); variableMap["Reco_JABDT_tHW_log_wb_pt"] = log(vectors["wb"].Pt());
variableMap["Reco_JABDT_tHW_log_whad_m"] = log(vectors["whad"].M());
variableMap["Reco_JABDT_tHW_log_whad_pt"] = log(vectors["whad"].Pt());
variableMap["Reco_JABDT_tHW_abs_top_eta__M__wb_eta"] = fabs(vectors["top"].Eta() - vectors["wb"].Eta()); variableMap["Reco_JABDT_tHW_abs_top_eta__M__wb_eta"] = fabs(vectors["top"].Eta() - vectors["wb"].Eta());
variableMap["Reco_JABDT_tHW_abs_btop_eta"] = fabs(vectors["btop"].Eta()); variableMap["Reco_JABDT_tHW_abs_btop_eta"] = fabs(vectors["btop"].Eta());
...@@ -227,6 +233,9 @@ std::map<std::string, TLorentzVector> MVAvarsJABDTthw::GetVectors(const TLorentz ...@@ -227,6 +233,9 @@ std::map<std::string, TLorentzVector> MVAvarsJABDTthw::GetVectors(const TLorentz
vectors["higg"] = vectors["hdau1"] + vectors["hdau2"]; vectors["higg"] = vectors["hdau1"] + vectors["hdau2"];
vectors["whad"] = vectors["whaddau1"] + vectors["whaddau2"]; vectors["whad"] = vectors["whaddau1"] + vectors["whaddau2"];
vectors["toplep"] = vectors["leptonicW"] + vectors["btop"];
vectors["tophad"] = vectors["whad"] + vectors["btop"];
if(topisleptonic) if(topisleptonic)
{ {
vectors["wtop"] = vectors["leptonicW"]; vectors["wtop"] = vectors["leptonicW"];
...@@ -242,19 +251,28 @@ std::map<std::string, TLorentzVector> MVAvarsJABDTthw::GetVectors(const TLorentz ...@@ -242,19 +251,28 @@ std::map<std::string, TLorentzVector> MVAvarsJABDTthw::GetVectors(const TLorentz
return vectors; return vectors;
} }
bool MVAvarsJABDTthw::SkipEvent( const std::vector<TLorentzVector> &selectedJetP4, bool MVAvarsJABDTthw::SkipEvent(const std::vector<TLorentzVector> &selectedJetP4,
const std::vector<double> &selectedJetCSV, const std::vector<double> &selectedJetCSV,
const std::vector<int> &jets_idx) const std::vector<int> &jets_idx)
{ {
int btop = jets_idx.at(tHWIndexes::tHW_btop_idx); int btop = jets_idx.at(tHWIndexes::tHW_btop_idx);
// int whaddau1 = jets_idx.at(tHWIndexes::tHW_whaddau1_idx); int whaddau1 = jets_idx.at(tHWIndexes::tHW_whaddau1_idx);
// int whaddau2 = jets_idx.at(tHWIndexes::tHW_whaddau2_idx); int whaddau2 = jets_idx.at(tHWIndexes::tHW_whaddau2_idx);
int hdau1 = jets_idx.at(tHWIndexes::tHW_hdau1_idx); int hdau1 = jets_idx.at(tHWIndexes::tHW_hdau1_idx);
int hdau2 = jets_idx.at(tHWIndexes::tHW_hdau2_idx); int hdau2 = jets_idx.at(tHWIndexes::tHW_hdau2_idx);
if (!JetIsCentral(selectedJetP4[btop])) return true; if (!JetIsCentral(selectedJetP4[btop])) return true;
if (!JetIsCentral(selectedJetP4[hdau1])) return true; if (!JetIsCentral(selectedJetP4[hdau1])) return true;
if (!JetIsCentral(selectedJetP4[hdau2])) return true; if (!JetIsCentral(selectedJetP4[hdau2])) return true;
if (JetIsTagged(selectedJetP4[whaddau1], selectedJetCSV.at(whaddau1))) return true;
if (JetIsTagged(selectedJetP4[whaddau2], selectedJetCSV.at(whaddau2))) return true;
int btags = 0;
if(JetIsTagged(selectedJetP4.at(btop), selectedJetCSV.at(btop))) btags++;
if(JetIsTagged(selectedJetP4.at(hdau1), selectedJetCSV.at(hdau1))) btags++;
if(JetIsTagged(selectedJetP4.at(hdau2), selectedJetCSV.at(hdau2))) btags++;
if(btags < 1) return true;
return false; return false;
} }
\ No newline at end of file
...@@ -30,15 +30,11 @@ std::map<std::string, float> thwHypothesisCombinatorics::GetBestPermutation(cons ...@@ -30,15 +30,11 @@ std::map<std::string, float> thwHypothesisCombinatorics::GetBestPermutation(cons
const TLorentzVector &metP4) const TLorentzVector &metP4)
{ {
// reconstruct leptonic and hadronic top cases // reconstruct leptonic and hadronic top cases
MVAvarsJABDTthw* tempmvars = (MVAvarsJABDTthw*) &mvars; mvars->SetTopisleptonic(true);
std::map<std::string, float> leptonictop; std::map<std::string, float> leptonictop = HypothesisCombinatorics::GetBestPermutation(selectedLeptonP4, selectedJetP4, selectedJetCSV, metP4);
std::map<std::string, float> hadronictop;
tempmvars->SetTopisleptonic(false); mvars->SetTopisleptonic(false);
leptonictop = HypothesisCombinatorics::GetBestPermutation(selectedLeptonP4, selectedJetP4, selectedJetCSV, metP4); std::map<std::string, float> hadronictop = HypothesisCombinatorics::GetBestPermutation(selectedLeptonP4, selectedJetP4, selectedJetCSV, metP4);
tempmvars->SetTopisleptonic(true);
hadronictop = HypothesisCombinatorics::GetBestPermutation(selectedLeptonP4, selectedJetP4, selectedJetCSV, metP4);
if(hadronictop[bdtoutput_name] > leptonictop[bdtoutput_name]) if(hadronictop[bdtoutput_name] > leptonictop[bdtoutput_name])
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment