Closed EricMEsch closed 3 months ago
Thanks for the bug reports. I already found fixes for both bugs, and will push them after testing. Unfortunately we do not have automated tests for all output code in place (that is also why those bugs existed in the first place...)
When using flat tuples the Ntuple will only be registered once. This is how it should be. However look at the code below:
The line
rmg_man->RegisterNtuple(det.second.uid, ana_man->CreateNtuple(ntuple_name, "Event data"));
will only be executed for the first detector of its type, as then the flatntuple_name
will always be the same (one tuple per type). So only this singledet.second.ui
will have the correct entry in the mapfNtupleIDs
ofRMGManager
. Lets say you register 4 Germanium and 4 Optical detectors. The first Germanium and Optical detectors will be registered correctly. For the restrmg_man->GetNtupleID(hit->detector_uid);
will just return0
.When using a single detector type this issue does not occur, as the
NtupleID
of0
is correct (by chance). However, when using more than one detector type this is an issue. In the example above, the 3 Optical detectors following the first will write in the tuple 0, which belongs to the germanium detectors, producing unpredictable results.This is (obviously) not an issue when writing seperate tuples for each detector.