#ifndef INJECTOR_H #define INJECTOR_H #include #include #include #include #include "simulation/coordinates.h" // defined in "simulation/drift_velocity.h" class DriftVelocity; // defined in "simulation/veloctiy_distribution.h" class VelocityDistribution; // defined in "simulation/particle.h" namespace particle { class Particle; } // defined in "simulation/species.h" namespace species { class Specie; class TrackedSpecie; } // namespace species // defined in "simulation/event_position_distribution.h" class EventPositionDistribution; // structure storing information about particles that are injected by the injector // conains the TrackedSpecie of the particle and its veloctiy distribution struct InjectorInfo { public: std::shared_ptr created_specie; std::shared_ptr creation_velocity_distribution; }; // class handling injection of event particles (i.e. particles from the tritium beta decay) class Injector { public: // Constructor: takes a vector of InjectorInfo objects defining the particles that are supposed to be injected at invocation of the Injector object // the activity of the simulation volume (units 1/s) defines the "timestep" (i.e. 1/activity) // an EventPositionDistribution defining the valid space of the simulation domain where particles can be created // a DriftVelocity object defining the bulk motion the injected particles are created with (regardless of specie), can be null Injector(std::vector& injector_info, double activity, std::shared_ptr position_distribution, std::shared_ptr mother_drift_velocity); // return a vector with the particles defined in the InjectorInfo vector using the random engine object std::vector rollNewParticles(std::mt19937* engine); // return average time between events (1/activity) double timePassed() const; private: std::vector injector_infos_; const double activity_; std::shared_ptr position_distribution_; std::shared_ptr mother_drift_velocity_; // draw a single particle of species created_specie with a velocity distribution creation_velocity_distribution // at the Coordinate position using the random engine engine particle::Particle rollNewParticle( std::mt19937* engine, const Coordinate& position, std::shared_ptr created_specie, std::shared_ptr creation_velocity_distribution); }; #endif /* INJECTOR_H */