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