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 collection for HLTOUT data in DDL format.
15 #include "AliHLTOUTHomerBuffer.h"
17 class AliHLTHOMERReader;
18 class AliRawDataHeader;
19 class AliHLTEsdManager;
22 * @class AliHLTOUTHomerCollection
23 * Handler of HLTOUT data in DDL format, base class for specific
24 * handlers for RawReader or Digit data.
26 * The class expects the data to be in the DDL data format.
27 * In contrast to the AliHLTOUTHomerBuffer, it also takes the
28 * additional CDH and HLT headers and optional HLT decision into
29 * account when opening the HOMER reader (see OpenReader()).
31 * The data access must be provided by the child class, the
32 * interface is pretty much like the AliRawReader interface.
34 class AliHLTOUTHomerCollection : public AliHLTOUTHomerBuffer {
37 AliHLTOUTHomerCollection(int event=-1, AliHLTEsdManager* pEsdManager=NULL);
39 virtual ~AliHLTOUTHomerCollection();
43 * Read next data form the data source.
45 virtual Bool_t ReadNextData(UChar_t*& data)=0;
48 * Reset data stream position.
49 * Reeading of data starts with the first data block.
51 virtual int Reset()=0;
54 * Get size of the current data block.
56 virtual int GetDataSize()=0;
59 * Get the header of the current data block
61 virtual const AliRawDataHeader* GetDataHeader()=0;
64 * Select equipment for data readout.
66 virtual void SelectEquipment(int equipmentType,
67 int minEquipmentId = -1,
68 int maxEquipmentId = -1)=0;
71 * Get equipment id of the current data block.
73 virtual int GetEquipmentId()=0;
76 * Get the current event no.
77 * The event no is set during creation of the HLTOUT object.
78 * For the reconstruction it is taken from the ESD provided by the
79 * AliReconstruction framework AliESDEvent::GetEventNumberInFile
80 * @return event no or -1 if not set
82 int GetCurrentEventNo() const {return fEvent;}
84 // interface function of AliHLTOUT
85 int WriteESD(const AliHLTUInt8_t* pBuffer, AliHLTUInt32_t size, AliHLTComponentDataType dt, AliESDEvent* tgtesd=NULL) const;
88 /** copy constructor prohibited */
89 AliHLTOUTHomerCollection(const AliHLTOUTHomerCollection&);
90 /** assignment operator prohibited */
91 AliHLTOUTHomerCollection& operator=(const AliHLTOUTHomerCollection&);
94 * Generate the index of the HLTOUT data from the data buffer.
100 * @param [in] index index of the block
101 * @param [out] pBuffer buffer of the selected data block
102 * @param [out] size size of the selected data block
104 int GetDataBuffer(AliHLTUInt32_t index, const AliHLTUInt8_t* &pBuffer,
105 AliHLTUInt32_t& size);
108 * Open HOMER reader for the data buffer.
109 * The function expects the data buffer including all headers (CDH
110 * and HLTOUT header). The offset for the HLT payload is determined from
111 * the headers and the optional HLT decision data.
112 * @param pSrc data buffer
113 * @param size size of the buffer in byte
114 * @return instance of HOMER reader
116 AliHLTHOMERReader* OpenReader(UChar_t* pSrc, unsigned int size);
118 /** current instance of the HOMER reader */
119 AliHLTHOMERReader* fpCurrent; //!transient
122 /** current event no */
123 int fEvent; //!transient
126 /** instance of the ESD manager for writing and merging */
127 AliHLTEsdManager* fpEsdManager; //!transient
129 /** DDL id offset shift for index
130 * bit 16-31: DDL id, bit 0-15 block no
132 static const int fgkIdShift; //!transient
134 ClassDef(AliHLTOUTHomerCollection, 0)