I wondered if someone already implemented the triangle algorithm to
determine the threshold.
Triangle algorithm is based on histogram interpretation:
First a linear line is drawn between the maximum and minimum number of
events.
Then a perpendicular line is drawn to this linear line.
At the point where the length of this perpendicular line is the largest
(distance between the linear line and the histogram values) the
threshold is set.