4 #ifndef ALIHLTTPCDIGITREADERPACKED_H
5 #define ALIHLTTPCDIGITREADERPACKED_H
7 //* This file is property of and copyright by the ALICE HLT Project *
8 //* ALICE Experiment at CERN, All rights reserved. *
9 //* See cxx source for full Copyright notice *
11 /** @file AliHLTTPCDigitReaderPacked.h
12 @author Timm Steinbeck, Jochen Thaeder, Matthias Richter, Kenneth Aamodt
14 @brief A digit reader implementation for simulated, packed TPC 'raw' data.
17 #include "AliHLTTPCDigitReader.h"
20 class AliRawReaderMemory;
21 class AliTPCRawStream;
24 * @class AliHLTTPCDigitReaderPacked
25 * A digit reader implementation for simulated, packed TPC 'raw' data.
26 * Includes reordering of the pads by default, sorting (and time and
27 * memory consuming intermediate storing of the data) can be disabled
28 * by @ref SetUnsorted() with argument <b>kTRUE</b>.
32 class AliHLTTPCDigitReaderPacked : public AliHLTTPCDigitReader{
34 /** standard constructor */
35 AliHLTTPCDigitReaderPacked();
37 virtual ~AliHLTTPCDigitReaderPacked();
40 * Init the reader with a data block.
41 * The function fetches the first and last row for the readout partition
42 * from @ref AliHLTTPCTransform.
43 * @param ptr pointer to data buffer
44 * @param size size of the data buffer
45 * @param patch patch (readout partition) number within the slice
46 * @param slice sector no (0 to 35)
48 Int_t InitBlock(void* ptr,ULong_t size, Int_t patch, Int_t slice);
50 void SetUnsorted(bool unsorted){fUnsorted=unsorted;}
58 AliHLTUInt32_t GetAltroBlockHWaddr() const;
59 int GetRCUTrailerSize();
60 bool GetRCUTrailerData(UChar_t*& trData);
62 const UInt_t* GetSignals();
63 Int_t GetTimeOfUnsortedSignal();
66 * Compound to hold both the AliTPCRawStreamInstance and the RawReader
68 class AliHLTTPCRawStream {
71 ~AliHLTTPCRawStream();
73 Bool_t SetMemory(Int_t ddlId, UChar_t* memory, ULong_t size );
79 Int_t GetTime() const;
80 Int_t GetSignal() const;
81 Int_t GetHWAddress() const;
82 Bool_t GetRCUTrailerData(UChar_t*& data) const;
83 Int_t GetRCUTrailerSize() const;
86 /** copy constructor prohibited */
87 AliHLTTPCRawStream(const AliHLTTPCRawStream&);
88 /** assignment operator prohibited */
89 AliHLTTPCRawStream& operator=(const AliHLTTPCRawStream&);
91 AliRawReaderMemory *fRawMemoryReader; //!transient
92 AliTPCRawStream *fTPCRawStream; //!transient
97 /** copy constructor prohibited */
98 AliHLTTPCDigitReaderPacked(const AliHLTTPCDigitReaderPacked&);
99 /** assignment operator prohibited */
100 AliHLTTPCDigitReaderPacked& operator=(const AliHLTTPCDigitReaderPacked&);
103 * Instance handling of the buffer to hold the sorted data.
104 * In order to keep memory consumption small, one global buffer will be used
105 * for the sorted data.
106 * This can actually be extended in order to support more than one global
107 * instance provided by a scheduler, but thats overkill for the moment.
109 static Int_t* GetBufferInstance();
112 * Release an instance of the buffer.
114 static void ReleaseBufferInstance(Int_t* pInstance);
117 * Instance handling of the TPCRawStream.
118 * In order to keep memory consumption small, one global instance of the
119 * TPCRawStream will be used to read data.
120 * This can actually be extended in order to support more than one global
121 * instance provided by a scheduler, but thats overkill for the moment.
123 AliHLTTPCRawStream* GetRawStreamInstance();
126 * Release an instance of the TPCRawStream.
128 void ReleaseRawStreamInstance(AliHLTTPCRawStream* pInstance);
130 AliHLTTPCRawStream* fTPCRawStream; //!transient
132 Int_t fCurrentRow; //!transient
133 Int_t fCurrentPad; //!transient
134 Int_t fCurrentBin; //!transient
136 Int_t fRowOffset; //!transient
137 Int_t fNRows; //!transient
138 Int_t fNPads; //!transient
140 static Int_t fNMaxRows; //!transient
141 static Int_t fNMaxPads; //!transient
142 static Int_t fNTimeBins; //!transient
144 Int_t *fData; //!transient
146 Bool_t fUnsorted; //!transient
148 /** array to hold bunch data */
149 vector<UInt_t> fDataBunch; //! transient
150 /** the current channel for bulk read mode */
151 Int_t fCurrentChannel; //! transient
152 /** last NextSignal returned data */
153 Int_t fbHaveData; //! transient
155 /** partition the reader is initialized for */
156 Int_t fCurrentPatch; //! transient
158 /** the global free instance of sorted data buffer */
159 static Int_t* fgpFreeBufferInstance; //! transient
160 /** occupied instance */
161 static Int_t* fgpIssuedBufferInstance; //! transient
163 /** the global free instance of the TPCRawStream */
164 static AliHLTTPCRawStream* fgpFreeStreamInstance; //! transient
165 /** occupied instance of the TPCRawStream */
166 static AliHLTTPCRawStream* fgpIssuedStreamInstance; //! transient
168 /** counter for instances of the reader */
169 static Int_t fgObjectCount; //! transient
171 ClassDef(AliHLTTPCDigitReaderPacked, 4)