From 34b3d958d10e39da3d19d1f93b9f4330776253e1 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Mon, 23 Sep 2019 09:16:46 -0500 Subject: add sub_run variable to the events array in the HDF5 file This commit adds the sub_run variable to the ev array in the HDF5 output file and updates plot-energy to order the events using the run and sub_run variables. This fixes a potential issue where I was sorting by GTID before, but the GTID can wrap around and so isn't guaranteed to put the events in the right order. --- src/hdf5_utils.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/hdf5_utils.c') diff --git a/src/hdf5_utils.c b/src/hdf5_utils.c index 05d1002..2a8f396 100644 --- a/src/hdf5_utils.c +++ b/src/hdf5_utils.c @@ -102,6 +102,7 @@ int save_output(const char *output, HDF5Event *hdf5_events, size_t nevents, HDF5 */ hdf5_events_tid = H5Tcreate(H5T_COMPOUND, sizeof(HDF5Event)); H5Tinsert(hdf5_events_tid, "run", HOFFSET(HDF5Event, run), H5T_NATIVE_INT); + H5Tinsert(hdf5_events_tid, "sub_run", HOFFSET(HDF5Event, sub_run), H5T_NATIVE_INT); H5Tinsert(hdf5_events_tid, "evn", HOFFSET(HDF5Event, evn), H5T_NATIVE_INT); H5Tinsert(hdf5_events_tid, "gtr", HOFFSET(HDF5Event, gtr), H5T_NATIVE_DOUBLE); H5Tinsert(hdf5_events_tid, "nhit", HOFFSET(HDF5Event, nhit), H5T_NATIVE_INT); -- cgit