8#include "TLorentzVector.h"
22 return StatusCode::SUCCESS;
31 if (evtStore()->retrieve(truth,
"TruthParticles").isFailure()) {
36 TLorentzVector
top, antitop;
38 for (
const auto* p : *truth) {
39 if (std::abs(p->pdgId()) != 6)
continue;
43 for (
unsigned int ic = 0; ic < p->nChildren(); ++ic) {
46 if (std::abs(child->
pdgId()) == 24) hasW =
true;
47 if (std::abs(child->
pdgId()) == 5) hasB =
true;
49 if (!hasW || !hasB)
continue;
52 vec.SetPtEtaPhiM(p->pt(), p->eta(), p->phi(), p->m());
53 if (p->pdgId() > 0)
top =
vec;
57 double mass_ttbar = -1.;
58 if (
top.Pt() > 0 && antitop.Pt() > 0) mass_ttbar = (
top + antitop).M();
std::vector< size_t > vec
int pdgId() const
PDG ID code.
TruthParticle_v1 TruthParticle
Typedef to implementation.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.