Project
Loading...
Searching...
No Matches
Geo.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
17
18#ifndef ALICEO2_HMPID_GEO_H
19#define ALICEO2_HMPID_GEO_H
20
21#include <TMath.h>
22#include <Rtypes.h>
23
24namespace o2
25{
26namespace hmpid
27{
28
29/* ------------------ HMPID Detector Coordinate definition -------------------
30
31 143 .-------------. .-------------. 0 ------.------ 23
32 | | |.-----.-----.| | | <-- |
33 | | || | || | | 9 0 |
34 | | || 4 | 5 || | | Dil. |
35 ^ | | || | || | | | | ^
36 | | | ||_____|_____|| | | | | |
37 | | | |.-----.-----.| | | | | |
38 Y | | || | || | | |
39 | | | || 2 | 3 || Column | n | n+1 | Column
40 | | | || | || | | |
41 | | ||_____|_____|| | | | | |
42 | | 47 ^ |.-----.-----.| | | | | |
43 | | | || | || V | | | |
44 | | Y || 0 | 1 || | Dil. | |
45 | | | || | || | 9 0 | |
46 | | 0 ||_____|_____|| | <-- | |
47 0 .-------------. ------------- 23 ------.------ 0
48 0 --X--> 159 0 -X->79
49
50 Pad(Module,x,y) Pad(Chamber,PhotoCat,x,y) Pad(Equipment,Column,Dilogic,Channel)
51
52 Equipment n
53
54 143
55 ^
56 | 46 40 34 28 22 16 10 04
57 | 44 38 32 26 20 14 08 02
58 40 36 30 24 18 12 06 00
59 y 43 37 31 25 19 13 07 01
60 45 39 33 27 21 15 09 03
61 | 47 41 35 29 23 17 11 05
62 |
63
64 0
65
66
67 0 --------- x ------> 79
68
69 For Equipment n : x = 79 - (Dilo * 8 + Chan / 8)
70 y = 143 - (Column * 6 + Chan % 6)
71
72 --------------------------------------------------------------------------- */
75class Geo
76{
77 public:
78 // ---- HMPID geometry -------
79 static constexpr int MAXEQUIPMENTS = 14;
80 static constexpr int N_SEGMENTS = 3;
81 static constexpr int N_COLXSEGMENT = 8;
82 static constexpr int N_COLUMNS = 24;
83 static constexpr int N_DILOGICS = 10;
84 static constexpr int N_CHANNELS = 48;
85 static constexpr int N_DILOCHANNELS = 64;
86
87 static constexpr int N_MODULES = 7;
88 static constexpr int N_XROWS = 160;
89 static constexpr int N_YCOLS = 144;
90
91 static constexpr int MAXYCOLS = 143;
92 static constexpr int MAXHALFXROWS = 79;
93 static constexpr int HALFXROWS = 80;
94
95 static constexpr int DILOPADSCOLS = 6;
96 static constexpr int DILOPADSROWS = 8;
97
98 static constexpr int EQUIPMENTSPERMODULE = 2;
99
102
103 static constexpr int N_PHOTOCATODS = 6;
104 static constexpr int N_PHOTOCATODSX = 80;
105 static constexpr int N_PHOTOCATODSY = 48;
106 static constexpr int MAXXPHOTO = 79;
107 static constexpr int MAXYPHOTO = 47;
108
109 private:
110 static void Init();
111
112 ClassDefNV(Geo, 1);
113};
114
116{
117 public:
118 struct LinkAddr {
119 uint8_t Fee;
120 uint16_t Cru;
121 uint8_t Lnk;
122 uint8_t Flp;
123 std::string_view FlpHostName;
124 };
125 union Lnk {
127 uint32_t LinkUId;
128 };
129 static constexpr Lnk mEq[Geo::MAXEQUIPMENTS] = {{0, 121, 0, 160, "alio2-cr1-flp160"},
130 {1, 121, 1, 160, "alio2-cr1-flp160"},
131 {2, 121, 2, 160, "alio2-cr1-flp160"},
132 {3, 121, 3, 160, "alio2-cr1-flp160"},
133 {4, 120, 0, 160, "alio2-cr1-flp160"},
134 {5, 120, 1, 160, "alio2-cr1-flp160"},
135 {8, 120, 2, 160, "alio2-cr1-flp160"},
136 {9, 120, 3, 160, "alio2-cr1-flp160"},
137 {6, 123, 0, 161, "alio2-cr1-flp161"},
138 {7, 123, 1, 161, "alio2-cr1-flp161"},
139 {10, 123, 2, 161, "alio2-cr1-flp161"},
140 {11, 122, 0, 161, "alio2-cr1-flp161"},
141 {12, 122, 1, 161, "alio2-cr1-flp161"},
142 {13, 122, 2, 161, "alio2-cr1-flp161"}};
143
144 static inline int FeeId(unsigned int idx) { return (idx >= Geo::MAXEQUIPMENTS) ? -1 : mEq[idx].Id.Fee; };
145 static inline int CruId(unsigned int idx) { return (idx >= Geo::MAXEQUIPMENTS) ? -1 : mEq[idx].Id.Cru; };
146 static inline int LnkId(unsigned int idx) { return (idx >= Geo::MAXEQUIPMENTS) ? -1 : mEq[idx].Id.Lnk; };
147 static inline int FlpId(unsigned int idx) { return (idx >= Geo::MAXEQUIPMENTS) ? -1 : mEq[idx].Id.Flp; };
148 static inline std::string_view FlpHostName(unsigned int idx) { return (idx >= Geo::MAXEQUIPMENTS) ? "wrong-host" : mEq[idx].Id.FlpHostName; };
149 static inline uint32_t UniqueId(unsigned int idx) { return (idx >= Geo::MAXEQUIPMENTS) ? -1 : mEq[idx].LinkUId; };
150
151 static unsigned int searchIdx(int FeeId)
152 {
153 for (int i = 0; i < Geo::MAXEQUIPMENTS; i++) {
154 if (FeeId == mEq[i].Id.Fee) {
155 return (i);
156 }
157 }
158 return (-1);
159 }
160 static unsigned int searchIdx(int CruId, int LnkId)
161 {
162 for (int i = 0; i < Geo::MAXEQUIPMENTS; i++) {
163 if (CruId == mEq[i].Id.Cru && LnkId == mEq[i].Id.Lnk) {
164 return (i);
165 }
166 }
167 return (-1);
168 }
169 static void getInfo(unsigned int idx, int& Fee, int& Cru, int& Lnk, int& Flp)
170 {
171 Cru = mEq[idx].Id.Cru;
172 Lnk = mEq[idx].Id.Lnk;
173 Fee = mEq[idx].Id.Fee;
174 Flp = mEq[idx].Id.Flp;
175 return;
176 }
177
179};
180
181} // namespace hmpid
182} // namespace o2
183
184#endif
int32_t i
HMPID detector geometry (only statics)
Definition Geo.h:76
static constexpr int N_HMPIDTOTALPADS
Definition Geo.h:101
static constexpr int N_PHOTOCATODSY
Definition Geo.h:105
static constexpr int N_COLXSEGMENT
Definition Geo.h:81
static constexpr int N_PHOTOCATODS
Definition Geo.h:103
static constexpr int N_COLUMNS
Definition Geo.h:82
static constexpr int N_SEGMENTS
Definition Geo.h:80
static constexpr int N_XROWS
Definition Geo.h:88
static constexpr int N_MODULES
Definition Geo.h:87
static constexpr int N_DILOGICS
Definition Geo.h:83
static constexpr int N_DILOCHANNELS
Definition Geo.h:85
static constexpr int N_CHANNELS
Definition Geo.h:84
static constexpr int N_YCOLS
Definition Geo.h:89
static constexpr int MAXHALFXROWS
Definition Geo.h:92
static constexpr int DILOPADSROWS
Definition Geo.h:96
static constexpr int DILOPADSCOLS
Definition Geo.h:95
static constexpr int MAXYPHOTO
Definition Geo.h:107
static constexpr int MAXXPHOTO
Definition Geo.h:106
static constexpr int N_PHOTOCATODSX
Definition Geo.h:104
static constexpr int EQUIPMENTSPERMODULE
Definition Geo.h:98
static constexpr int MAXYCOLS
Definition Geo.h:91
static constexpr int HALFXROWS
Definition Geo.h:93
static constexpr int MAXEQUIPMENTS
Definition Geo.h:79
static constexpr int N_EQUIPMENTTOTALPADS
Definition Geo.h:100
static std::string_view FlpHostName(unsigned int idx)
Definition Geo.h:148
static int FlpId(unsigned int idx)
Definition Geo.h:147
static int FeeId(unsigned int idx)
Definition Geo.h:144
static uint32_t UniqueId(unsigned int idx)
Definition Geo.h:149
static unsigned int searchIdx(int FeeId)
Definition Geo.h:151
static int CruId(unsigned int idx)
Definition Geo.h:145
static void getInfo(unsigned int idx, int &Fee, int &Cru, int &Lnk, int &Flp)
Definition Geo.h:169
static unsigned int searchIdx(int CruId, int LnkId)
Definition Geo.h:160
static int LnkId(unsigned int idx)
Definition Geo.h:146
static constexpr Lnk mEq[Geo::MAXEQUIPMENTS]
Definition Geo.h:129
ClassDefNV(ReadOut, 1)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string_view FlpHostName
Definition Geo.h:123