fBunchData(0),
fDataSize(0),
fWc(0),
- fHadd(0),
+ fHadd(-1),
+ fPrevHadd(-1),
fBunchCounter(0),
fIsComplete(0)
{
}
+/*
+bool
+//AliHLTAltroData::NextBunch(AliHLTAltroBunch *altroBunch)
+AliAltroData::NextBunch(AliAltroBunch *altroBunch)
+{
+ //comment
+ if(fIsComplete == true)
+ {
+
+ if(fBunchCounter == 0)
+ {
+ fBunchData = &fData[fDataSize - 1];
+ altroBunch->fData = &fData[fDataSize - 1];
+
+ }
+
+ if(fWc < fDataSize)
+ {
+ fWc += *fBunchData;
+ altroBunch->fBunchSize = *fBunchData;
+ altroBunch->fBunchDataSize = altroBunch->fBunchSize -2;
+
+ fBunchData --;
+ altroBunch->fEndTimeBin = *fBunchData;
+ fBunchData ++;
+
+ fBunchData = fBunchData - (altroBunch->fBunchSize);
+ altroBunch->fData = altroBunch->fData - (altroBunch->fBunchSize);
+ fBunchCounter ++;
+ return true;
+
+ }
+ else
+ {
+ fBunchCounter = 0;
+ fWc = 0;
+ return false;
+ }
+ }
+ else
+ {
+ printf("\nAliHLTAltroData::NextBunch: WARNING, dataset is not complet. 2AAA endmarker is missing ");
+ printf("\nfor branch %d, card %d, chip %d, channel %d\n", GetBranch(), GetCard(), GetChip(), GetChannel());
+ return false;
+ }
+}
+
+*/
+
+
+
+
Bool_t AliAltroData::NextBunch(AliAltroBunch *altroBunch)
{
+
if(fIsComplete == kTRUE)
{
altroBunch->SetEndTimeBin( *fBunchData );
// altroBunch->SetStartTimeBin(*fBunchData - fBunchSize);
fBunchData -= (altroBunch->GetBunchSize() +1);
+
+ // PATCH from Per Thomas Hille 250408 mke sure tha
+ // Data is consistent by cheking the start timebin, should never be negative
+ if( (int)altroBunch->GetStartTimeBin( ) < 0)
+ {
+ // printf("ERROR altroBunch->GetStartTimeBin( ) is %d", (int)altroBunch->GetStartTimeBin( ) );
+ return kFALSE;
+ }
+
+
fBunchCounter ++;
return kTRUE;
}
}
else
{
- printf("\nAliAltroData::NextBunch: WARNING, dataset is not complet. 2AAA endmarker is missing ");
- printf("\nfor branch %d, card %d, chip %d, channel %d\n", GetBranch(), GetCard(), GetChip(), GetChannel());
+ // printf("\nAliAltroData::NextBunch: WARNING, dataset is not complet. 2AAA endmarker is missing ");
+ // printf("\nfor branch %d, card %d, chip %d, channel %d\n", GetBranch(), GetCard(), GetChip(), GetChannel());
return kFALSE;
}
}
+
+
void AliAltroData::Reset()
{
fWc = 0;