4 #ifndef ALIHLTLOADERPUBLISHERCOMPONENT_H
5 #define ALIHLTLOADERPUBLISHERCOMPONENT_H
6 //* This file is property of and copyright by the ALICE HLT Project *
7 //* ALICE Experiment at CERN, All rights reserved. *
8 //* See cxx source for full Copyright notice *
10 /** @file AliHLTLoaderPublisherComponent.h
11 @author Matthias Richter
13 @brief A general tree publisher component for the AliLoader.
16 #include "AliHLTOfflineDataSource.h"
21 * @class AliHLTLoaderPublisherComponent
22 * A general tree publisher component for the AliLoader.
24 * <h2>General properties:</h2>
26 * Component ID: \b AliLoaderPublisher <br>
27 * Library: \b libAliHLTUtil.so <br>
28 * Input Data Types: none <br>
29 * Output Data Types: according to parameter, suggested types: <br>
30 * \li ::kAliHLTDataTypeAliTreeD for the digit tree
31 * \li ::kAliHLTDataTypeAliTreeR for the cluster tree
32 * , see @ref alihlt_component_datatypes <br>
34 * <h2>Mandatory arguments:</h2>
35 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
36 * \li -loader <i> loader name </i>
37 * e.g. <tt> -loader TPCLoader </tt>
39 * <h2>Optional arguments:</h2>
40 * \li -tree <i> tree name </i> : digits (default), clusters
41 * e.g. <tt> -tree digits </tt>
43 * print out some more info messages, mainly for the sake of tutorials
44 * \li -datatype <i> datatype dataorigin </i> <br>
45 * data type ID and origin, e.g. <tt>-datatype 'ALITREED' 'TPC ' </tt>
46 * \li -dataspec <i> specification </i> <br>
47 * data specification treated as decimal number or hex number if
50 * <h2>Configuration:</h2>
51 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
54 * <h2>Default CDB entries:</h2>
55 * The component loads no CDB entries.
57 * <h2>Performance:</h2>
58 * The component does not process any event data.
60 * <h2>Memory consumption:</h2>
61 * The component does not process any event data.
63 * <h2>Output size:</h2>
64 * According to the available data. The component is an AliHLTDataSource
65 * and inteded to be used in the AliHLTSystem framework only. The component
66 * implements the standard AliHLTSystem adaptive buffer allocation.
69 * @ingroup alihlt_util_components
71 class AliHLTLoaderPublisherComponent : public AliHLTOfflineDataSource {
73 /** standard constructor */
74 AliHLTLoaderPublisherComponent();
76 virtual ~AliHLTLoaderPublisherComponent();
79 * Get the id of the component.
80 * Each component is identified by a unique id.
81 * The function is pure virtual and must be implemented by the child class.
82 * @return component id (string)
84 const char* GetComponentID();
87 * Get the output data type of the component.
88 * The function is pure virtual and must be implemented by the child class.
89 * @return output data type
91 AliHLTComponentDataType GetOutputDataType();
94 * Get a ratio by how much the data volume is shrinked or enhanced.
95 * The function is pure virtual and must be implemented by the child class.
96 * @param constBase <i>return</i>: additive part, independent of the
98 * @param inputMultiplier <i>return</i>: multiplication ratio
99 * @return values in the reference variables
101 void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
105 * Each component must implement a spawn function to create a new instance of
106 * the class. Basically the function must return <i>new <b>my_class_name</b></i>.
107 * @return new class instance
109 virtual AliHLTComponent* Spawn();
115 int DoInit( int argc, const char** argv );
123 * Data source method.
124 * @param evtData event data structure
125 * @param trigData trigger data structure
128 int GetEvent(const AliHLTComponentEventData& evtData,
129 AliHLTComponentTriggerData& trigData);
131 using AliHLTOfflineDataSource::GetEvent;
134 /** copy constructor prohibited */
135 AliHLTLoaderPublisherComponent(const AliHLTLoaderPublisherComponent&);
136 /** assignment operator prohibited */
137 AliHLTLoaderPublisherComponent& operator=(const AliHLTLoaderPublisherComponent&);
140 * Get tree of type specified in fTreeType from loader.
144 /** max output block size, estimated during DoInit */
145 Int_t fMaxSize; //!transient
148 TString fLoaderType; //!transient
151 TString fTreeType; //!transient
153 /** be verbose: info printouts */
154 Bool_t fVerbose; //!transient
157 AliHLTComponentDataType fDataType; //!transient
159 /** data specification */
160 AliHLTUInt32_t fSpecification; //!transient
162 /** instance of the AliLoader */
163 AliLoader* fpLoader; //!transient
165 ClassDef(AliHLTLoaderPublisherComponent, 0);