Skip to content

Awkward array writer, and turn off stack trace on exception

Dan Guest requested to merge dguest/hh4b-analysis:awkward-writer into master

Why I want this

I'm interested in writing a drop-in replacement for our ntuples that uses half precision floats stored in H5 files. The current H5 writer doesn't exactly provide this: it stores an n_event x n_h5_jets array where n_h5_jets is a fixed number. Events with more jets are truncated, events with fewer are padded.

The uproot and awkward array paradigm is different: there you need a flat array together with a "counts" array that specifies how many jets are in each event. Here I add the option to do either one.

Implementation

I implemented an option to store in this format instead, by setting the --n-h5-jets parameter to 0. One interesting thing I observed: the zero padded version is actually smaller, even when the padding is set far larger than the maximum number of jets per event. I guess zlib and the underlying deflate filter are awesome.

Other stuff

I also configure the ExceptionSvc in the top level script to turn off the stack trace it usually throws after catching an exception. I'm pretty sure that trace was entirely useless, since it always just pointed back to the exception service. This should not have any effect on the stack traces that were useful (since those aren't caught by the exception service).

Edited by Dan Guest

Merge request reports