//-*- Mode: C++ -*- // @(#) $Id$ #ifndef ALIHLTLOADERPUBLISHERCOMPONENT_H #define ALIHLTLOADERPUBLISHERCOMPONENT_H //* This file is property of and copyright by the ALICE HLT Project * //* ALICE Experiment at CERN, All rights reserved. * //* See cxx source for full Copyright notice * /** @file AliHLTLoaderPublisherComponent.h @author Matthias Richter @date @brief A general tree publisher component for the AliLoader. */ #include "AliHLTOfflineDataSource.h" class AliLoader; /** * @class AliHLTLoaderPublisherComponent * A general tree publisher component for the AliLoader. * *

General properties:

* * Component ID: \b AliLoaderPublisher
* Library: \b libAliHLTUtil.so
* Input Data Types: none
* Output Data Types: according to parameter, suggested types:
* \li ::kAliHLTDataTypeAliTreeD for the digit tree * \li ::kAliHLTDataTypeAliTreeR for the cluster tree * , see @ref alihlt_component_datatypes
* *

Mandatory arguments:

* * \li -loader loader name * e.g. -loader TPCLoader * *

Optional arguments:

* \li -tree tree name : digits (default), clusters * e.g. -tree digits * \li -verbose
* print out some more info messages, mainly for the sake of tutorials * \li -datatype datatype dataorigin
* data type ID and origin, e.g. -datatype 'ALITREED' 'TPC ' * \li -dataspec specification
* data specification treated as decimal number or hex number if * prepended by '0x' * *

Configuration:

* * no configuration * *

Default CDB entries:

* The component loads no CDB entries. * *

Performance:

* The component does not process any event data. * *

Memory consumption:

* The component does not process any event data. * *

Output size:

* According to the available data. The component is an AliHLTDataSource * and inteded to be used in the AliHLTSystem framework only. The component * implements the standard AliHLTSystem adaptive buffer allocation. * * * @ingroup alihlt_util_components */ class AliHLTLoaderPublisherComponent : public AliHLTOfflineDataSource { public: /** standard constructor */ AliHLTLoaderPublisherComponent(); /** destructor */ virtual ~AliHLTLoaderPublisherComponent(); /** * Get the id of the component. * Each component is identified by a unique id. * The function is pure virtual and must be implemented by the child class. * @return component id (string) */ const char* GetComponentID(); /** * Get the output data type of the component. * The function is pure virtual and must be implemented by the child class. * @return output data type */ AliHLTComponentDataType GetOutputDataType(); /** * Get a ratio by how much the data volume is shrinked or enhanced. * The function is pure virtual and must be implemented by the child class. * @param constBase return: additive part, independent of the * input data volume * @param inputMultiplier return: multiplication ratio * @return values in the reference variables */ void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ); /** * Spawn function. * Each component must implement a spawn function to create a new instance of * the class. Basically the function must return new my_class_name. * @return new class instance */ virtual AliHLTComponent* Spawn(); protected: /** * Init method. */ int DoInit( int argc, const char** argv ); /** * Deinit method. */ int DoDeinit(); /** * Data source method. * @param evtData event data structure * @param trigData trigger data structure * @return */ int GetEvent(const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData); using AliHLTOfflineDataSource::GetEvent; private: /** copy constructor prohibited */ AliHLTLoaderPublisherComponent(const AliHLTLoaderPublisherComponent&); /** assignment operator prohibited */ AliHLTLoaderPublisherComponent& operator=(const AliHLTLoaderPublisherComponent&); /** * Get tree of type specified in fTreeType from loader. */ TTree* GetTree(); /** max output block size, estimated during DoInit */ Int_t fMaxSize; //!transient /** loader string */ TString fLoaderType; //!transient /** tree string */ TString fTreeType; //!transient /** be verbose: info printouts */ Bool_t fVerbose; //!transient /** data type */ AliHLTComponentDataType fDataType; //!transient /** data specification */ AliHLTUInt32_t fSpecification; //!transient /** instance of the AliLoader */ AliLoader* fpLoader; //!transient ClassDef(AliHLTLoaderPublisherComponent, 0); }; #endif