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"
23 #include "AliHLTHOMERLibManager.h"
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 * @ingroup alihlt_component
34 class AliHLTOUTComponent : public AliHLTOfflineDataSink {
36 /** standard constructor */
39 virtual ~AliHLTOUTComponent();
41 const char* GetComponentID();
42 void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
43 AliHLTComponent* Spawn();
49 int DoInit( int argc, const char** argv );
57 * Data processing method for the component.
58 * The function can be overloaded by other file writer components.
59 * @param evtData event data structure
60 * @param blocks input data block descriptors
61 * @param trigData trigger data structure
63 int DumpEvent( const AliHLTComponentEventData& evtData,
64 const AliHLTComponentBlockData* blocks,
65 AliHLTComponentTriggerData& trigData );
67 using AliHLTDataSink::DumpEvent;
70 * Fill ESD for one event.
71 * @param eventNo event No. \em Note: this is an internal enumeration of the
73 * @param runLoader the AliRoot runloader
74 * @param esd an AliESDEvent instance
75 * @return neg. error code if failed
77 int FillESD(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd);
80 /** copy constructor prohibited */
81 AliHLTOUTComponent(const AliHLTOUTComponent&);
82 /** assignment operator prohibited */
83 AliHLTOUTComponent& operator=(const AliHLTOUTComponent&);
85 int ShuffleWriters(AliHLTMonitoringWriterPVector &list, AliHLTUInt32_t size);
88 * Fill the output buffer and allocate if neccessary.
89 * Assemble ouput buffer with Common Data Header, HLT header and data from the
90 * writer. Works on the same buffer witch is allocated once and eventually
91 * grown in order to avoid frequent allocs/deallocs.
92 * @param eventNo number of the event
93 * @param pWriter [IN] the HOMER writer
94 * @param pBuffer [OUT] target to receive the pointer to buffer
95 * @return size of the buffer
97 int FillOutputBuffer(int eventNo, AliHLTMonitoringWriter* pWriter, const AliHLTUInt8_t* &pBuffer);
100 * Write the digits for one DDL
101 * @param eventNo number of the event
102 * @param runLoader AliRoot run loader instance
103 * @param hltddl Number of DDL link within the range of HLT
104 * @param pBuffer buffer to write
105 * @param size size of the buffer
106 * @return neg. error if failed
108 int WriteDigits(int eventNo, AliRunLoader* runLoader, int hltddl, const AliHLTUInt8_t* pBuffer, int size);
111 * Write the raw file for one DDL
112 * @param eventNo number of the event
113 * @param runLoader AliRoot run loader instance
114 * @param hltddl Number of DDL link within the range of HLT
115 * @param pBuffer buffer to write
116 * @param size size of the buffer
117 * @return neg. error if failed
119 int WriteRawFile(int eventNo, AliRunLoader* runLoader, int hltddl, const AliHLTUInt8_t* pBuffer, int size);
121 /** list of HOMER writers */
122 AliHLTMonitoringWriterPVector fWriters; //!transient
124 /** number of DDLs used*/
125 int fNofDDLs; //!transient
127 /** equipment ID of first HLT DDL */
128 int fIdFirstDDL; //!transient
130 /** write digits or not */
131 Bool_t fWriteDigits; //!transient
133 /** write raw file or not */
134 Bool_t fWriteRaw; //!transient
136 /** output buffer, allocated once in order to avoid frequent alloc/dealloc */
137 vector<AliHLTUInt8_t> fBuffer; //!transient
139 /** instance of the HOMER library manager */
140 AliHLTHOMERLibManager* fpLibManager; // !transient
142 ClassDef(AliHLTOUTComponent, 0)