- AliHLTSimulation uses AliHLTSystem singleton
- HLTOUT raw files written according to AliSimulation::SetWriteRawData
CLASS_HDRS:= AliHLTComponent.h \
AliHLTComponentHandler.h \
AliHLTSystem.h \
CLASS_HDRS:= AliHLTComponent.h \
AliHLTComponentHandler.h \
AliHLTSystem.h \
+ AliHLTReconstructorBase.h \
AliHLTProcessor.h \
AliHLTCalibrationProcessor.h \
AliHLTConfiguration.h \
AliHLTProcessor.h \
AliHLTCalibrationProcessor.h \
AliHLTConfiguration.h \
LIBHLTREC_VERSION := 0
CLASS_HDRS:= AliHLTReconstructor.h \
LIBHLTREC_VERSION := 0
CLASS_HDRS:= AliHLTReconstructor.h \
- AliHLTReconstructorBase.h \
AliRawReaderHLT.h \
AliHLTOUTRawReader.h
AliRawReaderHLT.h \
AliHLTOUTRawReader.h
fWriters(),
fNofDDLs(10),
fIdFirstDDL(7680), // 0x1e<<8
fWriters(),
fNofDDLs(10),
fIdFirstDDL(7680), // 0x1e<<8
- fWriteDigits(kTRUE),
- fWriteRaw(kTRUE),
fBuffer(),
fpLibManager(NULL)
{
fBuffer(),
fpLibManager(NULL)
{
+int AliHLTOUTComponent::fgOptions=kWriteRawFiles|kWriteDigits;
+
AliHLTOUTComponent::~AliHLTOUTComponent()
{
// see header file for class documentation
AliHLTOUTComponent::~AliHLTOUTComponent()
{
// see header file for class documentation
{
// see header file for class documentation
int iResult=0;
{
// see header file for class documentation
int iResult=0;
- HLTInfo("write %d output blocks", evtData.fBlockCnt);
+ HLTInfo("write %d output block(s)", evtData.fBlockCnt);
if (iResult>=0) {
homer_uint64 homerHeader[kCount_64b_Words];
HOMERBlockDescriptor homerDescriptor(homerHeader);
if (iResult>=0) {
homer_uint64 homerHeader[kCount_64b_Words];
HOMERBlockDescriptor homerDescriptor(homerHeader);
int bufferSize=0;
if ((bufferSize=FillOutputBuffer(eventNo, fWriters[*ddlno], pBuffer))>0) {
int bufferSize=0;
if ((bufferSize=FillOutputBuffer(eventNo, fWriters[*ddlno], pBuffer))>0) {
- if (fWriteDigits) WriteDigits(eventNo, runLoader, *ddlno, pBuffer, bufferSize);
- if (fWriteRaw) WriteRawFile(eventNo, runLoader, *ddlno, pBuffer, bufferSize);
+ if (fgOptions&kWriteDigits) WriteDigits(eventNo, runLoader, *ddlno, pBuffer, bufferSize);
+ if (fgOptions&kWriteRawFiles) WriteRawFile(eventNo, runLoader, *ddlno, pBuffer, bufferSize);
}
fWriters[*ddlno]->Clear();
ddlno++;
}
fWriters[*ddlno]->Clear();
ddlno++;
+
+void AliHLTOUTComponent::SetGlobalOption(unsigned int options)
+{
+ // see header file for class documentation
+ fgOptions|=options;
+}
+
+void AliHLTOUTComponent::ClearGlobalOption(unsigned int options)
+{
+ // see header file for class documentation
+ fgOptions&=~options;
+}
void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
AliHLTComponent* Spawn();
void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
AliHLTComponent* Spawn();
+ /**
+ * Enable global options valid for all instances of the component
+ * @param options bit field
+ */
+ static void SetGlobalOption(unsigned int options);
+
+ /**
+ * Disable global options valid for all instances of the component
+ * @param options bit field
+ */
+ static void ClearGlobalOption(unsigned int options);
+
+ enum {
+ /** write the raw files of the HLT links */
+ kWriteRawFiles = 0x1,
+ /** write the digit file */
+ kWriteDigits = 0x2
+ };
+
protected:
/**
* Init method.
protected:
/**
* Init method.
/** equipment ID of first HLT DDL */
int fIdFirstDDL; //!transient
/** equipment ID of first HLT DDL */
int fIdFirstDDL; //!transient
- /** write digits or not */
- Bool_t fWriteDigits; //!transient
-
- /** write raw file or not */
- Bool_t fWriteRaw; //!transient
-
/** output buffer, allocated once in order to avoid frequent alloc/dealloc */
vector<AliHLTUInt8_t> fBuffer; //!transient
/** instance of the HOMER library manager */
AliHLTHOMERLibManager* fpLibManager; // !transient
/** output buffer, allocated once in order to avoid frequent alloc/dealloc */
vector<AliHLTUInt8_t> fBuffer; //!transient
/** instance of the HOMER library manager */
AliHLTHOMERLibManager* fpLibManager; // !transient
- ClassDef(AliHLTOUTComponent, 0)
+ /** global options for all instances */
+ static int fgOptions; //! transient
+
+ ClassDef(AliHLTOUTComponent, 1)
#include "AliRawReaderDate.h"
#include "AliRawReaderRoot.h"
#include "AliESDEvent.h"
#include "AliRawReaderDate.h"
#include "AliRawReaderRoot.h"
#include "AliESDEvent.h"
+#include "AliHLTOUTComponent.h"
#if ALIHLTSIMULATION_LIBRARY_VERSION != LIBHLTSIM_VERSION
#error library version in header file and lib*.pkg do not match
#if ALIHLTSIMULATION_LIBRARY_VERSION != LIBHLTSIM_VERSION
#error library version in header file and lib*.pkg do not match
AliHLTSimulation::AliHLTSimulation()
:
fOptions(),
AliHLTSimulation::AliHLTSimulation()
:
fOptions(),
fpRawReader(NULL)
{
// see header file for class documentation
fpRawReader(NULL)
{
// see header file for class documentation
AliHLTSimulation::~AliHLTSimulation()
{
// see header file for function documentation
AliHLTSimulation::~AliHLTSimulation()
{
// see header file for function documentation
- if (fpSystem) {
- delete fpSystem;
- }
- fpSystem=NULL;
if (fpRawReader) {
delete fpRawReader;
}
if (fpRawReader) {
delete fpRawReader;
}
fOptions=options;
TString sysOp;
fOptions=options;
TString sysOp;
- if (!fpSystem) fpSystem=new AliHLTSystem;
- if (!fpSystem) {
- AliError("can not create AliHLTSystem object");
+ AliHLTSystem* pSystem=GetInstance();
+ if (!pSystem) {
+ AliError("can not get AliHLTSystem instance");
- if (fpSystem->CheckStatus(AliHLTSystem::kError)) {
+ if (pSystem->CheckStatus(AliHLTSystem::kError)) {
AliError("HLT system in error state");
return -EFAULT;
}
AliError("HLT system in error state");
return -EFAULT;
}
+ } else if (token.Contains("writerawfiles=")) {
+ if (!token.ReplaceAll("writerawfiles=", "").Contains("HLT")) {
+ AliHLTOUTComponent::ClearGlobalOption(AliHLTOUTComponent::kWriteRawFiles);
+ }
} else {
if (sysOp.Length()>0) sysOp+=" ";
sysOp+=token;
} else {
if (sysOp.Length()>0) sysOp+=" ";
sysOp+=token;
- if (fpSystem->ScanOptions(sysOp.Data())<0) {
+ if (pSystem->ScanOptions(sysOp.Data())<0) {
AliError("error setting options for HLT system");
return -EINVAL;
}
AliError("error setting options for HLT system");
return -EINVAL;
}
- if (!fpSystem->CheckStatus(AliHLTSystem::kReady)) {
- if ((fpSystem->Configure(pRunLoader))<0) {
+ if (!pSystem->CheckStatus(AliHLTSystem::kReady)) {
+ if ((pSystem->Configure(pRunLoader))<0) {
AliError("error during HLT system configuration");
return -EFAULT;
}
AliError("error during HLT system configuration");
return -EFAULT;
}
int nEvents = pRunLoader->GetNumberOfEvents();
int iResult=0;
int nEvents = pRunLoader->GetNumberOfEvents();
int iResult=0;
- if (fpSystem->CheckStatus(AliHLTSystem::kError)) {
+ AliHLTSystem* pSystem=GetInstance();
+ if (!pSystem) {
+ AliError("can not get AliHLTSystem instance");
+ return -ENOMEM;
+ }
+ if (pSystem->CheckStatus(AliHLTSystem::kError)) {
AliError("HLT system in error state");
return -EFAULT;
}
// Note: the rawreader is already placed at the first event
AliError("HLT system in error state");
return -EFAULT;
}
// Note: the rawreader is already placed at the first event
- if ((iResult=fpSystem->Reconstruct(1, pRunLoader, fpRawReader))>=0) {
- fpSystem->FillESD(0, pRunLoader, NULL);
+ if ((iResult=pSystem->Reconstruct(1, pRunLoader, fpRawReader))>=0) {
+ pSystem->FillESD(0, pRunLoader, NULL);
for (int i=1; i<nEvents; i++) {
if (fpRawReader && !fpRawReader->NextEvent()) {
AliError("missmatch in event count, rawreader corrupted");
break;
}
for (int i=1; i<nEvents; i++) {
if (fpRawReader && !fpRawReader->NextEvent()) {
AliError("missmatch in event count, rawreader corrupted");
break;
}
- fpSystem->Reconstruct(1, pRunLoader, fpRawReader);
- fpSystem->FillESD(i, pRunLoader, NULL);
+ pSystem->Reconstruct(1, pRunLoader, fpRawReader);
+ pSystem->FillESD(i, pRunLoader, NULL);
}
// send specific 'event' to execute the stop sequence
}
// send specific 'event' to execute the stop sequence
- fpSystem->Reconstruct(0, NULL, NULL);
+ pSystem->Reconstruct(0, NULL, NULL);
#include "TObject.h"
#include "TString.h"
#include "TObject.h"
#include "TString.h"
+#include "AliHLTReconstructorBase.h"
class AliRunLoader;
class AliHLTSystem;
class AliRawReader;
class AliRunLoader;
class AliHLTSystem;
class AliRawReader;
* @class AliHLTSimulation
* Base class of HLT data processing simulations.
*/
* @class AliHLTSimulation
* Base class of HLT data processing simulations.
*/
-class AliHLTSimulation : public TObject {
+class AliHLTSimulation : public TObject, public AliHLTReconstructorBase {
public:
/** create an instance of the class */
static AliHLTSimulation* CreateInstance();
public:
/** create an instance of the class */
static AliHLTSimulation* CreateInstance();
/* current options */
TString fOptions; //!transient
/* current options */
TString fOptions; //!transient
- /* HLT steering object */
- AliHLTSystem* fpSystem; //!transient
-
/* RAW reader instance for chains which need RAW data as input */
AliRawReader* fpRawReader; //!transient
/* RAW reader instance for chains which need RAW data as input */
AliRawReader* fpRawReader; //!transient
- ClassDef(AliHLTSimulation, 1)
+ ClassDef(AliHLTSimulation, 2)
};
#define ALIHLTSIMULATION_LIBRARY "libHLTsim.so"
};
#define ALIHLTSIMULATION_LIBRARY "libHLTsim.so"