Project
Loading...
Searching...
No Matches
CrateMapper.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_CRATEMAPPER_H
17#define O2_MID_CRATEMAPPER_H
18
19#include <cstdint>
20#include <vector>
21#include <unordered_map>
22#include <unordered_set>
23
24namespace o2
25{
26namespace mid
27{
29{
30 public:
32 ~CrateMapper() = default;
33
39 uint8_t deLocalBoardToRO(uint8_t deId, uint8_t columnId, uint8_t lineId) const;
40
44 uint16_t roLocalBoardToDE(uint8_t uniqueLocId) const;
45
49 bool hasDirectInputY(uint8_t uniqueLocId) const { return mLocIdsWithDirectInputY.find(getROBoardIdRight(uniqueLocId)) != mLocIdsWithDirectInputY.end(); }
50
53 std::unordered_set<uint8_t> getLocalBoardsWithDirectInputY() const { return mLocIdsWithDirectInputY; }
54
58 std::vector<uint8_t> getROBoardIds(uint16_t gbtUniqueId = 0xFFFF) const;
59
60 private:
62 void init();
63
65 uint8_t getROBoardIdRight(uint8_t uniqueLocId) const { return uniqueLocId % 0x80; }
66
67 std::unordered_map<uint8_t, uint16_t> mROToDEMap;
68 std::unordered_map<uint16_t, uint8_t> mDEToROMap;
69 std::unordered_set<uint8_t> mLocIdsWithDirectInputY;
70};
71} // namespace mid
72} // namespace o2
73
74#endif /* O2_MID_CRATEMAPPER_H */
std::vector< uint8_t > getROBoardIds(uint16_t gbtUniqueId=0xFFFF) const
Returns the list of local board IDs (RO convention)
bool hasDirectInputY(uint8_t uniqueLocId) const
Checks if local board ID (RO convention) has direct input from FEE y strips.
Definition CrateMapper.h:49
std::unordered_set< uint8_t > getLocalBoardsWithDirectInputY() const
Gets the local boards with a direct input from FEE y strips.
Definition CrateMapper.h:53
uint8_t deLocalBoardToRO(uint8_t deId, uint8_t columnId, uint8_t lineId) const
Converts the LOC ID expressed in the offline convention into the readout convention.
uint16_t roLocalBoardToDE(uint8_t uniqueLocId) const
Converts the LOC ID expressed in readout convention into the LOC ID in MT11 right in the offline conv...
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...