Shows differences between to event-formatted files at the ROB level.
45{
47
48 if ( argc != 3 ) {
49 std::cerr << "usage: " << argv[0] << " <file1> <file2>"
50 << std::endl;
51 std::cerr << "OBS: The event order should be the same on both files"
52 << std::endl;
53 std::exit(1);
54 }
55
56
57 size_t event_counter = 0;
58 std::fstream in1(argv[1], std::ios::in|std::ios::binary);
59 std::fstream in2(argv[2], std::ios::in|std::ios::binary);
62
65
66 while (true) {
69 ++event_counter;
70 try {
73 fe1.check_tree();
74 fe2.check_tree();
77 if (s1 != s2) {
78 std::cerr << "The number of ROB's of event " << event_counter
79 << " is different in file `" << argv[1]
80 << "' (" << s1 << ") and in file `" << argv[2]
81 << "' (" << s2 << "). Skipping comparison." << std::endl;
82 continue;
83 }
84
87 bool mark = false;
88 for (size_t i=0; i<s1; ++i) {
91 if (rob1.rod_source_id() != rob2.rod_source_id()) {
92 std::cerr << "! ROB[" << i << "]" << std::endl
93 <<
"- " <<
HEX(rob1.rod_source_id()) << std::endl
94 <<
"+ " <<
HEX(rob2.rod_source_id()) << std::endl;
95 mark = true;
96 }
97 }
98 if (mark) {
99 std::cerr << "Event #" << fe1.lvl1_id() << " differ." << std::endl;
100 }
101 }
103 std::cerr << std::endl
104 <<
"Uncaught eformat issue: " << ex.
what() << std::endl;
105 std::cout << "Trying to continue..." << std::endl;
106 continue;
107 }
109 std::cerr << std::endl
110 <<
"Uncaught ERS issue: " << ex.
what() << std::endl;
111 delete[] event1;
112 delete[] event2;
113 std::exit(1);
114 }
115 catch (std::exception& ex) {
116 std::cerr << std::endl
117 << "Uncaught std exception: " << ex.what() << std::endl;
118 delete[] event1;
119 delete[] event2;
120 std::exit(1);
121 }
122 catch (...) {
123 std::cerr << std::endl << "Uncaught unknown exception" << std::endl;
124 delete[] event1;
125 delete[] event2;
126 std::exit(1);
127 }
128
129 }
130
131 std::cerr << "In the absence of remarks, files do NOT differ." << std::endl;
132
133 delete[] event1;
134 delete[] event2;
135 return 0;
136}
const char * what() const
Human description message.
int cmp_source_id(const uint32_t *p1, const uint32_t *p2)
const size_t MAX_EVENT_SIZE