GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update MCH Raw Data Decoders (in particular UserLogic one) · AliceO2Group/AliceO2@ebd17d1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Detectors/MUON/MCH/Raw
    • Common
      • include/MCHRawCommon
        • RDHFields.h
        • RDHManip.h
        • SampaCluster.h
        • SampaHeader.h
      • src
        • RDHFieldsV4.cxx
        • RDHManip.cxx
        • SampaCluster.cxx
        • SampaHeader.cxx
      • test
        • CMakeLists.txt
    • Decoder
      • CMakeLists.txt
      • README.md
      • include/MCHRawDecoder
        • Decoder.h
        • PageDecoder.h
      • src
        • BareElinkDecoder.h
        • BareGBTDecoder.h
        • Debug.h
        • Decoder.cxx
        • DecoderLogic.cxx
        • DecoderLogic.h
        • PageDecoder.cxx
        • PageParser.h
        • PayloadDecoder.h
        • UserLogicElinkDecoder.h
        • UserLogicEndpointDecoder.h
        • UserLogicGBTDecoder.h
        • testPageDecoder.cxx
        • testUserLogicEndpointDecoder.cxx
    • ImplHelpers
      • CMakeLists.txt
      • DumpBuffer.h
    • Tools
      • CMakeLists.txt
      • README.md
      • rawdump.cxx
    • testdata
      • RefBufferCRU.cxx
  • Testing/Temporary
    • CTestCostData.txt
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Detectors/MUON/MCH/Raw/Common/include/MCHRawCommon/RDHFields.h‎

Copy file name to clipboardExpand all lines: Detectors/MUON/MCH/Raw/Common/include/MCHRawCommon/RDHFields.h
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ void rdhTriggerType(RDH& rdh, uint32_t triggerType);
9090

9191
template <typename RDH>
9292
uint8_t rdhEndpoint(const RDH& rdh);
93+
94+
template <typename RDH>
95+
void rdhEndpoint(RDH& rdh, uint8_t endpoint);
96+
9397
} // namespace raw
9498
} // namespace mch
9599
} // namespace o2
Collapse file

‎Detectors/MUON/MCH/Raw/Common/include/MCHRawCommon/RDHManip.h‎

Copy file name to clipboardExpand all lines: Detectors/MUON/MCH/Raw/Common/include/MCHRawCommon/RDHManip.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ template <typename RDH>
3434
RDH createRDH(gsl::span<const std::byte> buffer);
3535

3636
template <typename RDH>
37-
RDH createRDH(uint16_t cruId, uint8_t linkId, uint16_t feeId, uint32_t orbit, uint16_t bunchCrossing, uint16_t payloadSize);
37+
RDH createRDH(uint16_t cruId, uint8_t endpoint, uint8_t linkId, uint16_t feeId, uint32_t orbit, uint16_t bunchCrossing, uint16_t payloadSize);
3838

3939
template <typename RDH>
4040
bool isValid(const RDH& rdh);
Collapse file

‎Detectors/MUON/MCH/Raw/Common/include/MCHRawCommon/SampaCluster.h‎

Copy file name to clipboardExpand all lines: Detectors/MUON/MCH/Raw/Common/include/MCHRawCommon/SampaCluster.h
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ void assertNotMixingClusters(const std::vector<SampaCluster>& data)
8585
}
8686

8787
std::ostream& operator<<(std::ostream& os, const SampaCluster& sc);
88+
89+
std::string asString(const SampaCluster& sc);
90+
8891
} // namespace raw
8992
} // namespace mch
9093
} // namespace o2
Collapse file

‎Detectors/MUON/MCH/Raw/Common/include/MCHRawCommon/SampaHeader.h‎

Copy file name to clipboardExpand all lines: Detectors/MUON/MCH/Raw/Common/include/MCHRawCommon/SampaHeader.h
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class SampaHeader
111111
///@}
112112

