#include "AliHLTComponentHandler.h"
#include "AliHLTComponent.h"
#include "AliHLTDataTypes.h"
-//#include "AliHLTSystem.h"
+#include "AliHLTModuleAgent.h"
#include "TString.h"
-// the standard components
-// #include "AliHLTFilePublisher.h"
-// #include "AliHLTFileWriter.h"
-// #include "AliHLTRootFilePublisherComponent.h"
-// #include "AliHLTRootFileWriterComponent.h"
-
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTComponentHandler)
fScheduleList(),
fLibraryList(),
fEnvironment(),
- fStandardList()
+ fOwnedComponents()
{
// see header file for class documentation
// or
fScheduleList(),
fLibraryList(),
fEnvironment(),
- fStandardList()
+ fOwnedComponents()
{
// see header file for class documentation
if (pEnv) {
// for redirection
AliHLTLogging::Init(pEnv->fLoggingFunc);
}
- } else
+ } else {
memset(&fEnvironment, 0, sizeof(AliHLTComponentEnvironment));
+ }
+ //#ifndef __DEBUG
+ //SetLocalLoggingLevel(kHLTLogError);
+ //#else
+ //SetLocalLoggingLevel(kHLTLogInfo);
+ //#endif
+
AddStandardComponents();
}
return iResult;
}
+Int_t AliHLTComponentHandler::AddComponent(AliHLTComponent* pSample)
+{
+ // see header file for class documentation
+ Int_t iResult=0;
+ if ((iResult=RegisterComponent(pSample))>=0) {
+ fOwnedComponents.push_back(pSample);
+ }
+ return iResult;
+}
+
Int_t AliHLTComponentHandler::RegisterComponent(AliHLTComponent* pSample)
{
// see header file for class documentation
}
}
+int AliHLTComponentHandler::HasOutputData( const char* componentID)
+{
+ // see header file for class documentation
+ int iResult=0;
+ AliHLTComponent* pSample=FindComponent(componentID);
+ if (pSample) {
+ AliHLTComponent::TComponentType ct=AliHLTComponent::kUnknown;
+ ct=pSample->GetComponentType();
+ iResult=(ct==AliHLTComponent::kSource || ct==AliHLTComponent::kProcessor);
+ } else {
+ iResult=-ENOENT;
+ }
+ return iResult;
+}
+
void AliHLTComponentHandler::SetEnvironment(AliHLTComponentEnvironment* pEnv)
{
// see header file for class documentation
}
}
-int AliHLTComponentHandler::LoadLibrary( const char* libraryPath )
+int AliHLTComponentHandler::LoadLibrary( const char* libraryPath, int bActivateAgents)
{
// see header file for class documentation
int iResult=0;
if (libraryPath) {
+ // first activate all agents which are already loaded
+ if (bActivateAgents) ActivateAgents();
+
+ // set the global component handler for static component registration
AliHLTComponent::SetGlobalComponentHandler(this);
+
AliHLTLibHandle hLib;
const char* loadtype="";
#ifdef HAVE_DLFCN_H
// use interface to the dynamic linking loader
- hLib.fHandle=dlopen(libraryPath, RTLD_NOW);
- loadtype="dlopen";
+ try {
+ hLib.fHandle=dlopen(libraryPath, RTLD_NOW);
+ loadtype="dlopen";
+ }
+ catch (...) {
+ // error message printed further down
+ loadtype="dlopen exeption";
+ }
#else
// use ROOT dynamic loader
// check if the library was already loaded, as Load returns
// 'failure' if the library was already loaded
+ try {
AliHLTLibHandle* pLib=FindLibrary(libraryPath);
if (pLib) {
int* pRootHandle=reinterpret_cast<int*>(pLib->fHandle);
//HLTDebug("library %s loaded via gSystem", libraryPath);
}
loadtype="gSystem";
+ }
+ catch (...) {
+ // error message printed further down
+ loadtype="gSystem exeption";
+ }
#endif //HAVE_DLFCN_H
if (hLib.fHandle!=NULL) {
// create TString object to store library path and use pointer as handle
} else {
HLTInfo("no build info available (possible AliRoot embedded build)");
}
+
+ // static registration of components when library is loaded
iResult=RegisterScheduledComponents();
+
} else {
- HLTError("can not load library %s", libraryPath);
+ HLTError("can not load library %s (%s)", libraryPath, loadtype);
#ifdef HAVE_DLFCN_H
HLTError("dlopen error: %s", dlerror());
#endif //HAVE_DLFCN_H
#endif
}
AliHLTComponent::UnsetGlobalComponentHandler();
+
+ if (iResult>=0) {
+ // alternative dynamic registration by library agents
+ // !!! has to be done after UnsetGlobalComponentHandler
+ if (bActivateAgents) ActivateAgents();
+ }
+
} else {
iResult=-EINVAL;
}
fgAliLoggingFunc=NULL;
TString* pName=reinterpret_cast<TString*>(handle.fName);
#ifdef HAVE_DLFCN_H
- dlclose(handle.fHandle);
+ try {
+ dlclose(handle.fHandle);
+ }
+ catch (...) {
+ HLTError("exeption caught during dlclose of library %s", pName!=NULL?pName->Data():"");
+ }
#else
int* pCount=reinterpret_cast<int*>(handle.fHandle);
if (--(*pCount)==0) {
// see header file for class documentation
int iResult=0;
AliHLTComponent::SetGlobalComponentHandler(this);
-// fStandardList.push_back(new AliHLTFilePublisher);
-// fStandardList.push_back(new AliHLTFileWriter);
-// fStandardList.push_back(new AliHLTRootFilePublisherComponent);
-// fStandardList.push_back(new AliHLTRootFileWriterComponent);
AliHLTComponent::UnsetGlobalComponentHandler();
iResult=RegisterScheduledComponents();
return iResult;
return iResult;
}
+int AliHLTComponentHandler::ActivateAgents(const AliHLTModuleAgent** blackList, int size)
+{
+ // see header file for class documentation
+ int iResult=0;
+ AliHLTModuleAgent* pAgent=AliHLTModuleAgent::GetFirstAgent();
+ while (pAgent && iResult>=0) {
+ if (blackList) {
+ int i=0;
+ for (; i<size; i++) {
+ if (blackList[i]==pAgent) break;
+ }
+ if (i<size) {
+ // this agent was in the list
+ pAgent=AliHLTModuleAgent::GetNextAgent();
+ continue;
+ }
+ }
+
+ pAgent->ActivateComponentHandler(this);
+ pAgent=AliHLTModuleAgent::GetNextAgent();
+ }
+ return iResult;
+}
+
int AliHLTComponentHandler::DeleteStandardComponents()
{
// see header file for class documentation
int iResult=0;
- vector<AliHLTComponent*>::iterator element=fStandardList.begin();
- while (element!=fStandardList.end()) {
+ vector<AliHLTComponent*>::iterator element=fOwnedComponents.begin();
+ while (element!=fOwnedComponents.end()) {
//DeregisterComponent((*element)->GetComponentID());
delete(*element);
- fStandardList.erase(element);
- element=fStandardList.begin();
+ fOwnedComponents.erase(element);
+ element=fOwnedComponents.begin();
}
return iResult;
}
#include "AliHLTLogging.h"
class AliHLTComponent;
+class AliHLTModuleAgent;
struct AliHLTComponentEnvironment;
struct AliHLTComponentDataType;
* handler. The object has to be valid during the whole runtime and should
* thus be a global object which is ONLY used for the purpose of registration.
* This also ensures automatically registration at library load time.
- * @param libraryPath const char string containing the library name/path
+ * @param libraryPath const char string containing the library name/path
+ * @param bActivateAgents activate agents after loading (@ref ActivateAgents)
* @return 0 if succeeded, neg. error code if failed
*/
- int LoadLibrary( const char* libraryPath );
+ int LoadLibrary( const char* libraryPath, int bActivateAgents=1 );
/**
* Find a symbol in a dynamically loaded library.
* Registration is done by passing a sample object of the component to the
* handler. The object has to be valid during the whole runtime and should
* thus be a global object which is ONLY used for the purpose of registration.
- * @param pSample a sample object of the component
+ * @param pSample a sample object of the component
* @return neg. error code if failed
*/
- int RegisterComponent(AliHLTComponent* pSample );
+ int RegisterComponent(AliHLTComponent* pSample);
+
+ /**
+ * Add a component and leave control of the sample object to the handler.
+ * Exactly the same functionality as @ref RegisterComponent but deletes
+ * the sample object at clean-up of the handler.
+ * @param pSample a sample object of the component
+ * @return neg. error code if failed
+ */
+ int AddComponent(AliHLTComponent* pSample);
/**
* Registers all scheduled components.
return CreateComponent( componentID, pEnvParam, 0, NULL, component );
}
+ /**
+ * Check if a registered component has output data, e.g. is of type
+ * kSource or kProcessor (see @ref AliHLTComponent::TComponentType).
+ * @param componentID ID of the component to create
+ * @return 1 if component has output data, 0 if not <br>
+ * -ENOENT if component does not exist
+ */
+ int HasOutputData( const char* componentID);
+
/**
* Print registered components to stdout.
* @return none
*/
int AnnounceVersion();
+ /**
+ * Find a component.
+ * @param componentID ID of the component to find
+ * @return index, neg. error code if failed
+ */
+ int FindComponentIndex(const char* componentID);
+
protected:
private:
/** assignment operator prohibited */
AliHLTComponentHandler& operator=(const AliHLTComponentHandler&);
- /**
- * Find a component.
- * @param componentID ID of the component to find
- * @return index, neg. error code if failed
- */
- int FindComponentIndex(const char* componentID);
-
/**
* Find a component.
* @param componentID ID of the component to find
int UnloadLibraries();
/**
- * Compount descriptor for component libraries
+ * Activate all module agents with this component handler.
+ * The function loops over all available module agents and activates
+ * each agent with this component handler. During activation, the
+ * dynamic component registration is carried out by the agents version
+ * of @ref AliHLTModuleAgent::RegisterComponents
+ * @param blackList array of agents which should be excluded
+ * @param size array size
+ */
+ int ActivateAgents(const AliHLTModuleAgent** blackList=NULL, int size=0);
+
+ /**
+ * Compound descriptor for component libraries
*/
struct AliHLTLibHandle {
AliHLTLibHandle() : fHandle(NULL), fName(NULL) {}
vector<AliHLTLibHandle> fLibraryList; // see above
/** running environment for the component */
AliHLTComponentEnvironment fEnvironment; // see above
- /** list of standard components */
- vector<AliHLTComponent*> fStandardList; // see above
+ /** list of owned components, deleted at termination of the handler */
+ vector<AliHLTComponent*> fOwnedComponents; // see above
ClassDef(AliHLTComponentHandler, 0);
AliHLTModuleAgent::AliHLTModuleAgent()
:
- fpNext(NULL)
+ fpNext(NULL),
+ fpComponentHandler(NULL)
{
// see header file for class documentation
// or
return NULL;
}
-int AliHLTModuleAgent::RegisterComponents(AliRawReader* /*rawReader*/,
- AliRunLoader* /*runloader*/) const
+int AliHLTModuleAgent::ActivateComponentHandler(AliHLTComponentHandler* pHandler)
+{
+ int iResult=0;
+ if (pHandler==NULL) {
+ if (fpComponentHandler!=NULL) {
+ // reset and think about deregistration
+ fpComponentHandler=NULL;
+ HLTWarning("deregistration of components not yet implemented");
+ }
+ return 0;
+ }
+ if (fpComponentHandler!=NULL) {
+ if (pHandler!=fpComponentHandler) {
+ HLTError("only one component handler can be activated per agent");
+ return -EINVAL;
+ }
+ return 0;
+ }
+ if ((iResult=RegisterComponents(pHandler))>=0) {
+ fpComponentHandler=pHandler;
+ }
+ return iResult;
+}
+
+int AliHLTModuleAgent::RegisterComponents(AliHLTComponentHandler* /*pHandler*/) const
{
// default method, nothing to be done, child classes can overload
return 0;
#include "AliHLTLogging.h"
#include "AliHLTConfiguration.h"
#include "AliHLTConfigurationHandler.h"
+#include "AliHLTComponentHandler.h"
class AliRunLoader;
class AliRawReader;
*/
static AliHLTModuleAgent* GetNextAgent();
+ /**
+ * Activate a component handler for this agent.
+ * The @ref RegisterComponents method will be called in order to allow
+ * the agent to register components. Once activated, the function can
+ * be called repeatedly with the same handler and gently ignores the
+ * invocation. In the current stage of development, only one handler
+ * can be activated per agent. This is sufficient for the current
+ * operation, but can be extended.
+ * @param pHandler [in] the component handler instance
+ */
+ int ActivateComponentHandler(AliHLTComponentHandler* pHandler);
+
/**
* Register all configurations belonging to this module with the
* AliHLTConfigurationHandler. The agent can adapt the configurations
virtual const char* GetRequiredComponentLibraries() const;
/**
- * Register componets.
+ * Register components.
* This method can be used to register components for the module instead
- * of the 'static object approach'. Registration is don by passing a
- * sample object to @ref AliHLTComponentHandler::RegisterComponent<br>
- * \em Note: The sample object is owned by the agent, make sure to delete
- * it.
+ * of the 'static object approach'. Registration is done by passing a
+ * sample object to the AliHLTComponentHandler via
+ * - @ref AliHLTComponentHandler::RegisterComponent <br>
+ * The sample object is owned by the agent, make sure to delete it.
+ * - @ref AliHLTComponentHandler::AddComponent <br>
+ * Same functionality but handler deletes the object at the end.
+ *
+ * @param pHandler [in] instance of the component handler
*/
- virtual int RegisterComponents(AliRawReader* rawReader=NULL,
- AliRunLoader* runloader=NULL) const;
+ virtual int RegisterComponents(AliHLTComponentHandler* pHandler) const;
/**
* Old method kept for backward compatibility, redirected to @ref
/** number of agents */
static int fCount; //! transient
- ClassDef(AliHLTModuleAgent, 1);
+ /* instance of the active component handler */
+ AliHLTComponentHandler* fpComponentHandler; //! transient
+
+ ClassDef(AliHLTModuleAgent, 2);
};
#endif
using namespace std;
#endif
+#include <cassert>
#include "AliHLTStdIncludes.h"
#include "AliHLTSystem.h"
#include "AliHLTComponentHandler.h"
AliHLTComponentLogSeverity loglevel=fpComponentHandler->GetLocalLoggingLevel();
fpComponentHandler->SetLocalLoggingLevel(kHLTLogError);
fpComponentHandler->SetEnvironment(&env);
- fpComponentHandler->LoadLibrary("libAliHLTUtil.so");
+ fpComponentHandler->LoadLibrary("libAliHLTUtil.so", 0/* do not activate agents */);
fgAliLoggingFunc=(AliHLTLogging::AliHLTDynamicMessage)fpComponentHandler->FindSymbol("libAliHLTUtil.so", "AliDynamicMessage");
fpComponentHandler->SetLocalLoggingLevel(loglevel);
if (fgAliLoggingFunc==NULL) {
// see header file for class documentation
AliHLTTask* pTask=NULL;
if (id) {
- pTask=(AliHLTTask*)fTaskList.FindObject(id);
+ pTask=dynamic_cast<AliHLTTask*>(fTaskList.FindObject(id));
}
return pTask;
}
}
if (iResult>=0) {
iResult=iCount;
- } else if (iResult==-ENOENT) {
+ } else if (iResult==-ENOKEY) {
iResult=0; // do not propagate the error
}
ClearStatusFlags(kRunning);
if (lnk==NULL) {
HLTWarning("Task list is empty, aborting ...");
- return -ENOENT;
+ return -ENOKEY;
}
while (lnk && iResult>=0) {
TObject* obj=lnk->GetObject();
if (CheckStatus(kReady)) {
if (nofEvents==0) {
// special case to close the reconstruction
+ if (!CheckStatus(kError)) {
StopTasks();
DeinitTasks();
+ }
} else {
if ((iResult=AliHLTOfflineInterface::SetParamsToComponents(runLoader, rawReader))>=0) {
// the system always remains started after event processing, a specific
- // call with nofEvents==0 is neede to execute the stop sequence
- iResult=Run(nofEvents, 0);
+ // call with nofEvents==0 is needed to execute the stop sequence
+ if ((iResult=Run(nofEvents, 0))<0) SetStatusFlags(kError);
}
}
} else {
int AliHLTSystem::Configure(AliRunLoader* runloader)
{
// see header file for class documentation
- Configure(NULL, runloader);
+ return Configure(NULL, runloader);
}
int AliHLTSystem::Configure(AliRawReader* rawReader, AliRunLoader* runloader)
SetStatusFlags(kConfigurationLoaded);
if (CheckFilter(kHLTLogDebug))
fpConfigurationHandler->PrintConfigurations();
- iResult=BuildTaskListsFromTopConfigurations(rawReader, runloader);
+ iResult=BuildTaskListsFromReconstructionChains(rawReader, runloader);
if (iResult>=0) {
SetStatusFlags(kTaskListCreated);
}
return iResult;
}
-int AliHLTSystem::BuildTaskListsFromTopConfigurations(AliRawReader* rawReader, AliRunLoader* runloader)
+int AliHLTSystem::BuildTaskListsFromReconstructionChains(AliRawReader* rawReader, AliRunLoader* runloader)
{
// see header file for class documentation
if (CheckStatus(kRunning)) {
}
int iResult=0;
- AliHLTModuleAgent* pAgent=AliHLTModuleAgent::GetFirstAgent();
- while ((pAgent || fChains.Length()>0) && iResult>=0) {
- TString tops;
- if (fChains.Length()>0) {
- tops=fChains;
- HLTInfo("custom local reconstruction configurations: %s", tops.Data());
- } else {
- tops=pAgent->GetReconstructionChains(rawReader, runloader);
- HLTInfo("local reconstruction configurations for agent %s (%p): %s", pAgent->GetName(), pAgent, tops.Data());
+ int bHaveOutput=0;
+
+ // query chains
+ TString chains;
+ if (fChains.Length()>0) {
+ chains=fChains;
+ HLTInfo("custom reconstruction chain: %s", chains.Data());
+ } else {
+ AliHLTModuleAgent* pAgent=AliHLTModuleAgent::GetFirstAgent();
+ while ((pAgent || fChains.Length()>0) && iResult>=0) {
+ const char* agentchains=pAgent->GetReconstructionChains(rawReader, runloader);
+ if (agentchains) {
+ if (!chains.IsNull()) chains+="";
+ chains+=agentchains;
+ HLTInfo("reconstruction chains for agent %s (%p): %s", pAgent->GetName(), pAgent, agentchains);
+ }
+ pAgent=AliHLTModuleAgent::GetNextAgent();
}
- TObjArray* pTokens=tops.Tokenize(" ");
- if (pTokens) {
- int iEntries=pTokens->GetEntries();
- for (int i=0; i<iEntries && iResult>=0; i++) {
- const char* pCID=((TObjString*)pTokens->At(i))->GetString().Data();
- AliHLTConfiguration* pConf=fpConfigurationHandler->FindConfiguration(pCID);
- if (pConf) {
- iResult=BuildTaskList(pConf);
- } else {
- HLTWarning("can not find top configuration %s", pCID);
+ }
+
+ // build task list for chains
+ TObjArray* pTokens=chains.Tokenize(" ");
+ if (pTokens) {
+ int iEntries=pTokens->GetEntries();
+ for (int i=0; i<iEntries && iResult>=0; i++) {
+ const char* pCID=((TObjString*)pTokens->At(i))->GetString().Data();
+ AliHLTConfiguration* pConf=fpConfigurationHandler->FindConfiguration(pCID);
+ if (pConf) {
+ iResult=BuildTaskList(pConf);
+ if (runloader) {
+ assert(fpComponentHandler!=NULL);
+ TString cid=pConf->GetComponentID();
+ if (cid.CompareTo("HLTOUT")==0) {
+ // remove from the input of a global HLTOUT configuration
+ chains.ReplaceAll(pCID, "");
+ } else if (bHaveOutput==0) {
+ // check whether this configuration produces data output
+ if ((bHaveOutput=fpComponentHandler->HasOutputData(cid.Data()))<0) {
+ bHaveOutput=0;
+ chains.ReplaceAll(pCID, "");
+ }
+ }
}
+ } else {
+ HLTWarning("can not find configuration %s", pCID);
}
- delete pTokens;
}
-
- if (fChains.Length()>0) {
- break; // ignore the agents
+ delete pTokens;
+ }
+
+ // build HLTOUT for simulation
+ if (iResult>=0 && runloader) {
+ if (bHaveOutput) {
+ // there are components in the chain which produce data which need to be
+ // piped to an HLTOUT
+ if (fpComponentHandler->FindComponentIndex("HLTOUT")>=0 ||
+ LoadComponentLibraries("libHLTsim.so")>=0) {
+ AliHLTConfiguration globalout("_globalout_", "HLTOUT", chains.Data(), NULL);
+ iResult=BuildTaskList("_globalout_");
+ } else {
+ HLTError("can not load libHLTsim.so and HLTOUT component");
+ iResult=-EFAULT;
+ }
}
- pAgent=AliHLTModuleAgent::GetNextAgent();
}
+
if (iResult>=0) SetStatusFlags(kTaskListCreated);
return iResult;
* @param runloader optional instance of the run loader
* @return neg. error code if failed
*/
- int BuildTaskListsFromTopConfigurations(AliRawReader* rawReader,
- AliRunLoader* runloader=NULL);
+ int BuildTaskListsFromReconstructionChains(AliRawReader* rawReader,
+ AliRunLoader* runloader=NULL);
enum AliHLTSystemState_t {
kUninitialized = 0x0,
@brief Agent of the libAliHLTUtil library
*/
+#include <cassert>
#include "AliHLTAgentUtil.h"
#include "AliHLTConfiguration.h"
+// header files of library components
+#include "AliHLTDataGenerator.h"
+#include "AliHLTRawReaderPublisherComponent.h"
+#include "AliHLTLoaderPublisherComponent.h"
+#include "AliHLTRootFileStreamerComponent.h"
+#include "AliHLTRootFileWriterComponent.h"
+#include "AliHLTRootFilePublisherComponent.h"
+#include "AliHLTFileWriter.h"
+#include "AliHLTFilePublisher.h"
+
/** global instance for agent registration */
AliHLTAgentUtil gAliHLTAgentUtil;
// see header file for class documentation
return NULL;
}
+
+int AliHLTAgentUtil::RegisterComponents(AliHLTComponentHandler* pHandler) const
+{
+ // see header file for class documentation
+ assert(pHandler);
+ if (!pHandler) return -EINVAL;
+ pHandler->AddComponent(new AliHLTDataGenerator);
+ pHandler->AddComponent(new AliHLTRawReaderPublisherComponent);
+ pHandler->AddComponent(new AliHLTLoaderPublisherComponent);
+ pHandler->AddComponent(new AliHLTRootFileStreamerComponent);
+ pHandler->AddComponent(new AliHLTRootFileWriterComponent);
+ pHandler->AddComponent(new AliHLTRootFilePublisherComponent);
+ pHandler->AddComponent(new AliHLTFileWriter);
+ pHandler->AddComponent(new AliHLTFilePublisher);
+ return 0;
+}
*/
const char* GetRequiredComponentLibraries() const;
+ /**
+ * Register components for the AliHLTUtil library.
+ * @param pHandler [in] instance of the component handler
+ */
+ int RegisterComponents(AliHLTComponentHandler* pHandler) const;
protected:
private:
#include "AliHLTDataGenerator.h"
#include "TString.h"
-/** the global object for component registration */
-AliHLTDataGenerator gAliHLTDataGenerator;
-
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTDataGenerator)
#include <TMath.h>
#include <TFile.h>
-/** the global object for component registration */
-AliHLTFilePublisher gAliHLTFilePublisher;
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTFilePublisher)
int AliHLTFilePublisher::InsertFile(EventFiles* &pCurrEvent, FileDesc* pDesc)
{
+ // see header file for class documentation
int iResult=0;
if (pDesc) {
if (pCurrEvent==NULL) {
int AliHLTFilePublisher::InsertEvent(EventFiles* &pEvent)
{
+ // see header file for class documentation
int iResult=0;
if (pEvent) {
HLTDebug("Inserted event %p", pEvent);
AliHLTUInt32_t& size,
vector<AliHLTComponentBlockData>& outputBlocks )
{
+ // see header file for class documentation
int iResult=0;
TObjLink *lnk=fpCurrent;
if (lnk==NULL) lnk=fEvents.FirstLink();
fDataType(dt),
fSpecification(spec)
{
+ // see header file for class documentation
+ // or
+ // refer to README to build package
+ // or
+ // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
}
AliHLTFilePublisher::FileDesc::~FileDesc()
{
+ // see header file for class documentation
CloseFile();
}
void AliHLTFilePublisher::FileDesc::CloseFile()
{
+ // see header file for class documentation
if (fpInstance)
{
// Unfortunately had to use AliLog mechanisms rather that AliHLTLogging because
int AliHLTFilePublisher::FileDesc::OpenFile()
{
+ // see header file for class documentation
int iResult=0;
TString fullFN= fName + "?filetype=raw";
fpInstance = new TFile(fullFN);
//#include <TMath.h>
//#include <TFile.h>
-/** the global object for component registration */
-AliHLTFileWriter gAliHLTFileWriter;
-
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTFileWriter)
#include "AliLog.h"
#include "TTree.h"
-/** global instance for agent registration */
-AliHLTLoaderPublisherComponent gAliHLTLoaderPublisherComponent;
-
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTLoaderPublisherComponent)
AliHLTComponentDataType AliHLTLoaderPublisherComponent::GetOutputDataType()
{
+ // see header file for class documentation
return fDataType;
}
void AliHLTLoaderPublisherComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
{
+ // see header file for class documentation
constBase=fMaxSize;
inputMultiplier=1;
}
TTree* AliHLTLoaderPublisherComponent::GetTree()
{
+ // see header file for class documentation
TTree* pTree=NULL;
if (fpLoader) {
if (fTreeType.CompareTo("digits")==0)
#include <cerrno>
#include <cassert>
-/** global instance for agent registration */
-AliHLTRawReaderPublisherComponent gAliHLTRawReaderPublisherComponent;
-
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTRawReaderPublisherComponent)
AliHLTComponentDataType AliHLTRawReaderPublisherComponent::GetOutputDataType()
{
+ // see header file for class documentation
return fDataType;
}
void AliHLTRawReaderPublisherComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
{
+ // see header file for class documentation
constBase=fMaxSize;
inputMultiplier=1;
}
}
int AliHLTRawReaderPublisherComponent::GetSpecificationFromEquipmentId(int id, AliHLTUInt32_t& specification) const {
+ // see header file for class documentation
return specification=id;
}
// temporary
#include "TH1F.h"
-/** the global object for component registration */
-AliHLTRootFilePublisherComponent gAliHLTRootFilePublisherComponent;
-
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTRootFilePublisherComponent)
AliHLTUInt32_t& /*size*/,
vector<AliHLTComponentBlockData>& /*outputBlocks*/ )
{
+ // see header file for class documentation
int iResult=0;
if (GetEventCount()%2==0) {
TH1F *hpx = new TH1F("hpx","px distribution",100,-4,4);
#include "AliHLTRootFileStreamerComponent.h"
#include "TString.h"
-/** the global object for component registration */
-AliHLTRootFileStreamerComponent gAliHLTRootFileStreamerComponent;
-
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTRootFileStreamerComponent)
#include "TFile.h"
#include "TString.h"
-/** the global object for component registration */
-AliHLTRootFileWriterComponent gAliHLTRootFileWriterComponent;
-
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTRootFileWriterComponent)
+2007-10-16
+ - implemented component registration via agents
+ - added HLTOUT component as default data sink for simulation
+ - added AliHLTAgentSim for libHLTsim.so
+ - AliHLTComponentHandler: more robust library handling
+
2007-08-17 version HLT-v0-7 tagged
- corresponds to AliRoot v4-06-Rev-00
- calibration framework
@brief Agent of the libAliHLTSample library
*/
+#include <cassert>
#include "AliHLTAgentSample.h"
#include "AliHLTConfiguration.h"
#include "TSystem.h"
+// header files of library components
+#include "AliHLTDummyComponent.h"
+
/** global instance for agent registration */
AliHLTAgentSample gAliHLTAgentSample;
// see header file for class documentation
return "libAliHLTUtil.so libAliHLTSample.so";
}
+
+int AliHLTAgentSample::RegisterComponents(AliHLTComponentHandler* pHandler) const
+{
+ // see header file for class documentation
+ assert(pHandler);
+ if (!pHandler) return -EINVAL;
+ pHandler->AddComponent(new AliHLTDummyComponent);
+ return 0;
+}
*/
const char* GetRequiredComponentLibraries() const;
+ /**
+ * Register components for the AliHLTSample library.
+ * @param pHandler [in] instance of the component handler
+ */
+ int RegisterComponents(AliHLTComponentHandler* pHandler) const;
protected:
private:
#include "AliHLTSystem.h"
#include "AliHLTDummyComponent.h"
#include "AliHLTDefinitions.h"
-#include <stdlib.h>
-#include <errno.h>
-
-// this is a global object used for automatic component registration, do not use this
-AliHLTDummyComponent gAliHLTDummyComponent;
+#include <cstdlib>
+#include <cerrno>
+/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTDummyComponent)
AliHLTDummyComponent::AliHLTDummyComponent()
// see header file for class documentation
return NULL;
}
+
+int AliHLTTPCAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
+{
+ return 0;
+}
*/
const char* GetRequiredComponentLibraries() const;
+ /**
+ * Register components for the AliHLTTPC library.
+ * @param pHandler [in] instance of the component handler
+ */
+ int RegisterComponents(AliHLTComponentHandler* pHandler) const;
protected:
private:
LIBHLTSIM_VERSION := 0
-MODULE_SRCS= AliHLTSimulation.cxx
+MODULE_SRCS= AliHLTSimulation.cxx \
+ AliHLTAgentSim.cxx \
+ AliHLTOUTComponent.cxx
CLASS_HDRS:= $(MODULE_SRCS:.cxx=.h)