Fixed to state that drawing from density works.

Some debugging elements not removed.
This commit is contained in:
2024-08-12 14:20:45 +02:00
parent b57f6ff201
commit 9dda12b60a
13 changed files with 100 additions and 31 deletions
+15 -6
View File
@@ -183,14 +183,17 @@ void DynamicDensityField::initPositionDistributions() {
auto zbins = position_binning_.longitudinal_binning.binBorders();
auto phibins = position_binning_.azimuth_binning.binBorders();
rmin = *(rbins.begin());
rmax = *(rbins.end());
rmin = rbins.front();
rmax = rbins.back();
DEBUG_LEVEL_3("rmax: " + std::to_string(rmax));
zmin = *(zbins.begin());
zmax = *(zbins.end());
zmin = zbins.front();
zmax = zbins.back();
DEBUG_LEVEL_3("zmax: " + std::to_string(zmax));
phimin = *(phibins.begin());
phimax = *(phibins.end());
phimin = phibins.front();
phimax = phibins.back();
DEBUG_LEVEL_3("phimax: " + std::to_string(phimax));
r_dist_ = std::uniform_real_distribution<double>(rmin*rmin, rmax*rmax);
phi_dist_ = std::uniform_real_distribution<double>(phimin, phimax);
@@ -206,6 +209,7 @@ blitz::TinyVector<double, 4> DynamicDensityField::drawPositionAndEnergy(
std::mt19937* engine) {
// if the density is empty, then return a TinyVector filled with 0s as
// an indiction of that (probably not the best solution)
recalculateDensityArray();
if (isEqual(blitz::max(density_per_m3_), 0.)) {
DEBUG_LEVEL_3("Density is empty");
return blitz::TinyVector<double, 4> (0,0,0,0);
@@ -245,6 +249,7 @@ blitz::TinyVector<double, 4> DynamicDensityField::drawPositionAndEnergy(
densityAtPosition.begin());
random_E = E_dist_(*engine);
DEBUG_LEVEL_3("energy: " + std::to_string(random_E));
return blitz::TinyVector<double, 4> (random_r, random_phi, random_z, random_E);
}
@@ -288,6 +293,10 @@ double DynamicDensityField::physicalTime() const {
return timer_->time();
}
double DynamicDensityField::timeResolution() const {
return timer_->getDeltaT();
}
void DynamicDensityField::resetDynamicDensityField() {
//timer_->resetTime(); // time stays global
time_in_bin_s_ = 0.;