corrected powerlaw drawing
This commit is contained in:
@@ -240,19 +240,23 @@ CartesianVector VelocityDistributionFromDensityField::drawVelocity(
|
||||
alpha = 0;
|
||||
}
|
||||
if(alpha == -1) {
|
||||
energy_eV = (std::pow(2, theta_distribution_(*engine)) - 1)*energy_step
|
||||
+ energyBinBorders_[index(4) + 1];
|
||||
#ifdef debug
|
||||
std::stringstream out;
|
||||
out << "alpha = -1\n\tdrawn energy: " << energy_eV;
|
||||
out << "\n\tenergy value left: " << energyBinBorders_[index(4)+1];
|
||||
out << "\n\tenergy value right: " << energyBinBorders_[index(4)+2];
|
||||
DEBUG(out.str());
|
||||
#endif
|
||||
energy_eV = std::pow(energyBinBorders_[index(4) + 2]
|
||||
/ energyBinBorders_[index(4) + 1], theta_distribution_(*engine)) *
|
||||
energyBinBorders_[index(4) + 1];
|
||||
// energy_eV = (std::pow(2, theta_distribution_(*engine)) - 1)*energy_step
|
||||
// + energyBinBorders_[index(4) + 1];
|
||||
// #ifdef debug
|
||||
// std::stringstream out;
|
||||
// out << "alpha = -1\n\tdrawn energy: " << energy_eV;
|
||||
// out << "\n\tenergy value left: " << energyBinBorders_[index(4)+1];
|
||||
// out << "\n\tenergy value right: " << energyBinBorders_[index(4)+2];
|
||||
// DEBUG(out.str());
|
||||
// #endif
|
||||
} else {
|
||||
energy_eV = (std::pow((std::pow(2, alpha+1) - 1)*
|
||||
theta_distribution_(*engine) + 1, 1/(alpha + 1)) - 1)*
|
||||
energy_step + energyBinBorders_[index(4) + 1];
|
||||
double xl_alphap1 = std::pow(energyBinBorders_[index(4) + 1], alpha + 1);
|
||||
double xr_alphap1 = std::pow(energyBinBorders_[index(4) + 2], alpha + 1);
|
||||
energy_eV = std::pow((xr_alphap1 - xl_alphap1)*
|
||||
theta_distribution_(*engine) + xl_alphap1, 1/(alpha + 1));
|
||||
// #ifdef debug
|
||||
// std::stringstream out;
|
||||
// out << "alpha = "<< alpha << "\n\tdrawn energy: " << energy_eV;
|
||||
|
||||
Reference in New Issue
Block a user