]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/rec/AliHLTOUTHomerCollection.h
Fixing comments
[u/mrichter/AliRoot.git] / HLT / rec / AliHLTOUTHomerCollection.h
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 collection for HLTOUT data in DDL format.
14 */
15 #include "AliHLTOUTHomerBuffer.h"
16
17 class AliHLTHOMERReader;
18 class AliRawDataHeader;
19 class AliHLTEsdManager;
20
21 /**
22  * @class AliHLTOUTHomerCollection
23  * Handler of HLTOUT data in DDL format, base class for specific
24  * handlers for RawReader or Digit data.
25  *
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()).
30  *
31  * The data access must be provided by the child class, the
32  * interface is pretty much like the AliRawReader interface.
33  */
34 class AliHLTOUTHomerCollection : public AliHLTOUTHomerBuffer {
35  public:
36   /** constructor */
37   AliHLTOUTHomerCollection(int event=-1, AliHLTEsdManager* pEsdManager=NULL);
38   /** destructor */
39   virtual ~AliHLTOUTHomerCollection();
40
41  protected:
42   /**
43    * Read next data form the data source.
44    */
45   virtual Bool_t ReadNextData(UChar_t*& data)=0;
46
47   /**
48    * Reset data stream position.
49    * Reeading of data starts with the first data block.
50    */
51   virtual int Reset()=0;
52
53   /**
54    * Get size of the current data block.
55    */
56   virtual int GetDataSize()=0;
57
58   /**
59    * Get the header of the current data block
60    */
61   virtual const AliRawDataHeader* GetDataHeader()=0;
62
63   /**
64    * Select equipment for data readout.
65    */
66   virtual void SelectEquipment(int equipmentType, 
67                                int minEquipmentId = -1, 
68                                int maxEquipmentId = -1)=0;
69
70   /**
71    * Get equipment id of the current data block.
72    */
73   virtual int GetEquipmentId()=0;
74
75   /**
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
81    */
82   int GetCurrentEventNo() const {return fEvent;}
83
84   // interface function of AliHLTOUT
85   int WriteESD(const AliHLTUInt8_t* pBuffer, AliHLTUInt32_t size, AliHLTComponentDataType dt, AliESDEvent* tgtesd=NULL) const;
86
87  private:
88   /** copy constructor prohibited */
89   AliHLTOUTHomerCollection(const AliHLTOUTHomerCollection&);
90   /** assignment operator prohibited */
91   AliHLTOUTHomerCollection& operator=(const AliHLTOUTHomerCollection&);
92
93   /**
94    * Generate the index of the HLTOUT data from the data buffer.
95    */
96   int GenerateIndex();
97
98   /**
99    * Get the data buffer
100    * @param index   [in]  index of the block
101    * @param pBuffer [out] buffer of the selected data block
102    * @param size    [out] size of the selected data block
103    */
104   int GetDataBuffer(AliHLTUInt32_t index, const AliHLTUInt8_t* &pBuffer, 
105                     AliHLTUInt32_t& size);
106
107   /**
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
115    */
116   AliHLTHOMERReader* OpenReader(UChar_t* pSrc, unsigned int size);
117
118   /** current instance of the HOMER reader */
119   AliHLTHOMERReader* fpCurrent;  //!transient
120
121 protected:
122   /** current event no */
123   int fEvent; //!transient
124
125 private:
126   /** instance of the ESD manager for writing and merging */
127   AliHLTEsdManager* fpEsdManager; //!transient
128
129   /** DDL id offset shift for index
130    *  bit 16-31: DDL id, bit 0-15 block no
131    */
132   static const int fgkIdShift; //!transient
133   
134   ClassDef(AliHLTOUTHomerCollection, 0)
135 };
136 #endif