fLibStateAtLoad(),
fBits(0),
fDataEventsOnly(true)
+ , fMonitorPeriod(-1)
{
// Default constructor.
fDataEventsOnly = false;
continue;
}
+
+ if (strstr(argv[i], "-monitoring") == argv[i])
+ {
+ TString param=argv[i];
+ param.ReplaceAll("-monitoring", "");
+ if (param.IsNull())
+ {
+ // -monitoring
+ // enable monitoring trigger for all events
+ fMonitorPeriod=0;
+ } else {
+ // -monitoring=n
+ // enable monitoring trigger once every n seconds
+ param.ReplaceAll("=", "");
+ if (param.IsDigit()) {
+ fMonitorPeriod=param.Atoi();
+ } else {
+ HLTError("expecting number as parameter for argument '-monitoring=', got %s, skipping monitoring trigger", param.Data());
+ }
+ }
+ continue;
+ }
HLTError("Unknown option '%s'.", argv[i]);
return -EINVAL;
// add readout filter to event done data
CreateEventDoneReadoutFilter(decision.TriggerDomain(), 3);
- // add monitoring filter to event done data
- CreateEventDoneReadoutFilter(decision.TriggerDomain(), 4);
- if (decision.Result()) {
- // add monitoring event command for triggered events
- CreateEventDoneReadoutFilter(decision.TriggerDomain(), 5);
+
+ // add monitoring filter to event done data if enabled by setting
+ // a monitoring period >=0: -1 means off, 0 means for every event
+ // configured by argument '-monitoring[=n]'
+ if (fMonitorPeriod>=0) {
+ static UInt_t lastMonitorEvent=0;
+
+ AliHLTTriggerDomain monitoringFilter(decision.TriggerDomain());
+ if (decision.Result() &&
+ time.Get()-lastMonitorEvent>fMonitorPeriod) {
+ lastMonitorEvent=time.Get();
+ // add monitoring event command for triggered events
+ CreateEventDoneReadoutFilter(decision.TriggerDomain(), 5);
+ } else {
+ // empty filter list if events are not triggered
+ // or within the monitoring interval
+ monitoringFilter.Clear();
+ }
+ // add monitoring filter list
+ CreateEventDoneReadoutFilter(monitoringFilter, 4);
}
+
if (TriggerEvent(&decision) == -ENOSPC)
{
// Increase the estimated buffer space required if the PushBack methods in TriggerEvent
* \li -process-all-events <br>
* Indicates that all events should be processed with the global trigger logic and
* not just the data events. The default is not to process just the data events.
+ * \li -monitoring[=n] <br>
+ * enable monitoring trigger once every n seconds, enable for every event if
+ * parameter n is omitted
*
* <h2>Configuration:</h2>
* Configured from CDB but can be overridden with the -config argument.
TString fLibStateAtLoad; //! This stores the loaded libraries just before we tell CINT to load the interpreted file.
AliHLTUInt32_t fBits; //! Status bits
bool fDataEventsOnly; //! Flag indicating if only data events are processed with trigger logic.
+ int fMonitorPeriod; //! Period of the monitoring trigger in s, -1 means monitoring trigger off
static const char* fgkTriggerMenuCDBPath; //! The path string to read the trigger menu from the CDB.