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(){
58 // see header file for class documentation
61 int AliHLTTPCDigitReaderUnpacked::InitBlock(void* ptr,unsigned long size, Int_t patch, Int_t slice){
62 // see header file for class documentation
63 AliHLTTPCUnpackedRawData *tmpptr=NULL;
67 tmpptr = reinterpret_cast<AliHLTTPCUnpackedRawData*>(fPtr);
68 fDigitRowData = (AliHLTTPCDigitRowData*) tmpptr->fDigits;
69 fActRowData = (AliHLTTPCDigitRowData*) fDigitRowData;
74 AliHLTTPCTransform::Slice2Sector(slice, AliHLTTPCTransform::GetFirstRow(patch), dummy, fFirstRow);
75 AliHLTTPCTransform::Slice2Sector(slice, AliHLTTPCTransform::GetLastRow(patch), dummy, fLastRow);
79 if ((Int_t)fActRowData->fRow != fRow){
80 HLTWarning("Row number should match! fActRowData->fRow=%d fRow=%d", fActRowData->fRow, fRow);
85 bool AliHLTTPCDigitReaderUnpacked::Next(){
86 // see header file for class documentation
87 bool rreadvalue = true;
91 if ( fBin >= (Int_t)fActRowData->fNDigit ){
95 if ((fRow >= fFirstRow) && (fRow <= fLastRow)){
98 Byte_t *tmp = (Byte_t*) fActRowData;
99 Int_t size = sizeof(AliHLTTPCDigitRowData) + fActRowData->fNDigit*sizeof(AliHLTTPCDigitData);
101 fActRowData = (AliHLTTPCDigitRowData*) tmp;
103 if (((Byte_t*)fPtr) + fSize <= tmp){
115 if ((Int_t)fActRowData->fRow != fRow){
116 HLTWarning("Row number should match! fActRowData->fRow=%d fRow=%d", fActRowData->fRow, fRow);
120 fData = fActRowData->fDigitData;
125 int AliHLTTPCDigitReaderUnpacked::GetRow(){
126 // see header file for class documentation
132 int AliHLTTPCDigitReaderUnpacked::GetPad(){
133 // see header file for class documentation
135 rpad = (int)fData[fBin].fPad;
139 int AliHLTTPCDigitReaderUnpacked::GetSignal(){
140 // see header file for class documentation
142 rsignal = (int)fData[fBin].fCharge;
146 int AliHLTTPCDigitReaderUnpacked::GetTime(){
147 // see header file for class documentation
149 rtime = (int)fData[fBin].fTime;