29int main(
int argc,
char* argv[])
31 std::string inputFile;
33 po::options_description options(
"options");
36 bool printDigits{
false};
38 int maxNofTimeFrames{std::numeric_limits<int>::max()};
39 int firstTimeFrame{0};
44 (
"help,h",
"produce help message")
45 (
"infile,i", po::value<std::string>(&inputFile)->required(),
"input file name")
46 (
"count,c",po::bool_switch(&
count),
"count items (rofs, tfs, etc...)")
47 (
"describe,d",po::bool_switch(&describe),
"describe file format")
55 po::options_description cmdline;
58 po::store(po::command_line_parser(argc, argv).options(cmdline).run(), vm);
60 if (vm.count(
"help")) {
61 std::cout << options <<
"\n";
67 }
catch (boost::program_options::error& e) {
68 std::cout <<
"Error: " << e.what() <<
"\n";
72 std::ifstream in(inputFile.c_str());
74 std::cerr <<
"cannot open input file " << inputFile <<
"\n";
83 std::cout << fmt::format(
"nTFs {} nROFs {} nDigits {}\n",
87 if (printTFs || printDigits) {
91 std::vector<o2::mch::Digit>
digits;
92 std::vector<o2::mch::ROFRecord> rofs;
94 if (tfid >= firstTimeFrame && tfcount < maxNofTimeFrames) {
96 std::cout << fmt::format(
"TF {:5d} {:4d} rofs {:5d} digits\n",
97 tfid, rofs.size(),
digits.size());