27 std::vector<ULong64_t> rawData;
30 for (UInt_t j = 0; j < 5; j++) {
31 dataword = dataword << 8;
34 rawData.push_back(dataword);
37 ULong_t frameCount = -1;
38 ULong64_t header = GetType(dataword);
40 frameCount = GetFrameCount(dataword);
50 ULong_t header = data & 0xC000000000;
51 header = header >> 38;
56 ULong_t frame = data & 0x3FC0000;
64 ULong_t temp = header;
65 tempHeader.
fECC = temp & 0x3F;
78 ULong_t temp = trailer;
79 tempTrailer.
fECC = temp & 0x3F;
85 tempTrailer.
fNEvents = temp & 0xFFFF;
116 UInt_t temp = pixelnumber;
118 address.
fRow= temp & 0x7f;
120 address.
fSide= temp & 0x1;
122 address.
fCol = temp & 0x3f;
134 address = PixelNumberToPixelAddress(pixelnumber);
137 return PixelAddressToMatrixAddress(address);
260 UInt_t matrix_row = 0;
261 UInt_t matrix_col = 0;
263 if (address.
fCol == 0 || address.
fCol == 3){
264 matrix_row = address.
fRow;
265 matrix_col = address.
fCol * 6 + !(address.
fSide);
269 matrix_col = (address.
fRow / 32) * 2 + 2 + ((address.
fCol - 1) * 8);
270 if ( (address.
fRow/32) % 2 == 0 ){
271 matrix_row = address.
fRow % 32;
272 matrix_col += !(address.
fSide);
275 matrix_row = 31 - address.
fRow % 32;
276 matrix_col += address.
fSide;
280 return std::pair<UInt_t, UInt_t>(matrix_col, matrix_row);
285 return PixelAddressToMatrixAddress(address);
290 UInt_t matrix_col = matrixAddress.first;
291 UInt_t matrix_row = matrixAddress.second;
294 if (matrix_col < 2 || matrix_col > 17){
295 address.
fSide = !(matrix_col%2);
296 address.
fCol = matrix_col/2;
297 address.
fRow = matrix_row;
299 address.
fCol = (matrix_col - 2) / 8 + 1;
300 if ( ((matrix_col - 2) / 2) % 2 == 0) {
301 address.
fRow = (matrix_col - 2) / 2 * 32 + matrix_row;
302 address.
fSide = !((matrix_col - 2) % 2);
304 address.
fRow = ((((matrix_col - 2) % 8) / 2) + 1) * 32 - (matrix_row + 1);
305 address.
fSide = ((matrix_col - 2) % 2);
322 ULong64_t standard_hamming = 0;
324 standard_hamming = ( topixhamming & 0xff00000000);
325 standard_hamming += ((topixhamming & 0x00fffe0000) >> 1 );
326 standard_hamming += ((topixhamming & 0x000001fc00) >> 2 );
327 standard_hamming += ((topixhamming & 0x0000000380) >> 3 );
328 standard_hamming += ((topixhamming & 0x0000000040) >> 4 );
330 standard_hamming += ((topixhamming & 0x0000000020) << 26 );
331 standard_hamming += ((topixhamming & 0x0000000010) << 11 );
332 standard_hamming += ((topixhamming & 0x0000000008) << 4 );
333 standard_hamming += ((topixhamming & 0x0000000004) << 1 );
334 standard_hamming += ( topixhamming & 0x0000000002);
335 standard_hamming += ( topixhamming & 0x0000000001);
337 return standard_hamming;
ToPix4::frameTrailer BitAnalyzeTrailer(ULong64_t &trailer)
ToPix4::frameHeader BitAnalyzeHeader(ULong64_t &header)
std::pair< UInt_t, UInt_t > PixelAddressToMatrixAddress(ToPix4::pixelAddress address)
ULong64_t ConvertToPix4HammingToStandardHamming(ULong64_t topixhamming)
int GetFrameCount(ULong64_t data)
ToPix4::pixel BitAnalyzePixelData(ULong64_t &data)
std::vector< ULong64_t > GetRawData(TMrfData_8b *data)
std::pair< UInt_t, UInt_t > PixelNumberToMatrixAddress(UInt_t pixelnumber)
Base interface class for data storage and manipulation. Compatible with IO classes from MRF Suite...
ToPix4::pixelAddress MatrixAddressToPixelAddress(std::pair< UInt_t, UInt_t > matrixAddress)
ToPix4::pixelAddress PixelNumberToPixelAddress(UInt_t pixelnumber)
const UChar_t & getWord(const UInt_t &position) const
Retrieves the word found at position.
const UInt_t & getNumWords() const
Retrieves the length of the register in words.
int GetType(ULong64_t data)
returns if the data word is a header (0b01), trailer (0b10) or data (0b11)