Project
Loading...
Searching...
No Matches
LinkDecoder.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
16#ifndef O2_MID_LINKDECODER_H
17#define O2_MID_LINKDECODER_H
18
19#include <cstdint>
20#include <vector>
21#include <functional>
22#include <gsl/gsl>
28#include "MIDRaw/FEEIdConfig.h"
29
30namespace o2
31{
32namespace mid
33{
34
36{
37 public:
38 LinkDecoder(std::function<void(gsl::span<const uint8_t>, uint32_t orbit, uint32_t trigger, std::vector<ROBoard>& data, std::vector<ROFRecord>& rofs)> decode) : mDecode(decode) {}
39 void process(gsl::span<const uint8_t> payload, uint32_t orbit, uint32_t trigger, std::vector<ROBoard>& data, std::vector<ROFRecord>& rofs);
40
41 template <class RDH>
42 void process(gsl::span<const uint8_t> payload, const RDH& rdh, std::vector<ROBoard>& data, std::vector<ROFRecord>& rofs)
43 {
44 process(payload, o2::raw::RDHUtils::getHeartBeatOrbit(rdh), o2::raw::RDHUtils::getTriggerType(rdh), data, rofs);
45 }
46
47 protected:
48 std::function<void(gsl::span<const uint8_t>, uint32_t orbit, uint32_t trigger, std::vector<ROBoard>& data, std::vector<ROFRecord>& rofs)> mDecode{nullptr};
49};
50
51std::unique_ptr<LinkDecoder> createGBTDecoder(const o2::header::RDHAny& rdh, uint16_t feeId, bool isDebugMode, uint8_t mask, const ElectronicsDelay& electronicsDelay);
52
53std::unique_ptr<LinkDecoder> createLinkDecoder(const o2::header::RDHAny& rdh, uint16_t feeId, bool isDebugMode, uint8_t mask, const ElectronicsDelay& electronicsDelay, const FEEIdConfig& feeIdConfig);
54std::unique_ptr<LinkDecoder> createLinkDecoder(uint16_t feeId, bool isBare = false, bool isDebugMode = false, uint8_t mask = 0xFF, const ElectronicsDelay& electronicsDelay = ElectronicsDelay(), const FEEIdConfig& feeIdConfig = FEEIdConfig());
55
56} // namespace mid
57} // namespace o2
58
59#endif /* O2_MID_LINKDECODER_H */
Delay parameters for MID electronics.
Hardware Id to FeeId mapper.
uint64_t orbit
Definition RawEventData.h:6
unsigned short int uint16_t
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to process
Definition of the MID event record.
Definition of the RAW Data Header.
Structure to store the readout board information.
LinkDecoder(std::function< void(gsl::span< const uint8_t >, uint32_t orbit, uint32_t trigger, std::vector< ROBoard > &data, std::vector< ROFRecord > &rofs)> decode)
Definition LinkDecoder.h:38
void process(gsl::span< const uint8_t > payload, const RDH &rdh, std::vector< ROBoard > &data, std::vector< ROFRecord > &rofs)
Definition LinkDecoder.h:42
std::function< void(gsl::span< const uint8_t >, uint32_t orbit, uint32_t trigger, std::vector< ROBoard > &data, std::vector< ROFRecord > &rofs)> mDecode
Definition LinkDecoder.h:48
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLint GLuint mask
Definition glcorearb.h:291
std::unique_ptr< LinkDecoder > createGBTDecoder(const o2::header::RDHAny &rdh, uint16_t feeId, bool isDebugMode, uint8_t mask, const ElectronicsDelay &electronicsDelay)
std::unique_ptr< LinkDecoder > createLinkDecoder(const o2::header::RDHAny &rdh, uint16_t feeId, bool isDebugMode, uint8_t mask, const ElectronicsDelay &electronicsDelay, const FEEIdConfig &feeIdConfig)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
coder decode(ctfImage, triggersD, clustersD)