113113
/// return the header as a 64-bits integer
114-
uint64_t uint64() const { return mValue; }
114+
constexpr uint64_t uint64() const { return mValue; }
115115

116116
/// sets the value from a 64-bits integer.
117117
/// if the value does not fit within 50 bits an exception is thrown.
@@ -128,6 +128,9 @@ constexpr uint64_t sampaSyncWord{0x1555540f00113};
128128
/// The 50-bits Sampa SYNC word.
129129
SampaHeader sampaSync();
130130

131+
/// Return channel number (0..63)
132+
uint8_t channelNumber64(const SampaHeader& sh);
133+
131134
/// packetTypeName returns a string representation of the given packet type.
132135
std::string packetTypeName(SampaPacketType pkt);
133136

@@ -152,6 +155,8 @@ int computeHeaderParity2(uint64_t value);
152155
int computeHeaderParity3(uint64_t value);
153156
int computeHeaderParity4(uint64_t value);
154157

158+
std::string asString(const SampaHeader& sh);
159+
155160
std::ostream&
156161
operator<<(std::ostream& os, const SampaHeader& sh);
157162

Collapse file

‎Detectors/MUON/MCH/Raw/Common/src/RDHFieldsV4.cxx‎

Copy file name to clipboardExpand all lines: Detectors/MUON/MCH/Raw/Common/src/RDHFieldsV4.cxx
+13-3Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "Headers/RAWDataHeader.h"
1212
#include "MCHRawCommon/RDHFields.h"
13+
#include "Assertions.h"
1314

1415
namespace o2::mch::raw
1516
{
@@ -35,14 +36,16 @@ uint16_t rdhPayloadSize(const o2::header::RAWDataHeaderV4& rdh)
3536
template <>
3637
uint8_t rdhLinkId(const o2::header::RAWDataHeaderV4& rdh)
3738
{
38-
return rdh.linkID + 12 * rdh.endPointID;
39+
return rdh.linkID;
3940
}
4041

4142
template <>
4243
void rdhLinkId(o2::header::RAWDataHeaderV4& rdh, uint8_t linkId)
4344
{
44-
rdh.linkID = linkId % 12;
45-
rdh.endPointID = linkId / 12;
45+
if (linkId < 0 || (linkId > 11 && linkId != 15)) {
46+
throw std::invalid_argument(fmt::format("linkId should be between 0 and 11 or = 15 but is {}", linkId));
47+
}
48+
rdh.linkID = linkId;
4649
}
4750

4851
template <>
@@ -158,4 +161,11 @@ uint8_t rdhEndpoint(const o2::header::RAWDataHeaderV4& rdh)
158161
{
159162
return rdh.endPointID;
160163
}
164+
165+
template <>
166+
void rdhEndpoint(o2::header::RAWDataHeaderV4& rdh, uint8_t endpoint)
167+
{
168+
impl::assertIsInRange("endpoint", endpoint, 0, 1);
169+
rdh.endPointID = endpoint;
170+
}
161171
} // namespace o2::mch::raw
Collapse file

‎Detectors/MUON/MCH/Raw/Common/src/RDHManip.cxx‎

Copy file name to clipboardExpand all lines: Detectors/MUON/MCH/Raw/Common/src/RDHManip.cxx
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ RAWDataHeaderV4 createRDH(gsl::span<const std::byte> buffer)
186186
}
187187

