Files
2024-12-04 17:15:04 +01:00

31 lines
1.1 KiB
C++
Executable File

#ifndef RECOMBINATION_H
#define RECOMBINATION_H
#include "simulation/interaction.h"
namespace interaction {
// class for handling recombination between two simulated species (TrackedSpecies)
class Recombination : public Interaction {
public:
// Constructor: takes a function describing the energy dependent cross section
// and a shared_ptr to the TrackedSpecie that is the target in the interaction
Recombination(std::function<double(double)> cross_section,
std::shared_ptr<species::TrackedSpecie> target);
// return the result of the interaction as an InteractionOutput object
InteractionOutput performInteraction(particle::Particle& particle,
RandomNumbers* generator);
// return the cross section scaled by the density of the target at the position
// of the incident particle (units: m^{-1})
double macroscopicCrossSection(particle::Particle& particle);
private:
double macroscopicCrossSection(const Coordinate& position, const int bin_index);
std::shared_ptr<species::TrackedSpecie> recombination_target_;
};
}; // namespace interaction
#endif /* RECOMBINATION_H */