Add associated hit writer
I'm trying to implement a hit writer that looks like our everything-else writers, as demanded by #178. There's a bit to do:
-
Add an instance of the hit writer to the JetLinkWriteroptions -
Add output options in the dumpster json -
Add customConsumers for the hit variables -
Add a hit associator python block -
Make a working json config
Some bonus things happened in the meantime
- I realized that the
flowconfiguration was already doing almost exactly what I needed: it reads an arbitrarystd::vector<ElementLink<T>>off the jet and writes a dataset without applying any special selection. So I adapted that to hits.- I renamed
flowtoassociations, since it's really just a way to write any associated objects - I added options to use it for several other particle types which were already supported in
JetWritersbut not via this option
- I renamed
- Added a
write_flagoption to theflow/associationsoutputs, which names a decoration which must be nonzero to write, thus retaining some ability to add some selection if needed (although possibly in another algorithm). - I removed some
extern templatemagic fromaddCustomConsumers. This was apparently added to allow us to use some code fromFlavorTagInference, but the same logic didn't work with hits (as far as I could tell), and removing it didn't break anything.
@treisch: I didn't manage to make all the changes you made in !955 for the hit selection. That seemed to be just a few things though. I'd prefer to add these in another MR since this one is getting a bit bloated already.
The main todo items are:
- Filtering out the "bad" hits. I feel like we should be able to add an algorithm that decorates this info, and then filter them using the
write_flagthing above. - Removing overlapping hits. I don't know if we want to do this or not. My recollection is that we decided to do this at some point to when we were hand crafting features. But if we're just feeding them all to an NN maybe there's no loss in having them, similar to how we count both charge pflow and tracks in GN3.
- We also don't have the
jabcoordinates yet, they need to be added as custom float variables. Ideally we'd take the function that computes them from Athena but I wasn't able to figure that out just yet. It might require a new Athena release with some changes to make the functions public.
Edited by Dan Guest