Commit 732bfe38 authored by Simon Berlendis's avatar Simon Berlendis Committed by Nils Erik Krumnack
Browse files

Implementing the 4-top parton history

parent 9029c4cf
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include <iostream>
......@@ -60,6 +60,7 @@
#include "TopPartons/CalcTtbarGammaPartonHistory.h"
#include "TopPartons/CalcThqPartonHistory.h"
#include "TopPartons/CalcTzqPartonHistory.h"
#include "TopPartons/CalcTtttPartonHistory.h"
#include "TopParticleLevel/ParticleLevelLoader.h"
......@@ -411,6 +412,11 @@ int main(int argc, char** argv) {
std::unique_ptr<top::CalcTopPartonHistory>(new top::CalcTzqPartonHistory("top::CalcTzqPartonHistory"));
top::check(topPartonHistory->setProperty("config", topConfig),
"Failed to setProperty of top::CalcTzqPartonHistory");
} else if (settings->value("TopPartonHistory") == "tttt") {
topPartonHistory =
std::unique_ptr<top::CalcTopPartonHistory>(new top::CalcTtttPartonHistory("top::CalcTtttPartonHistory"));
top::check(topPartonHistory->setProperty("config", topConfig),
"Failed to setProperty of top::CalcTtttPartonHistory");
}
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include "TopConfiguration/ConfigurationSettings.h"
......@@ -468,7 +468,7 @@ namespace top {
registerParameter("ApplyElectronInJetSubtraction",
"Subtract electrons close to jets for boosted analysis : True or False(top default)", "False");
registerParameter("TopPartonHistory", "Topology to be assumed when reconstructing parton-level history.", "False",
{"ttbar", "ttbarlight", "tb", "Wtb", "tchannel", "ttz", "ttgamma", "tHq", "tZq", "False"});
{"ttbar", "ttbarlight", "tb", "Wtb", "tchannel", "ttz", "ttgamma", "tHq", "tZq", "tttt", "False"});
registerParameter("TopPartonLevel", "Perform parton level analysis (stored in truth tree)? True or False", "True");
registerParameter("TopParticleLevel",
......
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// $Id: CalcTopPartonHistory.cxx 800464 2017-03-13 18:06:24Z tpelzer $
......@@ -687,6 +687,80 @@ namespace top {
return false;
}
// for tttt events
bool CalcTopPartonHistory::tttt(const xAOD::TruthParticleContainer* truthParticles, std::array<int,4> &top_pdgId,
std::array<TLorentzVector,4> &top_beforeFSR_p4, std::array<TLorentzVector,4> &top_afterFSR_p4,
std::array<TLorentzVector,4> &b_p4, std::array<TLorentzVector,4> &W_p4,
std::array<int,4> &Wdecay1_pdgId, std::array<int,4> &Wdecay2_pdgId,
std::array<TLorentzVector,4> &Wdecay1_p4, std::array<TLorentzVector,4> &Wdecay2_p4) {
int n_top = 0;
// Loop over the truth event record
for (const auto* const particle : *truthParticles){
if( std::abs(particle->pdgId()) != 6 ) continue;
// For Sherpa 2.2.10 samples :
// So if you want to select parton-level event kinematics, you should always use status 20 if available in the event and otherwise status 3.
if( std::abs(particle->status()) == 20 && n_top >=4 ) n_top=0; // Re-fill the top-quarks kinematic
if(PartonHistoryUtils::hasParticleIdenticalParent(particle)) continue; // kepping only top before FSR
top_pdgId[n_top] = particle->pdgId();
top_beforeFSR_p4[n_top] = particle->p4();
// demanding the last top quark after FSR
const xAOD::TruthParticle* top_afterFSR = PartonHistoryUtils::findAfterFSR(particle);
if(top_afterFSR == nullptr){
ATH_MSG_WARNING("Top quark after FSR not found.");
return false;
}
top_afterFSR_p4[n_top] = top_afterFSR->p4();
// looping over top quark children
for (size_t k = 0; k < top_afterFSR->nChildren(); k++) {
const xAOD::TruthParticle* topChildren = top_afterFSR->child(k);
if (std::abs(topChildren->pdgId()) == 24) { // W-boson
W_p4[n_top] = topChildren->p4();
// demanding the last W after FSR
const xAOD::TruthParticle* W_afterFSR = PartonHistoryUtils::findAfterFSR(topChildren);
// Extracting W decay particles if there are two children
if( W_afterFSR->nChildren() == 2 ){
const xAOD::TruthParticle* Wdecay1 = W_afterFSR->child(0);
Wdecay1_p4[n_top] = Wdecay1->p4();
Wdecay1_pdgId[n_top] = Wdecay1->pdgId();
const xAOD::TruthParticle* Wdecay2 = W_afterFSR->child(1);
Wdecay2_p4[n_top] = Wdecay2->p4();
Wdecay2_pdgId[n_top] = Wdecay2->pdgId();
}
else{
ATH_MSG_WARNING("W decays not found.");
return false;
}
}
else if (abs(topChildren->pdgId()) == 5) { // b-quark
b_p4[n_top] = topChildren->p4();
}
} // top quark children loop
n_top++;
}
// Check the number of top quarks
if( n_top != 4 ){
ATH_MSG_WARNING("The truth event record contains " << n_top << " top quarks.");
return false;
}
return true;
}
StatusCode CalcTopPartonHistory::execute() {
// Get the Truth Particles
const xAOD::TruthParticleContainer* truthParticles(nullptr);
......
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include "TopPartons/CalcTtttPartonHistory.h"
#include "TopPartons/CalcTopPartonHistory.h"
#include "TopConfiguration/TopConfig.h"
#include <iostream>
namespace top {
CalcTtttPartonHistory::CalcTtttPartonHistory(const std::string& name) : CalcTopPartonHistory(name) {}
void CalcTtttPartonHistory::TtttHistorySaver(const xAOD::TruthParticleContainer* truthParticles,
xAOD::PartonHistory* TtttPartonHistory){
TtttPartonHistory->IniVarTttt();
// Extract the 4-top parton history
bool event_tttt = CalcTopPartonHistory::tttt(truthParticles, top_pdgId, top_beforeFSR_p4, top_afterFSR_p4,
b_p4, W_p4, Wdecay1_pdgId, Wdecay2_pdgId, Wdecay1_p4, Wdecay2_p4);
if(!event_tttt){
ATH_MSG_WARNING("WARNING:\t Fail to extract the 4-top parton history.");
return;
}
// Find the index of the top quarks in decreasing pt order after FSR
int index_ordered[4] = {0, 1, 2, 3};
std::sort(index_ordered, index_ordered+4,
[&](int a, int b){
return( top_afterFSR_p4[a].Pt() > top_afterFSR_p4[b].Pt() );
});
//top1 variables
TtttPartonHistory->auxdecor< int >("MC_top1_pdgId") = top_pdgId[index_ordered[0]];
TtttPartonHistory->auxdecor< float >("MC_top1_beforeFSR_m") = top_beforeFSR_p4[index_ordered[0]].M();
TtttPartonHistory->auxdecor< float >("MC_top1_beforeFSR_pt") = top_beforeFSR_p4[index_ordered[0]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top1_beforeFSR_eta", top_beforeFSR_p4[index_ordered[0]]);
TtttPartonHistory->auxdecor< float >("MC_top1_beforeFSR_phi") = top_beforeFSR_p4[index_ordered[0]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top1_afterFSR_m") = top_afterFSR_p4[index_ordered[0]].M();
TtttPartonHistory->auxdecor< float >("MC_top1_afterFSR_pt") = top_afterFSR_p4[index_ordered[0]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top1_afterFSR_eta", top_afterFSR_p4[index_ordered[0]]);
TtttPartonHistory->auxdecor< float >("MC_top1_afterFSR_phi") = top_afterFSR_p4[index_ordered[0]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top1_b_m") = b_p4[index_ordered[0]].M();
TtttPartonHistory->auxdecor< float >("MC_top1_b_pt") = b_p4[index_ordered[0]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top1_b_eta", b_p4[index_ordered[0]]);
TtttPartonHistory->auxdecor< float >("MC_top1_b_phi") = b_p4[index_ordered[0]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top1_W_m") = W_p4[index_ordered[0]].M();
TtttPartonHistory->auxdecor< float >("MC_top1_W_pt") = W_p4[index_ordered[0]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top1_W_eta", W_p4[index_ordered[0]]);
TtttPartonHistory->auxdecor< float >("MC_top1_W_phi") = W_p4[index_ordered[0]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top1_Wdecay1_m") = Wdecay1_p4[index_ordered[0]].M();
TtttPartonHistory->auxdecor< float >("MC_top1_Wdecay1_pt") = Wdecay1_p4[index_ordered[0]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top1_Wdecay1_eta", Wdecay1_p4[index_ordered[0]]);
TtttPartonHistory->auxdecor< float >("MC_top1_Wdecay1_phi") = Wdecay1_p4[index_ordered[0]].Phi();
TtttPartonHistory->auxdecor< int >("MC_top1_Wdecay1_pdgId") = Wdecay1_pdgId[index_ordered[0]];
TtttPartonHistory->auxdecor< float >("MC_top1_Wdecay2_m") = Wdecay2_p4[index_ordered[0]].M();
TtttPartonHistory->auxdecor< float >("MC_top1_Wdecay2_pt") = Wdecay2_p4[index_ordered[0]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top1_Wdecay2_eta", Wdecay2_p4[index_ordered[0]]);
TtttPartonHistory->auxdecor< float >("MC_top1_Wdecay2_phi") = Wdecay2_p4[index_ordered[0]].Phi();
TtttPartonHistory->auxdecor< int >("MC_top1_Wdecay2_pdgId") = Wdecay2_pdgId[index_ordered[0]];
//top2 variables
TtttPartonHistory->auxdecor< int >("MC_top2_pdgId") = top_pdgId[index_ordered[1]];
TtttPartonHistory->auxdecor< float >("MC_top2_beforeFSR_m") = top_beforeFSR_p4[index_ordered[1]].M();
TtttPartonHistory->auxdecor< float >("MC_top2_beforeFSR_pt") = top_beforeFSR_p4[index_ordered[1]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top2_beforeFSR_eta", top_beforeFSR_p4[index_ordered[1]]);
TtttPartonHistory->auxdecor< float >("MC_top2_beforeFSR_phi") = top_beforeFSR_p4[index_ordered[1]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top2_afterFSR_m") = top_afterFSR_p4[index_ordered[1]].M();
TtttPartonHistory->auxdecor< float >("MC_top2_afterFSR_pt") = top_afterFSR_p4[index_ordered[1]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top2_afterFSR_eta", top_afterFSR_p4[index_ordered[1]]);
TtttPartonHistory->auxdecor< float >("MC_top2_afterFSR_phi") = top_afterFSR_p4[index_ordered[1]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top2_b_m") = b_p4[index_ordered[1]].M();
TtttPartonHistory->auxdecor< float >("MC_top2_b_pt") = b_p4[index_ordered[1]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top2_b_eta", b_p4[index_ordered[1]]);
TtttPartonHistory->auxdecor< float >("MC_top2_b_phi") = b_p4[index_ordered[1]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top2_W_m") = W_p4[index_ordered[1]].M();
TtttPartonHistory->auxdecor< float >("MC_top2_W_pt") = W_p4[index_ordered[1]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top2_W_eta", W_p4[index_ordered[1]]);
TtttPartonHistory->auxdecor< float >("MC_top2_W_phi") = W_p4[index_ordered[1]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top2_Wdecay1_m") = Wdecay1_p4[index_ordered[1]].M();
TtttPartonHistory->auxdecor< float >("MC_top2_Wdecay1_pt") = Wdecay1_p4[index_ordered[1]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top2_Wdecay1_eta", Wdecay1_p4[index_ordered[1]]);
TtttPartonHistory->auxdecor< float >("MC_top2_Wdecay1_phi") = Wdecay1_p4[index_ordered[1]].Phi();
TtttPartonHistory->auxdecor< int >("MC_top2_Wdecay1_pdgId") = Wdecay1_pdgId[index_ordered[1]];
TtttPartonHistory->auxdecor< float >("MC_top2_Wdecay2_m") = Wdecay2_p4[index_ordered[1]].M();
TtttPartonHistory->auxdecor< float >("MC_top2_Wdecay2_pt") = Wdecay2_p4[index_ordered[1]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top2_Wdecay2_eta", Wdecay2_p4[index_ordered[1]]);
TtttPartonHistory->auxdecor< float >("MC_top2_Wdecay2_phi") = Wdecay2_p4[index_ordered[1]].Phi();
TtttPartonHistory->auxdecor< int >("MC_top2_Wdecay2_pdgId") = Wdecay2_pdgId[index_ordered[1]];
//top3 variables
TtttPartonHistory->auxdecor< int >("MC_top3_pdgId") = top_pdgId[index_ordered[2]];
TtttPartonHistory->auxdecor< float >("MC_top3_beforeFSR_m") = top_beforeFSR_p4[index_ordered[2]].M();
TtttPartonHistory->auxdecor< float >("MC_top3_beforeFSR_pt") = top_beforeFSR_p4[index_ordered[2]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top3_beforeFSR_eta", top_beforeFSR_p4[index_ordered[2]]);
TtttPartonHistory->auxdecor< float >("MC_top3_beforeFSR_phi") = top_beforeFSR_p4[index_ordered[2]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top3_afterFSR_m") = top_afterFSR_p4[index_ordered[2]].M();
TtttPartonHistory->auxdecor< float >("MC_top3_afterFSR_pt") = top_afterFSR_p4[index_ordered[2]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top3_afterFSR_eta", top_afterFSR_p4[index_ordered[2]]);
TtttPartonHistory->auxdecor< float >("MC_top3_afterFSR_phi") = top_afterFSR_p4[index_ordered[2]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top3_b_m") = b_p4[index_ordered[2]].M();
TtttPartonHistory->auxdecor< float >("MC_top3_b_pt") = b_p4[index_ordered[2]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top3_b_eta", b_p4[index_ordered[2]]);
TtttPartonHistory->auxdecor< float >("MC_top3_b_phi") = b_p4[index_ordered[2]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top3_W_m") = W_p4[index_ordered[2]].M();
TtttPartonHistory->auxdecor< float >("MC_top3_W_pt") = W_p4[index_ordered[2]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top3_W_eta", W_p4[index_ordered[2]]);
TtttPartonHistory->auxdecor< float >("MC_top3_W_phi") = W_p4[index_ordered[2]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top3_Wdecay1_m") = Wdecay1_p4[index_ordered[2]].M();
TtttPartonHistory->auxdecor< float >("MC_top3_Wdecay1_pt") = Wdecay1_p4[index_ordered[2]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top3_Wdecay1_eta", Wdecay1_p4[index_ordered[2]]);
TtttPartonHistory->auxdecor< float >("MC_top3_Wdecay1_phi") = Wdecay1_p4[index_ordered[2]].Phi();
TtttPartonHistory->auxdecor< int >("MC_top3_Wdecay1_pdgId") = Wdecay1_pdgId[index_ordered[2]];
TtttPartonHistory->auxdecor< float >("MC_top3_Wdecay2_m") = Wdecay2_p4[index_ordered[2]].M();
TtttPartonHistory->auxdecor< float >("MC_top3_Wdecay2_pt") = Wdecay2_p4[index_ordered[2]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top3_Wdecay2_eta", Wdecay2_p4[index_ordered[2]]);
TtttPartonHistory->auxdecor< float >("MC_top3_Wdecay2_phi") = Wdecay2_p4[index_ordered[2]].Phi();
TtttPartonHistory->auxdecor< int >("MC_top3_Wdecay2_pdgId") = Wdecay2_pdgId[index_ordered[2]];
//top4 variables
TtttPartonHistory->auxdecor< int >("MC_top4_pdgId") = top_pdgId[index_ordered[3]];
TtttPartonHistory->auxdecor< float >("MC_top4_beforeFSR_m") = top_beforeFSR_p4[index_ordered[3]].M();
TtttPartonHistory->auxdecor< float >("MC_top4_beforeFSR_pt") = top_beforeFSR_p4[index_ordered[3]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top4_beforeFSR_eta", top_beforeFSR_p4[index_ordered[3]]);
TtttPartonHistory->auxdecor< float >("MC_top4_beforeFSR_phi") = top_beforeFSR_p4[index_ordered[3]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top4_afterFSR_m") = top_afterFSR_p4[index_ordered[3]].M();
TtttPartonHistory->auxdecor< float >("MC_top4_afterFSR_pt") = top_afterFSR_p4[index_ordered[3]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top4_afterFSR_eta", top_afterFSR_p4[index_ordered[3]]);
TtttPartonHistory->auxdecor< float >("MC_top4_afterFSR_phi") = top_afterFSR_p4[index_ordered[3]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top4_b_m") = b_p4[index_ordered[3]].M();
TtttPartonHistory->auxdecor< float >("MC_top4_b_pt") = b_p4[index_ordered[3]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top4_b_eta", b_p4[index_ordered[3]]);
TtttPartonHistory->auxdecor< float >("MC_top4_b_phi") = b_p4[index_ordered[3]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top4_W_m") = W_p4[index_ordered[3]].M();
TtttPartonHistory->auxdecor< float >("MC_top4_W_pt") = W_p4[index_ordered[3]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top4_W_eta", W_p4[index_ordered[3]]);
TtttPartonHistory->auxdecor< float >("MC_top4_W_phi") = W_p4[index_ordered[3]].Phi();
TtttPartonHistory->auxdecor< float >("MC_top4_Wdecay1_m") = Wdecay1_p4[index_ordered[3]].M();
TtttPartonHistory->auxdecor< float >("MC_top4_Wdecay1_pt") = Wdecay1_p4[index_ordered[3]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top4_Wdecay1_eta", Wdecay1_p4[index_ordered[3]]);
TtttPartonHistory->auxdecor< float >("MC_top4_Wdecay1_phi") = Wdecay1_p4[index_ordered[3]].Phi();
TtttPartonHistory->auxdecor< int >("MC_top4_Wdecay1_pdgId") = Wdecay1_pdgId[index_ordered[3]];
TtttPartonHistory->auxdecor< float >("MC_top4_Wdecay2_m") = Wdecay2_p4[index_ordered[3]].M();
TtttPartonHistory->auxdecor< float >("MC_top4_Wdecay2_pt") = Wdecay2_p4[index_ordered[3]].Pt();
fillEtaBranch(TtttPartonHistory, "MC_top4_Wdecay2_eta", Wdecay2_p4[index_ordered[3]]);
TtttPartonHistory->auxdecor< float >("MC_top4_Wdecay2_phi") = Wdecay2_p4[index_ordered[3]].Phi();
TtttPartonHistory->auxdecor< int >("MC_top4_Wdecay2_pdgId") = Wdecay2_pdgId[index_ordered[3]];
// Combined mass of the 4-top system
TtttPartonHistory->auxdecor< float >("MC_mtttt") = (top_afterFSR_p4[0]+top_afterFSR_p4[1]+top_afterFSR_p4[2]+top_afterFSR_p4[3]).M();
// Sum of the transvers mass
TtttPartonHistory->auxdecor< float >("MC_HT") = top_afterFSR_p4[0].Mt() + top_afterFSR_p4[1].Mt() + top_afterFSR_p4[2].Mt() + top_afterFSR_p4[3].Mt();
}
StatusCode CalcTtttPartonHistory::execute() {
//Get the Truth Particles
const xAOD::TruthParticleContainer* truthParticles(nullptr);
ATH_CHECK(evtStore()->retrieve(truthParticles, m_config->sgKeyMCParticle()));
// Create the partonHistory xAOD object
xAOD::PartonHistoryAuxContainer* partonAuxCont = new xAOD::PartonHistoryAuxContainer {};
xAOD::PartonHistoryContainer* partonCont = new xAOD::PartonHistoryContainer {};
partonCont->setStore(partonAuxCont);
xAOD::PartonHistory* TtttPartonHistory = new xAOD::PartonHistory {};
partonCont->push_back(TtttPartonHistory);
// Recover the parton history for TZ events
TtttHistorySaver(truthParticles, TtttPartonHistory);
// Save to StoreGate / TStore
std::string outputSGKey = m_config->sgKeyTopPartonHistory();
std::string outputSGKeyAux = outputSGKey + "Aux.";
xAOD::TReturnCode save = evtStore()->tds()->record(partonCont, outputSGKey);
xAOD::TReturnCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
if (!save || !saveAux) {
return StatusCode::FAILURE;
}
return StatusCode::SUCCESS;
}
}
......@@ -724,8 +724,132 @@ namespace xAOD {
this->auxdecor< float >("MC_Zdecay2_phi") = -1000;
this->auxdecor< int >("MC_Zdecay2_pdgId") = -9999;
this->auxdecor< int >("MC_Zdecay2_status") = -9999;
}
// Initialize variables for tZq events
void PartonHistory::IniVarTttt() {
//top1 variables
this->auxdecor< int >("MC_top1_pdgId") = -9999;
this->auxdecor< float >("MC_top1_beforeFSR_m") = -1000;
this->auxdecor< float >("MC_top1_beforeFSR_pt") = -1000;
this->auxdecor< float >("MC_top1_beforeFSR_eta") = -1000;
this->auxdecor< float >("MC_top1_beforeFSR_phi") = -1000;
this->auxdecor< float >("MC_top1_afterFSR_m") = -1000;
this->auxdecor< float >("MC_top1_afterFSR_pt") = -1000;
this->auxdecor< float >("MC_top1_afterFSR_eta") = -1000;
this->auxdecor< float >("MC_top1_afterFSR_phi") = -1000;
this->auxdecor< float >("MC_top1_W_m") = -1000;
this->auxdecor< float >("MC_top1_W_pt") = -1000;
this->auxdecor< float >("MC_top1_W_eta") = -1000;
this->auxdecor< float >("MC_top1_W_phi") = -1000;
this->auxdecor< float >("MC_top1_b_m") = -1000;
this->auxdecor< float >("MC_top1_b_pt") = -1000;
this->auxdecor< float >("MC_top1_b_eta") = -1000;
this->auxdecor< float >("MC_top1_b_phi") = -1000;
this->auxdecor< float >("MC_top1_Wdecay1_m") = -1000;
this->auxdecor< float >("MC_top1_Wdecay1_pt") = -1000;
this->auxdecor< float >("MC_top1_Wdecay1_eta") = -1000;
this->auxdecor< float >("MC_top1_Wdecay1_phi") = -1000;
this->auxdecor< int >("MC_top1_Wdecay1_pdgId") = -9999;
this->auxdecor< float >("MC_top1_Wdecay2_m") = -1000;
this->auxdecor< float >("MC_top1_Wdecay2_pt") = -1000;
this->auxdecor< float >("MC_top1_Wdecay2_eta") = -1000;
this->auxdecor< float >("MC_top1_Wdecay2_phi") = -1000;
this->auxdecor< int >("MC_top1_Wdecay2_pdgId") = -9999;
//top2 variables
this->auxdecor< int >("MC_top2_pdgId") = -9999;
this->auxdecor< float >("MC_top2_beforeFSR_m") = -1000;
this->auxdecor< float >("MC_top2_beforeFSR_pt") = -1000;
this->auxdecor< float >("MC_top2_beforeFSR_eta") = -1000;
this->auxdecor< float >("MC_top2_beforeFSR_phi") = -1000;
this->auxdecor< float >("MC_top2_afterFSR_m") = -1000;
this->auxdecor< float >("MC_top2_afterFSR_pt") = -1000;
this->auxdecor< float >("MC_top2_afterFSR_eta") = -1000;
this->auxdecor< float >("MC_top2_afterFSR_phi") = -1000;
this->auxdecor< float >("MC_top2_W_m") = -1000;
this->auxdecor< float >("MC_top2_W_pt") = -1000;
this->auxdecor< float >("MC_top2_W_eta") = -1000;
this->auxdecor< float >("MC_top2_W_phi") = -1000;
this->auxdecor< float >("MC_top2_b_m") = -1000;
this->auxdecor< float >("MC_top2_b_pt") = -1000;
this->auxdecor< float >("MC_top2_b_eta") = -1000;
this->auxdecor< float >("MC_top2_b_phi") = -1000;
this->auxdecor< float >("MC_top2_Wdecay1_m") = -1000;
this->auxdecor< float >("MC_top2_Wdecay1_pt") = -1000;
this->auxdecor< float >("MC_top2_Wdecay1_eta") = -1000;
this->auxdecor< float >("MC_top2_Wdecay1_phi") = -1000;
this->auxdecor< int >("MC_top2_Wdecay1_pdgId") = -9999;
this->auxdecor< float >("MC_top2_Wdecay2_m") = -1000;
this->auxdecor< float >("MC_top2_Wdecay2_pt") = -1000;
this->auxdecor< float >("MC_top2_Wdecay2_eta") = -1000;
this->auxdecor< float >("MC_top2_Wdecay2_phi") = -1000;
this->auxdecor< int >("MC_top2_Wdecay2_pdgId") = -9999;
//top3 variables
this->auxdecor< int >("MC_top3_pdgId") = -9999;
this->auxdecor< float >("MC_top3_beforeFSR_m") = -1000;
this->auxdecor< float >("MC_top3_beforeFSR_pt") = -1000;
this->auxdecor< float >("MC_top3_beforeFSR_eta") = -1000;
this->auxdecor< float >("MC_top3_beforeFSR_phi") = -1000;
this->auxdecor< float >("MC_top3_afterFSR_m") = -1000;
this->auxdecor< float >("MC_top3_afterFSR_pt") = -1000;
this->auxdecor< float >("MC_top3_afterFSR_eta") = -1000;
this->auxdecor< float >("MC_top3_afterFSR_phi") = -1000;
this->auxdecor< float >("MC_top3_W_m") = -1000;
this->auxdecor< float >("MC_top3_W_pt") = -1000;
this->auxdecor< float >("MC_top3_W_eta") = -1000;
this->auxdecor< float >("MC_top3_W_phi") = -1000;
this->auxdecor< float >("MC_top3_b_m") = -1000;
this->auxdecor< float >("MC_top3_b_pt") = -1000;
this->auxdecor< float >("MC_top3_b_eta") = -1000;
this->auxdecor< float >("MC_top3_b_phi") = -1000;
this->auxdecor< float >("MC_top3_Wdecay1_m") = -1000;
this->auxdecor< float >("MC_top3_Wdecay1_pt") = -1000;
this->auxdecor< float >("MC_top3_Wdecay1_eta") = -1000;
this->auxdecor< float >("MC_top3_Wdecay1_phi") = -1000;
this->auxdecor< int >("MC_top3_Wdecay1_pdgId") = -9999;
this->auxdecor< float >("MC_top3_Wdecay2_m") = -1000;
this->auxdecor< float >("MC_top3_Wdecay2_pt") = -1000;
this->auxdecor< float >("MC_top3_Wdecay2_eta") = -1000;
this->auxdecor< float >("MC_top3_Wdecay2_phi") = -1000;
this->auxdecor< int >("MC_top3_Wdecay2_pdgId") = -9999;
//top4 variables
this->auxdecor< int >("MC_top4_pdgId") = -9999;
this->auxdecor< float >("MC_top4_beforeFSR_m") = -1000;
this->auxdecor< float >("MC_top4_beforeFSR_pt") = -1000;
this->auxdecor< float >("MC_top4_beforeFSR_eta") = -1000;
this->auxdecor< float >("MC_top4_beforeFSR_phi") = -1000;
this->auxdecor< float >("MC_top4_afterFSR_m") = -1000;
this->auxdecor< float >("MC_top4_afterFSR_pt") = -1000;
this->auxdecor< float >("MC_top4_afterFSR_eta") = -1000;
this->auxdecor< float >("MC_top4_afterFSR_phi") = -1000;
this->auxdecor< float >("MC_top4_W_m") = -1000;
this->auxdecor< float >("MC_top4_W_pt") = -1000;
this->auxdecor< float >("MC_top4_W_eta") = -1000;
this->auxdecor< float >("MC_top4_W_phi") = -1000;
this->auxdecor< float >("MC_top4_b_m") = -1000;
this->auxdecor< float >("MC_top4_b_pt") = -1000;
this->auxdecor< float >("MC_top4_b_eta") = -1000;
this->auxdecor< float >("MC_top4_b_phi") = -1000;
this->auxdecor< float >("MC_top4_Wdecay1_m") = -1000;
this->auxdecor< float >("MC_top4_Wdecay1_pt") = -1000;
this->auxdecor< float >("MC_top4_Wdecay1_eta") = -1000;
this->auxdecor< float >("MC_top4_Wdecay1_phi") = -1000;
this->auxdecor< int >("MC_top4_Wdecay1_pdgId") = -9999;
this->auxdecor< float >("MC_top4_Wdecay2_m") = -1000;
this->auxdecor< float >("MC_top4_Wdecay2_pt") = -1000;
this->auxdecor< float >("MC_top4_Wdecay2_eta") = -1000;
this->auxdecor< float >("MC_top4_Wdecay2_phi") = -1000;
this->auxdecor< int >("MC_top4_Wdecay2_pdgId") = -9999;
// Other parton-level variables
this->auxdecor< float >("MC_mtttt") = -1000;
this->auxdecor< float >("MC_HT") = -1000;
}
}
ADD_NS_DV_PROXY(xAOD, PartonHistoryContainer);
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// $Id: CalcTopPartonHistory.h 800464 2017-03-13 18:06:24Z tpelzer $
......@@ -22,6 +22,7 @@
// system include(s):
#include <memory>
#include <vector>
#include <array>
// Framework include(s):
#include "AsgTools/AsgTool.h"
......@@ -84,6 +85,13 @@ namespace top {
TLorentzVector& t_afterFSR_p4, TLorentzVector& Ph_p4, TLorentzVector& W_p4, TLorentzVector& b_p4,
TLorentzVector& Wdecay1_p4, int& Wdecay1_pdgId, TLorentzVector& Wdecay2_p4, int& Wdecay2_pdgId,
bool& has_ph, int& BranchType, int& IniPartonType, bool& missingTop);
//// Store the parton histoiry for 4-top events
bool tttt(const xAOD::TruthParticleContainer* truthParticles, std::array<int,4> &top_pdgId,
std::array<TLorentzVector,4> &top_beforeFSR_p4, std::array<TLorentzVector,4> &top_afterFSR_p4,
std::array<TLorentzVector,4> &b_p4, std::array<TLorentzVector,4> &W_p4,
std::array<int,4> &Wdecay1_pdgId, std::array<int,4> &Wdecay2_pdgId,
std::array<TLorentzVector,4> &Wdecay1_p4, std::array<TLorentzVector,4> &Wdecay2_p4);
virtual StatusCode execute();
protected:
......
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ANALYSISTOP_TOPPARTONS_CALCTtttPARTONHISTORY_H
#define ANALYSISTOP_TOPPARTONS_CALCTtttPARTONHISTORY_H
// Framework include(s):
#include "TopPartons/CalcTopPartonHistory.h"
#include "xAODTruth/TruthParticleContainer.h"
#include "TopPartons/PartonHistory.h"
// forward declaration(s):
namespace top {
class TopConfig;
}
namespace top {
class CalcTtttPartonHistory: public CalcTopPartonHistory {
public:
explicit CalcTtttPartonHistory(const std::string& name);
virtual ~CalcTtttPartonHistory() {}
//Storing parton history for ttbar resonance analysis
CalcTtttPartonHistory(const CalcTtttPartonHistory& rhs) = delete;
CalcTtttPartonHistory(CalcTtttPartonHistory&& rhs) = delete;
CalcTtttPartonHistory& operator = (const CalcTtttPartonHistory& rhs) = delete;
void TtttHistorySaver(const xAOD::TruthParticleContainer* truthParticles, xAOD::PartonHistory* TtttPartonHistory);
virtual StatusCode execute();
private:
std::array<int,4> top_pdgId;
std::array<TLorentzVector,4> top_beforeFSR_p4;
std::array<TLorentzVector,4> top_afterFSR_p4;
std::array<TLorentzVector,4> b_p4;
std::array<TLorentzVector,4> W_p4;
std::array<int,4> Wdecay1_pdgId;
std::array<int,4> Wdecay2_pdgId;
std::array<TLorentzVector,4> Wdecay1_p4;
std::array<TLorentzVector,4> Wdecay2_p4;
};
}
#endif
......@@ -62,6 +62,7 @@ namespace xAOD {
void IniVarZ();
void IniVarTtGamma();
void IniVarThq();
void IniVarTttt();
};