Problem 1847 - writing material properties broken after 100 characters
Summary: writing material properties broken after 100 characters
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: persistency/gdml (show other problems)
Version: 10.1
Hardware: All All
: P5 trivial
Assignee: Witold.Pokorski
URL:
Depends on:
Blocks:
 
Reported: 2016-03-16 16:07 CET by Martin Ritter
Modified: 2016-03-22 09:54 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Martin Ritter 2016-03-16 16:07:19 CET
When exporting a geometry with GDMLParser the material property values are broken after 100 characters.

The problem is in G4GDMLWrite.cc as the transcode() has a max chars value of 99 so even though the tempStr has space for 10000 characters only up to the first 100 are valid, the rest contains random characters like in the following example

<define>
    <matrix coldim="2" name="RINDEX" values="1e-06 1.00027 2e-06 1.00028 3e-06 1.00028 4e-06 1.00029"/>
    <matrix coldim="2" name="ABSLENGTH" values="1.4e-06 3.45407e+06 1.5e-06 2.62107e+06 1.6e-06 2.02471e+06 1.7e-06 1.58872e+06 1.8e-06 1.26402e+06䅁⭐牋朱䅁䅁䅂[continues up to the correct length...]"/>
</define>

increasing the max_chars in the transcode() calls fixes the problem.
Comment 1 Witold.Pokorski 2016-03-22 09:54:50 CET
Thanks a lot for reporting this.
I have increased max_chars to 9999. I hope this solves the problem.

Cheers,
Witek