, fLastObjectSize(0)
, fpCTPData(NULL)
, fPushbackPeriod(0)
- , fLastPushBackTime(-1)
+ , fLastPushBackTime(-1),
+ fEventModulo(-1)
{
// see header file for class documentation
// or
} else {
HLTError("wrong parameter for argument -pushback-period, number expected");
}
+ // -event-modulo
+ } else if (argument.BeginsWith("-event-modulo=")) {
+ argument.ReplaceAll("-event-modulo=", "");
+ if (argument.IsDigit()) {
+ fEventModulo=argument.Atoi();
+ if (fEventModulo < 1)
+ {
+ fEventModulo = -1;
+ HLTError("number passed in -event-modulo must be a positive integer greater or equal to 1.");
+ }
+ } else {
+ HLTError("wrong parameter for argument -event-modulo, integer number expected");
+ }
// -disable-component-stat
} else if (argument.CompareTo("-disable-component-stat")==0) {
fFlags|=kDisableComponentStat;
// increment CTP trigger counters if available
if (IsDataEvent()) fpCTPData->Increment(trigData);
}
+
+ // Check if the event processing should be skipped because of the
+ // down scaling from the event modulo argument. Using a prime number
+ // as pre divisor to pseudo-randomise the event number to get a more
+ // uniform distribution.
+ if (fEventModulo > 1)
+ {
+ bSkipDataProcessing |= ( ((AliHLTUInt64_t(fCurrentEvent) / AliHLTUInt64_t(4789)) % AliHLTUInt64_t(fEventModulo)) == 0 );
+ }
AliHLTComponentBlockDataList blockData;
if (iResult>=0 && !bSkipDataProcessing)
* \li -pushback-period=period <br>
* scale down for PushBack of objects, shipped only for one event
* every <i>period</i> seconds
+ * \li -event-module=number <br>
+ * This option reduces the event processing rate by processing only n'th event
+ * based on the modulo number <i>number</i>. The scale down should be about
+ * 1/<i>number</i>, where <i>number</i> is a positive integer.
*
* @ingroup alihlt_component
* @section alihltcomponent-members Class members
int fPushbackPeriod; //! transient
/// time of last executed PushBack
int fLastPushBackTime; //! transient
+
+ /// Event modulo for down scaling the processing rate.
+ int fEventModulo; //! transient
ClassDef(AliHLTComponent, 0)
};