60 lines
1.5 KiB
C++
Executable File
60 lines
1.5 KiB
C++
Executable File
#ifndef INJECTOR_H
|
|
#define INJECTOR_H
|
|
|
|
#include <map>
|
|
#include <memory>
|
|
#include <random>
|
|
#include <vector>
|
|
|
|
#include "simulation/coordinates.h"
|
|
|
|
class DriftVelocity;
|
|
class VelocityDistribution;
|
|
|
|
namespace particle {
|
|
class Particle;
|
|
}
|
|
|
|
namespace species {
|
|
class Specie;
|
|
class TrackedSpecie;
|
|
} // namespace species
|
|
|
|
class EventPositionDistribution;
|
|
|
|
struct InjectorInfo {
|
|
public:
|
|
std::shared_ptr<species::TrackedSpecie> created_specie;
|
|
std::shared_ptr<VelocityDistribution> creation_velocity_distribution;
|
|
int multiplicity;
|
|
};
|
|
|
|
class Injector {
|
|
public:
|
|
Injector(std::vector<InjectorInfo>& injector_info,
|
|
double activity,
|
|
std::shared_ptr<EventPositionDistribution> position_distribution,
|
|
std::shared_ptr<DriftVelocity> mother_drift_velocity);
|
|
|
|
std::vector<particle::Particle> rollNewParticles(std::mt19937* engine,
|
|
const double current_time,
|
|
const int time_resolution_events);
|
|
double timePassed() const;
|
|
|
|
private:
|
|
std::vector<InjectorInfo> injector_infos_;
|
|
const double activity_;
|
|
std::shared_ptr<EventPositionDistribution> position_distribution_;
|
|
std::shared_ptr<DriftVelocity> mother_drift_velocity_;
|
|
|
|
particle::Particle rollNewParticle(
|
|
std::mt19937* engine,
|
|
const Coordinate& position,
|
|
std::shared_ptr<species::TrackedSpecie> created_specie,
|
|
std::shared_ptr<VelocityDistribution> creation_velocity_distribution,
|
|
const double time_birth,
|
|
const double weight);
|
|
};
|
|
|
|
#endif /* INJECTOR_H */
|