Project
Loading...
Searching...
No Matches
GBTUserLogicEncoder.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_GBTUSERLOGICENCODER_H
17#define O2_MID_GBTUSERLOGICENCODER_H
18
19#include <cstdint>
20#include <map>
21#include <gsl/gsl>
27
28namespace o2
29{
30namespace mid
31{
33{
34 public:
35 void process(gsl::span<const ROBoard> data, InteractionRecord ir);
36 void processTrigger(const InteractionRecord& ir, uint8_t triggerWord);
37
38 void flush(std::vector<char>& buffer, const InteractionRecord& ir);
39
40 // Encoder has no data left
41 bool isEmpty() { return mBoards.empty(); }
42
46 void setConfig(uint16_t gbtUniqueId, const std::vector<ROBoardConfig>& configurations);
47
49 void setElectronicsDelay(const ElectronicsDelay& electronicsDelay) { mElectronicsDelay = electronicsDelay; }
50
51 private:
52 void addShort(std::vector<char>& buffer, uint16_t shortWord) const;
53
54 std::map<InteractionRecord, std::vector<ROBoard>> mBoards{};
55 uint8_t mCrateId{0};
56 uint8_t mOffset{0};
57 ElectronicsDelay mElectronicsDelay;
58 ROBoardResponse mResponse;
59};
60} // namespace mid
61} // namespace o2
62
63#endif /* O2_MID_GBTUSERLOGICENCODER_H */
Delay parameters for MID electronics.
Definition of the MID event record.
Local board response.
Structure to store the readout board information.
void flush(std::vector< char > &buffer, const InteractionRecord &ir)
void processTrigger(const InteractionRecord &ir, uint8_t triggerWord)
void setElectronicsDelay(const ElectronicsDelay &electronicsDelay)
Sets the delay in the electronics.
void setConfig(uint16_t gbtUniqueId, const std::vector< ROBoardConfig > &configurations)
GLuint buffer
Definition glcorearb.h:655
GLboolean * data
Definition glcorearb.h:298
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
o2::InteractionRecord ir(0, 0)