FindManyP failed if there is no association
FindManyP failed if there is no association.
%MSG %MSG-w FailModule: AnalysisTree:analysistree 05-Feb-2014 13:38:12 CST run: 1 subRun: 0 event: 5 Module failed due to an exception ---- LogicError BEGIN Invalid FindManyP ---- ProductNotFound BEGIN getByLabel: Found zero products matching all criteria Looking for type: art::Assns<recob::Track,anab::Calorimetry,void> Looking for module label: calo Looking for productInstanceName: ---- ProductNotFound END Attempt to use a FindManyP where the underlying art::Assns product was not found. ---- LogicError END %MSG
According to Issue #2938,
FindManyPshould not throw on construction if the
#1 Updated by Christopher Green over 6 years ago
- Subject changed from FindManyP failed if there is no assiciation to FindManyP failed if there is no association
- Description updated (diff)
- Category set to Navigation
- Status changed from New to Feedback
- Assignee set to Christopher Green
- SSI Package art added
- SSI Package deleted (
Your are correct in your reading of issue #2938: the
FindManyP should not throw on construction. However, that is not what is occurring here. The message you see comes from the
throwIfInvalid() function, which is called from various
FindManyP functions, but not from the constructor. If you attempt to use an invalid
FindXXX smart query object, then at the time of use the stored exception from construction is thrown. If you are able to connect a debugger to the process, stop on
__cxa_throw (in gdb, that is
catch throw) and look at the stack trace. It should show you that the stored exception is being thrown at the point you attempt to use the invalid object, not where it is constructed.
To ensure that the
FindManyP is safe for use, you can call the
isValid() function immediately after construction to verify validity before attempting to use the object, just as for (e.g.) a
Let us know if this turns out to be the problem.