Project
Loading...
Searching...
No Matches
ROBoard.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_ROBOARD_H
17#define O2_MID_ROBOARD_H
18
19#include <cstdint>
20#include <array>
21#include <iosfwd>
22
23namespace o2
24{
25namespace mid
26{
27struct ROBoard {
28 uint8_t statusWord{0};
29 uint8_t triggerWord{0};
30 uint8_t boardId{0};
31 uint8_t firedChambers{0};
32 std::array<uint16_t, 4> patternsBP{};
33 std::array<uint16_t, 4> patternsNBP{};
34};
35
39std::ostream& operator<<(std::ostream& os, const ROBoard& board);
40
41namespace raw
42{
43
44static constexpr uint8_t sSTARTBIT = 1 << 7;
45static constexpr uint8_t sCARDTYPE = 1 << 6;
46static constexpr uint8_t sLOCALBUSY = 1 << 5;
47static constexpr uint8_t sLOCALDECISION = 1 << 4;
48static constexpr uint8_t sACTIVE = 1 << 3;
49static constexpr uint8_t sREJECTING = 1 << 2;
50static constexpr uint8_t sMASKED = 1 << 1;
51static constexpr uint8_t sOVERWRITTEN = 1;
52
53static constexpr uint8_t sSOX = 1 << 7;
54static constexpr uint8_t sEOX = 1 << 6;
55static constexpr uint8_t sPAUSE = 1 << 5;
56static constexpr uint8_t sRESUME = 1 << 4;
57static constexpr uint8_t sCALIBRATE = 1 << 3;
58static constexpr uint8_t sPHY = 1 << 2;
59static constexpr uint8_t sRESET = 1 << 1;
60static constexpr uint8_t sORB = 1;
61
65inline bool isLoc(uint8_t statusWord) { return (statusWord >> 6) & 0x1; }
66
70inline bool isCalibration(uint8_t triggerWord) { return ((triggerWord & 0xc) == 0x8); }
71
75inline uint8_t getCrateId(uint8_t uniqueLocId) { return (uniqueLocId >> 4) & 0xF; }
76
80inline uint8_t getLocId(uint8_t uniqueLocId) { return uniqueLocId & 0xF; }
81
86inline uint8_t makeUniqueLocID(uint8_t crateId, uint8_t locId) { return locId | (crateId << 4); }
87} // namespace raw
88
89} // namespace mid
90} // namespace o2
91
92#endif /* O2_MID_ROBOARD_H */
bool isCalibration(uint8_t triggerWord)
Definition ROBoard.h:70
uint8_t getCrateId(uint8_t uniqueLocId)
Definition ROBoard.h:75
uint8_t makeUniqueLocID(uint8_t crateId, uint8_t locId)
Definition ROBoard.h:86
bool isLoc(uint8_t statusWord)
Definition ROBoard.h:65
uint8_t getLocId(uint8_t uniqueLocId)
Definition ROBoard.h:80
std::ostream & operator<<(std::ostream &os, const Cluster &data)
Definition Cluster.cxx:27
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::array< uint16_t, 4 > patternsNBP
Bending plane pattern.
Definition ROBoard.h:33
std::array< uint16_t, 4 > patternsBP
Fired chambers.
Definition ROBoard.h:32
uint8_t statusWord
Definition ROBoard.h:28
uint8_t boardId
Trigger word.
Definition ROBoard.h:30
uint8_t triggerWord
Status word.
Definition ROBoard.h:29
uint8_t firedChambers
Board ID in crate.
Definition ROBoard.h:31