Event mapping does not work for pregenerated files with weight
The output ROOT file created by simX contains the branch ___N___
which serves as a unique event ID.
In particular, if simX is initialized with pre-generated set of reaction events, ___N___
is supposed to provide a mapping to the event number in the pre-generated input file.
This works fine if the input file does not contain a weight variable. However, if a weight variable is present, simX fails to produce the correct mapping. The problem occurs both for text and ROOT input files.
(If the input file is a ROOT file, simX will look for a branch called w
to determine if a weight variable is present or not.)
When a weight variable is detected by simX, the file reader (RootSampleSet or TextSampleSet) gets transformed into a SampleSampler object, and this is essentially the cause of the problem: https://gitlab.au.dk/ausa/simx/-/blob/master/source/generator/PhaseSpaceSampler.cpp#L94
I'm not sure if there is an easy fix, but at least we could insert a warning about this which would be triggered if simX detects and weight variable?