You need to inspect how you define the “MC_out” tree, in particular its “ptype” and “volumeName” branches.
Try to run “
MC_out->MakeClass();” and then see the “MC_out.h” file. You will find "
Char_t ptype; and
Char_t volumeName;, which means that your names can be 4 characters long at most (plus the null character which ends the string, of course, hence at most 5 characters in total).
Moreover, you should also inspect the place where you fill these branches as it seems to me that they use uninitialized variables.
Note also that the “NaI_Scint” in the “G4Tubs” call is actually converted into a “G4String” which is basically a “std:string” (NOT a “char *”).