57 std::vector<TauolaParticle*>::iterator dIter = daughters.begin();
59 for(; dIter != daughters.end(); dIter++)
64 while(
m_particle->end_vertex()->particles_out().size())
66 m_particle->end_vertex()->remove_particle_out(
m_particle->end_vertex()->particles_out().front());
73 for(
unsigned int i=0;i<daughters.size();i++)
88 GenVertexPtr production_vertex = part->end_vertex();
89 GenVertexPtr orig_production_vertex = production_vertex;
94 if(!production_vertex){
95 production_vertex = make_shared<GenVertex>();
96 FourVector point = part->production_vertex()->position();
97 production_vertex->set_position(point);
98 part->parent_event()->add_vertex(production_vertex);
102 vector<TauolaParticle*>::iterator mother_itr;
103 for(mother_itr = mothers.begin(); mother_itr != mothers.end();
109 if(moth->end_vertex()!=orig_production_vertex)
110 Log::Fatal(
"Mother production_vertices point to difference places. Can not override. Please delete vertices first.",1);
112 production_vertex->add_particle_in(moth);
118 production_vertex->add_particle_out(
m_particle);
125 Log::Fatal(
"New particle needs the event set before it's daughters can be added",2);
128 if(daughters.size()>0){
133 GenParticlePtr first_daughter;
136 GenVertexPtr end_vertex;
137 end_vertex=first_daughter->production_vertex();
138 GenVertexPtr orig_end_vertex = end_vertex;
141 end_vertex = make_shared<GenVertex>();
142 m_particle->parent_event()->add_vertex(end_vertex);
146 vector<TauolaParticle*>::iterator daughter_itr;
147 for(daughter_itr = daughters.begin(); daughter_itr != daughters.end();
154 if(daug->production_vertex()!=orig_end_vertex)
155 Log::Fatal(
"Daughter production_vertices point to difference places. Can not override. Please delete vertices first.",3);
157 end_vertex->add_particle_out(daug);
239 double lifetime = Tauola::tau_lifetime * (-log( Tauola::randomDouble() ));
240 FourVector tau_momentum =
m_particle->momentum();
242 double mass = sqrt(abs( tau_momentum.e()*tau_momentum.e()
243 - tau_momentum.px()*tau_momentum.px()
244 - tau_momentum.py()*tau_momentum.py()
245 - tau_momentum.pz()*tau_momentum.pz()
249 FourVector previous_position =
m_particle->production_vertex()->position();
252 FourVector new_position(previous_position.x()+tau_momentum.px()/mass*lifetime,
253 previous_position.y()+tau_momentum.py()/mass*lifetime,
254 previous_position.z()+tau_momentum.pz()/mass*lifetime,
255 previous_position.t()+tau_momentum.e() /mass*lifetime);
258 m_particle->end_vertex()->set_position(new_position);
277 int pdg_id,
int status,
double mass,
278 double px,
double py,
double pz,
double e){
281 new_particle->getHepMC3()->set_pid(pdg_id);
282 new_particle->getHepMC3()->set_status(status);
283 new_particle->getHepMC3()->set_generated_mass(mass);
285 FourVector momentum(px,py,pz,e);
286 new_particle->getHepMC3()->set_momentum(momentum);
Interface to GenParticle objects.
Abstract base class for particle in the event. This class also handles boosting.
std::vector< TauolaParticle * > getDaughters()
void setStatus(int statu)
void setMothers(std::vector< TauolaParticle * > mothers)
GenParticlePtr getHepMC3()
std::vector< TauolaParticle * > m_mothers
std::vector< TauolaParticle * > m_created_particles
void setDaughters(std::vector< TauolaParticle * > daughters)
void checkMomentumConservation()
void recursiveSetPosition(GenParticlePtr p, FourVector pos)
std::vector< TauolaParticle * > getMothers()
TauolaHepMC3Particle * createNewParticle(int pdg_id, int status, double mass, double px, double py, double pz, double e)
void setMass(double mass)
std::vector< TauolaParticle * > m_daughters
void setPdgID(int pdg_id)