3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
7 * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 * Timm Steinbeck <timm@kip.uni-heidelberg.de> *
9 * Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
10 * for The ALICE HLT Project. *
12 * Permission to use, copy, modify and distribute this software and its *
13 * documentation strictly for non-commercial purposes is hereby granted *
14 * without fee, provided that the above copyright notice appears in all *
15 * copies and that both the copyright notice and this permission notice *
16 * appear in the supporting documentation. The authors make no claims *
17 * about the suitability of this software for any purpose. It is *
18 * provided "as is" without express or implied warranty. *
19 **************************************************************************/
21 /** @file AliHLTTPCDigitReaderUnpacked.cxx
22 @author Timm Steinbeck, Jochen Thaeder, Matthias Richter
24 @brief A digit reader implementation for unpacked TPC data.
31 #include "AliHLTTPCDigitReaderUnpacked.h"
32 #include "AliHLTTPCDigitData.h"
33 #include "AliHLTTPCRawDataFormat.h"
34 #include "AliHLTTPCTransform.h"
35 #include "AliHLTStdIncludes.h"
37 ClassImp(AliHLTTPCDigitReaderUnpacked)
39 AliHLTTPCDigitReaderUnpacked::AliHLTTPCDigitReaderUnpacked()
51 // see header file for class documentation
53 // refer to README to build package
55 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
58 AliHLTTPCDigitReaderUnpacked::AliHLTTPCDigitReaderUnpacked(const AliHLTTPCDigitReaderUnpacked& src)
70 // see header file for class documentation
71 HLTFatal("copy constructor not for use");
74 AliHLTTPCDigitReaderUnpacked& AliHLTTPCDigitReaderUnpacked::operator=(const AliHLTTPCDigitReaderUnpacked& src)
76 // see header file for class documentation
86 HLTFatal("assignment operator not for use");
90 AliHLTTPCDigitReaderUnpacked::~AliHLTTPCDigitReaderUnpacked(){
91 // see header file for class documentation
94 int AliHLTTPCDigitReaderUnpacked::InitBlock(void* ptr,unsigned long size, Int_t patch, Int_t slice){
95 // see header file for class documentation
96 AliHLTTPCUnpackedRawData *tmpptr=NULL;
100 tmpptr = (AliHLTTPCUnpackedRawData*) fPtr;
101 fDigitRowData = (AliHLTTPCDigitRowData*) tmpptr->fDigits;
102 fActRowData = (AliHLTTPCDigitRowData*) fDigitRowData;
106 fFirstRow=AliHLTTPCTransform::GetFirstRow(patch);
107 fLastRow=AliHLTTPCTransform::GetLastRow(patch);
112 if ((Int_t)fActRowData->fRow != fRow){
113 HLTWarning("Row number should match! fActRowData->fRow=%d fRow=%d", fActRowData->fRow, fRow);
117 bool AliHLTTPCDigitReaderUnpacked::Next(){
118 // see header file for class documentation
119 bool rreadvalue = true;
123 if ( fBin >= (Int_t)fActRowData->fNDigit ){
127 if ((fRow >= fFirstRow) && (fRow <= fLastRow)){
130 Byte_t *tmp = (Byte_t*) fActRowData;
131 Int_t size = sizeof(AliHLTTPCDigitRowData) + fActRowData->fNDigit*sizeof(AliHLTTPCDigitData);
133 fActRowData = (AliHLTTPCDigitRowData*) tmp;
135 if (((Byte_t*)fPtr) + fSize <= tmp){
147 if ((Int_t)fActRowData->fRow != fRow){
148 HLTWarning("Row number should match! fActRowData->fRow=%d fRow=%d", fActRowData->fRow, fRow);
152 fData = fActRowData->fDigitData;
157 int AliHLTTPCDigitReaderUnpacked::GetRow(){
158 // see header file for class documentation
164 int AliHLTTPCDigitReaderUnpacked::GetPad(){
165 // see header file for class documentation
167 rpad = (int)fData[fBin].fPad;
171 int AliHLTTPCDigitReaderUnpacked::GetSignal(){
172 // see header file for class documentation
174 rsignal = (int)fData[fBin].fCharge;
178 int AliHLTTPCDigitReaderUnpacked::GetTime(){
179 // see header file for class documentation
181 rtime = (int)fData[fBin].fTime;