1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Authors: Oystein Djuvsland <oysteind@ift.uib.no> *
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 **************************************************************************/
15 #include "AliHLTLogging.h"
16 #include "AliHLTPHOSDigitReader.h"
17 #include "AliHLTPHOSDigitDataStruct.h"
20 AliHLTPHOSDigitReader::AliHLTPHOSDigitReader() :
27 // See header file for documentation
30 AliHLTPHOSDigitReader::~AliHLTPHOSDigitReader()
32 // See header file for documentation
36 AliHLTPHOSDigitDataStruct* AliHLTPHOSDigitReader::NextDigit()
39 fPrevDigit = fCurrentDigit;
40 fCurrentDigit = fNextDigit;
42 if(fCurrentDigit == 0) return 0;
44 if(fCurrentDigit->fMemOffsetNext != 0)
46 fNextDigit = reinterpret_cast<AliHLTPHOSDigitDataStruct*>(reinterpret_cast<UChar_t*>(fCurrentDigit) + fCurrentDigit->fMemOffsetNext);
52 // cout << "Digit is (x, z): " << fCurrentDigit->fX << ", " << fCurrentDigit->fZ << endl;
56 void AliHLTPHOSDigitReader::DropDigit()
58 if(fCurrentDigit == fFirstDigit)
60 fFirstDigit = reinterpret_cast<AliHLTPHOSDigitDataStruct*>(reinterpret_cast<UChar_t*>(fFirstDigit) + fFirstDigit->fMemOffsetNext);
61 fDigitHeader->fFirstDigitOffset += fCurrentDigit->fMemOffsetNext;
62 // HLTError("Dropping digit (x,z): %d, %d was first in list", fCurrentDigit->fX, fCurrentDigit->fZ);
64 else if(fCurrentDigit != 0)
66 fPrevDigit->fMemOffsetNext = fPrevDigit->fMemOffsetNext + fCurrentDigit->fMemOffsetNext;
67 // HLTError("Dropping digit (x,z): %d, %d, first digit is (x,z): %d, %d", fCurrentDigit->fX, fCurrentDigit->fZ, fFirstDigit->fX, fFirstDigit->fZ);
69 fCurrentDigit = fPrevDigit;