doing backward compatibility correctly
[u/mrichter/AliRoot.git] / HLT / rec / AliHLTOUTHomerCollection.h
CommitLineData
c5123824 1//-*- Mode: C++ -*-
2// $Id$
3
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 *
9
10/** @file AliHLTOUTHomerCollection.h
11 @author Matthias Richter
12 @date
13 @brief General HLTOUT data collection.
14 */
15#include "AliHLTOUTHomerBuffer.h"
16
17class AliHLTHOMERReader;
18class AliRawDataHeader;
19class AliHLTEsdManager;
20
21/**
22 * @class AliHLTOUTHomerCollection
23 * Handler of HLTOUT data, base class for specific handlers for
24 * RawReader or Digit data.
25 */
26class AliHLTOUTHomerCollection : public AliHLTOUTHomerBuffer {
27 public:
28 /** constructor */
29 AliHLTOUTHomerCollection(int event=-1, AliHLTEsdManager* pEsdManager=NULL);
30 /** destructor */
31 virtual ~AliHLTOUTHomerCollection();
32
33 protected:
34 /**
35 * Read next data form the data source.
36 */
37 virtual Bool_t ReadNextData(UChar_t*& data)=0;
38
39 /**
40 * Reset data stream position.
41 * Reeading of data starts with the first data block.
42 */
43 virtual int Reset()=0;
44
45 /**
46 * Get size of the current data block.
47 */
48 virtual int GetDataSize()=0;
49
50 /**
51 * Get the header of the current data block
52 */
53 virtual const AliRawDataHeader* GetDataHeader()=0;
54
55 /**
56 * Select equipment for data readout.
57 */
58 virtual void SelectEquipment(int equipmentType,
59 int minEquipmentId = -1,
60 int maxEquipmentId = -1)=0;
61
62 /**
63 * Get equipment id of the current data block.
64 */
65 virtual int GetEquipmentId()=0;
66
67 /**
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
73 */
74 int GetCurrentEventNo() const {return fEvent;}
75
76 // interface function of AliHLTOUT
77 int WriteESD(const AliHLTUInt8_t* pBuffer, AliHLTUInt32_t size, AliHLTComponentDataType dt, AliESDEvent* tgtesd=NULL) const;
78
79 private:
80 /** copy constructor prohibited */
81 AliHLTOUTHomerCollection(const AliHLTOUTHomerCollection&);
82 /** assignment operator prohibited */
83 AliHLTOUTHomerCollection& operator=(const AliHLTOUTHomerCollection&);
84
85 /**
86 * Generate the index of the HLTOUT data from the data buffer.
87 */
88 int GenerateIndex();
89
90 /**
91 * Get 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
95 */
96 int GetDataBuffer(AliHLTUInt32_t index, const AliHLTUInt8_t* &pBuffer,
97 AliHLTUInt32_t& size);
98
99 /**
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
107 */
108 AliHLTHOMERReader* OpenReader(UChar_t* pSrc, unsigned int size);
109
110 /** current instance of the HOMER reader */
111 AliHLTHOMERReader* fpCurrent; //!transient
112
113 /** current event no */
114 int fEvent; //!transient
115
116 /** instance of the ESD manager for writing and merging */
117 AliHLTEsdManager* fpEsdManager; //!transient
118
119 /** DDL id offset shift for index
120 * bit 16-31: DDL id, bit 0-15 block no
121 */
122 static const int fgkIdShift; //!transient
123
124 ClassDef(AliHLTOUTHomerCollection, 0)
125};
126#endif