27 const int generations) {
32 int myIndex = vertCont->
size()-1;
37 xTruthVertex->
setX(oldVert.
x());
38 xTruthVertex->
setY(oldVert.
y());
39 xTruthVertex->
setZ(oldVert.
z());
40 xTruthVertex->
setT(oldVert.
t());
42 if (generations==0)
return myIndex;
49 (*partCont)[partIndex]->setProdVtxLink( eltv );
57 const int generations,
bool includeVertex) {
59 if (std::find(seenParticles.begin(), seenParticles.end(),
HepMC::uniqueID(&oldPart)) != seenParticles.end()){
60 for (
size_t p=0;p<partCont->
size();++p){
71 int myIndex = partCont->
size()-1;
78 (*vertCont)[vertIndex]->addIncomingParticleLink( eltp );
103 xTruthParticle->
setM(oldPart.
m());
104 xTruthParticle->
setPx(oldPart.
px());
105 xTruthParticle->
setPy(oldPart.
py());
106 xTruthParticle->
setPz(oldPart.
pz());
107 xTruthParticle->
setE(oldPart.
e());
114 typeDecorator(*xTruthParticle) = classifierParticleTypeAcc.
withDefault(oldPart, 0);
115 originDecorator(*xTruthParticle) = classifierParticleOriginAcc.
withDefault(oldPart, 0);
116 outcomeDecorator(*xTruthParticle) = classifierParticleOutComeAcc.
withDefault(oldPart, 0);
117 return xTruthParticle;
Helper class to provide constant type-safe access to aux data.
ATLAS-specific HepMC functions.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
static int addTruthVertex(const xAOD::TruthVertex &oldVert, xAOD::TruthParticleContainer *partCont, xAOD::TruthVertexContainer *vertCont, std::vector< int > &seenParticles, const int generations)
Helper function to set up a truth particle based on an old particle.
static xAOD::TruthParticle * setupTruthParticle(const xAOD::TruthParticle &oldPart, xAOD::TruthParticleContainer *partCont)
static int addTruthParticle(const xAOD::TruthParticle &oldPart, xAOD::TruthParticleContainer *partCont, xAOD::TruthVertexContainer *vertCont, std::vector< int > &seenParticles, const int generations, bool includeVertex=true)
< Helper function to add truth particles to a collection
ElementLink implementation for ROOT usage.
Helper class to provide constant type-safe access to aux data.
const_reference_type withDefault(const ELT &e, const T &deflt) const
Fetch the variable for one element, as a const reference, with a default.
Helper class to provide type-safe access to aux data.
void setPy(float value)
Set the y component of the particle's momentum.
int status() const
Status code.
void setUid(int value)
Set unique ID.
void setM(float value)
Also store the mass.
virtual double m() const override final
The mass of the particle.
void setE(float value)
Set the energy of the particle.
int pdgId() const
PDG ID code.
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
Polarization polarization() const
Retrieve a full Polarization with a single call.
void setPz(float value)
Set the z component of the particle's momentum.
float px() const
The x component of the particle's momentum.
bool hasDecayVtx() const
Check for a decay vertex on this particle.
virtual double e() const override final
The total energy of the particle.
bool setPolarizationParameter(float value, PolParam parameter)
Set method for polarization parameter values.
void setDecayVtxLink(const ElementLink< TruthVertexContainer > &link)
Set the decay vertex of the particle.
float py() const
The y component of the particle's momentum.
void setStatus(int value)
Set status code.
void setPdgId(int pid)
Set PDG ID code.
void setPx(float value)
Set the x component of the particle's momentum.
bool polarizationParameter(float &value, PolParam parameter) const
Accessor for polarization parameters.
float pz() const
The z component of the particle's momentum.
@ polarizationPhi
Polarization in ( )
@ polarizationTheta
Polarization in ( )
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
void addOutgoingParticleLink(const TPLink_t &link)
Add one outgoing particle.
float z() const
Vertex longitudinal distance along the beam line form the origin.
void setStatus(int value)
Set the vertex status.
void setZ(float value)
Set the vertex's longitudinal distance from the origin.
float y() const
Vertex y displacement.
void setUid(int value)
Set the vertex unique ID.
float t() const
Vertex time.
size_t nOutgoingParticles() const
Get the number of outgoing particles.
void setT(float value)
Set the vertex time.
float x() const
Vertex x displacement.
void setX(float value)
Set the x displacement of the vertex.
void setY(float value)
Set the y displacement of the vertex.
bool is_same_particle(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same particle.
TruthVertex_v1 TruthVertex
Typedef to implementation.
TruthVertexContainer_v1 TruthVertexContainer
Declare the latest version of the truth vertex container.
TruthParticle_v1 TruthParticle
Typedef to implementation.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
bool valid() const
Check if the stored values are valid.