Project
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
Cluster.cxx
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#include "ITStracking/Cluster.h"
19
20#include "GPUCommonArray.h"
21
22namespace o2
23{
24namespace its
25{
26
27using math_utils::computePhi;
28using math_utils::getNormalizedPhi;
29using math_utils::hypot;
30
31Cluster::Cluster(const float x, const float y, const float z, const int index)
32 : xCoordinate{x},
33 yCoordinate{y},
34 zCoordinate{z},
35 phi{getNormalizedPhi(computePhi(x, y))},
36 radius{hypot(x, y)},
37 clusterId{index},
38 indexTableBinIndex{0}
39{
40 // Nothing to do
41}
42
43Cluster::Cluster(const int layerIndex, const IndexTableUtils& utils, const Cluster& other)
44 : xCoordinate{other.xCoordinate},
45 yCoordinate{other.yCoordinate},
46 zCoordinate{other.zCoordinate},
47 phi{getNormalizedPhi(computePhi(other.xCoordinate, other.yCoordinate))},
48 radius{hypot(other.xCoordinate, other.yCoordinate)},
49 clusterId{other.clusterId},
50 indexTableBinIndex{utils.getBinIndex(utils.getZBinIndex(layerIndex, zCoordinate),
51 utils.getPhiBinIndex(phi))}
52//, montecarloId{ other.montecarloId }
53{
54 // Nothing to do
55}
56
57Cluster::Cluster(const int layerIndex, const float3& primaryVertex, const IndexTableUtils& utils, const Cluster& other)
58 : xCoordinate{other.xCoordinate},
59 yCoordinate{other.yCoordinate},
60 zCoordinate{other.zCoordinate},
61 phi{getNormalizedPhi(
62 computePhi(xCoordinate - primaryVertex.x, yCoordinate - primaryVertex.y))},
63 radius{hypot(xCoordinate - primaryVertex.x, yCoordinate - primaryVertex.y)},
64 clusterId{other.clusterId},
65 indexTableBinIndex{utils.getBinIndex(utils.getZBinIndex(layerIndex, zCoordinate),
66 utils.getPhiBinIndex(phi))}
67{
68 // Nothing to do
69}
70
71void Cluster::Init(const int layerIndex, const float3& primaryVertex, const IndexTableUtils& utils, const Cluster& other)
72{
73 xCoordinate = other.xCoordinate;
74 yCoordinate = other.yCoordinate;
75 zCoordinate = other.zCoordinate;
76 phi = getNormalizedPhi(
77 computePhi(xCoordinate - primaryVertex.x, yCoordinate - primaryVertex.y));
78 radius = hypot(xCoordinate - primaryVertex.x, yCoordinate - primaryVertex.y);
79 clusterId = other.clusterId;
80 indexTableBinIndex = utils.getBinIndex(utils.getZBinIndex(layerIndex, zCoordinate),
81 utils.getPhiBinIndex(phi));
82}
83
84bool Cluster::operator==(const Cluster& rhs) const
85{
86 return this->xCoordinate == rhs.xCoordinate &&
87 this->yCoordinate == rhs.yCoordinate &&
88 this->zCoordinate == rhs.zCoordinate &&
89 this->phi == rhs.phi &&
90 this->radius == rhs.radius &&
91 this->clusterId == rhs.clusterId &&
93}
94
95TrackingFrameInfo::TrackingFrameInfo(float x, float y, float z, float xTF, float alpha, o2::gpu::gpustd::array<float, 2>&& posTF,
97 : xCoordinate{x}, yCoordinate{y}, zCoordinate{z}, xTrackingFrame{xTF}, alphaTrackingFrame{alpha}, positionTrackingFrame{posTF}, covarianceTrackingFrame{covTF}
98{
99 // Nothing to do
100}
101
102} // namespace its
103} // namespace o2
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLint GLenum GLint x
Definition glcorearb.h:403
GLuint index
Definition glcorearb.h:781
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
std::array< T, N > array
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Common utility functions.
float yCoordinate
Definition Cluster.h:45
float zCoordinate
Definition Cluster.h:46
int indexTableBinIndex
Definition Cluster.h:50
float xCoordinate
Definition Cluster.h:44
VectorOfTObjectPtrs other