Skip to content

Add option to write jets per-event and a lot of low-level refactoring

I wanted to be able to dump jets in a rank 2 array, with one set of jets per event.

Implementing this in the BTagJetWriter would have been ugly: that class is already doing quite a few things to support fat-jets, jet substructure, subjets, and regular jets. There were also some rather confusing switches to configure the writer differently depending on which type of jet it was being applied to. So I split BTagJetWriter into BTagJetWriter, SubjetWriter, and FatJetWriter. They each have their own configuration class. I put the common code into BTagJetWriterUtils.

At a high level this should change nothing: I tested that the outputs dumping trigger jets don't change at all (they use all the same classes as offline single-jet b-tagging). I added one configuration option: n_jets_per_event which is usually set to zero. If set to zero the output is jet-wise. If it's set to some other number, it gives the dimension of the 2nd output index, i.e. how many jets we save in each event.

As I said, this should change very little, but @mguth should probably take a quick look anyway.

Merge request reports