Many, many more comments

This commit is contained in:
2024-12-04 17:15:04 +01:00
parent 8696517336
commit 03854339ca
100 changed files with 1702 additions and 49 deletions
@@ -7,6 +7,7 @@
#include "simulation/coordinates.h"
#include "simulation/scalar_field.h"
// structure for storing a minimum and maximum value
struct Limit {
Limit() : min(0), max(0){};
Limit(double min, double max) : min(min), max(max){};
@@ -14,19 +15,28 @@ struct Limit {
double max;
};
// class for drawing positions
class EventPositionDistribution {
public:
// Constructor: takes a shared_ptr to a ScalarField used as the distribution to be drawn from
// a Limit density containing the maximum value of the mother_density within the position limits (used for rejection method)
// a Limit r_position defining the region in r-direction, where positions are drawn from
// a Limit z_position defining the region in z-direction, where positions are drawn from
// a Limit phi_position defining the region in phi-direction, where positions are drawn from
EventPositionDistribution(std::shared_ptr<ScalarField> mother_density,
Limit density,
Limit r_position,
Limit phi_position,
Limit z_position);
// draw a position from the ScalarField using the given mt19937 engine pointer as a CylinderCoordinate
// using the rejection method
CylinderCoordinate rollPosition(std::mt19937* engine);
private:
// ScalarField defining the distribution
std::shared_ptr<ScalarField> mother_density_;
// for Rejection method
// distribution functions drawn to be drawn from in the rejection method
std::uniform_real_distribution<double> r_values;
std::uniform_real_distribution<double> z_values;
std::uniform_real_distribution<double> phi_values;