From solidwiki
Revision as of 19:03, 3 December 2020 by Saw (Talk | contribs) (Created 02/02/11(Simona), Last modified 05/21/13(Zwzhao))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


GEMC has two output format for now, txt and evio which is Jlab DAQ format

for text format, it's easy to see it from any output file.

for evio format, it's a bank format refer to https://clas12svn.jlab.org/repos/trunk/clas12/evio/

evio can be convert to root.

direct root output is on the agenda.

program covert evio to root

program "banks" is recommended as a general tool.

program "gemc_evio2root" can be used as a simple alternative.


Location of package

How to run it

  • Set the appropriate environment with: setenv JLAB_ROOT /site/12gev_phys and source $JLAB_ROOT/ce/jlab.csh
  • Compile the package with: scons
The executables are located in the bin directory

What can the current version do for you?

There are four executables in the bin directory and I will exemplify what they do using a evio output file that Zhiwen produced with SoLID GEMC:

(note from Zhiwen: for the output file, I used only baffle as FLUX type sensitive detector with option -BEAM_P="e-, 11*GeV, 60*deg, 0*deg")

  • banks_example1: this needs as argument the name of the database and lists on the screen the banks
./bin/banks_example1 clas12_banks
Loading bank definitions from clas12_banks
Bank <BMT> loaded with id 460
Bank <BST> loaded with id 400
  • banks_example2: this needs as arguments the evio file name and the bank name and will print on the screen all the variables from the bank specified.
./bin/banks_example2 output.ev FLUX
>> Event number: 10
ETot: 31.9338 31.4093 0 1.41605 0 0.482844 3.49607 1.08118 0 1.50174 ...
<x>: 720.504 1223.97 1289.92 1243.55 1289.86 1214.5 1204.92 ...
  • banks_example3: this needs as arguments the evio file name, the bank name and the variable name and it will print only the variable specified at the command line.
./bin/banks_example3 output.ev FLUX ETot
>> Event number: 10
FLUX, ETot: 31.9338 31.4093 0 1.41605 0 0.482844 3.49607 ...
  • banks_example4: this will convert the evio file to root and it needs as arguments the evio file name and the bank name
./bin/banks_example4 output.ev FLUX
I used it to convert the evio file that Zhiwen sent me and it worked fine. Below I attach 2 picures that I got from the root file:
total energy deposited from SoLID GEMC root output file
number of events from SoLID GEMC root output file

Room for improvement

Currently the program that converts evio to root needs to have put in by hand the bank variables that the user wants in the root Tree. Ideally, the conversion program should be smart enough to avoid that.


this will convert EXISTING CLAS12 output banks.

As SoLID is borrowing some of CLAS12 output banks, you can use it too. eg. FLUX bank.

It's available on ifarm like gemc.

If you want a local copy, run "go_gemc_evio2root" to download and compile from the "sourcebuild" directory

After setting up GEMC env, you can run "gemc_evio2root a.evio a.root"

Currently gemc_evio2root has a bug, it create a root tree with starting index 1 while it should be 0. So a evio file with 1000 events will has a root tree 1001 entries and the 0 entry is empty, ask Zhiwen Zhao zwzhao@jlab.org to check if it's fixed.