109 {
110
111 if (std::find(seen_particles.begin(),seen_particles.end(),
HepMC::uniqueID(&old_part))!=seen_particles.end()){
112 for (
size_t p=0;
p<part_cont->
size();++
p){
113
116 }
117 }
118
120
121 SG::WriteDecorHandle<xAOD::TruthParticleContainer, unsigned int > originDecorator(
m_originDecoratorKey, ctx);
122 SG::WriteDecorHandle<xAOD::TruthParticleContainer, unsigned int > typeDecorator(
m_typeDecoratorKey, ctx);
123 SG::WriteDecorHandle<xAOD::TruthParticleContainer, unsigned int > outcomeDecorator(
m_outcomeDecoratorKey, ctx);
127
130
134 xTruthParticle->
setM(old_part.
m());
135 xTruthParticle->
setPx(old_part.
px());
136 xTruthParticle->
setPy(old_part.
py());
137 xTruthParticle->
setPz(old_part.
pz());
138 xTruthParticle->
setE(old_part.
e());
139
143 }
144
145 int my_index = part_cont->
size()-1;
146 ElementLink<xAOD::TruthParticleContainer> eltp(*part_cont, my_index);
147
149 int vert_index =
addTruthVertex( ctx, *old_part.
decayVtx(), part_cont, vert_cont, seen_particles, generations);
150 ElementLink<xAOD::TruthVertexContainer> eltv( *vert_cont, vert_index );
152 (*vert_cont)[vert_index]->addIncomingParticleLink( eltp );
153 }
154
155 SG::ReadDecorHandle<xAOD::TruthParticleContainer, unsigned int > classifierParticleTypeAcc(
m_typeAccessorKey, ctx);
156 SG::ReadDecorHandle<xAOD::TruthParticleContainer, unsigned int > classifierParticleOriginAcc(
m_originAccessorKey, ctx);
157 SG::ReadDecorHandle<xAOD::TruthParticleContainer, unsigned int > classifierParticleOutcomeAcc(
m_outcomeAccessorKey, ctx);
159
160 typeDecorator(*xTruthParticle) = classifierParticleTypeAcc(old_part);
161 originDecorator(*xTruthParticle) = classifierParticleOriginAcc(old_part);
162 outcomeDecorator(*xTruthParticle) = classifierParticleOutcomeAcc(old_part);
163 classificationDecorator(*xTruthParticle) = ClassificationAcc(old_part);
164
165
166 return my_index;
167}
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.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_daughterIDDecoratorKey
int addTruthVertex(const EventContext &, const xAOD::TruthVertex &old_vert, xAOD::TruthParticleContainer *part_cont, xAOD::TruthVertexContainer *vert_cont, std::vector< int > &seen_particles, const int generations=-1) const
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeDecoratorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeAccessorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_motherIDDecoratorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_classificationAccessorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_originAccessorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_typeAccessorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_typeDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_originDecoratorKey
FIXME Using WriteDecorHandles for decorations on a Container created in the current algorithm is unne...
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_classificationDecoratorKey
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 ( )
bool is_same_particle(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same particle.
TruthParticle_v1 TruthParticle
Typedef to implementation.
bool valid() const
Check if the stored values are valid.