While the root_guess is a public function to guess the maximum, it would be a nice enhancement to make the z_max also a public function, so that the user can calculate the length or size of the trap by the same algorithm used here. At this place the public function can be used to avoid code duplication.
For the trajectory calculation the z_max is calculated in this line: https://github.com/MCFlowMace/CRESana/blob/a8b3dac53f8ba6278bd0968bf249fb5f5522905d/cresana/trap.py#L615
While the
root_guess
is a public function to guess the maximum, it would be a nice enhancement to make the z_max also a public function, so that the user can calculate thelength
orsize
of the trap by the same algorithm used here. At this place the public function can be used to avoid code duplication.