fix mu=-1 bug
This commit is contained in:
@@ -70,6 +70,13 @@ int PitchAngleBinning::bin(double pitch_angle) const {
|
||||
auto const it = std::lower_bound(pitch_angle_bin_borders_.begin(),
|
||||
pitch_angle_bin_borders_.end(),
|
||||
pitch_angle);
|
||||
// otherwise the valid mu-value of -1 is assigned to the underflow
|
||||
// bin which can lead to a segfault in the drawing of the pitch
|
||||
// angle in "velocity_distribution.cpp"
|
||||
if(!(pitch_angle < pitch_angle_bin_borders_.front()) &&
|
||||
(it == pitch_angle_bin_borders_.begin())) {
|
||||
return (it - pitch_angle_bin_borders_.begin());
|
||||
}
|
||||
return (it - pitch_angle_bin_borders_.begin()) - 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user