Project
Loading...
Searching...
No Matches
PayloadEncoder.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_PAYLOAD_ENCODER_H
13#define O2_MCH_RAW_PAYLOAD_ENCODER_H
14
15#include <memory>
16#include <set>
20#include <functional>
21#include <optional>
22#include <set>
23
24namespace o2::mch::raw
25{
26
34
36{
37 public:
38 virtual ~PayloadEncoder() = default;
39
49 const std::vector<SampaCluster>& data) = 0;
50
51 // startHeartbeatFrame sets the trigger (orbit,bunchCrossing) to be used
52 // for all generated payload headers (until next call to this method).
53 // Causes the alignment of the underlying gbts.
54 virtual void startHeartbeatFrame(uint32_t orbit, uint16_t bunchCrossing) = 0;
55
56 // addHeartbeatHeaders adds Heartbeat Sampa headers for each dual sampa in the
57 // given set.
58 virtual void addHeartbeatHeaders(const std::set<DsElecId>& dsids) = 0;
59
65 virtual size_t moveToBuffer(std::vector<std::byte>& buffer) = 0;
67};
68
76std::unique_ptr<PayloadEncoder> createPayloadEncoder(Solar2FeeLinkMapper solar2feelink,
77 bool userLogic,
78 int version,
79 bool chargeSumMode);
80
81} // namespace o2::mch::raw
82#endif
uint64_t orbit
Definition RawEventData.h:6
uint32_t version
Definition RawData.h:8
A PayloadEncoder builds MCH raw data (payload part only)
virtual void startHeartbeatFrame(uint32_t orbit, uint16_t bunchCrossing)=0
virtual ~PayloadEncoder()=default
virtual void addHeartbeatHeaders(const std::set< DsElecId > &dsids)=0
virtual void addChannelData(DsElecId dsId, DualSampaChannelId chId, const std::vector< SampaCluster > &data)=0
virtual size_t moveToBuffer(std::vector< std::byte > &buffer)=0
GLuint buffer
Definition glcorearb.h:655
GLboolean * data
Definition glcorearb.h:298
uint6_t DualSampaChannelId
Definition DataFormats.h:65
std::function< std::optional< FeeLinkId >(uint16_t solarId)> Solar2FeeLinkMapper
From solarId to (feeId,linkId)
Definition Mapper.h:57
std::unique_ptr< PayloadEncoder > createPayloadEncoder(Solar2FeeLinkMapper solar2feelink, bool userLogic, int version, bool chargeSumMode)