4 #ifndef ALIHLTOUTHOMERCOLLECTION_H
5 #define ALIHLTOUTHOMERCOLLECTION_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 AliHLTOUTHomerCollection.h
11 @author Matthias Richter
13 @brief General HLTOUT data collection.
15 #include "AliHLTOUTHomerBuffer.h"
17 class AliHLTHOMERReader;
18 class AliRawDataHeader;
19 class AliHLTEsdManager;
22 * @class AliHLTOUTHomerCollection
23 * Handler of HLTOUT data, base class for specific handlers for
24 * RawReader or Digit data.
26 class AliHLTOUTHomerCollection : public AliHLTOUTHomerBuffer {
29 AliHLTOUTHomerCollection(int event=-1, AliHLTEsdManager* pEsdManager=NULL);
31 virtual ~AliHLTOUTHomerCollection();
35 * Read next data form the data source.
37 virtual Bool_t ReadNextData(UChar_t*& data)=0;
40 * Reset data stream position.
41 * Reeading of data starts with the first data block.
43 virtual int Reset()=0;
46 * Get size of the current data block.
48 virtual int GetDataSize()=0;
51 * Get the header of the current data block
53 virtual const AliRawDataHeader* GetDataHeader()=0;
56 * Select equipment for data readout.
58 virtual void SelectEquipment(int equipmentType,
59 int minEquipmentId = -1,
60 int maxEquipmentId = -1)=0;
63 * Get equipment id of the current data block.
65 virtual int GetEquipmentId()=0;
68 * Get the current event no.
69 * The event no is set during creation of the HLTOUT object.
70 * For the reconstruction it is taken from the ESD provided by the
71 * AliReconstruction framework AliESDEvent::GetEventNumberInFile
72 * @return event no or -1 if not set
74 int GetCurrentEventNo() const {return fEvent;}
76 // interface function of AliHLTOUT
77 int WriteESD(const AliHLTUInt8_t* pBuffer, AliHLTUInt32_t size, AliHLTComponentDataType dt, AliESDEvent* tgtesd=NULL) const;
80 /** copy constructor prohibited */
81 AliHLTOUTHomerCollection(const AliHLTOUTHomerCollection&);
82 /** assignment operator prohibited */
83 AliHLTOUTHomerCollection& operator=(const AliHLTOUTHomerCollection&);
86 * Generate the index of the HLTOUT data from the data buffer.
92 * @param index [in] index of the block
93 * @param pBuffer [out] buffer of the selected data block
94 * @param size [out] size of the selected data block
96 int GetDataBuffer(AliHLTUInt32_t index, const AliHLTUInt8_t* &pBuffer,
97 AliHLTUInt32_t& size);
100 * Open HOMER reader for the data buffer.
101 * The function expects the data buffer including all headers (CDH
102 * and HLTOUT header). The offset for the HLT payload is determined from
103 * the headers and the optional HLT decision data.
104 * @param pSrc data buffer
105 * @param size size of the buffer in byte
106 * @return instance of HOMER reader
108 AliHLTHOMERReader* OpenReader(UChar_t* pSrc, unsigned int size);
110 /** current instance of the HOMER reader */
111 AliHLTHOMERReader* fpCurrent; //!transient
114 /** current event no */
115 int fEvent; //!transient
118 /** instance of the ESD manager for writing and merging */
119 AliHLTEsdManager* fpEsdManager; //!transient
121 /** DDL id offset shift for index
122 * bit 16-31: DDL id, bit 0-15 block no
124 static const int fgkIdShift; //!transient
126 ClassDef(AliHLTOUTHomerCollection, 0)