ATLAS Offline Software
Loading...
Searching...
No Matches
ISFTruthIncident.cxx File Reference
Include dependency graph for ISFTruthIncident.cxx:

Go to the source code of this file.

Functions

static HepMC::GenParticlePtr ParticleHelper_convert (const ISF::ISFParticle &particle)

Function Documentation

◆ ParticleHelper_convert()

HepMC::GenParticlePtr ParticleHelper_convert ( const ISF::ISFParticle & particle)
static

Definition at line 19 of file ISFTruthIncident.cxx.

19 {
20
21 const Amg::Vector3D &mom = particle.momentum();
22 double mass = particle.mass();
23 double energy = std::sqrt( mom.mag2() + mass*mass);
24 HepMC::FourVector fourMomentum( mom.x(), mom.y(), mom.z(), energy);
25
26 auto hepParticle = HepMC::newGenParticlePtr( fourMomentum, particle.pdgCode(), particle.status() );
27#ifndef HEPMC3
28 HepMC::suggest_barcode(hepParticle, particle.barcode() );
29#endif
30 // return a newly created GenParticle
31 return hepParticle;
32}
Eigen::Matrix< double, 3, 1 > Vector3D
bool suggest_barcode(T &p, int i)
Definition GenEvent.h:672
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
Definition GenParticle.h:39
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses