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 **************************************************************************/
16 #include "AliHLTPHOSDigitReader.h"
17 #include "AliHLTPHOSDigitDataStruct.h"
20 AliHLTPHOSDigitReader::AliHLTPHOSDigitReader() :
23 // See header file for documentation
26 AliHLTPHOSDigitReader::~AliHLTPHOSDigitReader()
28 // See header file for documentation
32 AliHLTPHOSDigitDataStruct* AliHLTPHOSDigitReader::NextDigit()
35 fPrevDigit = fCurrentDigit;
36 fCurrentDigit = fNextDigit;
38 if(fCurrentDigit->fMemOffsetNext != 0)
40 fNextDigit = reinterpret_cast<AliHLTPHOSDigitDataStruct*>(reinterpret_cast<Int_t>(fCurrentDigit) + fCurrentDigit->fMemOffsetNext);
50 void AliHLTPHOSDigitReader::DropDigit()
52 if(fCurrentDigit == fFirstDigit)
54 fFirstDigit = reinterpret_cast<AliHLTPHOSDigitDataStruct*>(reinterpret_cast<Int_t>(fFirstDigit) + fFirstDigit->fMemOffsetNext);
55 fDigitHeader->fFirstDigitOffset += fCurrentDigit->fMemOffsetNext;
57 else if(fCurrentDigit != 0)
59 fPrevDigit->fMemOffsetNext = fPrevDigit->fMemOffsetNext + fCurrentDigit->fMemOffsetNext;
61 fCurrentDigit = fPrevDigit;