188188
template <>
189-
RAWDataHeaderV4 createRDH(uint16_t cruId, uint8_t linkId, uint16_t feeId, uint32_t orbit, uint16_t bunchCrossing,
189+
RAWDataHeaderV4 createRDH(uint16_t cruId, uint8_t endpoint, uint8_t linkId, uint16_t feeId, uint32_t orbit, uint16_t bunchCrossing,
190190
uint16_t payloadSize)
191191
{
192192
RAWDataHeaderV4 rdh;
@@ -199,6 +199,7 @@ RAWDataHeaderV4 createRDH(uint16_t cruId, uint8_t linkId, uint16_t feeId, uint32
199199

200200
rdh.cruID = cruId;
201201
rdhLinkId(rdh, linkId);
202+
rdhEndpoint(rdh, endpoint);
202203
rdh.feeId = feeId;
203204
rdh.priority = 0;
204205
rdh.blockLength = memorySize - sizeof(rdh); // FIXME: the blockLength disappears in RDHv5 ?
Collapse file

‎Detectors/MUON/MCH/Raw/Common/src/SampaCluster.cxx‎

Copy file name to clipboardExpand all lines: Detectors/MUON/MCH/Raw/Common/src/SampaCluster.cxx
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "MCHRawCommon/DataFormats.h"
1313
#include "Assertions.h"
1414
#include <fmt/format.h>
15+
#include <sstream>
1516

1617
namespace o2
1718
{
@@ -37,7 +38,7 @@ SampaCluster::SampaCluster(uint16_t timestamp, const std::vector<uint16_t>& samp
3738
throw std::invalid_argument("cannot add data with no sample");
3839
}
3940
for (auto i = 0; i < samples.size(); i++) {
40-
impl::assertIsInRange(fmt::format("samples[{}]", i), samples[i], 0, 0x3FF);
41+
impl::assertIsInRange("sample", samples[i], 0, 0x3FF);
4142
}
4243
}
4344

@@ -82,6 +83,13 @@ std::ostream& operator<<(std::ostream& os, const SampaCluster& sc)
8283
return os;
8384
}
8485

86+
std::string asString(const SampaCluster& sc)
87+
{
88+
std::stringstream s;
89+
s << sc;
90+
return s.str();
91+
}
92+
8593
} // namespace raw
8694
} // namespace mch
8795
} // namespace o2
Collapse file

‎Detectors/MUON/MCH/Raw/Common/src/SampaHeader.cxx‎

Copy file name to clipboardExpand all lines: Detectors/MUON/MCH/Raw/Common/src/SampaHeader.cxx
+15-2Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <algorithm>
1919
#include "NofBits.h"
2020
#include <array>
21+
#include <sstream>
2122

2223
namespace
2324
{
@@ -373,8 +374,10 @@ SampaHeader sampaSync()
373374
0);
374375
}
375376

376-
std::ostream& operator<<(std::ostream& os, const SampaHeader& sh)
377+
std::string asString(const SampaHeader& sh)
377378
{
379+
std::stringstream os;
380+
378381
uint64_t one = 1;
379382
std::vector<int> sep = {5, 6, 9, 19, 23, 28, 48};
380383
for (int i = 0; i < 50; i++) {
@@ -397,7 +400,12 @@ std::ostream& operator<<(std::ostream& os, const SampaHeader& sh)
397400
packetTypeName(sh.packetType()),
398401
sh.hasError() ? "ERROR" : "")
399402
<< "\n";
400-
return os;
403+
return os.str();
404+
}
405+
406+
std::ostream& operator<<(std::ostream& os, const SampaHeader& sh)
407+
{
408+
return os << asString(sh);
401409
}
402410

403411
// conv array convert a bit position in the hamming sense
@@ -611,6 +619,11 @@ int computeHeaderParity4(uint64_t no)
611619
no &= ~(one << 6); // reset bit 6
612620
return computeParity(no);
613621
}
622+
623+
uint8_t channelNumber64(const SampaHeader& sh)
624+
{
625+
return sh.channelAddress() + (sh.chipAddress() % 2) * 32;
626+
}
614627
} // namespace raw
615628
} // namespace mch
616629
} // namespace o2
Collapse file

‎Detectors/MUON/MCH/Raw/Common/test/CMakeLists.txt‎

Copy file name to clipboardExpand all lines: Detectors/MUON/MCH/Raw/Common/test/CMakeLists.txt
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010

