// context
-#if __GNUC__>= 3
-using namespace std;
-#endif
-
//#include "AliHLTStdIncludes.h"
#include "AliHLTComponent.h"
#include "AliHLTComponentHandler.h"
, 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;
}
if (pString) {
- HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data());
- arguments+=pString->GetString().Data();
+ HLTInfo("received configuration object string: \'%s\'", pString->GetName());
+ arguments+=pString->GetName();
arguments+=" ";
} else {
HLTError("configuration object \"%s\"%s%s has wrong type, required TObjString", path, key?" key ":"",key?key:"");
return iResult;
}
-TObject* AliHLTComponent::LoadAndExtractOCDBObject(const char* path, int version, int subVersion, const char* key)
+TObject* AliHLTComponent::LoadAndExtractOCDBObject(const char* path, const char* key) const
{
// see header file for function documentation
- AliCDBEntry* pEntry=AliHLTMisc::Instance().LoadOCDBEntry(path, GetRunNo(), version, subVersion);
+ AliCDBEntry* pEntry=AliHLTMisc::Instance().LoadOCDBEntry(path, GetRunNo());
if (!pEntry) return NULL;
TObject* pObject=AliHLTMisc::Instance().ExtractObject(pEntry);
TMap* pMap=dynamic_cast<TMap*>(pObject);
public:
AliHLTComponentStatisticsId(AliHLTUInt32_t id) : fId(id) {}
AliHLTComponentStatisticsId(const AliHLTComponentStatisticsId& src) : fId(src.fId) {}
+ AliHLTComponentStatisticsId& operator=(const AliHLTComponentStatisticsId& src) {
+ if (this==&src) return *this;
+ fId=src.fId; return *this;
+ }
bool operator==(const AliHLTComponentStatistics& a) const {return a.fId==fId;}
private:
AliHLTComponentStatisticsId();
public:
AliHLTComponentBlockDataSpecification(AliHLTUInt32_t specification) : fSpecification(specification) {}
AliHLTComponentBlockDataSpecification(const AliHLTComponentBlockDataSpecification& src) : fSpecification(src.fSpecification) {}
+ AliHLTComponentBlockDataSpecification& operator=(const AliHLTComponentBlockDataSpecification& src) {
+ if (this==&src) return *this;
+ fSpecification=src.fSpecification; return *this;
+ }
bool operator==(const AliHLTComponentBlockData& bd) const {return bd.fSpecification==fSpecification;}
private:
AliHLTComponentBlockDataSpecification();
// 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)
// do not use ALIHLTCOMPONENT_DA_STOPWATCH(); macro
// in order to avoid 'shadowed variable' warning
AliHLTStopwatchGuard swguard2(fpStopwatches!=NULL?reinterpret_cast<TStopwatch*>(fpStopwatches->At((int)kSWDA)):NULL);
+ AliHLTMisc::AliOnlineGuard onlineGuard;
iResult=DoProcessing(evtData, blocks, trigData, outputPtr, size, blockData, edd);
} // end of the scope of the stopwatch guard
if (iResult>=0 && !bSkipDataProcessing) {
//
}
-AliHLTComponent::AliHLTStopwatchGuard& AliHLTComponent::AliHLTStopwatchGuard::operator=(const AliHLTStopwatchGuard&)
+AliHLTComponent::AliHLTStopwatchGuard& AliHLTComponent::AliHLTStopwatchGuard::operator=(const AliHLTStopwatchGuard& other)
{
//
// assignment operator not for use
//
+ if (this==&other) return *this;
fpStopwatch=NULL;
fpPrec=NULL;
return *this;