Skip to content

Commit 938108f

Browse files
committed
GPU TPC: Make GPUTPCGeometry fully constexpr
1 parent ee009a4 commit 938108f

File tree

3 files changed

+86
-84
lines changed

3 files changed

+86
-84
lines changed

GPU/GPUTracking/DataTypes/GPUTPCGeometry.h

Lines changed: 85 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -28,119 +28,123 @@
2828

2929
namespace o2::gpu
3030
{
31-
// Copy of TPC constants from AliRoot:TPCGeometry / O2:TPC/Base/Mapper
32-
// Should be unified, but cannot take the contants from the official headers for now, since we want it to be constexpr
33-
class GPUTPCGeometry // TODO: Make values constexpr
31+
// Copy of TPC constants from AliRoot:TPCGeometry / O2:TPC/Base/Mapper, cannot take the contants from the official headers for now, since we want it to be const / constexpr
32+
33+
namespace gputpcgeometry_internal
3434
{
3535
#ifdef GPUCA_TPC_GEOMETRY_O2
36-
const float mX[GPUCA_ROW_COUNT] = {85.225f, 85.975f, 86.725f, 87.475f, 88.225f, 88.975f, 89.725f, 90.475f, 91.225f, 91.975f, 92.725f, 93.475f, 94.225f, 94.975f, 95.725f, 96.475f, 97.225f, 97.975f, 98.725f, 99.475f, 100.225f, 100.975f,
37-
101.725f, 102.475f, 103.225f, 103.975f, 104.725f, 105.475f, 106.225f, 106.975f, 107.725f, 108.475f, 109.225f, 109.975f, 110.725f, 111.475f, 112.225f, 112.975f, 113.725f, 114.475f, 115.225f, 115.975f, 116.725f, 117.475f,
38-
118.225f, 118.975f, 119.725f, 120.475f, 121.225f, 121.975f, 122.725f, 123.475f, 124.225f, 124.975f, 125.725f, 126.475f, 127.225f, 127.975f, 128.725f, 129.475f, 130.225f, 130.975f, 131.725f, 135.2f, 136.2f, 137.2f,
39-
138.2f, 139.2f, 140.2f, 141.2f, 142.2f, 143.2f, 144.2f, 145.2f, 146.2f, 147.2f, 148.2f, 149.2f, 150.2f, 151.2f, 152.2f, 153.2f, 154.2f, 155.2f, 156.2f, 157.2f, 158.2f, 159.2f,
40-
160.2f, 161.2f, 162.2f, 163.2f, 164.2f, 165.2f, 166.2f, 167.2f, 168.2f, 171.4f, 172.6f, 173.8f, 175.f, 176.2f, 177.4f, 178.6f, 179.8f, 181.f, 182.2f, 183.4f, 184.6f, 185.8f,
41-
187.f, 188.2f, 189.4f, 190.6f, 191.8f, 193.f, 194.2f, 195.4f, 196.6f, 197.8f, 199.f, 200.2f, 201.4f, 202.6f, 203.8f, 205.f, 206.2f, 209.65f, 211.15f, 212.65f, 214.15f, 215.65f,
42-
217.15f, 218.65f, 220.15f, 221.65f, 223.15f, 224.65f, 226.15f, 227.65f, 229.15f, 230.65f, 232.15f, 233.65f, 235.15f, 236.65f, 238.15f, 239.65f, 241.15f, 242.65f, 244.15f, 245.65f};
43-
44-
const uint8_t mNPads[GPUCA_ROW_COUNT] = {66, 66, 66, 68, 68, 68, 70, 70, 70, 72, 72, 72, 74, 74, 74, 74, 76, 76, 76, 76, 78, 78, 78, 80, 80, 80, 82, 82, 82, 84, 84, 84, 86, 86, 86, 88, 88, 88,
45-
90, 90, 90, 90, 92, 92, 92, 94, 94, 94, 92, 92, 92, 94, 94, 94, 96, 96, 96, 98, 98, 98, 100, 100, 100, 76, 76, 76, 76, 78, 78, 78, 80, 80, 80, 80, 82, 82,
46-
82, 84, 84, 84, 84, 86, 86, 86, 88, 88, 88, 90, 90, 90, 90, 92, 92, 92, 94, 94, 94, 94, 96, 96, 96, 98, 98, 98, 100, 100, 102, 102, 102, 104, 104, 104, 106, 110,
47-
110, 112, 112, 112, 114, 114, 114, 116, 116, 116, 118, 118, 118, 118, 118, 120, 120, 122, 122, 124, 124, 124, 126, 126, 128, 128, 128, 130, 130, 132, 132, 132, 134, 134, 136, 136, 138, 138};
48-
49-
const uint8_t mRegion[GPUCA_ROW_COUNT] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
50-
4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
51-
const uint8_t mRegionRows[10] = {17, 15, 16, 15, 18, 16, 16, 14, 13, 12};
52-
const uint8_t mRegionStart[10] = {0, 17, 32, 48, 63, 81, 97, 113, 127, 140};
53-
54-
const uint8_t mSampaMapping[10] = {0, 0, 1, 1, 2, 3, 3, 4, 4, 2};
55-
const uint8_t mChannelOffset[10] = {0, 16, 0, 16, 0, 0, 16, 0, 16, 16};
56-
const uint8_t mSectorFECOffset[5] = {0, 15, 15 + 18, 15 + 18 + 18, 15 + 18 + 18 + 20};
57-
58-
const float mPadHeight[10] = {.75f, .75f, .75f, .75f, 1.f, 1.f, 1.2f, 1.2f, 1.5f, 1.5f};
59-
const float mPadWidth[10] = {.416f, .420f, .420f, .436f, .6f, .6f, .608f, .588f, .604f, .607f};
60-
61-
static constexpr float FACTOR_T2Z = 250.f / 512.f; // Used in compression, must remain constant at 250cm, 512 time bins!
62-
63-
public:
64-
GPUd() int32_t GetRegion(int32_t row) const { return mRegion[row]; }
65-
GPUd() int32_t GetRegionRows(int32_t region) const { return mRegionRows[region]; }
66-
GPUd() int32_t GetRegionStart(int32_t region) const { return mRegionStart[region]; }
67-
GPUd() int32_t GetSampaMapping(int32_t region) const { return mSampaMapping[region]; }
68-
GPUd() int32_t GetChannelOffset(int32_t region) const { return mChannelOffset[region]; }
69-
GPUd() int32_t GetSectorFECOffset(int32_t partition) const { return mSectorFECOffset[partition]; }
70-
GPUd() int32_t GetROC(int32_t row) const { return row < 97 ? (row < 63 ? 0 : 1) : (row < 127 ? 2 : 3); }
71-
GPUd() int32_t EndIROC() const { return 63; }
72-
GPUd() int32_t EndOROC1() const { return 97; }
73-
GPUd() int32_t EndOROC2() const { return 127; }
36+
GPUconstexpr() float mX[GPUCA_ROW_COUNT] = {85.225f, 85.975f, 86.725f, 87.475f, 88.225f, 88.975f, 89.725f, 90.475f, 91.225f, 91.975f, 92.725f, 93.475f, 94.225f, 94.975f, 95.725f, 96.475f, 97.225f, 97.975f, 98.725f, 99.475f, 100.225f, 100.975f,
37+
101.725f, 102.475f, 103.225f, 103.975f, 104.725f, 105.475f, 106.225f, 106.975f, 107.725f, 108.475f, 109.225f, 109.975f, 110.725f, 111.475f, 112.225f, 112.975f, 113.725f, 114.475f, 115.225f, 115.975f, 116.725f, 117.475f,
38+
118.225f, 118.975f, 119.725f, 120.475f, 121.225f, 121.975f, 122.725f, 123.475f, 124.225f, 124.975f, 125.725f, 126.475f, 127.225f, 127.975f, 128.725f, 129.475f, 130.225f, 130.975f, 131.725f, 135.2f, 136.2f, 137.2f,
39+
138.2f, 139.2f, 140.2f, 141.2f, 142.2f, 143.2f, 144.2f, 145.2f, 146.2f, 147.2f, 148.2f, 149.2f, 150.2f, 151.2f, 152.2f, 153.2f, 154.2f, 155.2f, 156.2f, 157.2f, 158.2f, 159.2f,
40+
160.2f, 161.2f, 162.2f, 163.2f, 164.2f, 165.2f, 166.2f, 167.2f, 168.2f, 171.4f, 172.6f, 173.8f, 175.f, 176.2f, 177.4f, 178.6f, 179.8f, 181.f, 182.2f, 183.4f, 184.6f, 185.8f,
41+
187.f, 188.2f, 189.4f, 190.6f, 191.8f, 193.f, 194.2f, 195.4f, 196.6f, 197.8f, 199.f, 200.2f, 201.4f, 202.6f, 203.8f, 205.f, 206.2f, 209.65f, 211.15f, 212.65f, 214.15f, 215.65f,
42+
217.15f, 218.65f, 220.15f, 221.65f, 223.15f, 224.65f, 226.15f, 227.65f, 229.15f, 230.65f, 232.15f, 233.65f, 235.15f, 236.65f, 238.15f, 239.65f, 241.15f, 242.65f, 244.15f, 245.65f};
43+
44+
GPUconstexpr() uint8_t mNPads[GPUCA_ROW_COUNT] = {66, 66, 66, 68, 68, 68, 70, 70, 70, 72, 72, 72, 74, 74, 74, 74, 76, 76, 76, 76, 78, 78, 78, 80, 80, 80, 82, 82, 82, 84, 84, 84, 86, 86, 86, 88, 88, 88,
45+
90, 90, 90, 90, 92, 92, 92, 94, 94, 94, 92, 92, 92, 94, 94, 94, 96, 96, 96, 98, 98, 98, 100, 100, 100, 76, 76, 76, 76, 78, 78, 78, 80, 80, 80, 80, 82, 82,
46+
82, 84, 84, 84, 84, 86, 86, 86, 88, 88, 88, 90, 90, 90, 90, 92, 92, 92, 94, 94, 94, 94, 96, 96, 96, 98, 98, 98, 100, 100, 102, 102, 102, 104, 104, 104, 106, 110,
47+
110, 112, 112, 112, 114, 114, 114, 116, 116, 116, 118, 118, 118, 118, 118, 120, 120, 122, 122, 124, 124, 124, 126, 126, 128, 128, 128, 130, 130, 132, 132, 132, 134, 134, 136, 136, 138, 138};
48+
49+
GPUconstexpr() uint8_t mRegion[GPUCA_ROW_COUNT] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
50+
4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
51+
GPUconstexpr() uint8_t mRegionRows[10] = {17, 15, 16, 15, 18, 16, 16, 14, 13, 12};
52+
GPUconstexpr() uint8_t mRegionStart[10] = {0, 17, 32, 48, 63, 81, 97, 113, 127, 140};
53+
54+
GPUconstexpr() uint8_t mSampaMapping[10] = {0, 0, 1, 1, 2, 3, 3, 4, 4, 2};
55+
GPUconstexpr() uint8_t mChannelOffset[10] = {0, 16, 0, 16, 0, 0, 16, 0, 16, 16};
56+
GPUconstexpr() uint8_t mSectorFECOffset[5] = {0, 15, 15 + 18, 15 + 18 + 18, 15 + 18 + 18 + 20};
57+
58+
GPUconstexpr() float mPadHeight[10] = {.75f, .75f, .75f, .75f, 1.f, 1.f, 1.2f, 1.2f, 1.5f, 1.5f};
59+
GPUconstexpr() float mPadWidth[10] = {.416f, .420f, .420f, .436f, .6f, .6f, .608f, .588f, .604f, .607f};
60+
61+
constexpr float FACTOR_T2Z = 250.f / 512.f; // Used in compression, must remain constant at 250cm, 512 time bins!
7462
#else
75-
const float mX[GPUCA_ROW_COUNT] = {85.195f, 85.945f, 86.695f, 87.445f, 88.195f, 88.945f, 89.695f, 90.445f, 91.195f, 91.945f, 92.695f, 93.445f, 94.195f, 94.945f, 95.695f, 96.445f, 97.195f, 97.945f, 98.695f, 99.445f, 100.195f, 100.945f, 101.695f,
76-
102.445f, 103.195f, 103.945f, 104.695f, 105.445f, 106.195f, 106.945f, 107.695f, 108.445f, 109.195f, 109.945f, 110.695f, 111.445f, 112.195f, 112.945f, 113.695f, 114.445f, 115.195f, 115.945f, 116.695f, 117.445f, 118.195f, 118.945f,
77-
119.695f, 120.445f, 121.195f, 121.945f, 122.695f, 123.445f, 124.195f, 124.945f, 125.695f, 126.445f, 127.195f, 127.945f, 128.695f, 129.445f, 130.195f, 130.945f, 131.695f, 135.180f, 136.180f, 137.180f, 138.180f, 139.180f, 140.180f,
78-
141.180f, 142.180f, 143.180f, 144.180f, 145.180f, 146.180f, 147.180f, 148.180f, 149.180f, 150.180f, 151.180f, 152.180f, 153.180f, 154.180f, 155.180f, 156.180f, 157.180f, 158.180f, 159.180f, 160.180f, 161.180f, 162.180f, 163.180f,
79-
164.180f, 165.180f, 166.180f, 167.180f, 168.180f, 169.180f, 170.180f, 171.180f, 172.180f, 173.180f, 174.180f, 175.180f, 176.180f, 177.180f, 178.180f, 179.180f, 180.180f, 181.180f, 182.180f, 183.180f, 184.180f, 185.180f, 186.180f,
80-
187.180f, 188.180f, 189.180f, 190.180f, 191.180f, 192.180f, 193.180f, 194.180f, 195.180f, 196.180f, 197.180f, 198.180f, 199.430f, 200.930f, 202.430f, 203.930f, 205.430f, 206.930f, 208.430f, 209.930f, 211.430f, 212.930f, 214.430f,
81-
215.930f, 217.430f, 218.930f, 220.430f, 221.930f, 223.430f, 224.930f, 226.430f, 227.930f, 229.430f, 230.930f, 232.430f, 233.930f, 235.430f, 236.930f, 238.430f, 239.930f, 241.430f, 242.930f, 244.430f, 245.930f};
82-
83-
const uint8_t mNPads[GPUCA_ROW_COUNT] = {68, 68, 68, 68, 70, 70, 70, 72, 72, 72, 74, 74, 74, 76, 76, 76, 78, 78, 78, 80, 80, 80, 82, 82, 82, 84, 84, 84, 86, 86, 86, 88, 88, 88, 90, 90, 90, 92, 92, 92,
84-
94, 94, 94, 96, 96, 96, 98, 98, 98, 100, 100, 100, 102, 102, 102, 104, 104, 104, 106, 106, 106, 108, 108, 74, 76, 76, 76, 76, 78, 78, 78, 80, 80, 80, 80, 82, 82, 82, 84, 84,
85-
84, 86, 86, 86, 86, 88, 88, 88, 90, 90, 90, 90, 92, 92, 92, 94, 94, 94, 96, 96, 96, 96, 98, 98, 98, 100, 100, 100, 100, 102, 102, 102, 104, 104, 104, 106, 106, 106, 106, 108,
86-
108, 108, 110, 110, 110, 110, 112, 112, 114, 114, 114, 116, 116, 118, 118, 120, 120, 122, 122, 122, 124, 124, 126, 126, 128, 128, 130, 130, 130, 132, 132, 134, 134, 136, 136, 138, 138, 138, 140};
87-
88-
const float mPadHeight[3] = {.75f, 1.f, 1.5f};
89-
const float mPadWidth[3] = {.4f, .6f, .6f};
63+
GPUconstexpr() float mX[GPUCA_ROW_COUNT] = {85.195f, 85.945f, 86.695f, 87.445f, 88.195f, 88.945f, 89.695f, 90.445f, 91.195f, 91.945f, 92.695f, 93.445f, 94.195f, 94.945f, 95.695f, 96.445f, 97.195f, 97.945f, 98.695f, 99.445f, 100.195f, 100.945f, 101.695f,
64+
102.445f, 103.195f, 103.945f, 104.695f, 105.445f, 106.195f, 106.945f, 107.695f, 108.445f, 109.195f, 109.945f, 110.695f, 111.445f, 112.195f, 112.945f, 113.695f, 114.445f, 115.195f, 115.945f, 116.695f, 117.445f, 118.195f, 118.945f,
65+
119.695f, 120.445f, 121.195f, 121.945f, 122.695f, 123.445f, 124.195f, 124.945f, 125.695f, 126.445f, 127.195f, 127.945f, 128.695f, 129.445f, 130.195f, 130.945f, 131.695f, 135.180f, 136.180f, 137.180f, 138.180f, 139.180f, 140.180f,
66+
141.180f, 142.180f, 143.180f, 144.180f, 145.180f, 146.180f, 147.180f, 148.180f, 149.180f, 150.180f, 151.180f, 152.180f, 153.180f, 154.180f, 155.180f, 156.180f, 157.180f, 158.180f, 159.180f, 160.180f, 161.180f, 162.180f, 163.180f,
67+
164.180f, 165.180f, 166.180f, 167.180f, 168.180f, 169.180f, 170.180f, 171.180f, 172.180f, 173.180f, 174.180f, 175.180f, 176.180f, 177.180f, 178.180f, 179.180f, 180.180f, 181.180f, 182.180f, 183.180f, 184.180f, 185.180f, 186.180f,
68+
187.180f, 188.180f, 189.180f, 190.180f, 191.180f, 192.180f, 193.180f, 194.180f, 195.180f, 196.180f, 197.180f, 198.180f, 199.430f, 200.930f, 202.430f, 203.930f, 205.430f, 206.930f, 208.430f, 209.930f, 211.430f, 212.930f, 214.430f,
69+
215.930f, 217.430f, 218.930f, 220.430f, 221.930f, 223.430f, 224.930f, 226.430f, 227.930f, 229.430f, 230.930f, 232.430f, 233.930f, 235.430f, 236.930f, 238.430f, 239.930f, 241.430f, 242.930f, 244.430f, 245.930f};
70+
71+
GPUconstexpr() uint8_t mNPads[GPUCA_ROW_COUNT] = {68, 68, 68, 68, 70, 70, 70, 72, 72, 72, 74, 74, 74, 76, 76, 76, 78, 78, 78, 80, 80, 80, 82, 82, 82, 84, 84, 84, 86, 86, 86, 88, 88, 88, 90, 90, 90, 92, 92, 92,
72+
94, 94, 94, 96, 96, 96, 98, 98, 98, 100, 100, 100, 102, 102, 102, 104, 104, 104, 106, 106, 106, 108, 108, 74, 76, 76, 76, 76, 78, 78, 78, 80, 80, 80, 80, 82, 82, 82, 84, 84,
73+
84, 86, 86, 86, 86, 88, 88, 88, 90, 90, 90, 90, 92, 92, 92, 94, 94, 94, 96, 96, 96, 96, 98, 98, 98, 100, 100, 100, 100, 102, 102, 102, 104, 104, 104, 106, 106, 106, 106, 108,
74+
108, 108, 110, 110, 110, 110, 112, 112, 114, 114, 114, 116, 116, 118, 118, 120, 120, 122, 122, 122, 124, 124, 126, 126, 128, 128, 130, 130, 130, 132, 132, 134, 134, 136, 136, 138, 138, 138, 140};
75+
76+
GPUconstexpr() float mPadHeight[3] = {.75f, 1.f, 1.5f};
77+
GPUconstexpr() float mPadWidth[3] = {.4f, .6f, .6f};
78+
79+
constexpr float FACTOR_T2Z = 250.f / 1024.f; // Used in compression, must remain constant at 250cm, 1024 time bins!
80+
#endif
81+
} // namespace gputpcgeometry_internal
9082

91-
static constexpr float FACTOR_T2Z = 250.f / 1024.f; // Used in compression, must remain constant at 250cm, 1024 time bins!
83+
class GPUTPCGeometry // TODO: Make values constexpr
84+
{
85+
static constexpr float FACTOR_Z2T = 1.f / gputpcgeometry_internal::FACTOR_T2Z;
9286

9387
public:
94-
GPUd() int32_t GetRegion(int32_t row) const { return (row < 63 ? 0 : row < 63 + 64 ? 1 : 2); }
95-
GPUd() int32_t GetRegionRows(int32_t region) const { return 0; } // dummy
96-
GPUd() int32_t GetRegionStart(int32_t region) const { return 0; } // dummy
97-
GPUd() int32_t GetROC(int32_t row) const { return GetRegion(row); }
98-
GPUd() int32_t EndIROC() const { return 63; }
99-
GPUd() int32_t EndOROC1() const { return 63 + 64; }
100-
GPUd() int32_t EndOROC2() const { return GPUCA_ROW_COUNT; }
88+
#ifdef GPUCA_TPC_GEOMETRY_O2
89+
GPUd() static constexpr int32_t GetRegion(int32_t row) { return gputpcgeometry_internal::mRegion[row]; }
90+
GPUd() static constexpr int32_t GetRegionRows(int32_t region) { return gputpcgeometry_internal::mRegionRows[region]; }
91+
GPUd() static constexpr int32_t GetRegionStart(int32_t region) { return gputpcgeometry_internal::mRegionStart[region]; }
92+
GPUd() static constexpr int32_t GetSampaMapping(int32_t region) { return gputpcgeometry_internal::mSampaMapping[region]; }
93+
GPUd() static constexpr int32_t GetChannelOffset(int32_t region) { return gputpcgeometry_internal::mChannelOffset[region]; }
94+
GPUd() static constexpr int32_t GetSectorFECOffset(int32_t partition) { return gputpcgeometry_internal::mSectorFECOffset[partition]; }
95+
GPUd() static constexpr int32_t GetROC(int32_t row) { return row < 97 ? (row < 63 ? 0 : 1) : (row < 127 ? 2 : 3); }
96+
GPUd() static constexpr int32_t EndIROC() { return 63; }
97+
GPUd() static constexpr int32_t EndOROC1() { return 97; }
98+
GPUd() static constexpr int32_t EndOROC2() { return 127; }
99+
#else
100+
GPUd() static constexpr int32_t GetRegion(int32_t row) { return (row < 63 ? 0 : row < 63 + 64 ? 1 : 2); }
101+
GPUd() static constexpr int32_t GetRegionRows(int32_t region) { return 0; } // dummy
102+
GPUd() static constexpr int32_t GetRegionStart(int32_t region) { return 0; } // dummy
103+
GPUd() static constexpr int32_t GetROC(int32_t row) { return GetRegion(row); }
104+
GPUd() static constexpr int32_t EndIROC() { return 63; }
105+
GPUd() static constexpr int32_t EndOROC1() { return 63 + 64; }
106+
GPUd() static constexpr int32_t EndOROC2() { return GPUCA_ROW_COUNT; }
101107
#endif
102-
private:
103-
static constexpr float FACTOR_Z2T = 1.f / FACTOR_T2Z;
104108

105-
public:
106109
GPUd() static constexpr float TPCLength() { return 250.f - 0.275f; }
107-
GPUd() float Row2X(int32_t row) const { return (mX[row]); }
108-
GPUd() float PadHeight(int32_t row) const { return (mPadHeight[GetRegion(row)]); }
109-
GPUd() float PadHeightByRegion(int32_t region) const { return (mPadHeight[region]); }
110-
GPUd() float PadWidth(int32_t row) const { return (mPadWidth[GetRegion(row)]); }
111-
GPUd() uint8_t NPads(int32_t row) const { return mNPads[row]; }
110+
GPUd() static constexpr float Row2X(int32_t row) { return (gputpcgeometry_internal::mX[row]); }
111+
GPUd() static constexpr float PadHeight(int32_t row) { return (gputpcgeometry_internal::mPadHeight[GetRegion(row)]); }
112+
GPUd() static constexpr float PadHeightByRegion(int32_t region) { return (gputpcgeometry_internal::mPadHeight[region]); }
113+
GPUd() static constexpr float PadWidth(int32_t row) { return (gputpcgeometry_internal::mPadWidth[GetRegion(row)]); }
114+
GPUd() static constexpr uint8_t NPads(int32_t row) { return gputpcgeometry_internal::mNPads[row]; }
112115

113-
GPUd() float LinearPad2Y(int32_t sector, int32_t row, float pad) const
116+
GPUd() static constexpr float LinearPad2Y(int32_t sector, int32_t row, float pad)
114117
{
115118
#ifdef GPUCA_TPC_GEOMETRY_O2
116-
const float u = (pad - 0.5f * (mNPads[row] - 1)) * PadWidth(row);
119+
const float u = (pad - 0.5f * (gputpcgeometry_internal::mNPads[row] - 1)) * PadWidth(row);
117120
#else
118-
const float u = (pad - 0.5f * mNPads[row]) * PadWidth(row);
121+
const float u = (pad - 0.5f * gputpcgeometry_internal::mNPads[row]) * PadWidth(row);
119122
#endif
120123
return (sector >= GPUCA_NSECTORS / 2) ? -u : u;
121124
}
122125

123-
GPUd() static float LinearTime2Z(int32_t sector, float time)
126+
GPUd() static constexpr float LinearTime2Z(int32_t sector, float time)
124127
{
125-
const float v = 250.f - time * FACTOR_T2Z; // Used in compression, must remain constant at 250cm!
128+
const float v = 250.f - time * gputpcgeometry_internal::FACTOR_T2Z; // Used in compression, must remain constant at 250cm!
126129
return (sector >= GPUCA_NSECTORS / 2) ? -v : v;
127130
}
128131

129-
GPUd() float LinearY2Pad(int32_t sector, int32_t row, float y) const
132+
GPUd() static constexpr float LinearY2Pad(int32_t sector, int32_t row, float y)
130133
{
131134
const float u = (sector >= GPUCA_NSECTORS / 2) ? -y : y;
132135
#ifdef GPUCA_TPC_GEOMETRY_O2
133-
return u / PadWidth(row) + 0.5f * (mNPads[row] - 1);
136+
return u / PadWidth(row) + 0.5f * (gputpcgeometry_internal::mNPads[row] - 1);
134137
#else
135-
return u / PadWidth(row) + 0.5f * mNPads[row];
138+
return u / PadWidth(row) + 0.5f * gputpcgeometry_internal::mNPads[row];
136139
#endif
137140
}
138141

139-
GPUd() static float LinearZ2Time(int32_t sector, float z)
142+
GPUd() static constexpr float LinearZ2Time(int32_t sector, float z)
140143
{
141144
const float v = (sector >= GPUCA_NSECTORS / 2) ? -z : z;
142145
return (250.f - v) * FACTOR_Z2T; // Used in compression, must remain constant at 250cm
143146
}
144147
};
148+
145149
} // namespace o2::gpu
146150
#endif

GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ namespace gpu
3131
{
3232

3333
struct ChargePos;
34-
class GPUTPCGeometry;
3534
struct GPUParam;
35+
class GPUTPCGeometry;
3636

3737
class ClusterAccumulator
3838
{

0 commit comments

Comments
 (0)