17 std::size_t readPointer{0};
18 std::span<const std::uint32_t>
data{
payload.data(), 3};
21 throw std::runtime_error(
Muon::nsw::format(
"ART Packet size not as expected: expected exactly 3 uint32_t, got {}",
payload.size() ));
36 std::vector<std::tuple<uint8_t,uint8_t,uint8_t>> artHitInfo =
VMMmapToHits();
38 for (
uint8_t i = 0;
i < artHitInfo.size();
i++){
46 std::vector<std::tuple<uint8_t,uint8_t>> hitmapBoardVMM;
47 std::vector<std::tuple<uint8_t,uint8_t,uint8_t>> artHitInfo;
50 if ((m_art_VMMmap >>
i) & 0b1) {
51 hitmapBoardVMM.push_back( std::make_tuple( (
int)(
i/8),
i%8 ) );
55 if (hitmapBoardVMM.size()>8) {
56 throw std::runtime_error(
"ART Packet cannot contain more than 8 ART hits!");
59 for (
uint8_t i = 0;
i<hitmapBoardVMM.size();
i++){
60 artHitInfo.push_back( std::make_tuple( std::get<0>(hitmapBoardVMM[
i]), std::get<1>(hitmapBoardVMM[
i]), m_art_ARTs[
i] ) );
68 int rightLeft = (
int)(m_art_fiberID/2.) % 2;
71 int flipBoardOrder = 0;
72 int flipFiberOrder = 0;
76 else {flipBoardOrder = 1;}
79 else {flipFiberOrder = 1;}
81 if (flipBoardOrder) board = 3-board;
85 if (m_art_fiberID % 2 == 0) {pcb = board;}
88 if (m_art_fiberID % 2 == 1) {pcb = board;}
93 int boardPosition = -1;
95 if (rightLeft==1) {boardPosition = (pcb-1) * 2;}
96 else {boardPosition = (pcb-1) * 2 + 1;}
98 if (rightLeft==0) {boardPosition = (pcb-1) * 2;}
99 else {boardPosition = (pcb-1) * 2 + 1;}
102 return boardPosition;
108 if (boardPosition%2==0){vmmPosition = 7-vmm;}
109 else {vmmPosition = vmm;}
111 vmmPosition += boardPosition*8;
112 int chPosition = 64*vmmPosition;
114 if (boardPosition%2==0){chPosition += (63 -
ch);}
115 else {chPosition +=
ch;}