I am converting a geometry in ROOT to GDML. However when I do this the names of the volumes in the GDML file receive numbers following them for example CPT in the root description becomes CPT_38400112 in the GDML file. I do not understand where these numbers come from but I do not want them. How is it possible to export to GDML without any change of the names?
I still dont know why the gdml conversion process from root add’s these numbers to every variable, and therefore the only solution I came up with was a perl script something like…
#!/usr/bin/perl -w
open (OLDFILE, "old_file.gdml");
open (NEWFILE, '>new_file.gdml');
while (<OLDFILE>) {
$pattern = '([C]+[P]+[T]+\d)([_]+\d+\d+\d+\d+\d+\d+\d+\d)';
if (/$pattern/)
{ print "Grabbed pattern: \$1 = $1 \$2 = $2 \n";
s/$2//g;
}
print NEWFILE $_;
}
close OLDFILE;
close NEWFILE;
This doesnt give much insight into why gdml adds these numbers but is a solution for anyone else who comes across this.
Hi,
Your help would be quite welcome. We are not maintaining anymore the python writer. The pointers are used to avoid name clashes since in geometry one can have different objects sharing the same name. This is the easiest solution.