MAP_ANY_OF has wrong short-circuit behavior
The FIND_IN_TREE
functor (added in !3441 (merged)) is intended to:
Check whenever a basic particle (from InputCandidates) is inside a decay tree of a composite one (from ReferenceParticles).
However, it only checks the supplied basic against the first basic from the decay tree of the composite, not against all basics from the decay tree of the composite. This is because the MAP_ANY_OF
functor seems to do an element by element comparison of the two ranges given to it and terminates whenever either of the ranges is exhausted.
The current test in Phys/FunctorCore/tests/src/TestFunctors.cpp
passes because it only checks with the first daughter:
BOOST_CHECK_EQUAL( find_in_tree_prepped( true, p3, p1 ), true );
which is the one case that works properly. If the following line is added to the test:
BOOST_CHECK_EQUAL( find_in_tree_prepped( true, p3, p2 ), true );
i.e. a check whether the second daughter is found in the decay tree, then it fails.
cc: @malehura @ghallett @dlancier @mmonk @fswystun @mramospe