fCompressionLevel(ALIHLTCOMPONENT_DEFAULT_OBJECT_COMPRESSION)
, fLastObjectSize(0)
, fpCTPData(NULL)
+ , fPushbackPeriod(0)
+ , fLastPushBackTime(-1)
{
// see header file for class documentation
// or
if (comenv) {
SetComponentEnvironment(comenv, environParam);
}
+ fPushbackPeriod=0;
+ fLastPushBackTime=-1;
+
fComponentArgs="";
const char** pArguments=NULL;
int iNofChildArgs=0;
} else {
HLTError("wrong parameter for argument -object-compression, number expected");
}
+ // -pushback-period=
+ } else if (argument.BeginsWith("-pushback-period=")) {
+ argument.ReplaceAll("-pushback-period=", "");
+ if (argument.IsDigit()) {
+ fPushbackPeriod=argument.Atoi();
+ } else {
+ HLTError("wrong parameter for argument -pushback-period, number expected");
+ }
} else {
pArguments[iNofChildArgs++]=argv[i];
}
ALIHLTCOMPONENT_BASE_STOPWATCH();
int iResult=0;
fLastObjectSize=0;
+ if (fPushbackPeriod>0) {
+ // suppress the output
+ TDatime time;
+ if (fLastPushBackTime<0 || (int)time.Get()-fLastPushBackTime<fPushbackPeriod) return 0;
+ }
if (pObject) {
AliHLTMessage msg(kMESS_OBJECT);
msg.SetCompressionLevel(fCompressionLevel);
{
// see header file for function documentation
ALIHLTCOMPONENT_BASE_STOPWATCH();
+ if (fPushbackPeriod>0) {
+ // suppress the output
+ TDatime time;
+ if (fLastPushBackTime<0 || (int)time.Get()-fLastPushBackTime<fPushbackPeriod) return 0;
+ }
+
return InsertOutputBlock(pBuffer, iSize, dt, spec, pHeader, headerSize);
}
}
}
if (indexEOREvent>=0) {
+ fLastPushBackTime=0; // always send at EOR
bAddComponentTableEntry=true;
if (fpRunDesc!=NULL) {
if (fpRunDesc) {
// reset the active triggers
if (fpCTPData) fpCTPData->SetTriggers(0);
+
+ // set the time for the pushback period
+ if (fPushbackPeriod>0) {
+ // suppress the output
+ TDatime time;
+ if (fLastPushBackTime<0 || (int)time.Get()-fLastPushBackTime>=fPushbackPeriod) {
+ fLastPushBackTime=time.Get();
+ }
+ }
+
return iResult;
}
* \li -object-compression=level <br>
* compression level for ROOT objects, default is defined by
* @ref ALIHLTCOMPONENT_DEFAULT_OBJECT_COMPRESSION
+ * \li -pushback-period=period <br>
+ * scale down for PushBack of objects, shipped only for one event
+ * every <i>period</i> seconds
*
* @ingroup alihlt_component
* @section alihltcomponent-members Class members
* Insert an object into the output.
* If header is specified, it will be inserted before the root object,
* default is no header.
+ * The publishing can be downscaled by means of the -pushback-period
+ * parameter. This is especially useful for histograms which do not
+ * need to be sent for every event.
* @param pObject pointer to root object
* @param dt data type of the object
* @param spec data specification
* Insert an object into the output.
* If header is specified, it will be inserted before the root object,
* default is no header.
+ * The publishing can be downscaled by means of the -pushback-period
+ * parameter. This is especially useful for histograms which do not
+ * need to be sent for every event.
* @param pObject pointer to root object
* @param dtID data type ID of the object
* @param dtOrigin data type origin of the object
/** array of trigger class descriptors */
AliHLTCTPData* fpCTPData; //! transient
- ClassDef(AliHLTComponent, 12)
+ /// update period for PushBack calls
+ int fPushbackPeriod; //! transient
+ /// time of last executed PushBack
+ int fLastPushBackTime; //! transient
+
+ ClassDef(AliHLTComponent, 13)
};
#endif