Binary file output

Hello!

I have a rather small problem. Could anyone let me know of a way to write a binary output file using a root macro. I am trying to make a conversion to the listmode format.

Thanks,
Sonal

Hi,
I don’t know listmode, but google found this: www-aix.gsi.de/~bio/DOCS/TRAX/DO … mtlmd.html shows you the structs to use. You can then simply construct an ofstream with the ios::binary flags. If that doesn’t tell you anything just ask google on “c++ binary write”.

If this doesn’t help you then you might want to ask the listmode guys on how to write data with their format. I mean - would you ask the listmode guys if you wanted to know how to create a root file? :wink:
Axel.

thanks axel,
i did try the google search of binary c++ earlier. thought there might be a standard format in root, since i am trying to convert a root output file into listmode.
:slight_smile:

[quote=“Axel”]Hi,
I don’t know listmode, but google found this: www-aix.gsi.de/~bio/DOCS/TRAX/DO … mtlmd.html shows you the structs to use. You can then simply construct an ofstream with the ios::binary flags. If that doesn’t tell you anything just ask google on “c++ binary write”.

If this doesn’t help you then you might want to ask the listmode guys on how to write data with their format. I mean - would you ask the listmode guys if you wanted to know how to create a root file? :wink:
Axel.[/quote]