Project
Loading...
Searching...
No Matches
EncoderImplHelper.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef O2_MCH_RAW_ENCODER_IMPL_HELPER_H
13#define O2_MCH_RAW_ENCODER_IMPL_HELPER_H
14
17#include <cstdlib>
18#include <gsl/span>
19#include <vector>
20
21namespace o2::mch::raw
22
23{
24
25namespace impl
26{
27void append(std::vector<uint10_t>& b10, uint50_t value);
28
29SampaHeader buildSampaHeader(uint8_t elinkId, DualSampaChannelId chId,
30 gsl::span<const SampaCluster> data);
31
32void fillUserLogicBuffer10(std::vector<uint10_t>& b10,
33 gsl::span<const SampaCluster> clusters,
34 uint8_t elinkId,
36 bool addSync);
37
38void b10to64(std::vector<uint10_t> b10, std::vector<uint64_t>& b64, uint16_t prefix14);
39
40uint16_t computeChipAddress(uint8_t elinkId, DualSampaChannelId chId);
41
42// ensures the buffer size is a multiple of 50 bits
43void addPadding(std::vector<uint10_t>& b10);
44
45// append Sampa sync word to the 10-bits buffer
46void appendSync(std::vector<uint10_t>& b10);
47
48} // namespace impl
49} // namespace o2::mch::raw
50
51#endif
GLsizei const GLfloat * value
Definition glcorearb.h:819
GLboolean * data
Definition glcorearb.h:298
void addPadding(std::vector< uint10_t > &b10)
void fillUserLogicBuffer10(std::vector< uint10_t > &b10, gsl::span< const SampaCluster > clusters, uint8_t elinkId, DualSampaChannelId chId, bool addSync)
uint16_t computeChipAddress(uint8_t elinkId, DualSampaChannelId chId)
void append(std::vector< uint10_t > &b10, uint50_t value)
SampaHeader buildSampaHeader(uint8_t elinkId, DualSampaChannelId chId, gsl::span< const SampaCluster > data)
void appendSync(std::vector< uint10_t > &b10)
void b10to64(std::vector< uint10_t > b10, std::vector< uint64_t > &b64, uint16_t prefix14)
uint6_t DualSampaChannelId
Definition DataFormats.h:65
uint64_t uint50_t
Definition DataFormats.h:69
std::vector< Cluster > clusters