Your “TotIon.C” is not a runnable macro (it does not define a “TotIon” function), so you should not try to execute it at root startup (i.e., just run “root -l”).
You can load this file at startup: root -l -e '.L TotIon.C'
and then: root [1] TotIon m; m.Loop();
or simply: root -l -e '.L TotIon.C' -e 'TotIon m; m.Loop();'