// or
// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+#include <string>
#include <TObject.h>
#include <TList.h>
#include <TString.h>
class AliRawStream;
class AliHLTOUTHandler;
class AliHLTOUT;
+class AliHLTModulePreprocessor;
/**
* @class AliHLTModuleAgent
* @note There must not be more than one agent per module/library.
*
* If a run loader is available, reconstruction is performed on simulated
- * data as part of <tt>AliSimulation</tt>, if the raw reader is present on
- * raw data as part of <tt>AliReconstruction</tt>. The configurations
+ * data as part of <tt>AliSimulation</tt>, if only the raw reader is present,
+ * on raw data as part of <tt>AliReconstruction</tt>. The configurations
* can adapt to the two cases.
*
* All HLT component libraries are loaded on demand through the HLT steering
* Create HLT configuration forming an HLT analysis chain. <br>
* Reconstruction of raw data or simulated data from digits needs
* usually different configurations. If a run loader is available,
- * reconstruction is performed on simulated data, on raw data if the
- * raw reader is present.
+ * reconstruction is performed on simulated data, on raw data if Run
+ * loader is NULL and only the raw reader present.
*
* - @ref GetReconstructionChains <br>
* Configurations run during event reconstruction. <br>
* standard constructor. The agent is automatically registered in the
* global agent manager
*/
- AliHLTModuleAgent();
+ AliHLTModuleAgent(const char* id);
/** destructor */
virtual ~AliHLTModuleAgent();
+ /**
+ * Get module id.
+ * The module id is a string specifying the detector, or module. The
+ * library must follow the naming scheme \em libAliHLTModule.so, e.g.
+ * \em libAliHLTTPC.so if the module is 'TPC'
+ */
+ const char* GetModuleId() const;
+
/**
* Print status info.
* Short summary on registered agents. This function acts globally on the
*/
static AliHLTModuleAgent* GetNextAgent();
+ /**
+ * Get string of blank separated Module Ids
+ */
+ static string GetAgentIds();
+
/**
* Activate a component handler for this agent.
* The @ref RegisterComponents method will be called in order to allow
* AliHLTConfigurationHandler. The agent can adapt the configurations
* to be registered to the current AliRoot setup by checking the
* runloader and the raw reader. <br>
- * Run loader and raw reader are usually not present at the same time.
- * If a run loader is available, reconstruction is performed on simulated
- * data, if the raw reader is present on raw data. The configurations
+ * The presence of Run loader and raw reader determines the mode of the
+ * HLT reconstruction. If a run loader is available, reconstruction is
+ * performed on simulated data, a raw reader might be available in that
+ * case also. When running embedded into AliReconstruction, the Run loader
+ * is always NULL and the raw gives access to data. The configurations
* can adapt to the two cases.
*
* @param handler [in] the configuration handler
kRawStream,
/** agent provides a chain
- * The data bock is fed into an analysis chain, the treatment
+ * The data block is fed into an analysis chain, the treatment
* depends on the components in the chain.
*/
kChain,
AliHLTOUTHandlerDesc(AliHLTOUTHandlerType handlerType, AliHLTComponentDataType dt, const char* module)
: fHType(handlerType), fDt(dt), fModule(module) {}
+ AliHLTOUTHandlerDesc(const AliHLTOUTHandlerDesc& src)
+ : fHType(src.fHType), fDt(src.fDt), fModule(src.fModule) {}
+
+ const AliHLTOUTHandlerDesc& operator=(const AliHLTOUTHandlerDesc& src) {
+ fHType=src.fHType; fDt=src.fDt; fModule=src.fModule; return *this;
+ }
+
~AliHLTOUTHandlerDesc() {}
+ bool operator==(const AliHLTOUTHandlerType handlerType) const {
+ return fHType==handlerType;
+ }
+ /**
+ * Two descriptors are equal if all members match.
+ */
+ bool operator==(const AliHLTOUTHandlerDesc& desc) const {
+ return fDt==desc.fDt && fHType==desc.fHType && fModule==desc.fModule;
+ }
+
+ operator AliHLTOUTHandlerType() {return fHType;}
+ operator AliHLTComponentDataType() {return fDt;}
+
private:
/** type of the handler */
- AliHLTOUTHandlerType fHType;
+ AliHLTOUTHandlerType fHType; //!transient
/** data type treated by the handler */
- AliHLTComponentDataType fDt;
+ AliHLTComponentDataType fDt; //!transient
/** class or chain name */
- TString fModule;
+ TString fModule; //!transient
};
+ static const AliHLTOUTHandlerDesc fgkVoidHandlerDesc; //! initializer
+
/**
* Get handler description for a data block.
+ * Depending on the data type and data specification the handler must
+ * provide information
+ * - if it can handle the data block, and
+ * - details how it will handle it, mainly the type of the handler
+ * @ref AliHLTOUTHandlerType
+ *
* @param dt [in] data type of the block
* @param spec [in] specification of the block
- * @param pDesc [out] handler description
+ * @param desc [out] handler description
* @return 1 if the agent can provide a handler, 0 if not
*/
virtual int GetHandlerDescription(AliHLTComponentDataType dt,
AliHLTUInt32_t spec,
- AliHLTOUTHandlerDesc* pDesc) const;
+ AliHLTOUTHandlerDesc& desc) const;
/**
* Get handler for a data block of the HLTOUT data.
/**
* Delete an HLTOUT handler.
- * Even if the agent returned the handler several times, this is the
- * final cleanup. The framwork makes sure that the handler is not
- * used any further outside the agent. The default implementation just
- * deltetes the object.
+ * This is the final cleanup. The framwork makes sure that the handler is
+ * not used any further outside the agent. Even if the agent returned the
+ * same handler several times, cleanup is invoked only once. The default
+ * implementation just deletes the object.
* @param pInstance pointer to handler
*/
virtual int DeleteOutputHandler(AliHLTOUTHandler* pInstance);
// AliHLTUInt32_t spec,
// const AliHLTOUT* pData);
+ /**
+ * Get the preprocessor for this component library.
+ * Create an instance of the preprocessor for this component library.
+ * The caller will delete it after useage.
+ * @return pointer to AliHLTModulePreprocessor object.
+ */
+ virtual AliHLTModulePreprocessor* GetPreprocessor();
+
/**
* Old method kept for backward compatibility, redirected to @ref
* GetReconstructionChains.
protected:
private:
+ /** standard constructor prohibited */
+ AliHLTModuleAgent();
/** copy constructor prohibited */
AliHLTModuleAgent(const AliHLTModuleAgent&);
/** assignment operator prohibited */
static int Unregister(AliHLTModuleAgent* pAgent);
/** the list of active agents */
- static AliHLTModuleAgent* fAnchor; //! transient
+ static AliHLTModuleAgent* fgAnchor; //! transient
/** next element in the list */
AliHLTModuleAgent* fpNext; //! transient
/** the current object link (list position) */
- static AliHLTModuleAgent* fCurrent; //! transient
+ static AliHLTModuleAgent* fgCurrent; //! transient
/** number of agents */
- static int fCount; //! transient
+ static int fgCount; //! transient
- /* instance of the active component handler */
+ /** instance of the active component handler */
AliHLTComponentHandler* fpComponentHandler; //! transient
- ClassDef(AliHLTModuleAgent, 2);
+ /** id of the module */
+ TString fModuleId; //! transient
+
+ ClassDef(AliHLTModuleAgent, 3);
};
#endif