]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/scripts/dump10bit.C
update from salvatore
[u/mrichter/AliRoot.git] / FMD / scripts / dump10bit.C
CommitLineData
17e542eb 1#include <iostream>
2#include <iomanip>
3#include <fstream>
4
5void
6dump10bit()
7{
8 std::ifstream file("FMD_4096.ddl");
9 if (!file) {
10 std::cerr << "No such file" << std::endl;
11 return;
12 }
13 size_t i = 0;
14 long long w40;
15 std::cout << std::setfill('0');
16 while (!file.eof()) {
17 if (i % 5 == 0)
18 std::cout << std::setw(7) << i << " ";
19
20 int w10 = file.get();
21 w40 |= ((0x3ff) & w10) << ((i % 5) * 8);
22 std::cout << std::hex << std::setw(2) << w10 << " ";
23
24 if (i % 5 == 4) {
25 std::cout << std::hex << std::setw(5) << w40 << std::endl;
26 w40 = 0;
27 }
28 i++;
29 }
30}
31
32