]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSDigitReader.h
4f0832df1432fd8d9fe6557cadba7638417d9487
[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
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
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) + sizeof(AliHLTPHOSDigitHeaderStruct) + fDigitHeader->fFirstDigitOffset);
53       }
54     else 
55       {
56         fFirstDigit = 0;
57       }
58     fNextDigit = fFirstDigit;
59   }
60     
61   void SetCurrentDigit(AliHLTPHOSDigitDataStruct *currentDigit) { fCurrentDigit = currentDigit; }
62
63   AliHLTPHOSDigitDataStruct* NextDigit();
64
65   void DropDigit();
66
67   void Rewind() { fCurrentDigit = fFirstDigit; }
68
69   Int_t GetCurrentDigitOffset() { return reinterpret_cast<Long_t>(fCurrentDigit) - reinterpret_cast<Long_t>(fDigitHeader) + sizeof(AliHLTPHOSDigitHeaderStruct); }
70 private:
71   
72   /** Pointer to the digit header */
73   AliHLTPHOSDigitHeaderStruct *fDigitHeader;    //COMMENT
74
75   /** Pointer to the current digit */
76   AliHLTPHOSDigitDataStruct *fCurrentDigit;    //COMMENT
77
78   /** Pointer to the next digit */
79   AliHLTPHOSDigitDataStruct *fNextDigit;    //COMMENT
80
81   /** Pointer to the current digit */
82   AliHLTPHOSDigitDataStruct *fPrevDigit;    //COMMENT
83
84   /** Pointer to the first digit */
85   AliHLTPHOSDigitDataStruct *fFirstDigit;    //COMMENT
86   };
87
88
89 #endif