Commit 25d3076f authored by Pablo Martinez Agullo's avatar Pablo Martinez Agullo Committed by Nils Erik Krumnack
Browse files

TopPartons fixes for tHq

parent 4cdf427d
......@@ -28,6 +28,8 @@ namespace top {
tH.tau_decay2_isHadronic = higgs.tau_decay2_isHadronic;
tH.tau_decay1_p4 = higgs.tau_decay1_vector;
tH.tau_decay2_p4 = higgs.tau_decay2_vector;
tH.tauvis_decay1_p4 = higgs.tauvis_decay1_vector;
tH.tauvis_decay2_p4 = higgs.tauvis_decay2_vector;
tH.decay1_from_decay1_p4 = higgs.decay1_from_decay1_vector;
tH.decay2_from_decay1_p4 = higgs.decay2_from_decay1_vector;
tH.decay1_from_decay1_pdgId = higgs.decay1_from_decay1_pdgId;
......@@ -44,6 +46,10 @@ namespace top {
tH.tau_decay2_from_decay1_p4 = higgs.tau_decay2_from_decay1_vector;
tH.tau_decay1_from_decay2_p4 = higgs.tau_decay1_from_decay2_vector;
tH.tau_decay2_from_decay2_p4 = higgs.tau_decay2_from_decay2_vector;
tH.tauvis_decay1_from_decay1_p4 = higgs.tauvis_decay1_from_decay1_vector;
tH.tauvis_decay2_from_decay1_p4 = higgs.tauvis_decay2_from_decay1_vector;
tH.tauvis_decay1_from_decay2_p4 = higgs.tauvis_decay1_from_decay2_vector;
tH.tauvis_decay2_from_decay2_p4 = higgs.tauvis_decay2_from_decay2_vector;
return true;
......@@ -63,14 +69,15 @@ namespace top {
int WpDecay2_pdgId;
TLorentzVector tau_decay_from_W_p4;
int tau_decay_from_W_isHadronic;
TLorentzVector tauvis_decay_from_W_p4;
const bool event_top = CalcTopPartonHistory::topWb(truthParticles, 6, t_before, t_after,
Wp, b, WpDecay1, WpDecay1_pdgId, WpDecay2,
WpDecay2_pdgId, tau_decay_from_W_p4, tau_decay_from_W_isHadronic);
Wp, b, WpDecay1, WpDecay1_pdgId, WpDecay2,
WpDecay2_pdgId, tau_decay_from_W_p4, tau_decay_from_W_isHadronic, tauvis_decay_from_W_p4);
const bool event_top_SC = CalcTopPartonHistory::topAfterFSR_SC(truthParticles, 6, t_after_SC);
const bool event_topbar = CalcTopPartonHistory::topWb(truthParticles, -6, t_before, t_after,
Wp, b, WpDecay1, WpDecay1_pdgId, WpDecay2,
WpDecay2_pdgId, tau_decay_from_W_p4, tau_decay_from_W_isHadronic);
Wp, b, WpDecay1, WpDecay1_pdgId, WpDecay2,
WpDecay2_pdgId, tau_decay_from_W_p4, tau_decay_from_W_isHadronic, tauvis_decay_from_W_p4);
const bool event_topbar_SC = CalcTopPartonHistory::topAfterFSR_SC(truthParticles, -6, t_after_SC);
const bool event_Higgs = CalcThqPartonHistory::HiggsAndDecay(truthParticles);
......@@ -146,7 +153,7 @@ namespace top {
fillEtaBranch(ThqPartonHistory,"MC_spectatorquark_afterFSR_eta", spectatorquark_after);
}
// tay decay system
// tau decay system
ThqPartonHistory->auxdecor< float >("MC_W_from_t_m") = Wp.M();
ThqPartonHistory->auxdecor< float >("MC_W_from_t_pt") = Wp.Pt();
ThqPartonHistory->auxdecor< float >("MC_W_from_t_phi") = Wp.Phi();
......@@ -175,6 +182,11 @@ namespace top {
ThqPartonHistory->auxdecor< int >("MC_tau_from_W_from_t_isHadronic") = tau_decay_from_W_isHadronic;
fillEtaBranch(ThqPartonHistory, "MC_tau_from_W_from_t_eta", tau_decay_from_W_p4);
ThqPartonHistory->auxdecor< float >("MC_tauvis_from_W_from_t_m") = tauvis_decay_from_W_p4.M();
ThqPartonHistory->auxdecor< float >("MC_tauvis_from_W_from_t_pt") = tauvis_decay_from_W_p4.Pt();
ThqPartonHistory->auxdecor< float >("MC_tauvis_from_W_from_t_phi") = tauvis_decay_from_W_p4.Phi();
fillEtaBranch(ThqPartonHistory, "MC_tauvis_from_W_from_t_eta", tauvis_decay_from_W_p4);
//Higgs-Variables
ThqPartonHistory->auxdecor< float >("MC_Higgs_m") = tH.Higgs_p4.M();
ThqPartonHistory->auxdecor< float >("MC_Higgs_pt") = tH.Higgs_p4.Pt();
......@@ -193,6 +205,11 @@ namespace top {
ThqPartonHistory->auxdecor< float >("MC_Higgs_tau_decay1_pt") = tH.tau_decay1_p4.Pt();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tau_decay1_phi") = tH.tau_decay1_p4.Phi();
fillEtaBranch(ThqPartonHistory, "MC_Higgs_tau_decay1_eta", tH.tau_decay1_p4);
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay1_m") = tH.tauvis_decay1_p4.M();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay1_pt") = tH.tauvis_decay1_p4.Pt();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay1_phi") = tH.tauvis_decay1_p4.Phi();
fillEtaBranch(ThqPartonHistory, "MC_Higgs_tauvis_decay1_eta", tH.tauvis_decay1_p4);
//Higgs-decay2-Variables
ThqPartonHistory->auxdecor< float >("MC_Higgs_decay2_m") = tH.decay2_p4.M();
......@@ -206,6 +223,11 @@ namespace top {
ThqPartonHistory->auxdecor< float >("MC_Higgs_tau_decay2_pt") = tH.tau_decay2_p4.Pt();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tau_decay2_phi") = tH.tau_decay2_p4.Phi();
fillEtaBranch(ThqPartonHistory, "MC_Higgs_tau_decay2_eta", tH.tau_decay2_p4);
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay2_m") = tH.tauvis_decay2_p4.M();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay2_pt") = tH.tauvis_decay2_p4.Pt();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay2_phi") = tH.tauvis_decay2_p4.Phi();
fillEtaBranch(ThqPartonHistory, "MC_Higgs_tauvis_decay2_eta", tH.tauvis_decay2_p4);
//Higgs-decay1- from decay1-Variables
ThqPartonHistory->auxdecor< float >("MC_Higgs_decay1_from_decay1_m") = tH.decay1_from_decay1_p4.M();
......@@ -219,6 +241,11 @@ namespace top {
ThqPartonHistory->auxdecor< float >("MC_Higgs_tau_decay1_from_decay1_pt") = tH.tau_decay1_from_decay1_p4.Pt();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tau_decay1_from_decay1_phi") = tH.tau_decay1_from_decay1_p4.Phi();
fillEtaBranch(ThqPartonHistory, "MC_Higgs_tau_decay1_from_decay1_eta", tH.tau_decay1_from_decay1_p4);
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay1_from_decay1_m") = tH.tauvis_decay1_from_decay1_p4.M();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay1_from_decay1_pt") = tH.tauvis_decay1_from_decay1_p4.Pt();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay1_from_decay1_phi") = tH.tauvis_decay1_from_decay1_p4.Phi();
fillEtaBranch(ThqPartonHistory, "MC_Higgs_tauvis_decay1_from_decay1_eta", tH.tauvis_decay1_from_decay1_p4);
//Higgs-decay2- from decay1-Variables
ThqPartonHistory->auxdecor< float >("MC_Higgs_decay2_from_decay1_m") = tH.decay2_from_decay1_p4.M();
......@@ -227,12 +254,20 @@ namespace top {
ThqPartonHistory->auxdecor< int >("MC_Higgs_decay2_from_decay1_pdgId") = tH.decay2_from_decay1_pdgId;
fillEtaBranch(ThqPartonHistory, "MC_Higgs_decay2_from_decay1_eta", tH.decay2_from_decay1_p4);
ThqPartonHistory->auxdecor< int >("MC_Higgs_tau_decay2_from_decay1_isHadronic") = tH.tau_decay2_from_decay1_isHadronic;
ThqPartonHistory->auxdecor< float >("MC_Higgs_tau_decay2_from_decay1_m") = tH.tau_decay2_from_decay1_p4.M();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tau_decay2_from_decay1_pt") = tH.tau_decay2_from_decay1_p4.Pt();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tau_decay2_from_decay1_phi") = tH.tau_decay2_from_decay1_p4.Phi();
fillEtaBranch(ThqPartonHistory, "MC_Higgs_tau_decay2_from_decay1_eta", tH.tau_decay2_from_decay1_p4);
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay2_from_decay1_m") = tH.tauvis_decay2_from_decay1_p4.M();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay2_from_decay1_pt") = tH.tauvis_decay2_from_decay1_p4.Pt();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay2_from_decay1_phi") = tH.tauvis_decay2_from_decay1_p4.Phi();
fillEtaBranch(ThqPartonHistory, "MC_Higgs_tauvis_decay2_from_decay1_eta", tH.tauvis_decay2_from_decay1_p4);
//Higgs-decay1- from decay2-Variables
ThqPartonHistory->auxdecor< float >("MC_Higgs_decay1_from_decay2_m") = tH.decay1_from_decay2_p4.M();
ThqPartonHistory->auxdecor< float >("MC_Higgs_decay1_from_decay2_pt") = tH.decay1_from_decay2_p4.Pt();
......@@ -246,6 +281,11 @@ namespace top {
ThqPartonHistory->auxdecor< float >("MC_Higgs_tau_decay1_from_decay2_phi") = tH.tau_decay1_from_decay2_p4.Phi();
fillEtaBranch(ThqPartonHistory, "MC_Higgs_tau_decay1_from_decay2_eta", tH.tau_decay1_from_decay2_p4);
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay1_from_decay2_m") = tH.tauvis_decay1_from_decay2_p4.M();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay1_from_decay2_pt") = tH.tauvis_decay1_from_decay2_p4.Pt();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay1_from_decay2_phi") = tH.tauvis_decay1_from_decay2_p4.Phi();
fillEtaBranch(ThqPartonHistory, "MC_Higgs_tauvis_decay1_from_decay2_eta", tH.tauvis_decay1_from_decay2_p4);
//Higgs-decay2- from decay2-Variables
ThqPartonHistory->auxdecor< float >("MC_Higgs_decay2_from_decay2_m") = tH.decay2_from_decay2_p4.M();
ThqPartonHistory->auxdecor< float >("MC_Higgs_decay2_from_decay2_pt") = tH.decay2_from_decay2_p4.Pt();
......@@ -259,6 +299,11 @@ namespace top {
ThqPartonHistory->auxdecor< float >("MC_Higgs_tau_decay2_from_decay2_phi") = tH.tau_decay2_from_decay2_p4.Phi();
fillEtaBranch(ThqPartonHistory, "MC_Higgs_tau_decay2_from_decay2_eta", tH.tau_decay2_from_decay2_p4);
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay2_from_decay2_m") = tH.tauvis_decay2_from_decay2_p4.M();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay2_from_decay2_pt") = tH.tauvis_decay2_from_decay2_p4.Pt();
ThqPartonHistory->auxdecor< float >("MC_Higgs_tauvis_decay2_from_decay2_phi") = tH.tauvis_decay2_from_decay2_p4.Phi();
fillEtaBranch(ThqPartonHistory, "MC_Higgs_tauvis_decay2_from_decay2_eta", tH.tauvis_decay2_from_decay2_p4);
}
}
......
......@@ -183,7 +183,7 @@ namespace top {
TLorentzVector& W_p4,
TLorentzVector& b_p4, TLorentzVector& Wdecay1_p4,
int& Wdecay1_pdgId, TLorentzVector& Wdecay2_p4, int& Wdecay2_pdgId,
TLorentzVector& tau_decay_from_W_p4, int& tau_decay_from_W_isHadronic) {
TLorentzVector& tau_decay_from_W_p4, int& tau_decay_from_W_isHadronic, TLorentzVector& tauvis_decay_from_W_p4) {
bool hasT = false;
bool hasW = false;
bool hasB = false;
......@@ -221,7 +221,11 @@ namespace top {
if (std::abs(WChildren->pdgId()) == 11 || std::abs(WChildren->pdgId()) == 13 || std::abs(WChildren->pdgId()) == 15){
Wdecay1_p4 = WChildren->p4();
Wdecay1_pdgId = WChildren->pdgId();
tau_decay_from_W_isHadronic = PartonHistoryUtils::TauIsHadronic(WChildren, tau_decay_from_W_p4);
const xAOD::TruthParticle* WChildrenAfterFSR = PartonHistoryUtils::findAfterFSR(WChildren);
tau_decay_from_W_isHadronic = PartonHistoryUtils::TauIsHadronic(WChildren, tauvis_decay_from_W_p4);
if (std::abs(Wdecay1_pdgId) == 15){
tau_decay_from_W_p4 = WChildrenAfterFSR->p4();
}
hasWdecayProd1 = true;
}
if (std::abs(WChildren->pdgId()) == 12 || std::abs(WChildren->pdgId()) == 14 || std::abs(WChildren->pdgId()) == 16){
......@@ -277,7 +281,8 @@ namespace top {
int& Wdecay1_pdgId, TLorentzVector& Wdecay2_p4, int& Wdecay2_pdgId) {
TLorentzVector tau_decay_from_W_p4;
int tau_decay_from_W_isHadronic = -9999;
return topWb(truthParticles, start, t_beforeFSR_p4, t_afterFSR_p4, W_p4, b_p4, Wdecay1_p4,Wdecay1_pdgId, Wdecay2_p4, Wdecay2_pdgId, tau_decay_from_W_p4, tau_decay_from_W_isHadronic);
TLorentzVector tauvis_decay_from_W_p4;
return topWb(truthParticles, start, t_beforeFSR_p4, t_afterFSR_p4, W_p4, b_p4, Wdecay1_p4,Wdecay1_pdgId, Wdecay2_p4, Wdecay2_pdgId, tau_decay_from_W_p4, tau_decay_from_W_isHadronic, tauvis_decay_from_W_p4);
return false;
}
......
......@@ -570,6 +570,11 @@ namespace xAOD {
this->auxdecor< float >("MC_tau_from_W_from_t_eta") = -1000;
this->auxdecor< float >("MC_tau_from_W_from_t_phi") = -1000;
this->auxdecor< int >("MC_tau_from_W_from_t_isHadronic") = -9999;
this->auxdecor< float >("MC_tauvis_from_W_from_t_m") = -1000;
this->auxdecor< float >("MC_tauvis_from_W_from_t_pt") = -1000;
this->auxdecor< float >("MC_tauvis_from_W_from_t_eta") = -1000;
this->auxdecor< float >("MC_tauvis_from_W_from_t_phi") = -1000;
// Higgs variables
this->auxdecor< float >("MC_Higgs_m") = -1000;
......@@ -588,6 +593,10 @@ namespace xAOD {
this->auxdecor< float >("MC_Higgs_tau_decay1_pt") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay1_phi") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay1_eta") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay1_m") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay1_pt") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay1_phi") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay1_eta") = -1000;
this->auxdecor< float >("MC_Higgs_decay2_m") = -1000;
this->auxdecor< float >("MC_Higgs_decay2_pt") = -1000;
......@@ -599,7 +608,11 @@ namespace xAOD {
this->auxdecor< float >("MC_Higgs_tau_decay2_m") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay2_pt") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay2_phi") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay2_eta") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay2_eta") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay2_m") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay2_pt") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay2_phi") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay2_eta") = -1000;
this->auxdecor< float >("MC_Higgs_decay1_from_decay1_m") = -1000;
this->auxdecor< float >("MC_Higgs_decay1_from_decay1_pt") = -1000;
......@@ -612,6 +625,10 @@ namespace xAOD {
this->auxdecor< float >("MC_Higgs_tau_decay1_from_decay1_pt") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay1_from_decay1_phi") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay1_from_decay1_eta") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay1_from_decay1_m") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay1_from_decay1_pt") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay1_from_decay1_phi") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay1_from_decay1_eta") = -1000;
this->auxdecor< float >("MC_Higgs_decay2_from_decay1_m") = -1000;
this->auxdecor< float >("MC_Higgs_decay2_from_decay1_pt") = -1000;
......@@ -623,7 +640,11 @@ namespace xAOD {
this->auxdecor< float >("MC_Higgs_tau_decay2_from_decay1_m") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay2_from_decay1_pt") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay2_from_decay1_phi") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay2_from_decay1_eta") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay2_from_decay1_eta") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay2_from_decay1_m") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay2_from_decay1_pt") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay2_from_decay1_phi") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay2_from_decay1_eta") = -1000;
this->auxdecor< float >("MC_Higgs_decay1_from_decay2_m") = -1000;
this->auxdecor< float >("MC_Higgs_decay1_from_decay2_pt") = -1000;
......@@ -636,6 +657,10 @@ namespace xAOD {
this->auxdecor< float >("MC_Higgs_tau_decay1_from_decay2_pt") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay1_from_decay2_phi") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay1_from_decay2_eta") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay1_from_decay2_m") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay1_from_decay2_pt") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay1_from_decay2_phi") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay1_from_decay2_eta") = -1000;
this->auxdecor< float >("MC_Higgs_decay2_from_decay2_m") = -1000;
......@@ -649,6 +674,10 @@ namespace xAOD {
this->auxdecor< float >("MC_Higgs_tau_decay2_from_decay2_pt") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay2_from_decay2_phi") = -1000;
this->auxdecor< float >("MC_Higgs_tau_decay2_from_decay2_eta") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay2_from_decay2_m") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay2_from_decay2_pt") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay2_from_decay2_phi") = -1000;
this->auxdecor< float >("MC_Higgs_tauvis_decay2_from_decay2_eta") = -1000;
// Spectator light quark
this->auxdecor< int >("MC_spectatorquark_pdgId") = -1000;
......
......@@ -61,10 +61,14 @@ namespace PartonHistoryUtils {
if (std::abs(result.decay1_pdgId) == 15) { // Tautau channel -> Check if the Tau is hadronic or leptonic
result.tau_decay1_isHadronic = TauIsHadronic(higgs_fsr->child(0),result.tau_decay1_vector);
const xAOD::TruthParticle* tau1_fsr = findAfterFSR(higgs_fsr->child(0));
result.tau_decay1_vector = tau1_fsr->p4();
result.tau_decay1_isHadronic = TauIsHadronic(higgs_fsr->child(0),result.tauvis_decay1_vector);
}
if (std::abs(result.decay2_pdgId) == 15) { // Tautau channel -> Check if the Tau is hadronic or leptonic
result.tau_decay2_isHadronic = TauIsHadronic(higgs_fsr->child(1),result.tau_decay2_vector);
const xAOD::TruthParticle* tau2_fsr = findAfterFSR(higgs_fsr->child(1));
result.tau_decay2_vector = tau2_fsr->p4();
result.tau_decay2_isHadronic = TauIsHadronic(higgs_fsr->child(1),result.tauvis_decay2_vector);
}
if (!isZ && !isW) return result;
......@@ -87,13 +91,27 @@ namespace PartonHistoryUtils {
result.decay2_from_decay2_pdgId = decay2->child(1)->pdgId();
// If the W or Z decays into a Tau, we need to know if the Tau is leptonic or hadronic
result.tau_decay1_from_decay1_isHadronic = TauIsHadronic(decay1->child(0),result.tau_decay1_from_decay1_vector);
result.tau_decay2_from_decay1_isHadronic = TauIsHadronic(decay1->child(1),result.tau_decay2_from_decay1_vector);
result.tau_decay1_from_decay2_isHadronic = TauIsHadronic(decay2->child(0),result.tau_decay1_from_decay2_vector);
result.tau_decay2_from_decay2_isHadronic = TauIsHadronic(decay2->child(1),result.tau_decay2_from_decay2_vector);
if (std::abs(result.decay1_from_decay1_pdgId) == 15) {
const xAOD::TruthParticle* tau11fsr = findAfterFSR(decay1->child(0));
result.tau_decay1_from_decay1_vector = tau11fsr->p4();
result.tau_decay1_from_decay1_isHadronic = TauIsHadronic(decay1->child(0),result.tauvis_decay1_from_decay1_vector);
}
if (std::abs(result.decay2_from_decay1_pdgId) == 15) {
const xAOD::TruthParticle* tau12fsr = findAfterFSR(decay1->child(1));
result.tau_decay2_from_decay1_vector = tau12fsr->p4();
result.tau_decay2_from_decay1_isHadronic = TauIsHadronic(decay1->child(1),result.tauvis_decay2_from_decay1_vector);
}
if (std::abs(result.decay1_from_decay2_pdgId) == 15) {
const xAOD::TruthParticle* tau21fsr = findAfterFSR(decay2->child(0));
result.tau_decay1_from_decay2_vector = tau21fsr->p4();
result.tau_decay1_from_decay2_isHadronic = TauIsHadronic(decay2->child(0),result.tauvis_decay1_from_decay2_vector);
}
if (std::abs(result.decay2_from_decay2_pdgId) == 15) {
const xAOD::TruthParticle* tau22fsr = findAfterFSR(decay2->child(1));
result.tau_decay2_from_decay2_vector = tau22fsr->p4();
result.tau_decay2_from_decay2_isHadronic = TauIsHadronic(decay2->child(1),result.tauvis_decay2_from_decay2_vector);
}
return result;
}
......@@ -101,6 +119,10 @@ namespace PartonHistoryUtils {
int TauIsHadronic(const xAOD::TruthParticle* tau, TLorentzVector& tau_visible_decay_p4) {
// Takes a tau as input and returns information about how is this tau decaying
// - tau_decay_pdgId: Identifies the type of decay. For leptonoically decaying taus stores the pdgId
// of the light lepton and for hadronically decaying tau stores +24 for tau+ and -24 for tau^-
// - tau_visible_decay_p4: Stores the combined four-momentum of the all the decay products except the neutrinos.
int tau_decay_pdgId = -99;
......@@ -116,22 +138,20 @@ namespace PartonHistoryUtils {
for (size_t k = 0; k < afterFsr->nChildren(); k++) {
if (std::abs(afterFsr->child(k)->pdgId()) == 16){
if (there_are_leptons == false){
tau_visible_decay_p4 = afterFsr->p4() - afterFsr->child(k)->p4(); // p4 of HadTau visible decay = p(tau) - p(neutrino-tau)
if (afterFsr->pdgId() == 15){
tau_decay_pdgId = 24;
}else{
tau_decay_pdgId = -24;
}
}
if (there_are_leptons == false){
tau_visible_decay_p4 = afterFsr->p4() - afterFsr->child(k)->p4(); // p4 of HadTau visible decay = p(tau) - p(neutrino-tau)
if (afterFsr->pdgId() == -15){
tau_decay_pdgId = 24;
}else{
tau_decay_pdgId = -24;
}
}
}
if (std::abs(afterFsr->child(k)->pdgId()) == 11 or std::abs(afterFsr->child(k)->pdgId()) == 13){ // Leptonic Tau
tau_visible_decay_p4 = afterFsr->child(k)->p4(); // p4 of LepTau visible decay is the p4 of Lepton
tau_decay_pdgId = afterFsr->child(k)->pdgId(); // pdgId of LepTau is the pdgId of Lepton
there_are_leptons = true;
}
tau_visible_decay_p4 = afterFsr->child(k)->p4(); // p4 of LepTau visible decay is the p4 of Lepton
tau_decay_pdgId = afterFsr->child(k)->pdgId(); // pdgId of LepTau is the pdgId of Lepton
there_are_leptons = true;
}
}
return tau_decay_pdgId;
......
......@@ -36,7 +36,9 @@ namespace top {
int tau_decay1_isHadronic;
int tau_decay2_isHadronic;
TLorentzVector tau_decay1_p4;
TLorentzVector tau_decay2_p4;
TLorentzVector tau_decay2_p4;
TLorentzVector tauvis_decay1_p4;
TLorentzVector tauvis_decay2_p4;
TLorentzVector decay1_from_decay1_p4;
......@@ -58,6 +60,11 @@ namespace top {
TLorentzVector tau_decay1_from_decay2_p4;
TLorentzVector tau_decay2_from_decay2_p4;
TLorentzVector tauvis_decay1_from_decay1_p4;
TLorentzVector tauvis_decay2_from_decay1_p4;
TLorentzVector tauvis_decay1_from_decay2_p4;
TLorentzVector tauvis_decay2_from_decay2_p4;
} tH;
......
......@@ -57,7 +57,8 @@ namespace top {
///Store the four-momentum of several particles in the top decay chain
bool topWb(const xAOD::TruthParticleContainer* truthParticles, int start, TLorentzVector& t_beforeFSR_p4,
TLorentzVector& t_afterFSR_p4, TLorentzVector& W_p4, TLorentzVector& b_p4, TLorentzVector& Wdecay1_p4,
int& Wdecay1_pdgId, TLorentzVector& Wdecay2_p4, int& Wdecay2_pdgId, TLorentzVector& tau_decay_from_W_p4, int& tau_decay_from_W_isHadronic); //overloaded
int& Wdecay1_pdgId, TLorentzVector& Wdecay2_p4, int& Wdecay2_pdgId, TLorentzVector& tau_decay_from_W_p4,
int& tau_decay_from_W_isHadronic, TLorentzVector& tauvis_decay_from_W_p4); //overloaded
bool topWb(const xAOD::TruthParticleContainer* truthParticles, int start, TLorentzVector& t_beforeFSR_p4,
TLorentzVector& t_afterFSR_p4, TLorentzVector& W_p4, TLorentzVector& b_p4, TLorentzVector& Wdecay1_p4,
int& Wdecay1_pdgId, TLorentzVector& Wdecay2_p4, int& Wdecay2_pdgId);
......
......@@ -27,6 +27,9 @@ namespace PartonHistoryUtils {
TLorentzVector tau_decay1_vector;
TLorentzVector tau_decay2_vector;
TLorentzVector tauvis_decay1_vector;
TLorentzVector tauvis_decay2_vector;
/// subsequent decays of W/Z
TLorentzVector decay1_from_decay1_vector;
int decay1_from_decay1_pdgId;
......@@ -46,6 +49,11 @@ namespace PartonHistoryUtils {
TLorentzVector tau_decay1_from_decay2_vector;
TLorentzVector tau_decay2_from_decay2_vector;
TLorentzVector tauvis_decay1_from_decay1_vector;
TLorentzVector tauvis_decay2_from_decay1_vector;
TLorentzVector tauvis_decay1_from_decay2_vector;
TLorentzVector tauvis_decay2_from_decay2_vector;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment