]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCDigitReader.h
DigitReaderPacket revived: uses AliRawReader and Stream (K. Aamodt)
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCDigitReader.h
1 // XEmacs -*-C++-*-
2 // @(#) $Id$
3
4 #ifndef ALIHLTTPCDIGITREADER_H
5 #define ALIHLTTPCDIGITREADER_H
6
7 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
8  * See cxx source for full Copyright notice                               */
9
10 /** @file   AliHLTTPCDigitReader.h
11     @author Timm Steinbeck, Jochen Thaeder, Matthias Richter, Kenneth Aamodt
12     @date   
13     @brief  An abstract reader class for TPC data.
14 */
15
16 #include "AliHLTLogging.h"
17 #include "TObject.h"
18
19 /**
20  * @class AliHLTTPCDigitReader
21  * An abstract reader class for the TPC data. The Data is treated as a stream
22  * of data points, each containing row number, pad number, time bin and ADC
23  * value. The class hides the actual encoding of the data stream for the sub-
24  * sequent components like the cluster finder.
25  * @ingroup alihlt_tpc
26  */
27 class AliHLTTPCDigitReader : public AliHLTLogging {
28 public:
29   /** standard constructor */
30   AliHLTTPCDigitReader();
31   /** destructor */
32   virtual ~AliHLTTPCDigitReader();
33   
34   /**
35    * Init the reader with a data block.
36    * The function fetches the first and last row for the readout partition
37    * from @ref AliHLTTPCTransform. The method is pure virtual and must be implemented
38    * by the child class.
39    * @param ptr     pointer to data buffer
40    * @param size    size of the data buffer
41    * @param patch   patch (readout partition) number within the slice
42    * @param slice   sector no (0 to 35)
43    */
44   virtual int InitBlock(void* ptr,unsigned long size, Int_t patch, Int_t slice)=0;
45
46   /**
47    * Old Init function.
48    * <b>Note:</b> This method is for backward compatibility only, not for further
49    * use. The <i>firstrow</i> and <i>lastrow</i> parameters are fetched from
50    * @ref AliHLTTPCTransform.
51    *
52    * @param ptr       pointer to data buffer
53    * @param size      size of the data buffer
54    * @param firstrow  first row occuring in the data
55    * @param lastrow   last row occuring in the data
56    * @param patch     patch (readout partition) number within the slice
57    * @param slice     sector no (0 to 35)
58    */
59   virtual int InitBlock(void* ptr,unsigned long size,Int_t firstrow,Int_t lastrow, Int_t patch, Int_t slice);
60
61   /**
62    * Set the reader position to the next value.
63    * If the reader was not yet initialized, initialization is carried out and
64    * the position set to the beginning of the stream (which is in essence the
65    * end of the data block due to the back-linked list).
66    */
67   virtual bool Next()=0;
68
69   /**
70    * Get the row number of the current value.
71    */
72   virtual int GetRow()=0;
73
74   /**
75    * Get the pad number of the current value.
76    */
77   virtual int GetPad()=0;
78
79   /**
80    * Get the current ADC value.
81    */
82   virtual int GetSignal()=0;
83
84   /**
85    * Get the time bin of the current value.
86    */
87   virtual int GetTime()=0;
88
89   /**
90    * Method to use old rcu fomat.
91    */
92   virtual void SetOldRCUFormat(Bool_t oldrcuformat);
93
94 protected:
95         
96 private:
97
98   ClassDef(AliHLTTPCDigitReader, 0)
99     
100 };
101 #endif
102