// -*- Mode: C++ -*- // $Id$ #ifndef ALIHLTROOTFILESTREAMERCOMPONENT_H #define ALIHLTROOTFILESTREAMERCOMPONENT_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 AliHLTRootFileStreamerComponent.h @author Matthias Richter @date @brief Save objects in a ROOT memory file */ #include "AliHLTProcessor.h" /** * @class AliHLTRootFileStreamerComponent * The RootFileStreamer provides a stand alone component to write incoming * TObject like structures into a ROOT memory file. A ROOT memory file is * a ROOT file stored in memory instead on disk (AliHLTMemoryFile) The file * is published via the output stream. On the receiver side the file can * be directly written to disk and appears like a normal root file. * *

General properties:

* * Component ID: \b ROOTFileStreamer
* Library: \b libAliHLTUtil.so
* Input Data Types: ::kAliHLTAnyDataType
* Output Data Types: according to component arguments, * ::kAliHLTVoidDataType by default
* *

Mandatory arguments:

* * *

Optional arguments:

* * \li -datatype datatype dataorigin
* data type ID and origin, e.g. -datatype CLUSTERS TPC * \li -dataspec specification
* data specification treated as decimal number or hex number if * prepended by '0x' * *

Configuration:

* * Configuration by component arguments. * *

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:

* No data published (AliHLTDataSink). * * @ingroup alihlt_util_components */ class AliHLTRootFileStreamerComponent : public AliHLTProcessor { public: /** standard constructor */ AliHLTRootFileStreamerComponent(); /** destructor */ virtual ~AliHLTRootFileStreamerComponent(); /** * The id of the component. * @return component id (string) */ const char* GetComponentID() {return "ROOTFileStreamer";}; /** * Spawn function. * @return new class instance */ AliHLTComponent* Spawn() {return new AliHLTRootFileStreamerComponent;} /** * Get the input data types of the component. * The function is pure virtual and must be implemented by the child class. * @return list of data types in the vector reference */ void GetInputDataTypes( vector& ); /** * 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 ); protected: /** * Internal initialization. * @see @ref AliHLTComponent::DoInit for description and parameters */ virtual int DoInit( int argc, const char** argv ); /** * The high-level data processing method. * All incoming objects are saved into a ROOT file in memory. * @param evtData event data structure * @param trigData trigger data structure * @return neg. error code if failed */ int DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData); using AliHLTProcessor::DoEvent; private: /** not a valid copy constructor, defined according to effective C++ style */ AliHLTRootFileStreamerComponent(const AliHLTRootFileStreamerComponent&); /** not a valid assignment op, but defined according to effective C++ style */ AliHLTRootFileStreamerComponent& operator=(const AliHLTRootFileStreamerComponent&); /** data type */ AliHLTComponentDataType fDataType; // see above /** data specification */ AliHLTUInt32_t fSpecification; // see above ClassDef(AliHLTRootFileStreamerComponent, 0) }; #endif