4 #ifndef ALIHLTOUTHOMERCOLLECTION_H
5 #define ALIHLTOUTHOMERCOLLECTION_H
6 //* This file is property of and copyright by the *
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;
87 /** current event no */
88 int fEvent; //!transient
93 /** copy constructor prohibited */
94 AliHLTOUTHomerCollection(const AliHLTOUTHomerCollection&);
95 /** assignment operator prohibited */
96 AliHLTOUTHomerCollection& operator=(const AliHLTOUTHomerCollection&);
99 * Generate the index of the HLTOUT data from the data buffer.
104 * Get the data buffer
105 * Overloaded from AliHLTOUT
106 * @param [in] index index of the block
107 * @param [out] pBuffer buffer of the selected data block
108 * @param [out] size size of the selected data block
110 int GetDataBuffer(AliHLTUInt32_t index, const AliHLTUInt8_t* &pBuffer,
111 AliHLTUInt32_t& size);
114 * Open HOMER reader for the data buffer.
115 * The function expects the data buffer including all headers (CDH
116 * and HLTOUT header). The offset for the HLT payload is determined from
117 * the headers and the optional HLT decision data.
118 * @param pSrc data buffer
119 * @param size size of the buffer in byte
120 * @return instance of HOMER reader
122 AliHLTHOMERReader* OpenReader(UChar_t* pSrc, unsigned int size);
124 /** current instance of the HOMER reader */
125 AliHLTHOMERReader* fpCurrent; //!transient
127 /** instance of the ESD manager for writing and merging */
128 AliHLTEsdManager* fpEsdManager; //!transient
130 /** DDL id offset shift for index
131 * bit 16-31: DDL id, bit 0-15 block no
133 static const int fgkIdShift; //!transient
135 ClassDef(AliHLTOUTHomerCollection, 0)