1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
5 * Primary Author: Per Thomas Hille <perthi@fys.uio.no> *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 #include "AliHLTAltroData.h"
20 AliHLTAltroData::AliHLTAltroData(): fData(0),
34 AliHLTAltroData::~AliHLTAltroData()
43 AliHLTAltroData::NextBunch(AliHLTAltroBunch *altroBunch)
46 if(fIsComplete == true)
49 if(fBunchCounter == 0)
51 fBunchData = &fData[fDataSize - 1];
52 altroBunch->fData = &fData[fDataSize - 1];
58 altroBunch->fBunchSize = *fBunchData;
59 altroBunch->fBunchDataSize = altroBunch->fBunchSize -2;
62 altroBunch->fEndTimeBin = *fBunchData;
65 fBunchData = fBunchData - (altroBunch->fBunchSize);
66 altroBunch->fData = altroBunch->fData - (altroBunch->fBunchSize);
67 // altroBunch->fData = fBunchData - (altroBunch->fBunchSize);
70 // altroBunch->fData ++;
87 printf("\nAliHLTAltroData::NextBunch: WARNING, dataset is not complet. 2AAA endmarker is missing ");
88 printf("\nfor branch %d, card %d, chip %d, channel %d\n", GetBranch(), GetCard(), GetChip(), GetChannel());
98 AliHLTAltroData::NextBunch(AliHLTAltroBunch *altroBunch)
100 if(fIsComplete == true)
103 if(fBunchCounter == 0)
105 fBunchData = &fData[fDataSize - 1];
111 // if(*fBunchData == 0)
117 altroBunch->fData = fData - *fBunchData -1; ;
118 altroBunch->fBunchDataSize = *fBunchData -2;
120 altroBunch->fEndTimeBin = *fBunchData;
121 cout << "*fBuncchData = " << *fBunchData << endl;
122 fBunchData = fBunchData - (altroBunch->fBunchDataSize +1);
137 printf("\nAliHLTAltroData::NextBunch: WARNING, dataset is not complet. 2AAA endmarker is missing ");
138 printf("\nfor branch %d, card %d, chip %d, channel %d\n", GetBranch(), GetCard(), GetChip(), GetChannel());
147 AliHLTAltroData::Reset()
156 AliHLTAltroData::GetChannel()
163 AliHLTAltroData::GetChip()
166 return (fHadd & 0x70) >> 4 ;
170 AliHLTAltroData::GetCard()
173 return (fHadd & 0x780) >> 7;
178 AliHLTAltroData::GetBranch()
181 return (fHadd & 0x800 ) >> 11;