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.
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.
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)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
o2::InteractionRecord ir(0, 0)