}
-void AliHLTTrigger::TriggerEvent(bool value)
+int AliHLTTrigger::TriggerEvent(bool value)
{
// Sets the trigger decision for the current event.
// See header file for more details.
- if (fTriggerEventResult != 0) return; // Do not do anything if a previous call failed.
+ if (fTriggerEventResult != 0) return fTriggerEventResult; // Do not do anything if a previous call failed.
AliHLTTriggerDecision triggerResult(value, GetTriggerName(), fTriggerDomain, fDescription);
// Append the readout list if it contains anything.
triggerResult.TriggerDomain().Add(fReadoutList);
fTriggerEventResult = PushBack(&triggerResult, kAliHLTDataTypeTObject|kAliHLTDataOriginOut);
if (fTriggerEventResult == 0) fDecisionMade = true;
+ return fTriggerEventResult;
}
-void AliHLTTrigger::TriggerEvent(
+int AliHLTTrigger::TriggerEvent(
AliHLTTriggerDecision* result, const AliHLTComponentDataType& type,
AliHLTUInt32_t spec
)
// Sets a custom trigger decision for the current event.
// See header file for more details.
- if (fTriggerEventResult != 0) return; // Do not do anything if a previous call failed.
+ if (fTriggerEventResult != 0) return fTriggerEventResult; // Do not do anything if a previous call failed.
fTriggerEventResult = PushBack(result, type, spec);
if (fTriggerEventResult == 0) fDecisionMade = true;
+ return fTriggerEventResult;
}
* method when a trigger decision has been made.
* @param value The trigger decision value. True for positive trigger and false
* for a negative result. (true by default)
+ * \returns zero on success and negative value on failure. The possible failure
+ * codes are:<br>
+ * -ENOSPC - If there is not enough output buffer space for the trigger decision.<br>
+ * -ENOMSG - If the trigger decision object could not be serialised.
*/
- void TriggerEvent(bool value = true);
+ int TriggerEvent(bool value = true);
/**
* Fills the output with the given trigger decision. This should be called in the
* kAliHLTDataTypeTObject|kAliHLTDataOriginOut by default).
* @param spec The data block specification to use (set to kAliHLTVoidDataSpec
* by default).
+ * \returns zero on success and negative value on failure. The possible failure
+ * codes are:<br>
+ * -ENOSPC - If there is not enough output buffer space for the trigger decision.<br>
+ * -ENOMSG - If the trigger decision object could not be serialised.<br>
+ * -EINVAL - If the <i>result</i> object is NULL.
*/
- void TriggerEvent(
+ int TriggerEvent(
AliHLTTriggerDecision* result,
const AliHLTComponentDataType& type = kAliHLTDataTypeTObject|kAliHLTDataOriginOut,
AliHLTUInt32_t spec = kAliHLTVoidDataSpec
);
+ /**
+ * Method for finding out the result of the last call to TriggerEvent.
+ * \returns the error code for the last call to TriggerEvent.
+ */
+ int GetLastTriggerEventResult() const { return fTriggerEventResult; }
+
/**
* Returns the event data structure for the current event.
* NULL is returned if this method is not called inside the DoTrigger method.