Project
Loading...
Searching...
No Matches
MapCRU.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
12#ifndef O2_MCH_WORKFLOW_MAPCRU_H
13#define O2_MCH_WORKFLOW_MAPCRU_H
14
15#include <string_view>
16#include <array>
17#include <cstdlib>
18#include <optional>
20#include <set>
21
22namespace o2::mch::raw
23{
24class MapCRU
25{
26 public:
27 MapCRU(std::string_view content);
28 std::optional<uint16_t> operator()(const FeeLinkId& feeLinkId) const;
29 size_t size() const;
30 std::set<uint16_t> getSolarUIDs() const;
31 std::optional<FeeLinkId> operator()(uint16_t solarId) const;
32
33 private:
34 int indexFeeLink(int feeid, int linkid) const;
35
36 private:
37 static constexpr int sMaxFeeId = 64;
38 static constexpr int sMaxLinkId = 12;
39 std::array<uint16_t, sMaxFeeId * sMaxLinkId> mFeeLink2Solar;
40 size_t mSize = 0;
41};
42
43} // namespace o2::mch::raw
44#endif
std::optional< uint16_t > operator()(const FeeLinkId &feeLinkId) const
Definition MapCRU.cxx:93
size_t size() const
Definition MapCRU.cxx:88
std::set< uint16_t > getSolarUIDs() const
Definition MapCRU.cxx:53