]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSDigitReader.h
bugfix in the generation of the readout filter blocklist, domain entries of data...
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSDigitReader.h
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Authors: Oystein Djuvsland <oysteind@ift.uib.no>                       *
5  *                                                                        *
6  * Permission to use, copy, modify and distribute this software and its   *
7  * documentation strictly for non-commercial purposes is hereby granted   *
8  * without fee, provided that the above copyright notice appears in all   *
9  * copies and that both the copyright notice and this permission notice   *
10  * appear in the supporting documentation. The authors make no claims     *
11  * about the suitability of this software for any purpose. It is          *
12  * provided "as is" without express or implied warranty.                  *
13  **************************************************************************/
14
15 #ifndef ALIHLTPHOSDIGITREADER_H
16 #define ALIHLTPHOSDIGITREADER_H
17
18
19 /** @file   AliHLTPHOSClusterizerComponent.cxx
20     @author Oystein Djuvsland
21     @date   
22     @brief  A clusterizer component for PHOS HLT
23 */
24
25 // see header file for class documentation
26 // or
27 // refer to README to build package
28 // or
29 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
30
31 #include "AliHLTLogging.h"
32 #include "AliHLTPHOSDigitDataStruct.h"
33
34 /** 
35  * @class AliHLTPHOSDigitReader
36  * Class takes as input a AliHLTPHOSDigitHeaderStruct and iterates through 
37  * the list of digits following the header
38  * @ingroup alihlt_phos
39  */
40 class AliHLTPHOSDigitReader : public AliHLTLogging
41 {
42
43 public:
44   AliHLTPHOSDigitReader();                      
45   virtual ~AliHLTPHOSDigitReader();
46
47   void SetDigitHeader(AliHLTPHOSDigitHeaderStruct *digitHeader) 
48   { 
49     fDigitHeader = digitHeader; 
50     if(fDigitHeader->fNDigits != 0)
51       {
52         fFirstDigit = reinterpret_cast<AliHLTPHOSDigitDataStruct*>(reinterpret_cast<Long_t>(fDigitHeader) + fDigitHeader->fFirstDigitOffset);
53       }
54     else 
55       {
56         fFirstDigit = 0;
57       }
58     fNextDigit = fFirstDigit;
59   }
60     
61   void SetCurrentDigit(AliHLTPHOSDigitDataStruct *currentDigit) 
62   { 
63     fCurrentDigit = currentDigit; 
64     //    fNextDigit = reinterpret_cast<AliHLTPHOSDigitDataStruct*>(reinterpret_cast<UChar_t*>(fCurrentDigit) + fCurrentDigit->fMemOffsetNext);
65   }
66   void SetNextDigit(AliHLTPHOSDigitDataStruct *nextDigit) 
67   { 
68     fNextDigit = nextDigit; 
69     //    fNextDigit = reinterpret_cast<AliHLTPHOSDigitDataStruct*>(reinterpret_cast<UChar_t*>(fCurrentDigit) + fCurrentDigit->fMemOffsetNext);
70   }
71
72   AliHLTPHOSDigitDataStruct* NextDigit();
73
74   void DropDigit();
75
76   void Rewind() 
77   { 
78     fNextDigit = fFirstDigit; 
79     fPrevDigit = 0;
80   }
81
82   //  Int_t GetCurrentDigitOffset() { return reinterpret_cast<Long_t>(fCurrentDigit) - reinterpret_cast<Long_t>(fDigitHeader) + sizeof(AliHLTPHOSDigitHeaderStruct); }
83
84   Int_t GetCurrentDigitOffset() { return reinterpret_cast<Long_t>(fCurrentDigit) - reinterpret_cast<Long_t>(fDigitHeader); }
85
86 private:
87   
88   /** Pointer to the digit header */
89   AliHLTPHOSDigitHeaderStruct *fDigitHeader;    //COMMENT
90
91   /** Pointer to the current digit */
92   AliHLTPHOSDigitDataStruct *fCurrentDigit;    //COMMENT
93
94   /** Pointer to the next digit */
95   AliHLTPHOSDigitDataStruct *fNextDigit;    //COMMENT
96
97   /** Pointer to the current digit */
98   AliHLTPHOSDigitDataStruct *fPrevDigit;    //COMMENT
99
100   /** Pointer to the first digit */
101   AliHLTPHOSDigitDataStruct *fFirstDigit;    //COMMENT
102
103   AliHLTPHOSDigitReader (const AliHLTPHOSDigitReader  & );
104   AliHLTPHOSDigitReader & operator = (const AliHLTPHOSDigitReader &);
105
106
107 };
108
109
110 #endif