31{
33
34 if ( argc != 2 ) {
35 std::cerr << "usage: " << argv[0] << " <file>" << std::endl;
36 std::exit(1);
37 }
38
39
40 std::fstream in(argv[1], std::ios::in|std::ios::binary);
41 if (!in) {
42 std::cerr << "File `" << argv[1] << "' does not exist?!" << std::endl;
43 std::exit(1);
44 }
46 uint32_t sevent = 0;
47 while(in.good() && !in.eof() && sevent != 0xaa1234aa) {
48 in.read((char*)&sevent, 4);
49 }
50 if (sevent == 0xaa1234aa) in.seekg(in.tellg()-(std::streampos)4);
51 else exit(1);
52
53
54
55
56
57 while (true) {
58
60
61 try {
63 fe.check_tree();
64
65 std::cout << "Event " << fe.lvl1_id() << " is Ok." << std::endl;
66 }
68 std::cerr << std::endl
69 <<
"Uncaught eformat issue: " << ex.
what() << std::endl;
70 std::cout << "Trying to continue..." << std::endl;
71 continue;
72 }
74 std::cerr << std::endl
75 <<
"Uncaught ERS issue: " << ex.
what() << std::endl;
76 delete[] event;
77 std::exit(1);
78 }
79 catch (std::exception& ex) {
80 std::cerr << std::endl
81 << "Uncaught std exception: " << ex.what() << std::endl;
82 delete[] event;
83 std::exit(1);
84 }
85 catch (...) {
86 std::cerr << std::endl << "Uncaught unknown exception" << std::endl;
87 delete[] event;
88 std::exit(1);
89 }
90
91 }
92
93 delete[] event;
94 return 0;
95}
const size_t MAX_EVENT_SIZE
const char * what() const
Human description message.