I send you my macro that converts an ASCI file to root file,
conv.C (7.41 KB)
In attachment see your macro modified such that it works correctly.
The main change is:
ie you had uninitialized variables used later to count the number of particle species.
conv.C (7.68 KB)