3 /**************************************************************************
4 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
7 * Timm Steinbeck <timm@kip.uni-heidelberg.de> *
8 * Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
9 * for The ALICE Off-line Project. *
11 * Permission to use, copy, modify and distribute this software and its *
12 * documentation strictly for non-commercial purposes is hereby granted *
13 * without fee, provided that the above copyright notice appears in all *
14 * copies and that both the copyright notice and this permission notice *
15 * appear in the supporting documentation. The authors make no claims *
16 * about the suitability of this software for any purpose. It is *
17 * provided "as is" without express or implied warranty. *
18 **************************************************************************/
20 ///////////////////////////////////////////////////////////////////////////////
22 // class for reading unpacked data for the HLT //
24 ///////////////////////////////////////////////////////////////////////////////
30 #include "AliHLTTPCDigitReaderUnpacked.h"
31 #include "AliHLTTPCDigitData.h"
32 #include "AliHLTTPCRawDataFormat.h"
34 #include "AliHLTTPCLogging.h"
39 ClassImp(AliHLTTPCDigitReaderUnpacked)
41 AliHLTTPCDigitReaderUnpacked::AliHLTTPCDigitReaderUnpacked(){
48 AliHLTTPCDigitReaderUnpacked::~AliHLTTPCDigitReaderUnpacked(){
51 int AliHLTTPCDigitReaderUnpacked::InitBlock(void* ptr,unsigned long size, Int_t firstrow, Int_t lastrow){
52 AliHLTTPCUnpackedRawData *tmpptr;
56 tmpptr = (AliHLTTPCUnpackedRawData*) fPtr;
57 fDigitRowData = (AliHLTTPCDigitRowData*) tmpptr->fDigits;
58 fActRowData = (AliHLTTPCDigitRowData*) fDigitRowData;
67 if ((Int_t)fActRowData->fRow != fRow){
68 LOG(AliHLTTPCLog::kWarning,"AliHLTTPCDigitReaderUnpacked::Next","Digits") << "Row number should match!" << fActRowData->fRow << " " << fRow << ENDLOG;
72 bool AliHLTTPCDigitReaderUnpacked::Next(){
73 bool rreadvalue = true;
77 if ( fBin >= (Int_t)fActRowData->fNDigit ){
81 if ((fRow >= fFirstRow) && (fRow <= fLastRow)){
84 Byte_t *tmp = (Byte_t*) fActRowData;
85 Int_t size = sizeof(AliHLTTPCDigitRowData) + fActRowData->fNDigit*sizeof(AliHLTTPCDigitData);
87 fActRowData = (AliHLTTPCDigitRowData*) tmp;
89 if (((Byte_t*)fPtr) + fSize <= tmp){
101 if ((Int_t)fActRowData->fRow != fRow){
102 LOG(AliHLTTPCLog::kWarning,"AliHLTTPCDigitReaderUnpacked::Next","Digits") << "Row number should match!" << fActRowData->fRow << " " << fRow << ENDLOG;
106 fData = fActRowData->fDigitData;
111 int AliHLTTPCDigitReaderUnpacked::GetRow(){
117 int AliHLTTPCDigitReaderUnpacked::GetPad(){
119 rpad = (int)fData[fBin].fPad;
123 int AliHLTTPCDigitReaderUnpacked::GetSignal(){
125 rsignal = (int)fData[fBin].fCharge;
129 int AliHLTTPCDigitReaderUnpacked::GetTime(){
131 rtime = (int)fData[fBin].fTime;