Partialy working code for testpartical calculation, mostly a skeleton, from Nico (some comments may be in frence)