3 #ifndef ALIHLTOUTCOMPONENT_H
4 #define ALIHLTOUTCOMPONENT_H
5 /* This file is property of and copyright by the ALICE HLT Project *
6 * ALICE Experiment at CERN, All rights reserved. *
7 * See cxx source for full Copyright notice */
9 /** @file AliHLTOUTComponent.h
10 @author Matthias Richter
12 @brief The HLTOUT data sink component similar to HLTOUT nodes
15 // see class description below
17 // refer to README to build package
19 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
22 #include "AliHLTOfflineDataSink.h"
24 class AliHLTHOMERLibManager;
25 class AliHLTMonitoringWriter;
26 typedef vector<AliHLTMonitoringWriter*> AliHLTMonitoringWriterPVector;
29 * @class AliHLTOUTComponent
30 * The HLTOUT data sink component which models the behavior of the HLTOUT
31 * nodes of the HLT cluster.
32 * <h2>General properties:</h2>
34 * Component ID: \b HLTOUT <br>
35 * Library: \b libHLTrec.so <br>
36 * Input Data Types: @ref kAliHLTAnyDataType <br>
37 * Output Data Types: none (offline data sink) <br>
39 * <h2>Mandatory arguments:</h2>
40 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating -->
42 * <h2>Optional arguments:</h2>
43 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating -->
44 * \li -links <i> n </i> <br>
45 * number of output ddl links
47 * <h2>Configuration:</h2>
48 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating -->
51 * <h2>Default CDB entries:</h2>
54 * <h2>Performance:</h2>
55 * The component does not any event data processing.
57 * <h2>Memory consumption:</h2>
58 * The component does not any event data processing.
60 * <h2>Output size:</h2>
61 * The component is an offline sink component and has no output data.
63 * The component can be used to write data in the same format as
64 * the HLTOUT on the real HLT. In case of AliRoot simulation, the
65 * component is automatically added to the chain if the specified
66 * chains have output data. By that means, the HLT output is added
71 class AliHLTOUTComponent : public AliHLTOfflineDataSink {
73 /** standard constructor */
76 virtual ~AliHLTOUTComponent();
78 const char* GetComponentID();
79 void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
80 AliHLTComponent* Spawn();
86 int DoInit( int argc, const char** argv );
94 * Data processing method for the component.
95 * The function can be overloaded by other file writer components.
96 * @param evtData event data structure
97 * @param blocks input data block descriptors
98 * @param trigData trigger data structure
100 int DumpEvent( const AliHLTComponentEventData& evtData,
101 const AliHLTComponentBlockData* blocks,
102 AliHLTComponentTriggerData& trigData );
104 using AliHLTDataSink::DumpEvent;
107 * Fill ESD for one event.
108 * @param eventNo event No. \em Note: this is an internal enumeration of the
110 * @param runLoader the AliRoot runloader
111 * @param esd an AliESDEvent instance
112 * @return neg. error code if failed
114 int FillESD(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd);
117 /** copy constructor prohibited */
118 AliHLTOUTComponent(const AliHLTOUTComponent&);
119 /** assignment operator prohibited */
120 AliHLTOUTComponent& operator=(const AliHLTOUTComponent&);
122 int ShuffleWriters(AliHLTMonitoringWriterPVector &list, AliHLTUInt32_t size);
125 * Fill the output buffer and allocate if neccessary.
126 * Assemble ouput buffer with Common Data Header, HLT header and data from the
127 * writer. Works on the same buffer witch is allocated once and eventually
128 * grown in order to avoid frequent allocs/deallocs.
129 * @param eventNo number of the event
130 * @param pWriter [IN] the HOMER writer
131 * @param pBuffer [OUT] target to receive the pointer to buffer
132 * @return size of the buffer
134 int FillOutputBuffer(int eventNo, AliHLTMonitoringWriter* pWriter, const AliHLTUInt8_t* &pBuffer);
137 * Write the digits for one DDL
138 * @param eventNo number of the event
139 * @param runLoader AliRoot run loader instance
140 * @param hltddl Number of DDL link within the range of HLT
141 * @param pBuffer buffer to write
142 * @param size size of the buffer
143 * @return neg. error if failed
145 int WriteDigits(int eventNo, AliRunLoader* runLoader, int hltddl, const AliHLTUInt8_t* pBuffer, unsigned int size);
148 * Write the raw file for one DDL
149 * @param eventNo number of the event
150 * @param runLoader AliRoot run loader instance
151 * @param hltddl Number of DDL link within the range of HLT
152 * @param pBuffer buffer to write
153 * @param size size of the buffer
154 * @return neg. error if failed
156 int WriteRawFile(int eventNo, AliRunLoader* runLoader, int hltddl, const AliHLTUInt8_t* pBuffer, unsigned int size);
158 /** list of HOMER writers */
159 AliHLTMonitoringWriterPVector fWriters; //!transient
161 /** number of DDLs used*/
162 int fNofDDLs; //!transient
164 /** equipment ID of first HLT DDL */
165 int fIdFirstDDL; //!transient
167 /** write digits or not */
168 Bool_t fWriteDigits; //!transient
170 /** write raw file or not */
171 Bool_t fWriteRaw; //!transient
173 /** output buffer, allocated once in order to avoid frequent alloc/dealloc */
174 vector<AliHLTUInt8_t> fBuffer; //!transient
176 /** instance of the HOMER library manager */
177 AliHLTHOMERLibManager* fpLibManager; // !transient
179 ClassDef(AliHLTOUTComponent, 0)