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 "AliHLTTPCTransform.h"
34 #include "AliHLTStdIncludes.h"
36 ClassImp(AliHLTTPCDigitReaderUnpacked)
38 AliHLTTPCDigitReaderUnpacked::AliHLTTPCDigitReaderUnpacked()
50 // see header file for class documentation
52 // refer to README to build package
54 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
57 AliHLTTPCDigitReaderUnpacked::AliHLTTPCDigitReaderUnpacked(const AliHLTTPCDigitReaderUnpacked& src)
69 // see header file for class documentation
70 HLTFatal("copy constructor not for use");
73 AliHLTTPCDigitReaderUnpacked& AliHLTTPCDigitReaderUnpacked::operator=(const AliHLTTPCDigitReaderUnpacked& src)
75 // see header file for class documentation
85 HLTFatal("assignment operator not for use");
89 AliHLTTPCDigitReaderUnpacked::~AliHLTTPCDigitReaderUnpacked(){
90 // see header file for class documentation
93 int AliHLTTPCDigitReaderUnpacked::InitBlock(void* ptr,unsigned long size, Int_t patch, Int_t slice){
94 // see header file for class documentation
95 AliHLTTPCUnpackedRawData *tmpptr=NULL;
99 tmpptr = reinterpret_cast<AliHLTTPCUnpackedRawData*>(fPtr);
100 fDigitRowData = (AliHLTTPCDigitRowData*) tmpptr->fDigits;
101 fActRowData = (AliHLTTPCDigitRowData*) fDigitRowData;
105 fFirstRow=AliHLTTPCTransform::GetFirstRow(patch);
106 fLastRow=AliHLTTPCTransform::GetLastRow(patch);
110 if ((Int_t)fActRowData->fRow != fRow){
111 HLTWarning("Row number should match! fActRowData->fRow=%d fRow=%d", fActRowData->fRow, fRow);
116 bool AliHLTTPCDigitReaderUnpacked::Next(){
117 // see header file for class documentation
118 bool rreadvalue = true;
122 if ( fBin >= (Int_t)fActRowData->fNDigit ){
126 if ((fRow >= fFirstRow) && (fRow <= fLastRow)){
129 Byte_t *tmp = (Byte_t*) fActRowData;
130 Int_t size = sizeof(AliHLTTPCDigitRowData) + fActRowData->fNDigit*sizeof(AliHLTTPCDigitData);
132 fActRowData = (AliHLTTPCDigitRowData*) tmp;
134 if (((Byte_t*)fPtr) + fSize <= tmp){
146 if ((Int_t)fActRowData->fRow != fRow){
147 HLTWarning("Row number should match! fActRowData->fRow=%d fRow=%d", fActRowData->fRow, fRow);
151 fData = fActRowData->fDigitData;
156 int AliHLTTPCDigitReaderUnpacked::GetRow(){
157 // see header file for class documentation
163 int AliHLTTPCDigitReaderUnpacked::GetPad(){
164 // see header file for class documentation
166 rpad = (int)fData[fBin].fPad;
170 int AliHLTTPCDigitReaderUnpacked::GetSignal(){
171 // see header file for class documentation
173 rsignal = (int)fData[fBin].fCharge;
177 int AliHLTTPCDigitReaderUnpacked::GetTime(){
178 // see header file for class documentation
180 rtime = (int)fData[fBin].fTime;