]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCDigitReaderUnpacked.h
Coding violations
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCDigitReaderUnpacked.h
1 // XEmacs -*-C++-*-
2 // @(#) $Id$
3
4 #ifndef ALIHLTTPCDIGITREADERUNPACKED_H
5 #define ALIHLTTPCDIGITREADERUNPACKED_H
6
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                               *
10
11 /** @file   AliHLTTPCDigitReaderUnpacked.h
12     @author Timm Steinbeck, Jochen Thaeder, Matthias Richter
13     @date   
14     @brief  A digit reader implementation for unpacked TPC data.
15 */
16
17 #include "AliHLTTPCDigitReader.h"
18 #include "AliHLTTPCDigitData.h"
19 class AliHLTTPCMapping;
20 class AliHLTTPCDigitRowData;
21
22 /**
23  * @class AliHLTTPCDigitReaderUnpacked
24  * A digit reader implementation for unpacked TPC data.
25  * @ingroup alihlt_tpc
26  */
27 class AliHLTTPCDigitReaderUnpacked : public AliHLTTPCDigitReader{
28 public:
29   /** standard constructor */
30   AliHLTTPCDigitReaderUnpacked();
31   /** destructor */
32   virtual ~AliHLTTPCDigitReaderUnpacked();
33
34   /**
35    * Init the reader
36    * @param ptr    pointer to input buffer
37    * @param size   size of the input buffer
38    * @param patch  readout partition
39    * @param slice  sector no
40    */  
41   int InitBlock(void* ptr,unsigned long size, Int_t patch, Int_t slice);
42   using AliHLTTPCDigitReader::InitBlock;
43
44   /**
45    * place the reader at the next signal
46    * @return 1 if there was a nest signal, 0 if not
47    */
48   bool NextSignal();
49
50   /**
51    * Get row number of the current signal
52    * @return row number of the current signal
53    */
54   int GetRow();
55
56   /**
57    * Get pad number of the current signal
58    * @return pad number of the current signal
59    */
60   int GetPad();
61
62   /**
63    * Get signal
64    * @return ADC signal
65    */
66   int GetSignal();
67
68   /**
69    * Get time of the current signal
70    * @return time of the current signal
71    */
72   int GetTime();
73   
74   bool NextChannel();
75   int NextBunch();
76   AliHLTUInt32_t GetAltroBlockHWaddr() const;
77   int GetBunchSize();
78   const UInt_t* GetSignals();
79   Int_t GetSortedTime();    
80   Int_t GetSortedSignal();
81   Int_t GetSortedPad() const;
82   Int_t GetSortedRow() const;
83   int GetRowOffset() const;
84
85   void SetUnsorted(bool unsorted){fUnsorted=unsorted;}
86
87   const AliHLTTPCDigitData* GetBunchDigits();
88
89 protected:
90
91
92 private:
93   /** copy constructor prohibited */
94   AliHLTTPCDigitReaderUnpacked(const AliHLTTPCDigitReaderUnpacked&);
95   /** assignment operator prohibited */
96   AliHLTTPCDigitReaderUnpacked& operator=(const AliHLTTPCDigitReaderUnpacked&);
97
98   /**
99    * Increment to the next raw data pointer.
100    * @param pRow        [IN] the current row data pointer
101    *                    [OUT] the new pointer
102    * @return -EBADF in case of format error 
103    */
104   int GetNextRowData(AliHLTTPCDigitRowData*& pRow) const;
105
106   /** intermediate row data structure (pointer in fPtr buffer) */
107   AliHLTTPCDigitRowData *fDigitRowData; //!
108   /** current row data structure (pointer in fPtr buffer) */
109   AliHLTTPCDigitRowData *fActRowData; //!
110   /** the current digit data */
111   AliHLTTPCDigitData *fData; //!
112
113   /** input buffer */
114   void* fPtr; //!
115   /** size of the input buffer */
116   unsigned long fSize;                                             // see above
117
118   /** current bin */
119   Int_t fBin;                                                      // see above
120   /** current row */
121   Int_t fRow;                                                      // see above
122   /** first row */
123   Int_t fFirstRow;                                                 // see above
124   /** last row */
125   Int_t fLastRow;                                                  // see above
126
127   Bool_t fUnsorted; //!transient
128
129   /** array to hold bunch data */
130   vector<UInt_t> fDataBunch;                            //! transient
131
132   vector<Int_t> fTrackIDs;                              //! transient
133   vector<UInt_t> fTrackIDCounts;                        //! transient
134   
135   Bool_t fEndOfDataReached;                             //! transient
136
137   Bool_t fEndOfChannelReached;                          //! transient
138
139   Int_t fPrevTime;                                      //! transient
140
141   Int_t fEndTimeBinOfBunch;                             //! transient
142
143   Int_t fPrevSignal;                                    //! transient
144
145   Int_t fPrevPad;                                       //! transient
146
147   Int_t fPrevRow;                                       //! transient
148   
149   Bool_t fNextChannelIsAlreadyConfirmed;                //! transient 
150
151   AliHLTTPCMapping *fMapping;                           //! transient
152
153   vector<AliHLTTPCDigitData> fDigitsVector;             //! transient
154
155   Int_t fPatch;
156
157   ClassDef(AliHLTTPCDigitReaderUnpacked, 1)
158 };
159 #endif
160
161  
162