int AliHLTComponent::MakeOutputDataBlockList( const vector<AliHLTComponentBlockData>& blocks, AliHLTUInt32_t* blockCount,
AliHLTComponentBlockData** outputBlocks ) {
if ( !blockCount || !outputBlocks )
- return EFAULT;
+ return -EFAULT;
AliHLTUInt32_t count = blocks.size();
if ( !count )
{
}
*outputBlocks = reinterpret_cast<AliHLTComponentBlockData*>( AllocMemory( sizeof(AliHLTComponentBlockData)*count ) );
if ( !*outputBlocks )
- return ENOMEM;
+ return -ENOMEM;
for ( unsigned long i = 0; i < count; i++ )
(*outputBlocks)[i] = blocks[i];
*blockCount = count;
}
return iResult;
}
+
+void AliHLTComponent::FillBlockData( AliHLTComponentBlockData& blockData ) {
+ blockData.fStructSize = sizeof(blockData);
+ FillShmData( blockData.fShmKey );
+ blockData.fOffset = ~(AliHLTUInt32_t)0;
+ blockData.fPtr = NULL;
+ blockData.fSize = 0;
+ FillDataType( blockData.fDataType );
+ blockData.fSpecification = ~(AliHLTUInt32_t)0;
+}
+
+void AliHLTComponent::FillShmData( AliHLTComponentShmData& shmData ) {
+ shmData.fStructSize = sizeof(shmData);
+ shmData.fShmType = gkAliHLTComponentInvalidShmType;
+ shmData.fShmID = gkAliHLTComponentInvalidShmID;
+}
+
+void AliHLTComponent::FillDataType( AliHLTComponentDataType& dataType ) {
+ dataType.fStructSize = sizeof(dataType);
+ memset( dataType.fID, '*', kAliHLTComponentDataTypefIDsize );
+ memset( dataType.fOrigin, '*', kAliHLTComponentDataTypefOriginSize );
+}
+
+void AliHLTComponent::CopyDataType(AliHLTComponentDataType& tgtdt, const AliHLTComponentDataType& srcdt) {
+ memcpy(&tgtdt.fID[0], &srcdt.fID[0], kAliHLTComponentDataTypefIDsize);
+ memcpy(&tgtdt.fOrigin[0], &srcdt.fOrigin[0], kAliHLTComponentDataTypefOriginSize);
+}
+
+void AliHLTComponent::SetDataType(AliHLTComponentDataType& tgtdt, const char* id, const char* origin) {
+ tgtdt.fStructSize = sizeof(AliHLTComponentDataType);
+ memset(&tgtdt.fID[0], 0, kAliHLTComponentDataTypefIDsize);
+ memset(&tgtdt.fOrigin[0], 0, kAliHLTComponentDataTypefOriginSize);
+
+ if (strlen(id)>kAliHLTComponentDataTypefIDsize) {
+ HLTWarning("data type id %s is too long, truncated to %d", id, kAliHLTComponentDataTypefIDsize);
+ }
+ strncpy(&tgtdt.fID[0], id, kAliHLTComponentDataTypefIDsize);
+
+ if (strlen(origin)>kAliHLTComponentDataTypefOriginSize) {
+ HLTWarning("data type origin %s is too long, truncated to %d", origin, kAliHLTComponentDataTypefOriginSize);
+ }
+ strncpy(&tgtdt.fOrigin[0], origin, kAliHLTComponentDataTypefOriginSize);
+}
#include "AliHLTDefinitions.h"
#include "TObject.h"
+/* Matthias Dec 2006
+ * The names have been changed for Aliroot's coding conventions sake
+ * The old names are defined for backward compatibility with the
+ * stand alone SampleLib package
+ */
+typedef AliHLTComponentLogSeverity AliHLTComponent_LogSeverity;
+typedef AliHLTComponentEventData AliHLTComponent_EventData;
+typedef AliHLTComponentShmData AliHLTComponent_ShmData;
+typedef AliHLTComponentDataType AliHLTComponent_DataType;
+typedef AliHLTComponentBlockData AliHLTComponent_BlockData;
+typedef AliHLTComponentTriggerData AliHLTComponent_TriggerData;
+typedef AliHLTComponentEventDoneData AliHLTComponent_EventDoneData;
+
class AliHLTComponentHandler;
/**
* @param trigData
* @param outputPtr
* @param size
- * @param outputBlockCnt
- * @param outputBlocks
+ * @param outputBlockCnt out: size of the output block array, set by the component
+ * @param outputBlocks out: the output block array is allocated internally
* @param edd
* @return neg. error code if failed
*/
* Fill AliHLTComponentBlockData structure with default values.
* @param blockData reference to data structure
*/
- void FillBlockData( AliHLTComponentBlockData& blockData ) {
- blockData.fStructSize = sizeof(blockData);
- FillShmData( blockData.fShmKey );
- blockData.fOffset = ~(AliHLTUInt32_t)0;
- blockData.fPtr = NULL;
- blockData.fSize = 0;
- FillDataType( blockData.fDataType );
- blockData.fSpecification = ~(AliHLTUInt32_t)0;
- }
+ void FillBlockData( AliHLTComponentBlockData& blockData );
/**
* Fill AliHLTComponentShmData structure with default values.
* @param shmData reference to data structure
*/
- void FillShmData( AliHLTComponentShmData& shmData ) {
- shmData.fStructSize = sizeof(shmData);
- shmData.fShmType = gkAliHLTComponentInvalidShmType;
- shmData.fShmID = gkAliHLTComponentInvalidShmID;
- }
+ void FillShmData( AliHLTComponentShmData& shmData );
/**
* Fill AliHLTComponentDataType structure with default values.
* @param dataType reference to data structure
*/
- void FillDataType( AliHLTComponentDataType& dataType ) {
- dataType.fStructSize = sizeof(dataType);
- memset( dataType.fID, '*', 8 );
- memset( dataType.fOrigin, '*', 4 );
- }
+ void FillDataType( AliHLTComponentDataType& dataType );
+ /**
+ * Copy data type structure
+ * Copies the value an AliHLTComponentDataType structure to another one
+ * @param[out] tgtdt target structure
+ * @param[in] srcdt source structure
+ */
+ void CopyDataType(AliHLTComponentDataType& tgtdt, const AliHLTComponentDataType& srcdt);
+
+ /**
+ * Set the ID and Origin of an AliHLTComponentDataType structure.
+ * The function sets the fStructureSize member and copies the strings
+ * to the ID and Origin. Only characters from the valid part of the string
+ * are copied, the rest is fille with 0's.
+ * Please note that the fID and fOrigin members are not strings, just arrays of
+ * chars of size @ref kAliHLTComponentDataTypefIDsize and
+ * @kAliHLTComponentDataTypefOriginSize respectively and not necessarily with
+ * a terminating zero.
+ * @param id ID string
+ * @param origin Origin string
+ */
+ void SetDataType(AliHLTComponentDataType& tgtdt, const char* id, const char* origin);
+
/**
* Default method for the internal initialization.
* The method is called by @ref Init
return iResult;
}
-int AliHLTComponentHandler::CreateComponent(const char* componentID, void* pEnv, int argc, const char** argv, AliHLTComponent*& component )
+int AliHLTComponentHandler::CreateComponent(const char* componentID, void* pEnvParam, int argc, const char** argv, AliHLTComponent*& component )
{
int iResult=0;
if (componentID) {
component=pSample->Spawn();
if (component) {
HLTDebug("component \"%s\" created (%p)", componentID, component);
- if ((iResult=component->Init(&fEnvironment, pEnv, argc, argv))!=0) {
+ if ((iResult=component->Init(&fEnvironment, pEnvParam, argc, argv))!=0) {
HLTError("Initialization of component \"%s\" failed with error %d", componentID, iResult);
delete component;
component=NULL;
/**
* Create a component of the given name (ID).
+ * The method tries to find a registerd component of id \em componentID and calls
+ * the \em Spawn method of the template component. After successful creation of
+ * a new object, the Init method is called in order to initialize the environment
+ * and the component arguments. <br>
+ * The environment is the same for all components, but each component can
+ * have an additional private parameter \em pEnvParam.<br>
+ * The component arguments consist of an array of strings and the array size in the
+ * usual manner of the main() function.
* @param componentID ID of the component to create
- * @param pEnv environment for the component
+ * @param pEnvParam environment parameter for the component
* @param argc number of arguments in argv
* @param argv argument array like in main()
* @param component reference to receive the create component instance
* @return component pointer in component, neg. error code if failed
*/
- int CreateComponent( const char* componentID, void* pEnv,
+ int CreateComponent( const char* componentID, void* pEnvParam,
int argc, const char** argv, AliHLTComponent*& component );
/**
* Create a component of the given name (ID).
* Introduced for backward compatibility.
* @param componentID ID of the component to create
- * @param pEnv environment for the component
+ * @param pEnvParam environment parameter for the component
* @param component reference to receive the create component instance
* @return component pointer in component, neg. error code if failed
*/
- int CreateComponent( const char* componentID, void* pEnv,
+ int CreateComponent( const char* componentID, void* pEnvParam,
AliHLTComponent*& component )
{
- return CreateComponent( componentID, pEnv, 0, NULL, component );
+ return CreateComponent( componentID, pEnvParam, 0, NULL, component );
}
/**
{
int iResult=0;
if (fpConfiguration!=NULL && fpConfiguration!=pConf) {
- HLTWarning("overriding previous reference to configuration object %p (%s) by %p",
+ HLTWarning("overriding existing reference to configuration object %p (%s) by %p",
fpConfiguration, GetName(), pConf);
}
if (pConf!=NULL) fpConfiguration=pConf;
const char** argv=NULL;
if ((iResult=fpConfiguration->GetArguments(&argv))>=0) {
argc=iResult; // just to make it clear
+ // TODO: we have to think about the optional environment parameter,
+ // currently just set to NULL.
iResult=pCH->CreateComponent(fpConfiguration->GetComponentID(), NULL, argc, argv, fpComponent);
if (fpComponent) {
} else {
int AliHLTTask::Deinit()
{
- return 0;
+ int iResult=0;
+ AliHLTComponent* pComponent=GetComponent();
+ fpComponent=NULL;
+ if (pComponent) {
+ pComponent->Deinit();
+ delete pComponent;
+ } else {
+ HLTWarning("task %s (%p) doesn't seem to be in initialized", GetName(), this);
+ }
+ return iResult;
}
const char *AliHLTTask::GetName() const
}
}
-/* this function is most likely depricated
-int AliHLTTask::InsertBlockData(AliHLTComponentBlockData* pBlock, AliHLTTask* pSource)
-{
- int iResult=0;
- return iResult;
-}
-*/
-
int AliHLTTask::SetDependency(AliHLTTask* pDep)
{
int iResult=0;
return iResult;
}
-/* this function is most likely depricated
-int AliHLTTask::BuildBlockDataArray(AliHLTComponentBlockData*& pBlockData)
-{
- int iResult=0;
- return iResult;
-}
-*/
-
int AliHLTTask::StartRun()
{
int iResult=0;
}
// component init
+ // the initialization of the component is done by the ComponentHandler after creation
+ // of the component.
//iResult=Init( AliHLTComponentEnvironment* environ, void* environ_param, int argc, const char** argv );
- // allocate internal task varables for bookkeeping aso.
+ // allocate internal task variables for bookkeeping aso.
fpBlockDataArray=new AliHLTComponentBlockData[iNofInputDataBlocks];
if (fpBlockDataArray) {
fBlockDataArraySize=iNofInputDataBlocks;
int AliHLTTask::EndRun()
{
int iResult=0;
+ if (fpBlockDataArray) {
+ fBlockDataArraySize=0;
+ delete [] fpBlockDataArray;
+ fpBlockDataArray=0;
+ } else {
+ HLTWarning("task %s (%p) doesn't seem to be in running mode", GetName(), this);
+ }
return iResult;
}
int AliHLTTask::ProcessTask()
{
int iResult=0;
- if (fpComponent && fpBlockDataArray) {
+ AliHLTComponent* pComponent=GetComponent();
+ if (pComponent && fpBlockDataArray) {
int iSourceDataBlock=0;
int iInputDataVolume=0;
if (iResult>=0) {
long unsigned int iConstBase=0;
double fInputMultiplier=0;
- fpComponent->GetOutputDataSize(iConstBase, fInputMultiplier);
+ pComponent->GetOutputDataSize(iConstBase, fInputMultiplier);
int iOutputDataSize=int(fInputMultiplier*iInputDataVolume) + iConstBase;
AliHLTUInt8_t* pTgtBuffer=fpDataBuffer->GetTargetBuffer(iOutputDataSize);
AliHLTComponentEventData evtData;
AliHLTComponentBlockData* outputBlocks=NULL;
AliHLTComponentEventDoneData* edd;
if (pTgtBuffer!=NULL || iOutputDataSize==0) {
- iResult=fpComponent->ProcessEvent(evtData, fpBlockDataArray, trigData, pTgtBuffer, size, outputBlockCnt, outputBlocks, edd);
+ iResult=pComponent->ProcessEvent(evtData, fpBlockDataArray, trigData, pTgtBuffer, size, outputBlockCnt, outputBlocks, edd);
+ if (iResult>=0) {
+ iResult=fpDataBuffer->SetSegments(pTgtBuffer, outputBlocks, outputBlockCnt);
+ }
} else {
}
}
HLTError("Task %s (%p): realease of task %s (%p) failed with error %d", GetName(), this, pSrcTask->GetName(), pSrcTask, iTempRes);
}
} else {
- HLTFatal("fatal internal error in ROOT list handling");
- iResult=-EFAULT;
+ HLTFatal("internal error in ROOT list handling");
+ if (iResult>=0) iResult=-EFAULT;
}
subscribedTaskList.Remove(lnk);
lnk=subscribedTaskList.FirstLink();
return iResult;
}
-int AliHLTTask::GetNofMatchingDataBlocks(const AliHLTTask* pConsumerTask)
+int AliHLTTask::GetNofMatchingDataBlocks(const AliHLTTask* pConsumerTask) const
{
int iResult=0;
if (pConsumerTask) {
return iResult;
}
-int AliHLTTask::GetNofMatchingDataTypes(const AliHLTTask* pConsumerTask)
+int AliHLTTask::GetNofMatchingDataTypes(const AliHLTTask* pConsumerTask) const
{
int iResult=0;
if (pConsumerTask) {
void AliHLTTask::PrintStatus()
{
HLTLogKeyword("task properties");
- if (fpComponent) {
- HLTMessage(" component: %s (%p)", fpComponent->GetComponentID(), fpComponent);
+ AliHLTComponent* pComponent=GetComponent();
+ if (pComponent) {
+ HLTMessage(" component: %s (%p)", pComponent->GetComponentID(), pComponent);
} else {
HLTMessage(" no component set!");
}
if (fSegments.size()>0) {
vector<AliHLTDataSegment>::iterator segment=fSegments.begin();
while (segment!=fSegments.end()) {
- if (iResult=((*segment).fSegmentOffset==offset && (*segment).fSegmentSize==size)) {
+ if ((iResult=((*segment).fSegmentOffset==offset && (*segment).fSegmentSize==size))>0) {
break;
}
segment++;
if (fSegments.size()>0) {
vector<AliHLTDataSegment>::iterator segment=fSegments.begin();
while (segment!=fSegments.end()) {
- if (iResult=((*segment).fSegmentOffset==offset && (*segment).fSegmentSize==size)) {
+ if ((iResult=((*segment).fSegmentOffset==offset && (*segment).fSegmentSize==size))>0) {
fSegments.erase(segment);
break;
}
segment++;
}
- if (iResult=0) {
+ if (iResult==0) {
//HLTWarning("no data segment (%d:%d) active for consumer %p", offset, size, this);
iResult=-ENOENT;
}
* This is usually done after the component has written the data to the buffer,
* which was requested by the @ref GetTargetBuffer method. The component might
* produce different types of data, for each type a segment has to be defined
- * which describes the data inside the bauffer.<br>
+ * which describes the data inside the buffer.<br>
* The @ref AliHLTComponentBlockData segment descriptor comes directly from the
* @ref AliHLTComponent::ProcessEvent method.
* @param pTgt the target buffer which the segments refer to
{
}
+void AliHLTDataSource::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
+{
+ list.clear(); // there are no input data types
+}
+
+
int AliHLTDataSource::ProcessEvent( const AliHLTComponentEventData& evtData,
const AliHLTComponentBlockData* blocks,
AliHLTComponentTriggerData& trigData,
* - @ref DoDeinit (optional)
* - @ref GetEvent
* - @ref GetComponentID
- * - @ref GetInputDataTypes
* - @ref GetOutputDataType
* - @ref GetOutputDataSize
* - @ref Spawn
*/
TComponentType GetComponentType() { return AliHLTComponent::kSource;}
+ /**
+ * Default implementation for all data sources.
+ * There are no input data types.
+ */
+ void AliHLTDataSource::GetInputDataTypes( vector<AliHLTComponentDataType>& list);
+
private:
/**
* Data processing method for the component.
const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
+ const int kAliHLTComponentDataTypefIDsize=8;
+ const int kAliHLTComponentDataTypefOriginSize=4;
struct AliHLTComponentDataType
{
AliHLTUInt32_t fStructSize;
- char fID[8];
- char fOrigin[4];
+ char fID[kAliHLTComponentDataTypefIDsize];
+ char fOrigin[kAliHLTComponentDataTypefOriginSize];
};
+
+# define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
+# define kAliHLTVoidDataOrigin "\0\0\0"
+ const AliHLTComponentDataType kAliHLTVoidDataType = {sizeof(AliHLTComponentDataType), kAliHLTVoidDataTypeID, kAliHLTVoidDataOrigin};
struct AliHLTComponentBlockData
{
inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
{
- for ( unsigned i = 0; i < 8; i++ )
+ for ( unsigned i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
if ( dt1.fID[i] != dt2.fID[i] )
return false;
- for ( unsigned i = 0; i < 4; i++ )
+ for ( unsigned i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
return false;
return true;
inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
{
- for ( unsigned i = 0; i < 8; i++ )
+ for ( unsigned i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
if ( dt1.fID[i] != dt2.fID[i] )
return true;
- for ( unsigned i = 0; i < 4; i++ )
+ for ( unsigned i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
return true;
return false;
--- /dev/null
+// $Id$
+
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
+ * for The ALICE Off-line Project. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/** @file AliHLTFilePublisher.cxx
+ @author Matthias Richter
+ @date
+ @brief HLT file publisher component implementation. */
+
+#if __GNUC__>= 3
+using namespace std;
+#endif
+
+#include "AliHLTFilePublisher.h"
+#include <TObjString.h>
+#include <TMath.h>
+#include <TFile.h>
+
+/** ROOT macro for the implementation of ROOT specific class methods */
+ClassImp(AliHLTFilePublisher)
+
+AliHLTFilePublisher::AliHLTFilePublisher()
+ :
+ fFileNames(),
+ fFiles(),
+ fpCurrent(NULL),
+ fDataType(kAliHLTVoidDataType),
+ fSpecification(~(AliHLTUInt32_t)0),
+ fMaxSize(0)
+{
+ // make the lists owners of their objects in order to automatically
+ // de-allocate the objects
+ fFileNames.SetOwner();
+ fFiles.SetOwner();
+}
+
+AliHLTFilePublisher::AliHLTFilePublisher(const AliHLTFilePublisher&)
+ :
+ fFileNames(),
+ fFiles(),
+ fpCurrent(NULL),
+ fDataType(kAliHLTVoidDataType),
+ fSpecification(0),
+ fMaxSize(0)
+{
+ HLTFatal("copy constructor untested");
+}
+
+AliHLTFilePublisher& AliHLTFilePublisher::operator=(const AliHLTFilePublisher&)
+{
+ HLTFatal("assignment operator untested");
+ return *this;
+}
+
+AliHLTFilePublisher::~AliHLTFilePublisher()
+{
+ // file list and file name list are owner of their objects and
+ // delete all the objects
+}
+
+const char* AliHLTFilePublisher::GetComponentID()
+{
+ return "FilePublisher";
+}
+
+void AliHLTFilePublisher::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
+{
+ list.clear();
+}
+
+AliHLTComponentDataType AliHLTFilePublisher::GetOutputDataType()
+{
+ return (AliHLTComponentDataType){ sizeof(AliHLTComponentDataType), kAliHLTVoidDataTypeID, kAliHLTVoidDataOrigin};
+}
+
+void AliHLTFilePublisher::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
+{
+ constBase=fMaxSize;
+ inputMultiplier=1.0;
+}
+
+AliHLTComponent* AliHLTFilePublisher::Spawn()
+{
+ return new AliHLTFilePublisher;
+}
+
+int AliHLTFilePublisher::DoInit( int argc, const char** argv )
+{
+ int iResult=0;
+ TString argument="";
+ int bMissingParam=0;
+ for (int i; i<argc; i++) {
+ argument=argv[i];
+
+ // -datafile
+ if (argument.CompareTo("-datafile")==0) {
+ if ((bMissingParam=(++i>=argc))) break;
+ TObjString* parameter=new TObjString(argv[i]);
+ if (parameter) {
+ fFileNames.Add(parameter);
+ } else {
+ iResult=-ENOMEM;
+ }
+
+ // -datafilelist
+ } else if (argument.CompareTo("-datafilelist")==0) {
+ if ((bMissingParam=(++i>=argc))) break;
+ HLTWarning("-datafilelist option not yet implemented");
+
+ // -datatype
+ } else if (argument.CompareTo("-datatype")==0) {
+ if ((bMissingParam=(++i>=argc))) break;
+ memcpy(&fDataType.fID, argv[i], TMath::Min(kAliHLTComponentDataTypefIDsize, (Int_t)strlen(argv[i])));
+
+ // -dataspec
+ } else if (argument.CompareTo("-dataspec")==0) {
+ if ((bMissingParam=(++i>=argc))) break;
+ TString parameter(argv[i]);
+ if (parameter.IsDigit()) {
+ fSpecification=(AliHLTUInt32_t)parameter.Atoi();
+ } else {
+ HLTError("wrong parameter for argument %s, number expected", argument.Data());
+ iResult=-EINVAL;
+ }
+ // -dataorigin
+ } else if (argument.CompareTo("-dataorigin")==0) {
+ if ((bMissingParam=(++i>=argc))) break;
+ memcpy(&fDataType.fOrigin, argv[i], TMath::Min(kAliHLTComponentDataTypefOriginSize,(Int_t)strlen(argv[i])));
+ } else {
+ HLTError("unknown argument %s", argument.Data());
+ iResult=-EINVAL;
+ }
+ }
+ if (bMissingParam) {
+ HLTError("missing parameter for argument %s", argument.Data());
+ iResult=-EINVAL;
+ }
+ if (fFileNames.GetSize()==0) {
+ HLTError("the publisher needs at least one file argument");
+ iResult=-EINVAL;
+ }
+ if (iResult>=0) iResult=OpenFiles();
+ if (iResult<0) {
+ fFileNames.Clear();
+ }
+ return iResult;
+}
+
+int AliHLTFilePublisher::OpenFiles()
+{
+ int iResult=0;
+ TObjLink *lnk=fFileNames.FirstLink();
+ while (lnk && iResult>=0) {
+ TObjString* pFileName=(TObjString*)lnk->GetObject();
+ if (pFileName) {
+ TString fullFN= pFileName->GetString() + "?filetype=raw";
+ TFile* pFile = new TFile(fullFN);
+ if (pFile) {
+ if (pFile->IsZombie()==0) {
+ fFiles.Add(pFile);
+ if (pFile->GetSize()>fMaxSize) fMaxSize=pFile->GetSize();
+ } else {
+ HLTError("can not open file %s", (pFileName->GetString()).Data());
+ fFiles.Clear();
+ iResult=-ENOENT;
+ }
+ }
+ }
+ lnk = lnk->Next();
+ }
+
+ return iResult;
+}
+
+int AliHLTFilePublisher::DoDeinit()
+{
+ int iResult=0;
+ fFileNames.Clear();
+ fFiles.Clear();
+ return iResult;
+}
+
+int AliHLTFilePublisher::GetEvent( const AliHLTComponentEventData& evtData,
+ AliHLTComponentTriggerData& trigData,
+ AliHLTUInt8_t* outputPtr,
+ AliHLTUInt32_t& size,
+ vector<AliHLTComponentBlockData>& outputBlocks )
+{
+ int iResult=0;
+ TFile * pFile=NULL;
+ TObjLink *lnk;
+ if (fpCurrent) lnk=fpCurrent->Next();
+ if (lnk==NULL) lnk=fFiles.FirstLink();
+ fpCurrent=lnk;
+ if (lnk) {
+ TFile* pFile=(TFile*)lnk->GetObject();
+ if (pFile) {
+ int iCopy=pFile->GetSize();
+ if (iCopy>size) {
+ iCopy=size;
+ HLTWarning("buffer to small, data of file %s truncated", pFile->GetName());
+ }
+ if (pFile->ReadBuffer((char*)outputPtr, iCopy)!=0) {
+ // ReadBuffer returns 1 in case of failure and 0 in case of success
+ iResult=-EIO;
+ } else {
+ AliHLTComponentBlockData bd;
+ FillBlockData(bd);
+ bd.fPtr=outputPtr;
+ bd.fOffset=0;
+ bd.fSize=iCopy;
+ bd.fDataType=fDataType;
+ bd.fSpecification=fSpecification;
+ outputBlocks.push_back(bd);
+ size=iCopy;
+ }
+ } else {
+ iResult=-EFAULT;
+ }
+ } else {
+ iResult=-ENOENT;
+ }
+ return iResult;
+}
--- /dev/null
+// @(#) $Id$
+
+#ifndef ALIHLTFILEPUBLISHER_H
+#define ALIHLTFILEPUBLISHER_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/** @file AliHLTFilePublisher.h
+ @author Matthias Richter
+ @date
+ @brief An HLT file publishing (data source) component.
+ @note The class is used in Offline (AliRoot) context
+*/
+
+#include "AliHLTDataSource.h"
+#include <TList.h>
+
+/**
+ * @class AliHLTFilePublisher
+ * An HLT data source component which publishes data from one or a sequence
+ * of files.<br>
+ * Mandatory arguments: <br>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating -->
+ * \li -datafile <i> filename </i>
+ * \li -datafilelist <i> file pattern </i>
+ * \li -datatype <i> data type </i>
+ * \li -dataspec <i> specification </i>
+ * \li -dataorigin <i> origin </i>
+ *
+ * Optional arguments:<br>
+ *
+ * The component needs at least one argument \em -datafile or \em -datafilelist.
+ * Both can occur multiple times.
+ * @ingroup alihlt_component
+ */
+class AliHLTFilePublisher : public AliHLTDataSource {
+ public:
+ /** standard constructor */
+ AliHLTFilePublisher();
+ /** not a valid copy constructor, defined according to effective C++ style */
+ AliHLTFilePublisher(const AliHLTFilePublisher&);
+ /** not a valid assignment op, but defined according to effective C++ style */
+ AliHLTFilePublisher& operator=(const AliHLTFilePublisher&);
+ /** destructor */
+ virtual ~AliHLTFilePublisher();
+
+ const char* GetComponentID();
+ void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
+ AliHLTComponentDataType GetOutputDataType();
+ void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
+ AliHLTComponent* Spawn();
+
+ /**
+ * Open all files.
+ * Opens all files from the file name list @ref fFileNames and adds TFile
+ * opjects to the TFiles list.
+ */
+ int OpenFiles();
+
+ protected:
+ /**
+ * Init method.
+ */
+ int DoInit( int argc, const char** argv );
+
+ /**
+ * Deinit method.
+ */
+ int DoDeinit();
+
+ /**
+ * Data processing method for the component.
+ * @param evtData event data structure
+ * @param trigData trigger data structure
+ * @param outputPtr pointer to target buffer
+ * @param size <i>input</i>: size of target buffer
+ * <i>output</i>:size of produced data
+ * @param outputBlocks list to receive output block descriptors
+ * @return
+ */
+ int GetEvent( const AliHLTComponentEventData& evtData,
+ AliHLTComponentTriggerData& trigData,
+ AliHLTUInt8_t* outputPtr,
+ AliHLTUInt32_t& size,
+ vector<AliHLTComponentBlockData>& outputBlocks );
+
+ private:
+ TList fFileNames;
+ TList fFiles;
+ TObjLink* fpCurrent; //! transient value
+ AliHLTComponentDataType fDataType;
+ AliHLTUInt32_t fSpecification;
+ Int_t fMaxSize;
+
+ ClassDef(AliHLTFilePublisher, 0)
+};
+#endif
#include "AliHLTConfiguration.h"
#include "AliHLTConfigurationHandler.h"
#include "AliHLTTask.h"
+#include "TString.h"
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTSystem)
AliHLTSystem::~AliHLTSystem()
{
- AliHLTConfiguration::GlobalDeinit();
- if (fpConfigurationHandler) {
- delete fpConfigurationHandler;
- }
- fpConfigurationHandler=NULL;
-
- if (fpComponentHandler) {
- delete fpComponentHandler;
- }
- fpComponentHandler=NULL;
+ CleanTaskList();
+ AliHLTConfiguration::GlobalDeinit();
+ if (fpConfigurationHandler) {
+ delete fpConfigurationHandler;
+ }
+ fpConfigurationHandler=NULL;
+
+ if (fpComponentHandler) {
+ delete fpComponentHandler;
+ }
+ fpComponentHandler=NULL;
}
int AliHLTSystem::AddConfiguration(AliHLTConfiguration* pConf)
}
}
+void AliHLTSystem::PrintComponentDataTypeInfo(const AliHLTComponentDataType& dt) {
+ TString msg;
+ msg.Form("AliHLTComponentDataType(%d): ID=\"", dt.fStructSize);
+ for ( unsigned i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) {
+ if (dt.fID[i]!=0) msg+=dt.fID[i];
+ else msg+="\\0";
+ }
+ msg+="\" Origin=\"";
+ for ( unsigned i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) {
+ if (dt.fOrigin[i]!=0) msg+=dt.fOrigin[i];
+ else msg+="\\0";
+ }
+ msg+="\"";
+ HLTMessage(msg.Data());
+}
+
int AliHLTSystem::Run(Int_t iNofEvents)
{
int iResult=0;
if ((iResult=StartTasks())>=0) {
for (int i=0; i<iNofEvents && iResult>=0; i++) {
iResult=ProcessTasks(i);
+ if (iResult>=0) {
+ HLTInfo("Event %d successfully finished (%d)", i, iResult);
+ iResult=0;
+ } else {
+ HLTError("Processing of event %d failed (%d)", i, iResult);
+ // TODO: define different running modes to either ignore errors in
+ // event processing or not
+ // currently ignored
+ iResult=0;
+ }
}
StopTasks();
} else {
*/
void PrintTaskList();
+ /**
+ * Print info on an AliHLTComponentDataType structure
+ */
+ void PrintComponentDataTypeInfo(const AliHLTComponentDataType& dt);
+
/**
* Run the task list.
* All tasks of the list will be subsequently processed for each event.
/**
* Initialize the task.
* The task is initialized with a configuration descriptor. It needs a
- * component handler instance to create the analysis component.
+ * component handler instance to create the analysis component. The
+ * component is created and initialized.
* @param pConf pointer to configuration descriptor, can be NULL if it
* was already provided to the constructor
* @param pCH the HLT component handler
/**
* De-Initialize the task.
- * Final cleanup after the run. The analysis component is deleted.
+ * Final cleanup after the run. The @ref AliHLTComponent::Deinit method of
+ * the component is called. The analysis component is deleted.
*/
int Deinit();
*/
AliHLTTask* FindDependency(const char* id);
- /*
- * insert block data to the list
- * the data has to come from a task the current one depends on
- * result:
- * -EEXIST : the block data from this task has already been inserted
- * -ENOENT : no dependencies to the task the data is coming from
- */
- /*
- * this function is most likely depricated
- int InsertBlockData(AliHLTComponentBlockData* pBlock, AliHLTTask* pSource);
- */
-
/**
* Add a dependency for the task.
* The task maintains a list of other tasks it depends on.
*/
int SetTarget(AliHLTTask* pDep);
- // build a monolithic array of block data
- // @param pBlockData reference to the block data target
- // @return: array size, pointer to array in the target pTgt
- //
- /* this function is most likely depricated
- int BuildBlockDataArray(AliHLTComponentBlockData*& pBlockData);
- */
-
/**
* Prepare the task for event processing.
* The method initializes the Data Buffer and calls the
* @ref AliHLTComponent::Init method of the component.<br>
- * The @ref ProcessTask methode can be called an arbitrary number of times
+ * The @ref ProcessTask method can be called an arbitrary number of times
* as soon as the task is in <i>running</i> mode.
*/
int StartRun();
/**
* Clean-up the task after event processing.
- * The method cleans up internal structures and calls the
- * @ref AliHLTComponent::Deinit method of the component.
+ * The method cleans up internal structures.
*/
int EndRun();
* @param pConsumerTask the task which subscribes to the data
* @return number of matching data blocks
*/
- int GetNofMatchingDataBlocks(const AliHLTTask* pConsumerTask);
+ int GetNofMatchingDataBlocks(const AliHLTTask* pConsumerTask) const;
/**
* Determine the number of matching data types between the component and a
* @param pConsumerTask the task which subscribes to the data
* @return number of matching data types
*/
- int GetNofMatchingDataTypes(const AliHLTTask* pConsumerTask);
+ int GetNofMatchingDataTypes(const AliHLTTask* pConsumerTask) const;
/**
* Subscribe to the data of a source task.
* Get number of source tasks.
* @return number of source tasks
*/
- int GetNofSources() {return fListDependencies.GetSize();}
+ int GetNofSources() const {return fListDependencies.GetSize();}
private:
/** the configuration descriptor (external pointer) */
*/
#include <AliHLTDataTypes.h>
+/* Matthias Dec 2006
+ * The names have been changed for Aliroot's coding conventions sake
+ * The old names are defined for backward compatibility with the
+ * PublisherSubscriber framework
+ */
typedef AliHLTComponentLogSeverity AliHLTComponent_LogSeverity;
typedef AliHLTComponentEventData AliHLTComponent_EventData;
typedef AliHLTComponentShmData AliHLTComponent_ShmData;
# $Id$
# Makefile template for the Alice HLT framework
+# be aware of the two different meanings of 'MODULE'
+# 1. AliRoot classifies each detector and main sub-package as a module
+# so for all HLT library packages MODULE is equal HLT
+# 2. The HLT stand-alone build system knows about sub-modules
+# e.g. for libHLTbase, MODULE=HLTbase
MODULE = HLTbase
AM_CPPFLAGS = -DMODULE=$(MODULE)
# library definition
lib_LTLIBRARIES = libHLTbase.la
+# version info for the library
+LIBRARY_VERSION = '1:1:0'
+
+# MODDIR is set by the AliRoot build system and denotes the topdir
+# of the module, we must set it since the package definition libHLTbase.pkg
+# includes another common configuration file
MODDIR = $(top_srcdir)
PKGDEF = $(MODDIR)/libHLTbase.pkg
-#include $(top_srcdir)/libHLTbase.pkg
+include $(top_srcdir)/libHLTbase.pkg
# library sources
-# temporary until lib*.pkg file is commited to AliRoot
-#libHLTbase_la_SOURCES = $(MODULE_SRCS)
-libHLTbase_la_SOURCES = AliHLTComponent.cxx \
- AliHLTComponentHandler.cxx \
- AliHLTSystem.cxx \
- AliHLT_C_Component_WrapperInterface.cxx \
- AliHLTProcessor.cxx \
- AliHLTConfiguration.cxx \
- AliHLTLogging.cxx \
- AliHLTDataBuffer.cxx \
- AliHLTDataSource.cxx \
- AliHLTDataSink.cxx
+libHLTbase_la_SOURCES = $(MODULE_SRCS)
-# class header files, the link definition for the root dictionary
-# will be created from the names of the header files
-CLASS_HDRS = AliHLTComponent.h \
- AliHLTComponentHandler.h \
- AliHLTSystem.h \
- AliHLTProcessor.h \
- AliHLTConfiguration.h \
- AliHLTConfigurationHandler.h \
- AliHLTTask.h \
- AliHLTLogging.h \
- AliHLTDataBuffer.h \
- AliHLTDataSource.h \
- AliHLTDataSink.h
+# library headers
+pkginclude_HEADERS = $(MODULE_HDRS)
-# temporary until lib*.pkg file is commited to AliRoot
-#pkginclude_HEADERS = $(MODULE_HDRS)
-pkginclude_HEADERS = $(CLASS_HDRS) \
- AliHLTDataTypes.h \
- AliHLT_C_Component_WrapperInterface.h \
- AliHLTDefinitions.h \
- AliHLTStdIncludes.h
-
-# version info for the library
-libHLTbase_la_LDFLAGS = -version-info 1:1:0
+# linker flags
+libHLTbase_la_LDFLAGS = -version-info $(LIBRARY_VERSION)
# automatic generation of data and time of library build
COMPILE_INFO = HLTBaseCompileInfo.cxx
@echo '//add changes in Makefile.am' >> $@
@echo 'void $(MODULE)CompileInfo( char*& date, char*& time)' >> $@
@echo '{date=__DATE__; time=__TIME__; return;}' >> $@
-
+2007-01-05
+ - changes according to coding conventions and documentation
+ - AliHLTTPCDigitReaderRaw: HAVE_TPC_MAPPING dependend implementation
+ fixed in order to make class definition independend
+ - helper functions for data structure handling added
+ - libHLTbase.pkg and libAliHLTSample.pkg included to the stand-alone
+ build system
+ - AliHLTFilePublisher added
+ - target to create the stand-alone sample library package added
2006-12-28 changes according to coding conventions
- special characters in function names have been removed in the
internal usage, the C interface still uses them in order to preserve
$(PHOS_DIR) \
doc
+EXTRA_DIST = libHLTbase.pkg \
+ libAliHLTSample.pkg \
+ hlt.conf
+
DIST_SUBDIRS = $(SUBDIRS)
+SampleLibPkg: Makefile $(top_srcdir)/SampleLib/*
+ @tmpdir=/tmp/$(USER)/$@ ; \
+ if test -d $@ ; then \
+ cp -ruv $(top_srcdir)/SampleLib/* $@; \
+ cp -uv $(top_srcdir)/libAliHLTSample.pkg $@; \
+ cp -uv $(top_srcdir)/acinclude.m4 $@; \
+ else \
+ (test ! -d $$tmpdir || rm $$tmpdir); \
+ echo "creating package in tmp dir $$tmpdir" ; \
+ mkdir -p $$tmpdir && \
+ (cp -r $(top_srcdir)/SampleLib/* $$tmpdir ; \
+ cp -uv $(top_srcdir)/libAliHLTSample.pkg $$tmpdir ; \
+ cp -uv $(top_srcdir)/acinclude.m4 $$tmpdir; \
+ (echo 'running autoreconf -f -i' ;cd $$tmpdir ; autoreconf -f -i) ; \
+ echo moving $$tmpdir to `pwd`; mv $$tmpdir . ) \
+ fi
+
+clean-local:
+ (test ! -d SampleLibPkg || rm -rf SampleLibPkg)
+
#
# EOF
#
using namespace std;
#endif
+#include "AliHLTSystem.h"
#include "AliHLTDummyComponent.h"
#include <stdlib.h>
#include <errno.h>
ClassImp(AliHLTDummyComponent)
AliHLTDummyComponent::AliHLTDummyComponent()
+ :
+ fOutputPercentage(100) // By default we copy to the output exactly what we got as input
{
- fOutputPercentage = 100; // By default we copy to the output exactly what we got as input
}
AliHLTDummyComponent::~AliHLTDummyComponent()
AliHLTComponentDataType AliHLTDummyComponent::GetOutputDataType()
{
- return (AliHLTComponentDataType){ sizeof(AliHLTComponentDataType), {'D','U','M','M','Y',' ',' ',' '},{'D','U','M','Y'}};
+ AliHLTComponentDataType dt;
+ SetDataType(dt, "DUMMY", "DUMY");
+ cout << "SetDataType: size " << dt.fStructSize << endl;
+ return dt;
}
void AliHLTDummyComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
AliHLTComponent* AliHLTDummyComponent::Spawn()
{
return new AliHLTDummyComponent;
- };
+ }
int AliHLTDummyComponent::DoInit( int argc, const char** argv )
{
ClassImp(AliHLTSampleComponent1)
-const AliHLTComponentDataType AliHLTSampleComponent1::inputDataTypes[]={{0,0}, {0,0}}; //'zero' terminated array
-const AliHLTComponentDataType AliHLTSampleComponent1::outputDataType={0,0};
+const AliHLTComponentDataType AliHLTSampleComponent1::inputDataTypes[]={kAliHLTVoidDataType,
+ {0,"",""}}; //'zero' terminated array
+const AliHLTComponentDataType AliHLTSampleComponent1::outputDataType=kAliHLTVoidDataType;
AliHLTSampleComponent1::AliHLTSampleComponent1()
{
ClassImp(AliHLTSampleComponent2)
-const AliHLTComponentDataType AliHLTSampleComponent2::inputDataTypes[]={{0,0}, {0,0}}; //'zero' terminated array
-const AliHLTComponentDataType AliHLTSampleComponent2::outputDataType={0,0};
+const AliHLTComponentDataType AliHLTSampleComponent2::inputDataTypes[]={kAliHLTVoidDataType,
+ {0,"",""}}; //'zero' terminated array
+const AliHLTComponentDataType AliHLTSampleComponent2::outputDataType=kAliHLTVoidDataType;
AliHLTSampleComponent2::AliHLTSampleComponent2()
{
MODULE = AliHLTSample
-#EXTRA_DIST = libAliHLTSample.pkg
+EXTRA_DIST =
+if STANDALONE_SAMPLELIB
+EXTRA_DIST += libAliHLTSample.pkg
+endif
# include the pkg definition which actually contains the source
# file definitions
-#include libAliHLTSample.pkg
+include $(top_srcdir)/libAliHLTSample.pkg
# library definition
# The lib_LTLIBRARIES variable is a fixed variable of the autotools build
# library sources
# The source files are specified in libAliHLTSample.pkg
-#libAliHLTSample_la_SOURCES = $(MODULE_SRCS)
-# temporary until lib*.pkg file is commited to AliRoot
-libAliHLTSample_la_SOURCES= AliHLTSampleComponent1.cxx \
- AliHLTSampleComponent2.cxx \
- AliHLTDummyComponent.cxx
-
-# temporary until lib*.pkg file is commited to AliRoot
-CLASS_HDRS= AliHLTSampleComponent1.h \
- AliHLTSampleComponent2.h \
- AliHLTDummyComponent.h
+libAliHLTSample_la_SOURCES = $(MODULE_SRCS)
# library headers
# The header files are specified in libAliHLTSample.pkg
-#noinst_HEADERS = $(MODULE_HDRS)
-# temporary until lib*.pkg file is commited to AliRoot
-noinst_HEADERS= $(CLASS_HDRS)
+noinst_HEADERS = $(MODULE_HDRS)
# compilation flags of the library
# This is the place to add further include directories if you are
3. Copy the SampleLib folder as new 'Test' folder
> cp -a SampleLib Test
-4. Change dir to the new folder
-> cd Test
+4. Copy libAliHLTSample.pkg to libAliHLTTest.pkg
+> cp libAliHLTSample.pkg libAliHLTTest.pkg
-5. Rename libAliHLTSample.pkg to libAliHLTTest.pkg
-> mv libAliHLTSample.pkg libAliHLTTest.pkg
+5. Change dir to the new folder
+> cd Test
6. Open 'Makefile.am' with an editor
This is the Makefile template for the autotools build system. In particular
http://www.kip.uni-heidelberg.de/wiki/HLT
8. Once you are finnished with the first code development, you have to add
- the new component files to the build system. Open 'libAliHLTTest.pkg'
+ the new component files to the build system. Open 'libAliHLTTest.pkg' in
+ the package topdir
8.1. Add all your source files to the SRCS variable, remove the files from
the libAliHLTSample
8.2. Add all header files of classes which should be added to the ROOT
2. Requirements
===============
+At this point you should have downloaded and unpacked a package with name
+alice-hlt-sample.tar.gz. If not, please download it from
+http://www.kip.uni-heidelberg.de/ti/HLT/software/download/alice-hlt-sample.tar.gz
+The following description refers to that package.
+
The package needs both ROOT and AliRoot. Both must be set up in the
usual way (ROOTSYS, ALICE_ROOT, library locations evtl. specified in
LD_LIBRARY_PATH, ...). The package also needs the ALICE HLT component
===============
Package build relies on the GNU triplet configure, make and make install.
In order to keep the development directory clean, it is recommended to
-use a separate build directory.
+use a separate build directory. Please read the full section before you
+start. The build is in priciple done like
mkdir build
cd build
file '<component>.cxx
Leave your build directory and go back to the top directory where you can find
-the source code as well as the Makefile template Makefile.am. Choose a new
-name of your library (the tutorial uses AliHLTTest) and follow the instructions
-5 to 8 of Part A (embedded case).
+the source code as well as the Makefile template Makefile.am.
+1. Choose a new name of your library (the tutorial uses AliHLTTest)
+
+2. Copy libAliHLTSample.pkg to libAliHLTTest.pkg
+> cp libAliHLTSample.pkg libAliHLTTest.pkg
+
+3. follow the instructions 6 to 8 of Part A (embedded case).
When you are done with this, you can build the library by typing 'make' in your
build directory, and install it by make install.
+++ /dev/null
-dnl
-dnl $Id$
-dnl
-dnl Copyright (C) 2002 Christian Holm Christensen <cholm@nbi.dk>
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public License
-dnl as published by the Free Software Foundation; either version 2.1
-dnl of the License, or (at your option) any later version.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free
-dnl Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-dnl 02111-1307 USA
-dnl
-dnl ------------------------------------------------------------------
-AC_DEFUN([AC_DEBUG],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_PROG_CXX])
- AC_MSG_CHECKING(whether to make debug objects)
- AC_ARG_ENABLE(debug,
- [AC_HELP_STRING([--enable-debug],[Enable debugging symbols in objects])],
- [],[enable_debug=yes])
- if test "x$enable_debug" = "xno" ; then
- CFLAGS=`echo $CFLAGS | sed 's,-g,,'`
- CXXFLAGS=`echo $CXXFLAGS | sed 's,-g,,'`
- else
- AC_DEFINE(__DEBUG)
- case $CXXFLAGS in
- *-g*) ;;
- *) CXXFLAGS="$CXXFLAGS -g" ;;
- esac
- case $CFLAGS in
- *-g*) ;;
- *) CFLAGS="$CFLAGS -g" ;;
- esac
- fi
- AC_MSG_RESULT($enable_debug 'CFLAGS=$CFLAGS')
-])
-
-dnl ------------------------------------------------------------------
-AC_DEFUN([AC_OPTIMIZATION],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_PROG_CXX])
-
- AC_ARG_ENABLE(optimization,
- [AC_HELP_STRING([--enable-optimization],[Enable optimization of objects])],
- [],[enable_optimization=yes])
-
- AC_MSG_CHECKING(for optimiztion level)
-
- changequote(<<, >>)dnl
- if test "x$enable_optimization" = "xno" ; then
- CFLAGS=`echo $CFLAGS | sed 's,-O\([0-9][0-9]*\|\),,'`
- CXXFLAGS=`echo $CXXFLAGS | sed 's,-O\([0-9][0-9]*\|\),,'`
- elif test "x$enable_optimization" = "xyes" ; then
- case $CXXFLAGS in
- *-O*) ;;
- *) CXXFLAGS="$CXXFLAGS -O2" ;;
- esac
- case $CFLAGS in
- *-O*) ;;
- *) CFLAGS="$CXXFLAGS -O2" ;;
- esac
- else
- CFLAGS=`echo $CFLAGS | sed "s,-O\([0-9][0-9]*\|\),-O$enable_optimization,"`
- CXXFLAGS=`echo $CXXFLAGS | sed "s,-O\([0-9][0-9]*\|\),-O$enable_optimization,"`
- fi
- changequote([, ])dnl
- AC_MSG_RESULT($enable_optimization 'CFLAGS=$CFLAGS')
-])
-
-dnl ------------------------------------------------------------------
-
-dnl
-dnl Autoconf macro to check for existence or ROOT on the system
-dnl Synopsis:
-dnl
-dnl ROOT_PATH([MINIMUM-VERSION, [ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND]]])
-dnl
-dnl Some examples:
-dnl
-dnl ROOT_PATH(3.03/05, , AC_MSG_ERROR(Your ROOT version is too old))
-dnl ROOT_PATH(, AC_DEFINE([HAVE_ROOT]))
-dnl
-dnl The macro defines the following substitution variables
-dnl
-dnl ROOTCONF full path to root-config
-dnl ROOTEXEC full path to root
-dnl ROOTCINT full path to rootcint
-dnl ROOTLIBDIR Where the ROOT libraries are
-dnl ROOTINCDIR Where the ROOT headers are
-dnl ROOTCFLAGS Extra compiler flags
-dnl ROOTLIBS ROOT basic libraries
-dnl ROOTGLIBS ROOT basic + GUI libraries
-dnl ROOTAUXLIBS Auxilary libraries and linker flags for ROOT
-dnl ROOTAUXCFLAGS Auxilary compiler flags
-dnl ROOTRPATH Same as ROOTLIBDIR
-dnl
-dnl The macro will fail if root-config and rootcint isn't found.
-dnl
-dnl Christian Holm Christensen <cholm@nbi.dk>
-dnl
-AC_DEFUN([ROOT_PATH],
-[
- AC_ARG_WITH(rootsys,
- [ --with-rootsys top of the ROOT installation directory],
- user_rootsys=$withval,
- user_rootsys="none")
- if test ! x"$user_rootsys" = xnone; then
- rootbin="$user_rootsys/bin"
- elif test ! x"$ROOTSYS" = x ; then
- rootbin="$ROOTSYS/bin"
- else
- rootbin=$PATH
- fi
- AC_PATH_PROG(ROOTCONF, root-config , no, $rootbin)
- AC_PATH_PROG(ROOTEXEC, root , no, $rootbin)
- AC_PATH_PROG(ROOTCINT, rootcint , no, $rootbin)
-
- if test ! x"$ROOTCONF" = "xno" && \
- test ! x"$ROOTCINT" = "xno" ; then
-
- # define some variables
- ROOTLIBDIR=`$ROOTCONF --libdir`
- ROOTINCDIR=`$ROOTCONF --incdir`
- ROOTCFLAGS=`$ROOTCONF --noauxcflags --cflags`
- ROOTLIBS=`$ROOTCONF --noauxlibs --noldflags --libs`
- ROOTGLIBS=`$ROOTCONF --noauxlibs --noldflags --glibs`
- ROOTAUXCFLAGS=`$ROOTCONF --auxcflags`
- ROOTAUXLIBS=`$ROOTCONF --auxlibs`
- ROOTRPATH=$ROOTLIBDIR
-
- if test $1 ; then
- AC_MSG_CHECKING(wether ROOT version >= [$1])
- vers=`$ROOTCONF --version | tr './' ' ' | awk 'BEGIN { FS = " "; } { printf "%d", ($''1 * 1000 + $''2) * 1000 + $''3;}'`
- requ=`echo $1 | tr './' ' ' | awk 'BEGIN { FS = " "; } { printf "%d", ($''1 * 1000 + $''2) * 1000 + $''3;}'`
- if test $vers -lt $requ ; then
- AC_MSG_RESULT(no)
- no_root="yes"
- else
- AC_MSG_RESULT(yes)
- fi
- fi
- else
- # otherwise, we say no_root
- no_root="yes"
- fi
-
- AC_SUBST(ROOTLIBDIR)
- AC_SUBST(ROOTINCDIR)
- AC_SUBST(ROOTCFLAGS)
- AC_SUBST(ROOTLIBS)
- AC_SUBST(ROOTGLIBS)
- AC_SUBST(ROOTAUXLIBS)
- AC_SUBST(ROOTAUXCFLAGS)
- AC_SUBST(ROOTRPATH)
-
- if test "x$no_root" = "x" ; then
- ifelse([$2], , :, [$2])
- else
- ifelse([$3], , :, [$3])
- fi
-])
-
-
-#
-# EOF
-#
AC_DEBUG
AC_OPTIMIZATION
+AM_CONDITIONAL(STANDALONE_SAMPLELIB, 1)
dnl ------------------------------------------------------------------
dnl
dnl check for AliRoot features
AC_LANG_PUSH(C++)
have_aliroot=no
-AC_ARG_WITH(aliroot,[ --with-aliroot top of the AliRoot installation],
+AC_ARG_WITH(aliroot,[ --with-aliroot top of the AliRoot installation],
[test -d $with_aliroot && ALICE_ROOT=$with_aliroot],
[])
dnl ------------------------------------------------------------------
dnl check for the HLT component framework
AC_MSG_CHECKING([for HLT component framework in ])
-AC_ARG_WITH(hltbase, [installation path of the HLT component framework],
+AC_ARG_WITH(hltbase, [ --with-hltbase installation path of the HLT component framework],
[],
[test -n $have_aliroot && with_hltbase=$have_aliroot ])
if test -z $with_hltbase || ! test -d $with_hltbase ; then
AC_DEBUG
AC_OPTIMIZATION
+AM_CONDITIONAL(STANDALONE_SAMPLELIB, 0)
dnl ------------------------------------------------------------------
dnl
#-*- Mode: Makefile -*-
# $Id:
-include HLT/hlt.conf
-
# This files defines the source and header files for the
# libAliHLTSample library and additional flags for the compilation
# and linking process. For further information refer to the
# directories and linking flags/options must be specified in
# Makefile.am (stand-alone build system) and here (AliRoot).
EDEFINE := ${HLTDEFS}
-PACKCXXFLAGS := ${HLTCXXFLAGS}
-PACKCFLAGS := ${HLTCLFAGS}
-PACKDCXXFLAGS:= ${HLTDCXXFLAGS}
+PACKCXXFLAGS := $(filter-out -ansi,$(filter-out -pedantic-errors, $(CXXFLAGS)))
+PACKCFLAGS := $(filter-out -ansi, $(filter-out -pedantic-errors, $(CFLAGS)))
+PACKDCXXFLAGS:= $(filter-out -pedantic-errors, $(CXXFLAGS))
EINCLUDE := HLT/BASE
#-*- Mode: Makefile -*-
# $Id:
-include HLT/hlt.conf
+include $(MODDIR)/hlt.conf
MODULE_SRCS= AliHLTComponent.cxx \
AliHLTComponentHandler.cxx \
AliHLTLogging.cxx \
AliHLTDataBuffer.cxx \
AliHLTDataSource.cxx \
- AliHLTDataSink.cxx
+ AliHLTDataSink.cxx \
+ AliHLTFilePublisher.cxx
CLASS_HDRS:= AliHLTComponent.h \
AliHLTComponentHandler.h \
AliHLTLogging.h \
AliHLTDataBuffer.h \
AliHLTDataSource.h \
- AliHLTDataSink.h
+ AliHLTDataSink.h \
+ AliHLTFilePublisher.h
MODULE_HDRS:= $(CLASS_HDRS) \
AliHLTDataTypes.h \