The code in this repository is meant to convert files created using LArCV1 into LArCV2-compatible files.
LArCV1 and LArCV2 cannot be setup in the same shell environment, so we create different processes that talk to one another through ZMQ.
The data is converted from larcv1 into a numpy array and serialized using msgpack-numpy.
The primary external dependency is CERN ROOT.
When first checking out the repository, first get the dependencies included here through submodules.
git submodule init
git submodule update
Next we need to build larlite
, larcv1
, larcv2
.
python setup.py
-
Customize the script as needed that loads larcv1 data and converts it into a dictionary of numpy arrays. See
start_server_larcv1.py
, specifically theload_data_larcv1
method near the start of the module. This module also has the name of the input file hard-coded into it. -
Modify
start_larcv2_client.py
as needed to convert the incoming numpy arrays into larcv2 data products. Seestart_larcv2_client.py
as an example. This module laos has the name of the output file hard-coded into it. -
Perform the conversion by running
python convert_larcv1_to_larcv2.py
This script just runs the server and client scripts.
Tests of the conversion processes are done with the following scripts
run_test_larcv1.py
: callstest_larcv1.sh
. Have to have a second wrapper in order to create a subprocess that won't set the shell environment permanently