Project
Loading...
Searching...
No Matches
PMLookupTable.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_FT0_PMLOOKUPTABLE_H_
13#define O2_FT0_PMLOOKUPTABLE_H_
14
15#include <array>
16#include <cstddef>
17#include <cstdint>
18#include <map>
19
20#include "FT0Base/Constants.h"
21
22namespace o2::ft0
23{
24
30{
31 public:
33 using PMHash = uint8_t;
34 using PMMap = std::map<PMHash, bool>; // PM hash -> true for A side, false for C side
35
37 static const PMLookupTable& Instance();
38
41
43 bool isASide(PMHash pmHash) const;
44
46 const PMMap& getPMs() const noexcept { return mPMHash2IsASide; }
47
48 private:
50
51 std::array<PMHash, Constants::sNCHANNELS_PM> mChannelID2PMHash{};
52 std::array<bool, Constants::sNCHANNELS_PM> mChannelIsMapped{};
53 PMMap mPMHash2IsASide;
54};
55
56} // namespace o2::ft0
57
58#endif // O2_FT0_PMLOOKUPTABLE_H_
General constants in FT0.
uint8_t channelID
Definition RawEventData.h:8
unsigned char uint8_t
unsigned short int uint16_t
bool isASide(PMHash pmHash) const
Return true for an A-side PM and false for a C-side PM.
PMHash getPMHash(ChannelID channelID) const
Return the PM hash assigned to a detector channel.
static const PMLookupTable & Instance()
Return the process-wide immutable lookup table.
std::map< PMHash, bool > PMMap
const PMMap & getPMs() const noexcept
Return all PM hashes and their sides. TCM entries are not included.