Added option for initial weights in the injector
This commit is contained in:
@@ -30,8 +30,10 @@ InteractionOutput ClusterFormation::performInteraction(
|
||||
const blitz::TinyVector<double, 3> v_cluster =
|
||||
kinematic::velocity(energy_eV, product_->mass_kg()) *
|
||||
v_target / kinematic::norm(v_target);
|
||||
// product inherits weight of the main particle (not the target, which is
|
||||
// assumed to be just a density, i.e. has no weight of its own)
|
||||
particle::Particle cluster(product_, x_impact, CartesianVector(v_cluster),
|
||||
particle.timeAlive());
|
||||
particle.timeAlive(), particle.weight());
|
||||
|
||||
InteractionOutput output;
|
||||
output.add(cluster);
|
||||
|
||||
@@ -95,12 +95,14 @@ InteractionOutput ElectronIonization::performInteraction(
|
||||
|
||||
|
||||
const double time_birth = particle.timeAlive();
|
||||
const double weight_parent = particle.weight();
|
||||
|
||||
InteractionOutput output;
|
||||
output.add(
|
||||
particle::Particle(electron_, x_impact, CartesianVector(v_ejected),
|
||||
time_birth));
|
||||
time_birth, weight_parent));
|
||||
output.add(particle::Particle(ion_, x_impact, CartesianVector(v_target),
|
||||
time_birth));
|
||||
time_birth, weight_parent));
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user