Project
Loading...
Searching...
No Matches
SampaHeader.cxx File Reference
#include "MCHRawCommon/SampaHeader.h"
#include <stdexcept>
#include <fmt/format.h>
#include <fmt/printf.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include "NofBits.h"
#include <array>
#include <sstream>

Go to the source code of this file.

Namespaces

namespace  o2
 a couple of static helper functions to create timestamp values for CCDB queries or override obsolete objects
 
namespace  o2::mch
 
namespace  o2::mch::raw
 

Functions

std::string o2::mch::raw::packetTypeName (SampaPacketType pkt)
 packetTypeName returns a string representation of the given packet type.
 
SampaHeader o2::mch::raw::sampaSync ()
 The 50-bits Sampa SYNC word.
 
SampaHeader o2::mch::raw::sampaHeartbeat (uint8_t elinkId, uint20_t bunchCrossing)
 Heartbeat packet.
 
std::string o2::mch::raw::asString (const SampaHeader &sh)
 
std::ostream & o2::mch::raw::operator<< (std::ostream &os, const SampaHeader &sh)
 
int o2::mch::raw::computeParity (uint64_t v)
 
int o2::mch::raw::partialOddParity3 (uint64_t value, int pos)
 
int o2::mch::raw::computeHammingCode3 (uint64_t value)
 
template<size_t N>
int o2::mch::raw::partialOddParity2 (uint64_t value, const std::array< int, N > &pos)
 
template<size_t N>
int o2::mch::raw::partialOddParity (uint64_t value, const std::array< uint64_t, N > &masks)
 
int o2::mch::raw::computeHammingCode2 (uint64_t value)
 
int o2::mch::raw::computeHammingCode (uint64_t value)
 
int o2::mch::raw::computeHammingCode1 (uint64_t value)
 
template<size_t N>
uint64_t o2::mch::raw::computeMask (const std::array< uint64_t, N > &masks)
 
int o2::mch::raw::computeHammingCode4 (uint64_t value)
 
int o2::mch::raw::computeHeaderParity (uint64_t value)
 
int o2::mch::raw::computeHeaderParity1 (uint64_t value)
 
int o2::mch::raw::computeHeaderParity2 (uint64_t value)
 
int o2::mch::raw::computeHeaderParity3 (uint64_t value)
 
int o2::mch::raw::computeHeaderParity4 (uint64_t value)
 
DualSampaChannelId o2::mch::raw::getDualSampaChannelId (const SampaHeader &sh)
 Return channel number (0..63)
 

Variables

constexpr std::array< int, 49 > o2::mch::raw::conv
 
std::array< int, 24 > o2::mch::raw::p0 {7, 8, 10, 11, 13, 15, 17, 18, 20, 22, 24, 26, 28, 30, 32, 33, 35, 37, 39, 41, 43, 45, 47, 49}
 
std::array< int, 23 > o2::mch::raw::p1 {7, 9, 10, 12, 13, 16, 17, 19, 20, 23, 24, 27, 28, 31, 32, 34, 35, 38, 39, 42, 43, 46, 47}
 
std::array< int, 23 > o2::mch::raw::p2 {8, 9, 10, 14, 15, 16, 17, 21, 22, 23, 24, 29, 30, 31, 32, 36, 37, 38, 39, 44, 45, 46, 47}
 
std::array< int, 23 > o2::mch::raw::p3 {11, 12, 13, 14, 15, 16, 17, 25, 26, 27, 28, 29, 30, 31, 32, 40, 41, 42, 43, 44, 45, 46, 47}
 
std::array< int, 17 > o2::mch::raw::p4 {18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 48, 49}
 
std::array< int, 17 > o2::mch::raw::p5 {33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49}
 
std::array< uint64_t, 24 > o2::mch::raw::m0 = {0x80, 0x100, 0x400, 0x800, 0x2000, 0x8000, 0x20000, 0x40000, 0x100000, 0x400000, 0x1000000, 0x4000000, 0x10000000, 0x40000000, 0x100000000, 0x200000000, 0x800000000, 0x2000000000, 0x8000000000, 0x20000000000, 0x80000000000, 0x200000000000, 0x800000000000, 0x2000000000000}
 
std::array< uint64_t, 23 > o2::mch::raw::m1 = {0x80, 0x200, 0x400, 0x1000, 0x2000, 0x10000, 0x20000, 0x80000, 0x100000, 0x800000, 0x1000000, 0x8000000, 0x10000000, 0x80000000, 0x100000000, 0x400000000, 0x800000000, 0x4000000000, 0x8000000000, 0x40000000000, 0x80000000000, 0x400000000000, 0x800000000000}
 
std::array< uint64_t, 23 > o2::mch::raw::m2 = {0x100, 0x200, 0x400, 0x4000, 0x8000, 0x10000, 0x20000, 0x200000, 0x400000, 0x800000, 0x1000000, 0x20000000, 0x40000000, 0x80000000, 0x100000000, 0x1000000000, 0x2000000000, 0x4000000000, 0x8000000000, 0x100000000000, 0x200000000000, 0x400000000000, 0x800000000000}
 
std::array< uint64_t, 23 > o2::mch::raw::m3 = {0x800, 0x1000, 0x2000, 0x4000, 0x8000, 0x10000, 0x20000, 0x2000000, 0x4000000, 0x8000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0x100000000, 0x10000000000, 0x20000000000, 0x40000000000, 0x80000000000, 0x100000000000, 0x200000000000, 0x400000000000, 0x800000000000}
 
std::array< uint64_t, 17 > o2::mch::raw::m4 = {0x40000, 0x80000, 0x100000, 0x200000, 0x400000, 0x800000, 0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0x100000000, 0x1000000000000, 0x2000000000000}
 
std::array< uint64_t, 17 > o2::mch::raw::m5 = {0x200000000, 0x400000000, 0x800000000, 0x1000000000, 0x2000000000, 0x4000000000, 0x8000000000, 0x10000000000, 0x20000000000, 0x40000000000, 0x80000000000, 0x100000000000, 0x200000000000, 0x400000000000, 0x800000000000, 0x1000000000000, 0x2000000000000}
 
constexpr std::array< uint64_t, 49 > o2::mch::raw::parityMasks = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000, 0x10000, 0x20000, 0x40000, 0x80000, 0x100000, 0x200000, 0x400000, 0x800000, 0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0x100000000, 0x200000000, 0x400000000, 0x800000000, 0x1000000000, 0x2000000000, 0x4000000000, 0x8000000000, 0x10000000000, 0x20000000000, 0x40000000000, 0x80000000000, 0x100000000000, 0x200000000000, 0x400000000000, 0x800000000000, 0x1000000000000, 0x2000000000000}