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