Project
Loading...
Searching...
No Matches
Constants.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.
15
16#ifndef TRACKINGITSU_INCLUDE_CONSTANTS_H_
17#define TRACKINGITSU_INCLUDE_CONSTANTS_H_
18
19#ifndef GPUCA_GPUCODE_DEVICE
20#include <climits>
21#include <vector>
22#endif
23
26#include "GPUCommonMath.h"
27#include "GPUCommonDef.h"
28
29namespace o2
30{
31namespace its
32{
33
34namespace constants
35{
36constexpr float MB = 1024.f * 1024.f;
37constexpr float GB = 1024.f * 1024.f * 1024.f;
38constexpr bool DoTimeBenchmarks = true;
39constexpr bool SaveTimeBenchmarks = false;
40
41namespace math
42{
43constexpr float Pi{3.14159265359f};
44constexpr float TwoPi{2.0f * Pi};
45constexpr float FloatMinThreshold{1e-20f};
46} // namespace math
47
48namespace its
49{
50constexpr int LayersNumberVertexer{3};
51constexpr int ClustersPerCell{3};
52constexpr int UnusedIndex{-1};
53constexpr float Resolution{0.0005f};
54
56{
57 return GPUArray<float, 3>{{1.98, 1.98, 40.f}};
58}
59} // namespace its
60
61namespace its2
62{
63constexpr int LayersNumber{7};
64constexpr int TrackletsPerRoad{LayersNumber - 1};
65constexpr int CellsPerRoad{LayersNumber - 2};
66
68{
69 constexpr double s = 1.; // safety margin
70 return GPUArray<float, LayersNumber>{{16.333f + s, 16.333f + s, 16.333f + s, 42.140f + s, 42.140f + s, 73.745f + s, 73.745f + s}};
71}
73{
74 return GPUArray<float, LayersNumber>{{2.33959f, 3.14076f, 3.91924f, 19.6213f, 24.5597f, 34.388f, 39.3329f}};
75}
76
77constexpr int ZBins{256};
78constexpr int PhiBins{128};
81{
82 constexpr auto zSize = LayersZCoordinate();
83 return GPUArray<float, LayersNumber>{{0.5f * ZBins / (zSize[0]), 0.5f * ZBins / (zSize[1]), 0.5f * ZBins / (zSize[2]),
84 0.5f * ZBins / (zSize[3]), 0.5f * ZBins / (zSize[4]), 0.5f * ZBins / (zSize[5]),
85 0.5f * ZBins / (zSize[6])}};
86}
87inline float getInverseZCoordinate(const int layerIndex)
88{
89 return 0.5f * ZBins / LayersZCoordinate()[layerIndex];
90}
91
92GPUhdi() int getZBinIndex(const int layerIndex, const float zCoordinate)
93{
94 return (zCoordinate + LayersZCoordinate()[layerIndex]) *
95 InverseZBinSize()[layerIndex];
96}
97
98GPUhdi() int getPhiBinIndex(const float currentPhi)
99{
100 return (currentPhi * InversePhiBinSize);
101}
102
103GPUhdi() int getBinIndex(const int zIndex, const int phiIndex)
104{
105 return o2::gpu::GPUCommonMath::Min(phiIndex * ZBins + zIndex,
106 ZBins * PhiBins - 1);
107}
108
109GPUhdi() constexpr int4 getEmptyBinsRect() { return int4{0, 0, 0, 0}; }
110
111} // namespace its2
112
113namespace pdgcodes
114{
115constexpr int PionCode{211};
116}
117} // namespace constants
118#ifndef __OPENCL__
119typedef std::vector<std::vector<int>> index_table_t;
120#endif
121} // namespace its
122} // namespace o2
123
124#endif /* TRACKINGITSU_INCLUDE_CONSTANTS_H_ */
std::array< T, Size > GPUArray
useful math constants
const float zCoordinate
Definition Constants.h:93
constexpr int PhiBins
Definition Constants.h:78
constexpr float InversePhiBinSize
Definition Constants.h:79
constexpr int TrackletsPerRoad
Definition Constants.h:64
constexpr int ZBins
Definition Constants.h:77
GPUhdi() const expr GPUArray< float
Definition Constants.h:98
LayersNumber LayersZCoordinate()
Definition Constants.h:67
LayersNumber LayersRCoordinate()
Definition Constants.h:72
float getInverseZCoordinate(const int layerIndex)
Definition Constants.h:87
constexpr int CellsPerRoad
Definition Constants.h:65
constexpr int LayersNumber
Definition Constants.h:63
LayersNumber InverseZBinSize()
Definition Constants.h:80
constexpr int LayersNumberVertexer
Definition Constants.h:50
GPUhdi() const expr GPUArray< float
constexpr int ClustersPerCell
Definition Constants.h:51
constexpr int UnusedIndex
Definition Constants.h:52
constexpr float Resolution
Definition Constants.h:53
constexpr float Pi
Definition Constants.h:43
constexpr float TwoPi
Definition Constants.h:44
constexpr float FloatMinThreshold
Definition Constants.h:45
constexpr float GB
Definition Constants.h:37
constexpr float MB
Definition Constants.h:36
constexpr bool DoTimeBenchmarks
Definition Constants.h:38
constexpr bool SaveTimeBenchmarks
Definition Constants.h:39
std::vector< std::vector< int > > index_table_t
FIXME: this is for compatibility with OCL.
Definition Constants.h:119
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...