//-*- Mode: C++ -*- // @(#) $Id$ #ifndef ALIHLTRAWREADERPUBLISHERCOMPONENT_H #define ALIHLTRAWREADERPUBLISHERCOMPONENT_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 AliHLTRawReaderPublisherComponent.h @author Matthias Richter @date @brief A general data publisher component for the AliRawReader. */ // see header file for class documentation // or // refer to README to build package // or // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt #include "AliHLTOfflineDataSource.h" /** * @class AliHLTRawReaderPublisherComponent * A general data publisher component for the AliRawReader. * The component publishs the data of a given detector and equipment ID. * * If no data specification is given, the equipment id is used as default. * A child class can implement @ref GetSpecificationFromEquipmentId to * provide a different rule. * * The component publishes one data block for each equipment id in the * give range. If the RawReader does not provide any data, an empty data * block consisting of the Common Data Header is produced. * * Component ID: \b AliRawReaderPublisher
* Library: \b libAliHLTUtil. * * Mandatory arguments:
* * \li -detector detector name * e.g. -detector TPC * \li -equipmentid id * the equipmentid within the detector, e.g. TPC 0 is 768 * \li -minid id * the minimum equipmentid including detector offset, e.g. 768 is TPC 0
* if the -detector option is used, the id is without detector offset * \li -maxid id * the maximum equipmentid including detector offset (default = minid)
* if the -detector option is used, the id is without detector offset * \li -verbose
* print out some more info messages, mainly for the sake of tutorials * \li -skipempty * skip all empty ddls in the specified range; by default, the component * generates and inserts empty data blocks * \li -datatype datatype dataorigin
* data type ID and origin, e.g. -datatype DIGITS TPC * \li -dataspec specification
* data specification treated as decimal number or hex number if * prepended by '0x' * * Optional arguments:
* * * @ingroup alihlt_system */ class AliHLTRawReaderPublisherComponent : public AliHLTOfflineDataSource { public: /** standard constructor */ AliHLTRawReaderPublisherComponent(); /** destructor */ virtual ~AliHLTRawReaderPublisherComponent(); /** * 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 * @param outputPtr pointer to target buffer * @param size input: size of target buffer * output:size of produced data * @param outputBlocks list to receive output block descriptors * @return neg. error code if failed */ int GetEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector& outputBlocks ); using AliHLTOfflineDataSource::GetEvent; protected: virtual int GetSpecificationFromEquipmentId(int id, AliHLTUInt32_t &specification) const; private: /** copy constructor prohibited */ AliHLTRawReaderPublisherComponent(const AliHLTRawReaderPublisherComponent&); /** assignment operator prohibited */ AliHLTRawReaderPublisherComponent& operator=(const AliHLTRawReaderPublisherComponent&); /** max output block size, estimated during DoInit */ Int_t fMaxSize; //!transient /** detector string */ TString fDetector; //!transient /** min equipment id */ int fMinEquId; //!transient /** max equipment id */ int fMaxEquId; //!transient /** be verbose: info printouts */ Bool_t fVerbose; //!transient /** data type */ AliHLTComponentDataType fDataType; //!transient /** data specification */ AliHLTUInt32_t fSpecification; //!transient /** skip the generation of empty data blocks */ Bool_t fSkipEmpty; //!transient ClassDef(AliHLTRawReaderPublisherComponent, 1); }; #endif