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 AliHLTTPCDigitReader.cxx
22 @author Timm Steinbeck, Jochen Thaeder, Matthias Richter, Kenneth Aamodt
24 @brief An abstract reader class for TPC data.
31 #include "AliHLTTPCDigitReader.h"
32 #include "AliHLTTPCTransform.h"
33 #include "AliHLTStdIncludes.h"
35 ClassImp(AliHLTTPCDigitReader)
37 AliHLTTPCDigitReader::AliHLTTPCDigitReader()
45 AliHLTTPCDigitReader::~AliHLTTPCDigitReader()
49 int AliHLTTPCDigitReader::InitBlock(void* ptr,unsigned long size,Int_t firstrow,Int_t lastrow, Int_t patch, Int_t slice)
51 if (patch<0 || patch>=AliHLTTPCTransform::GetNumberOfPatches()) {
52 HLTError("invalid readout partition number %d", patch);
55 if (firstrow!=AliHLTTPCTransform::GetFirstRow(patch)) {
56 HLTWarning("The firstrow parameter does not match the layout of the readout partition %d "
57 "(firstrow=%d). Parameter is ignored", patch, AliHLTTPCTransform::GetFirstRow(patch));
59 if (lastrow!=AliHLTTPCTransform::GetLastRow(patch)) {
60 HLTWarning("The lastrow parameter does not match the layout of the readout partition %d "
61 "(lastrow=%d). Parameter is ignored", patch, AliHLTTPCTransform::GetLastRow(patch));
63 return InitBlock(ptr, size, patch, slice);
66 void AliHLTTPCDigitReader::SetOldRCUFormat(Bool_t /*oldrcuformat*/)
69 void AliHLTTPCDigitReader::SetUnsorted(Bool_t /*unsorted*/){
72 bool AliHLTTPCDigitReader::Next()
74 if (!CheckFlag(kLocked)) return NextSignal();
77 if (!CheckFlag(kChannelOverwrap))
78 haveData=NextSignal();
80 if (haveData && (fLckRow!=GetRow() || fLckPad!=GetPad())) {
81 SetFlag(kChannelOverwrap);
88 void AliHLTTPCDigitReader::EnableCaching(bool bCache)
90 if (bCache) SetFlag(kChannelCaching);
91 else ClearFlag(kChannelCaching);
94 int AliHLTTPCDigitReader::RewindChannel()
101 unsigned int AliHLTTPCDigitReader::SetFlag(unsigned int flag)
106 unsigned int AliHLTTPCDigitReader::ClearFlag(unsigned int flag)
108 return fFlags&=~flag;
111 // int operator[](int timebin)
116 int AliHLTTPCDigitReader::RewindCurrentChannel()
119 if (!CheckFlag(kChannelCaching)) return -ENODATA;
123 int AliHLTTPCDigitReader::RewindToPrevChannel()
126 if (!CheckFlag(kChannelCaching)) return -ENODATA;