1111
o2_add_test(rdh-manip
1212
SOURCES testRDHManip.cxx
13-
COMPONENT_NAME mch
14-
LABELS "mch;raw"
13+
COMPONENT_NAME mchraw
14+
LABELS "muon;mch;raw"
1515
PUBLIC_LINK_LIBRARIES O2::MCHRawCommon Boost::boost)
1616

1717
o2_add_test(sampa-header
1818
SOURCES testSampaHeader.cxx
19-
COMPONENT_NAME mch
20-
LABELS "mch;raw"
19+
COMPONENT_NAME mchraw
20+
LABELS "muon;mch;raw"
2121
PUBLIC_LINK_LIBRARIES O2::MCHRawCommon Boost::boost)
2222

2323
o2_add_test(sampa-cluster
2424
SOURCES testSampaCluster.cxx
25-
COMPONENT_NAME mch
26-
LABELS "mch;raw"
25+
COMPONENT_NAME mchraw
26+
LABELS "muon;mch;raw"
2727
PUBLIC_LINK_LIBRARIES O2::MCHRawCommon Boost::boost)
2828

2929
if(benchmark_FOUND)
Collapse file

‎Detectors/MUON/MCH/Raw/Decoder/CMakeLists.txt‎

Copy file name to clipboardExpand all lines: Detectors/MUON/MCH/Raw/Decoder/CMakeLists.txt
+19-18Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,28 @@
99
# submit itself to any jurisdiction.
1010

1111
o2_add_library(MCHRawDecoder
12-
SOURCES src/Decoder.cxx
13-
PUBLIC_LINK_LIBRARIES O2::MCHRawCommon O2::MCHRawElecMap
14-
PRIVATE_LINK_LIBRARIES O2::MCHRawImplHelpers)
12+
SOURCES src/PageDecoder.cxx src/DecoderLogic.cxx
13+
PUBLIC_LINK_LIBRARIES O2::MCHRawCommon O2::MCHRawElecMap
14+
PRIVATE_LINK_LIBRARIES O2::MCHRawImplHelpers)
1515

1616
if(BUILD_TESTING)
17-
o2_add_test(decoder
18-
SOURCES src/testDecoder.cxx
19-
COMPONENT_NAME mch
20-
LABELS "mch;raw"
21-
PUBLIC_LINK_LIBRARIES O2::MCHRawDecoder O2::MCHTestRawRefBuffers)
17+
o2_add_test(page-decoder
18+
SOURCES src/testPageDecoder.cxx
19+
COMPONENT_NAME mchraw
20+
LABELS "muon;mch;raw"
21+
PUBLIC_LINK_LIBRARIES O2::MCHRawDecoder O2::MCHTestRawRefBuffers
22+
O2::DPLUtils)
2223

23-
o2_add_test(bare-elink-decoder
24-
SOURCES src/testBareElinkDecoder.cxx
25-
COMPONENT_NAME mch
26-
LABELS "mch;raw"
27-
PUBLIC_LINK_LIBRARIES O2::MCHRawDecoder O2::MCHRawImplHelpers)
24+
o2_add_test(bare-elink-decoder
25+
SOURCES src/testBareElinkDecoder.cxx
26+
COMPONENT_NAME mchraw
27+
LABELS "muon;mch;raw"
28+
PUBLIC_LINK_LIBRARIES O2::MCHRawDecoder O2::MCHRawImplHelpers)
2829

29-
o2_add_test(userlogic-elink-decoder
30-
SOURCES src/testUserLogicElinkDecoder.cxx
31-
COMPONENT_NAME mch
32-
LABELS "mch;raw"
33-
PUBLIC_LINK_LIBRARIES O2::MCHRawDecoder O2::MCHRawImplHelpers)
30+
o2_add_test(userlogic-endpoint-decoder
31+
SOURCES src/testUserLogicEndpointDecoder.cxx
32+
COMPONENT_NAME mchraw
33+
LABELS "muon;mch;raw"
34+
PUBLIC_LINK_LIBRARIES O2::MCHRawDecoder O2::MCHRawImplHelpers)
3435

3536
endif()

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.