function get_tot_parts() result(allWalkersSummed)
! if the second RK step is to be compared, the reference has to be reset
! -> recount the TotParts from the restored data
implicit none
integer(int64) :: i
real(dp) :: CurrentSign(lenof_sign)
real(dp) :: allWalkersSummed(lenof_sign)
allWalkersSummed = 0.0_dp
do i = 1, TotWalkers
call extract_sign(CurrentDets(:, i), CurrentSign)
allWalkersSummed = allWalkersSummed + abs(CurrentSign)
end do
if (tStabilizerShift) then
do i = 1, inum_runs
TotPartsPeak(i) = max(allWalkersSummed(min_part_type(i)) + &
allWalkersSummed(max_part_type(i)), TotPartsPeak(i))
end do
end if
end function get_tot_parts