|
ATLAS Offline Software
|
Go to the documentation of this file.
25 const std::string&
name,
29 declareInterface<Trk::ITruthTrajectoryBuilder>(
this);
35 return StatusCode::SUCCESS;
50 std::stack<HepMC::ConstGenParticlePtr>
tmp;
59 while (!
tmp.empty()) {
81 if(vtx && (vtx->particles_in_size() == 1)) {
83 mother = vtx->particles_in().front();
85 mother = *vtx->particles_in_const_begin();
98 if (vtx->particles_out_size() <= 2) {
99 int num_passed_cuts = 0;
101 for(
const auto& candidate: *vtx) {
102 if(candidate->pdg_id() == mother->pdg_id()) {
105 if(candidate->momentum().e() > passed_cuts->momentum().e()) {
106 passed_cuts = candidate;
109 passed_cuts = candidate;
115 if(num_passed_cuts==1) {
116 daughter = passed_cuts;
123 return std::make_pair(mother, daughter);
130 if(
res.first == mother)
return res.second;
139 if(
res.second == daughter)
return res.first;
void buildTruthTrajectory(TruthTrajectory *result, const HepMC::ConstGenParticlePtr &input) const
Build a TruthTrajectory this particle belongs to.
std::pair< HepMC::ConstGenParticlePtr, HepMC::ConstGenParticlePtr > MotherDaughter
Return type for the next method.
HepMC::ConstGenParticlePtr getDaughter(const HepMC::ConstGenParticlePtr &particle) const
Returns an umambiguous daughter of the truth particle on a TruthTrajectory, or 0.
virtual StatusCode initialize()
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
std::pair< std::vector< unsigned int >, bool > res
static MotherDaughter truthTrajectoryCuts(const HepMC::ConstGenVertexPtr &vtx)
Decides if the vertex connects two particles on the same TruthTrajectory.
HepMC::ConstGenParticlePtr getMother(const HepMC::ConstGenParticlePtr &particle) const
Returns an umambiguous mother of the truth particle on a TruthTrajectory, or 0.
const GenParticle * ConstGenParticlePtr
Ensure that the ATLAS eigen extensions are properly loaded.
ElasticTruthTrajectoryBuilder(const std::string &type, const std::string &name, const IInterface *parent)
An STL vector of pointers that by default owns its pointed-to elements.
const HepMC::GenVertex * ConstGenVertexPtr