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 AliHLTTPCDigitReaderDecoder.cxx
22 @author Kenneth Aamodt, Matthias Richter
24 @brief DigitReader implementation for the fast ALTRO Decoder
31 #include "AliHLTTPCDigitReaderDecoder.h"
32 #include "AliHLTTPCMapping.h"
33 #include "AliAltroDecoder.h"
34 #include "AliAltroData.h"
35 #include "AliAltroBunch.h"
37 ClassImp(AliHLTTPCDigitReaderDecoder)
39 AliHLTTPCDigitReaderDecoder::AliHLTTPCDigitReaderDecoder()
41 AliHLTTPCDigitReader(),
47 fNextSignalMethodUsed(kFALSE)
49 // see header file for class documentation
51 // refer to README to build package
53 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
56 AliHLTTPCDigitReaderDecoder::~AliHLTTPCDigitReaderDecoder()
58 // see header file for class documentation
70 int AliHLTTPCDigitReaderDecoder::InitBlock(void* ptr,unsigned long size, Int_t patch, Int_t slice)
72 // see header file for class documentation
73 fMapping = new AliHLTTPCMapping(patch);
74 fAltroDecoder = new AliAltroDecoder();
75 fAltroBunch = new AliAltroBunch();
76 fAltroDecoder->SetMemory((UChar_t*)ptr, size);
77 fAltroDecoder->Decode();
81 bool AliHLTTPCDigitReaderDecoder::NextChannel()
83 // see header file for class documentation
84 return fAltroDecoder->NextChannel(&fAltroData);
87 int AliHLTTPCDigitReaderDecoder::NextBunch()
89 // see header file for class documentation
90 return fAltroData.NextBunch(fAltroBunch);
93 bool AliHLTTPCDigitReaderDecoder::NextSignal()
95 // see header file for class documentation
96 /* nextSignalMethodUsed=kTRUE;
97 if(!fAltroBunch){ // this is true when NextChannel and Next bunch has not been called yet
98 if(NextChannel()){ // checks if ther is any pads with data
99 if(!NextBunch()){ // checks if there is any bunch
108 UInt_t bunchSize=fAltroBunchSize;
109 if(nextCounter==bunchSize){
116 const UInt_t* AliHLTTPCDigitReaderDecoder::GetSignals()
118 // see header file for class documentation
119 return fAltroBunch->GetData();
122 int AliHLTTPCDigitReaderDecoder::GetRow()
124 // see header file for class documentation
125 return fMapping->GetRow(fAltroData.GetHadd());
128 int AliHLTTPCDigitReaderDecoder::GetPad()
130 // see header file for class documentation
131 return fMapping->GetPad(fAltroData.GetHadd());
135 int AliHLTTPCDigitReaderDecoder::GetSignal()
137 // see header file for class documentation
141 int AliHLTTPCDigitReaderDecoder::GetTime()
143 // see header file for class documentation
144 if(!fNextSignalMethodUsed){// this is true if the bunch approach is used
145 return fAltroBunch->GetStartTimeBin();
148 return fAltroBunch->GetStartTimeBin()+fNextCounter;
152 int AliHLTTPCDigitReaderDecoder::GetBunchSize()
154 return fAltroBunch->GetBunchSize();