![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
16 bool isAfterGamma(
false);
17 const int particle_ID =
particle->pdgId();
20 while (!isAfterGamma) {
22 for (
size_t j = 0; j <
particle->nChildren(); j++) {
24 if (tmp_children && tmp_children->
pdgId() == particle_ID && tmp_children->
pdgId() != 22) {
31 if (forLoop == 0) isAfterGamma =
true;
39 if (!
parent)
return nullptr;
41 for (
size_t i=0;
i<
parent->nChildren(); ++
i)
43 const auto & sibling_candidate =
parent->child(
i);
44 if (!sibling_candidate)
continue;
45 if (sibling_candidate->pdgId() == -
particle->pdgId())
47 return sibling_candidate;
80 for (
size_t k = 0;
k <
particle->nChildren();
k++) {
83 if (ZChildren->
pdgId() > 0) {
103 if (std::abs(
particle->pdgId()) > 19)
continue;
104 if (
particle->pdgId() < 0)
continue;
105 if (
particle->nParents() != 1)
continue;
108 if (
parent->pdgId() != 23)
continue;
110 if (!sibling)
continue;
141 for (
size_t k = 0;
k <
particle->nChildren();
k++) {
143 if (ZChildren->
pdgId() > 0) {
177 if (std::abs(
particle->pdgId()) != 6)
continue;
184 for (
size_t i=0;
i<
parent->nChildren();
i++)
187 if (!child)
continue;
188 if (std::abs(child->
pdgId()) == 6)
continue;
189 if (child->
pdgId() == 23)
202 else if (std::abs(child->
pdgId()) == 5)
207 else if (std::abs(child->
pdgId()) < 5)
213 else if (child->
pdgId() == 25 )
223 if (child->
pdgId() < 0)
continue;
224 if (child->
pdgId() > 19)
continue;
226 if (!sibling)
continue;
249 if (foundZ&&foundQ)
return true;
257 return (foundZ&&foundQ);
261 TLorentzVector &Wdecay1_p4,
int &Wdecay1_pdgId,
262 TLorentzVector &Wdecay2_p4,
int &Wdecay2_pdgId)
264 bool hasWdecayProd1 =
false;
265 bool hasWdecayProd2 =
false;
276 if (std::abs(
p->pdgId()) < 17)
280 Wdecay1_p4 =
p->p4();
281 Wdecay1_pdgId =
p->pdgId();
282 hasWdecayProd1 =
true;
286 Wdecay2_p4 =
p->p4();
287 Wdecay2_pdgId =
p->pdgId();
288 hasWdecayProd2 =
true;
291 if (hasWdecayProd1 && hasWdecayProd2)
return true;
300 TLorentzVector &t_beforeFSR_p4, TLorentzVector &t_afterFSR_p4,
301 TLorentzVector &W_p4, TLorentzVector &b_p4, TLorentzVector &Wdecay1_p4,
302 int &Wdecay1_pdgId, TLorentzVector &Wdecay2_p4,
int &Wdecay2_pdgId)
307 bool hasWdecayProd1 =
false;
308 bool hasWdecayProd2 =
false;
312 if (std::abs(
particle->pdgId()) != 6)
continue;
321 for (
size_t j=0; j<
particle->nChildren(); j++)
324 if (!child)
continue;
325 if (std::abs(child->
pdgId()) == 24)
333 if (!Wchild)
continue;
334 if (std::abs(Wchild->
pdgId()) < 17)
336 if (Wchild->
pdgId() > 0)
338 Wdecay1_p4 = Wchild->
p4();
339 Wdecay1_pdgId = Wchild->
pdgId();
340 hasWdecayProd1 =
true;
344 Wdecay2_p4 = Wchild->
p4();
345 Wdecay2_pdgId = Wchild->
pdgId();
346 hasWdecayProd2 =
true;
351 else if (std::abs(child->
pdgId()) == 5)
357 if (hasT && hasW && hasB && hasWdecayProd1 && hasWdecayProd2)
return true;
360 if (!hasWdecayProd1 || !hasWdecayProd2)
362 hasWdecayProd1 = hasWdecayProd2 =
FindLostW(truthParticles, Wdecay1_p4, Wdecay1_pdgId, Wdecay2_p4, Wdecay2_pdgId);
365 return (hasT && hasW && hasB && hasWdecayProd1 && hasWdecayProd2);
371 TLorentzVector t_before, t_after, t_after_SC;
374 TLorentzVector WpDecay1;
375 TLorentzVector WpDecay2;
376 int WpDecay1_pdgId{};
377 int WpDecay2_pdgId{};
380 WpDecay2, WpDecay2_pdgId);
383 WpDecay1_pdgId, WpDecay2, WpDecay2_pdgId);
386 if (!event_top && !event_topbar) {
390 WpDecay1, WpDecay1_pdgId,
391 WpDecay2, WpDecay2_pdgId);
398 if (event_top || event_topbar) {
400 fillEtaBranch(TzqPartonHistory,
"MC_t_beforeFSR_eta", t_before);
403 fillEtaBranch(TzqPartonHistory,
"MC_t_afterFSR_eta", t_after);
405 if (event_top_SC || event_topbar_SC) {
407 fillEtaBranch(TzqPartonHistory,
"MC_t_afterFSR_SC_eta", t_after_SC);
416 TzqPartonHistory->
auxdecor<
int >(
"MC_Wdecay1_from_t_pdgId") = WpDecay1_pdgId;
417 fillEtaBranch(TzqPartonHistory,
"MC_Wdecay1_from_t_eta", WpDecay1);
420 TzqPartonHistory->
auxdecor<
int >(
"MC_Wdecay2_from_t_pdgId") = WpDecay2_pdgId;
421 fillEtaBranch(TzqPartonHistory,
"MC_Wdecay2_from_t_eta", WpDecay2);
470 if(
m_config->getDerivationStream() ==
"PHYS")
473 std::vector<std::string> collections = {
"TruthTop",
"TruthBosonsWithDecayParticles",
"HardScatterParticles"};
490 partonCont->setStore(partonAuxCont);
499 std::string outputSGKey =
m_config->sgKeyTopPartonHistory();
500 std::string outputSGKeyAux = outputSGKey +
"Aux.";
504 if (!
save || !saveAux) {
505 return StatusCode::FAILURE;
508 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
TLorentzVector Zdecay1_tauvis_p4
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...
int Zdecay2_tau_isHadronic
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...
bool FindLostTop(const xAOD::TruthParticleContainer *truthParticles, 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 Zdecay2_p4
void FillZ(const xAOD::TruthParticle *particle)
Decorator< T, ALLOC >::reference_type auxdecor(const std::string &name) const
Fetch an aux decoration, as a non-const reference.
virtual StatusCode execute()
std::shared_ptr< top::TopConfig > m_config
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
CalcTzqPartonHistory(const std::string &name)
const xAOD::TruthParticle * findAfterGamma(const xAOD::TruthParticle *particle)
def save(self, fileName="./columbo.out")
bool b(const xAOD::TruthParticleContainer *truthParticles, TLorentzVector &b_beforeFSR, TLorentzVector &b_afterFSR)
Store the four-momentum of b (not from tops_ before and after FSR.
const xAOD::TruthParticle * findAfterFSR(const xAOD::TruthParticle *particle)
Return particle after FSR (before the decay vertex)
bool TauIsHadronic(const xAOD::TruthParticle *tau, bool &isOk)
Check if tau decays hadronically or not.
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
TLorentzVector Zdecay2_tauvis_p4
bool bottom(const xAOD::TruthParticleContainer *truthParticles, int start)
bool topAfterFSR_SC(const xAOD::TruthParticleContainer *truthParticles, int start, TLorentzVector &top_afterFSR_SC_p4)
Store the four-momentum of the post-FSR top or anti-top found using statusCodes This would only work ...
bool Zllqq(const xAOD::TruthParticleContainer *truthParticles, int start)
Store the four-momentum of several particles in the Z decay chain.
const xAOD::TruthParticle * getFlavourSibling(const xAOD::TruthParticle *particle)
int Zdecay1_tau_isHadronic
size_t nChildren() const
Number of children of this particle.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
bool FindTZQVertex(const xAOD::TruthParticleContainer *truthParticles)
TLorentzVector Zdecay1_p4
int status() const
Status code.
const TruthParticle_v1 * child(size_t i=0) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
struct top::CalcTzqPartonHistory::tZ_values tZ
bool FindLostZ(const xAOD::TruthParticleContainer *truthParticles)
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)
Store the four-momentum of several particles in the top decay chain.
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
void fillEtaBranch(xAOD::PartonHistory *partonHistory, std::string branchName, TLorentzVector &tlv)
int pdgId() const
PDG ID code.
bool FindLostW(const xAOD::TruthParticleContainer *truthParticles, TLorentzVector &Wdecay1_p4, int &Wdecay1_pdgId, TLorentzVector &Wdecay2_p4, int &Wdecay2_pdgId)
bool hasParticleIdenticalParent(const xAOD::TruthParticle *particle)
Return true when particle is a top before FSR.
void TZHistorySaver(const xAOD::TruthParticleContainer *truthParticles, xAOD::PartonHistory *TzqPartonHistory)
void decorateWithMPtPhi(xAOD::PartonHistory *pHistory, const std::string &prefix, const TLorentzVector &vec)
Perform decoration M, Pt, Phi of the history from a TLorentzVector.