There are already several files which help you to analyse root files from primasoft:
This is what they do:
/primasoft/geant4$ root -l rootmacros/test.C+
c.OpenTreeFiles("test_bwec.root","sim_ana_utilities/ana_default.conf");
If the path is relative and not absolute for the root and config file, pay attention that the relative path changes when you execute the rootmacro from a different folder.
geant4$ root -l 'rootmacros/event_display.C(“path/file.root”,eventnumber)
')