1 #include "AliAltroDecoder.h" // decoder for altro payload
2 #include "AliAltroData.h" // container for altro payload
3 #include "AliAltroBunch.h" // container for altro bunches
13 #define MIN_BUNCH_SIZE 0
17 int main(int argc, const char** argv)
20 // int n_loops = 200000;
26 AliAltroData altrodata;
27 AliAltroBunch *altrobunchPtr = new AliAltroBunch;
32 AliAltroDecoder *decoder = new AliAltroDecoder();
34 fin.open(argv[1], ios::binary);
36 fin.seekg (0, ios::end);
38 fin.seekg (0, ios::beg);
40 char *dataPtr = new char[length];
42 fin.read (dataPtr,length);
50 for(int i=0; i < n_loops; i++)
52 decoder->SetMemory((UChar_t*)dataPtr, length);
56 while(decoder->NextChannel(&altrodata) == true && channelCnt < 10)
60 // decoder->PrintInfo(altrodata, altrodata.GetDataSize() +4);
62 if( altrodata.GetDataSize() != 0 )
66 while( altrodata.NextBunch(altrobunchPtr) == true)
70 if(altrobunchPtr->GetBunchSize() > MIN_BUNCH_SIZE)
73 cout <<"cnt = "<< cnt <<endl;
74 cout << "altrobunch.fDataSize = " << altrobunchPtr->GetBunchSize() << endl;
75 cout << "altrobunch.fEndTimeBin = " << altrobunchPtr->GetEndTimeBin() << endl;
76 cout << "altrobunch.fStartTimeBin = " << altrobunchPtr->GetStartTimeBin() << endl;
78 for(int i=0; i<altrobunchPtr->GetBunchSize() + 20; i++)
85 // printf("%d\t", altrobunchPtr->fData[i]);
86 printf("%d\t", (altrobunchPtr->GetData())[i]);
102 float mikro = (float)(((float)end -(float)start)/((float)n_loops));
104 printf("\nProcessing time per event is %f us\n", mikro);
106 decoder->GetFailureRate();