Tuesday, February 26, 2008

Convert stdhep into HEPEvt

Here are instructions and codes to convert an .stdhep file into a .HEPEvt. Two files are needed:
The first file is the FORTRAN code used for the conversion. It outputs a file called output.HEPEvt. The second file must contain the name of your input stdhep file. To compile the code you need the stdhep include directory and the libraries libstdhep.a and libFmcfio.a. You can find them as part of the old cernlib versions, like 2002. You then compile with the commands (change the location according to your setup):
g77 -I$CERN/2002/include/stdhep -fno-second-underscore -c std2evt.F
g77 -fno-second-underscore -o std2evt std2evt.o $CERN/2002/lib/libstdhep.a $CERN/2002/lib/libFmcfio.a -lnsl
I also made a script with those commands. After compiling, an executable calles std2evt is created. Modify the file stdhep_file_name with the name of your stdhep file and run:
./std2evt
Some output may be redirect to the screen but don't worry. The converted output file in called output.HEPEvt.

No comments: