|
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()) {
89 if(vtx && (vtx->particles_in_size() == 1) && (vtx->particles_out_size() <= 2) ) {
92 mother = vtx->particles_in().front();
94 mother = *vtx->particles_in_const_begin();
99 int num_passed_cuts = 0;
102 if(candidate->pdg_id() == mother->pdg_id()) {
105 if(candidate->momentum().e() > passed_cuts->momentum().e()) {
106 passed_cuts = candidate;
110 passed_cuts = candidate;
115 else if(std::abs(candidate->pdg_id()) == 13){
116 passed_cuts = candidate;
121 if(num_passed_cuts==1) {
122 daughter = passed_cuts;
127 return std::make_pair(mother, daughter);
134 if(
res.first == mother)
return res.second;
143 if(
res.second == daughter)
return res.first;
HepMC::ConstGenParticlePtr getDaughter(const HepMC::ConstGenParticlePtr &particle) const
Returns an umambiguous daughter of the truth particle on a TruthTrajectory, or 0.
DecayInFlyTruthTrajectoryBuilder(const std::string &type, const std::string &name, const IInterface *parent)
void buildTruthTrajectory(TruthTrajectory *result, const HepMC::ConstGenParticlePtr &input) const
Build a TruthTrajectory this particle belongs to.
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)
static MotherDaughter truthTrajectoryCuts(const HepMC::ConstGenVertexPtr &vtx)
Decides if the vertex connects two particles on the same TruthTrajectory.
std::pair< std::vector< unsigned int >, bool > res
const GenParticle * ConstGenParticlePtr
Ensure that the ATLAS eigen extensions are properly loaded.
std::pair< HepMC::ConstGenParticlePtr, HepMC::ConstGenParticlePtr > MotherDaughter
Return type for the next method.
An STL vector of pointers that by default owns its pointed-to elements.
HepMC::ConstGenParticlePtr getMother(const HepMC::ConstGenParticlePtr &particle) const
Returns an umambiguous mother of the truth particle on a TruthTrajectory, or 0.
const HepMC::GenVertex * ConstGenVertexPtr