Added option for initial weights in the injector

This commit is contained in:
2024-07-31 10:35:14 +02:00
parent 961f1a2a8e
commit 4301c4453b
7 changed files with 36 additions and 12 deletions
+3 -1
View File
@@ -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);
+4 -2
View File
@@ -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;
}