|
ATLAS Offline Software
|
Go to the documentation of this file.
18 TLorentzVector ZDecay1;
19 TLorentzVector ZDecay2;
33 ttbarPartonHistory->
auxdecor<
float >(
"MC_Z_m") = Z.M();
34 ttbarPartonHistory->
auxdecor<
float >(
"MC_Z_pt") = Z.Pt();
35 ttbarPartonHistory->
auxdecor<
float >(
"MC_Z_eta") = Z.Eta();
36 ttbarPartonHistory->
auxdecor<
float >(
"MC_Z_phi") = Z.Phi();
38 ttbarPartonHistory->
auxdecor<
float >(
"MC_Zdecay1_m") = ZDecay1.M();
39 ttbarPartonHistory->
auxdecor<
float >(
"MC_Zdecay1_pt") = ZDecay1.Pt();
40 ttbarPartonHistory->
auxdecor<
float >(
"MC_Zdecay1_eta") = ZDecay1.Eta();
41 ttbarPartonHistory->
auxdecor<
float >(
"MC_Zdecay1_phi") = ZDecay1.Phi();
42 ttbarPartonHistory->
auxdecor<
int >(
"MC_Zdecay1_pdgId") = ZDecay1_pdgId;
44 ttbarPartonHistory->
auxdecor<
float >(
"MC_Zdecay2_m") = ZDecay2.M();
45 ttbarPartonHistory->
auxdecor<
float >(
"MC_Zdecay2_pt") = ZDecay2.Pt();
46 ttbarPartonHistory->
auxdecor<
float >(
"MC_Zdecay2_eta") = ZDecay2.Eta();
47 ttbarPartonHistory->
auxdecor<
float >(
"MC_Zdecay2_phi") = ZDecay2.Phi();
48 ttbarPartonHistory->
auxdecor<
int >(
"MC_Zdecay2_pdgId") = ZDecay2_pdgId;
50 ttbarPartonHistory->
auxdecor<
int >(
"MC_Z_IsOnShell") =
static_cast<int>(is_on_shell);
58 TLorentzVector* ZDecay1,
60 TLorentzVector* ZDecay2,
80 for (
const auto *
p : *truthParticles) {
81 if (!
p->isZ())
continue;
86 if (
z->nChildren() != 2)
continue;
91 for (
size_t i = 0;
i <
z->nChildren(); ++
i) {
92 const auto& child =
z->child(
i);
94 if (child->pdgId() > 0) {
95 *ZDecay1 = child->p4();
96 *ZDecay1_pdgId = child->pdgId();
99 *ZDecay2 = child->p4();
100 *ZDecay2_pdgId = child->pdgId();
108 if (hasZ)
return hasZ && hasZDecay1 && hasZDecay2;
113 for (
const auto *
p : *truthParticles) {
114 if (abs(
p->pdgId()) > 19)
continue;
115 if (
p->pdgId() < 0)
continue;
118 if (!sibling)
continue;
121 bool has_top_sibling {
124 bool has_antitop_sibling {
127 const auto&
parent =
p->parent(0);
129 for (
size_t i = 0;
i <
parent->nChildren(); ++
i) {
130 const auto* child =
parent->child(
i);
131 if (!child)
continue;
132 if (child ==
p)
continue;
133 if (child->pdgId() == 6) has_top_sibling =
true;
134 if (child->pdgId() == -6) has_antitop_sibling =
true;
135 if (has_top_sibling && has_antitop_sibling)
break;
137 if (!(has_top_sibling && has_antitop_sibling))
continue;
140 *ZDecay1_pdgId =
p->pdgId();
142 *ZDecay2 = sibling->p4();
143 *ZDecay2_pdgId = sibling->pdgId();
146 *Z_p4 = *ZDecay1 + *ZDecay2;
151 return hasZ && hasZDecay1 && hasZDecay2;
157 if (!
parent)
return nullptr;
159 for (
size_t i = 0;
i <
parent->nChildren(); ++
i) {
160 const auto& sibling_candidate =
parent->child(
i);
161 if (!sibling_candidate)
continue;
162 if (sibling_candidate->pdgId() == -
particle->pdgId()) {
163 return sibling_candidate;
173 if(
m_config->getDerivationStream() ==
"PHYS")
176 std::vector<std::string> collections = {
"TruthTop",
"TruthBosonsWithDecayParticles",
"HardScatterParticles"};
193 partonCont->setStore(partonAuxCont);
196 partonCont->
push_back(ttbarPartonHistory);
203 std::string outputSGKey =
m_config->sgKeyTopPartonHistory();
204 std::string outputSGKeyAux = outputSGKey +
"Aux.";
208 if (!
save || !saveAux) {
209 return StatusCode::FAILURE;
212 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
StatusCode buildContainerFromMultipleCollections(const std::vector< std::string > &collections, const std::string &out_contName)
used to build container from multiple collections in DAOD_PHYS we don't have the TruthParticles colle...
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
TopConfig A simple configuration that is NOT a singleton.
StatusCode linkBosonCollections()
currently in DAOD_PHYS TruthTop have links to Ws from the TruthBoson collection, which have no link t...
const xAOD::TruthParticle * getFlavourSibling(const xAOD::TruthParticle *particle)
Decorator< T, ALLOC >::reference_type auxdecor(const std::string &name) const
Fetch an aux decoration, as a non-const reference.
std::shared_ptr< top::TopConfig > m_config
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
def save(self, fileName="./columbo.out")
const xAOD::TruthParticle * findAfterFSR(const xAOD::TruthParticle *particle)
Return particle after FSR (before the decay vertex)
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
bool m_ancestry_corrupted
virtual StatusCode execute()
CalcTTZPartonHistory(const std::string &name)
void zHistorySaver(const xAOD::TruthParticleContainer *truthParticles, xAOD::PartonHistory *ttbarPartonHistory)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
void ttbarHistorySaver(const xAOD::TruthParticleContainer *truthParticles, xAOD::PartonHistory *ttbarPartonHistory)
bool getZ(const xAOD::TruthParticleContainer *truthParticles, TLorentzVector *Z, TLorentzVector *ZDecay1, int *ZDecay1_pdgId, TLorentzVector *ZDecay2, int *ZDecay2_pdgId, bool *is_on_shell)
bool hasParticleIdenticalParent(const xAOD::TruthParticle *particle)
Return true when particle is a top before FSR.