Project
Loading...
Searching...
No Matches
DetectorParameters.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_DETECTORPARAMETERS_H
17#define O2_MID_DETECTORPARAMETERS_H
18
19#include <cstdint>
20#include <array>
21#include <string>
22
23namespace o2
24{
25namespace mid
26{
28namespace detparams
29{
30constexpr int NChambers = 4;
31constexpr int NDetectionElements = 72;
32constexpr int NDetectionElementsPerSide = 36;
33constexpr int NLocalBoards = 234;
34constexpr int NRPCLines = 9;
35constexpr int NStripsBP = 16;
36
39inline int getChamber(int deId) { return (deId % NDetectionElementsPerSide) / NRPCLines; }
40
43inline int getRPCLine(int deId) { return deId % NRPCLines; }
44
47inline bool isRightSide(int deId) { return (deId / NDetectionElementsPerSide) == 0; }
48
51void assertDEId(int deId);
52
57int getDEId(bool isRight, int chamber, int rpc);
58
61std::string getDEName(int deId);
62
68inline uint16_t makeUniqueFEEId(int deId, int columnId, int lineId) { return lineId | (columnId << 4) | (deId << 8); }
69
73inline int getDEIdFromFEEId(uint16_t uniqueFEEId) { return (uniqueFEEId >> 8) & 0x7F; }
74
78inline int getColumnIdFromFEEId(uint16_t uniqueFEEId) { return (uniqueFEEId >> 4) & 0x7; }
79
83inline int getLineIdFromFEEId(uint16_t uniqueFEEId) { return uniqueFEEId & 0x3; }
84
85} // namespace detparams
86} // namespace mid
87} // namespace o2
88
89#endif /* O2_MID_DETECTORPARAMETERS_H */
constexpr int NDetectionElements
Number of RPCs.
int getColumnIdFromFEEId(uint16_t uniqueFEEId)
constexpr int NChambers
Number of chambers.
uint16_t makeUniqueFEEId(int deId, int columnId, int lineId)
constexpr int NRPCLines
Number of RPC lines.
constexpr int NLocalBoards
Number of local boards per chamber.
std::string getDEName(int deId)
bool isRightSide(int deId)
int getDEIdFromFEEId(uint16_t uniqueFEEId)
int getLineIdFromFEEId(uint16_t uniqueFEEId)
constexpr int NDetectionElementsPerSide
Number of detection elements per side.
int getDEId(bool isRight, int chamber, int rpc)
constexpr int NStripsBP
Number of strips in the Bending Plane.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...