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 **************************************************************************/
16 #include "AliAltroData.h"
17 #include "AliAltroBunch.h"
19 ClassImp(AliAltroData)
21 AliAltroData::AliAltroData(): fData(0),
36 AliAltroData::~AliAltroData()
45 //AliHLTAltroData::NextBunch(AliHLTAltroBunch *altroBunch)
46 AliAltroData::NextBunch(AliAltroBunch *altroBunch)
49 if(fIsComplete == true)
52 if(fBunchCounter == 0)
54 fBunchData = &fData[fDataSize - 1];
55 altroBunch->fData = &fData[fDataSize - 1];
62 altroBunch->fBunchSize = *fBunchData;
63 altroBunch->fBunchDataSize = altroBunch->fBunchSize -2;
66 altroBunch->fEndTimeBin = *fBunchData;
69 fBunchData = fBunchData - (altroBunch->fBunchSize);
70 altroBunch->fData = altroBunch->fData - (altroBunch->fBunchSize);
84 printf("\nAliHLTAltroData::NextBunch: WARNING, dataset is not complet. 2AAA endmarker is missing ");
85 printf("\nfor branch %d, card %d, chip %d, channel %d\n", GetBranch(), GetCard(), GetChip(), GetChannel());
95 Bool_t AliAltroData::NextBunch(AliAltroBunch *altroBunch)
98 if(fIsComplete == kTRUE)
101 if(fBunchCounter == 0)
103 fBunchData = &fData[fDataSize - 1];
108 if(*fBunchData == 0){ fWc += 1;};
110 altroBunch->SetData(fData + fDataSize - fWc);
111 altroBunch->SetBunchSize(*fBunchData -2);
113 altroBunch->SetEndTimeBin( *fBunchData );
114 // altroBunch->SetStartTimeBin(*fBunchData - fBunchSize);
115 fBunchData -= (altroBunch->GetBunchSize() +1);
128 printf("\nAliAltroData::NextBunch: WARNING, dataset is not complet. 2AAA endmarker is missing ");
129 printf("\nfor branch %d, card %d, chip %d, channel %d\n", GetBranch(), GetCard(), GetChip(), GetChannel());
137 void AliAltroData::Reset()
144 Int_t AliAltroData::GetChannel() const
149 Int_t AliAltroData::GetChip() const
151 return (fHadd & 0x70) >> 4 ;
154 Int_t AliAltroData::GetCard() const
156 return (fHadd & 0x780) >> 7;
160 Int_t AliAltroData::GetBranch() const
162 return (fHadd & 0x800 ) >> 11;