14 #include <Event/Event.h>
15 #include <Event/oncsEvent.h>
45 std::cout <<
"Packet array too small, need " << nw <<
" entries" << std::endl;
49 if (! insert_chk.second)
51 std::cout <<
"event " << eventno <<
" exists already"
59 std::set<int> femclkcemc, clkcemc;
60 std::set<int> femclkmbd, clkmbd;
61 static int ifirst = 1;
62 for (
int i=0;
i<nw;
i++)
67 clkcemc.insert(
plist[
i]->iValue(0,
"CLOCK"));
71 clkmbd.insert(
plist[
i]->iValue(0,
"CLOCK"));
76 <<
plist[
i]->
iValue(0,
"EVTNR") <<
", bclk 0x" << std::hex
77 <<
plist[
i]->
iValue(0,
"CLOCK") << std::dec << std::endl;
83 std::cout <<
"FEM " <<
j <<
", Clock 0x" << std::hex
88 femclkcemc.insert(
plist[
i]->iValue(
j,
"FEMCLOCK"));
92 femclkmbd.insert(
plist[
i]->iValue(
j,
"FEMCLOCK"));
98 if (femclkcemc.size() > 1)
100 std::cout <<
"CEMC FEM clock mismatch, saw " << std::hex << std::endl;
101 for (
auto iter : femclkcemc)
103 std::cout << iter << std::endl;
105 std::cout << std::dec;
107 if (femclkmbd.size() > 1)
109 std::cout <<
"MBD FEM clock mismatch, saw " << std::hex << std::endl;
110 for (
auto iter : femclkmbd)
112 std::cout << iter << std::endl;
114 std::cout << std::dec;
116 if (clkcemc.size() > 1)
118 std::cout <<
"CEMC Packet clock mismatch, saw " << std::hex << std::endl;
119 for (
auto iter : clkcemc)
121 std::cout << iter << std::endl;
123 std::cout << std::dec;
125 if (clkmbd.size() > 1)
127 std::cout <<
"MBD Packet clock mismatch, saw " << std::hex << std::endl;
128 for (
auto iter : clkmbd)
130 std::cout << iter << std::endl;
132 std::cout << std::dec;
135 int femclockcemc = *(clkcemc.begin());
136 int femclockmbd = *(clkmbd.begin());
145 std::cout <<
"clock diff changed at event "
147 << femclockcemc - femclockmbd << std::endl;