Project
Loading...
Searching...
No Matches
GBTMapper.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_GBTMAPPER_H
17#define O2_MID_GBTMAPPER_H
18
21
22namespace o2
23{
24namespace mid
25{
27namespace gbtmapper
28{
32inline uint16_t getGBTIdFromUniqueLocId(uint8_t uniqueLocId) { return crateparams::makeGBTUniqueId(raw::getCrateId(uniqueLocId), crateparams::getGBTIdFromBoardInCrate(raw::getLocId(uniqueLocId))); }
37inline bool isBoardInGBT(uint8_t uniqueLocId, uint16_t gbtUniqueId) { return (raw::getCrateId(uniqueLocId) == crateparams::getCrateIdFromGBTUniqueId(gbtUniqueId) && crateparams::getGBTIdFromBoardInCrate(raw::getLocId(uniqueLocId)) == crateparams::getGBTIdInCrate(gbtUniqueId)); }
38} // namespace gbtmapper
39} // namespace mid
40} // namespace o2
41
42#endif /* O2_MID_GBTMAPPER_H */
MID RO crate parameters.
Structure to store the readout board information.
uint8_t getCrateIdFromGBTUniqueId(uint16_t gbtUniqueId)
Gets the crate ID from the GBT unique ID.
uint8_t getGBTIdInCrate(uint16_t gbtUniqueId)
Gets the link ID in crate from the RO ID.
uint16_t makeGBTUniqueId(uint8_t crateId, uint8_t gbtId)
Builds the GBT unique ID from the crate ID and the GBT ID in the crate.
uint8_t getGBTIdFromBoardInCrate(uint8_t locId)
Gets the link ID in crate from the board ID.
uint16_t getGBTIdFromUniqueLocId(uint8_t uniqueLocId)
Definition GBTMapper.h:32
bool isBoardInGBT(uint8_t uniqueLocId, uint16_t gbtUniqueId)
Definition GBTMapper.h:37
uint8_t getCrateId(uint8_t uniqueLocId)
Definition ROBoard.h:75
uint8_t getLocId(uint8_t uniqueLocId)
Definition ROBoard.h:80
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...