Project
Loading...
Searching...
No Matches
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
20namespace o2
21{
22namespace its
23{
24
25using math_utils::computePhi;
26using math_utils::getNormalizedPhi;
27using math_utils::hypot;
28
29Cluster::Cluster(const float x, const float y, const float z, const int index)
30 : xCoordinate{x},
31 yCoordinate{y},
32 zCoordinate{z},
33 phi{getNormalizedPhi(computePhi(x, y))},
34 radius{hypot(x, y)},
35 clusterId{index},
36 indexTableBinIndex{0}
37{
38 // Nothing to do
39}
40
41Cluster::Cluster(const int layerIndex, const IndexTableUtils& utils, const Cluster& other)
42 : xCoordinate{other.xCoordinate},
43 yCoordinate{other.yCoordinate},
44 zCoordinate{other.zCoordinate},
45 phi{getNormalizedPhi(computePhi(other.xCoordinate, other.yCoordinate))},
46 radius{hypot(other.xCoordinate, other.yCoordinate)},
47 clusterId{other.clusterId},
48 indexTableBinIndex{utils.getBinIndex(utils.getZBinIndex(layerIndex, zCoordinate),
49 utils.getPhiBinIndex(phi))}
50//, montecarloId{ other.montecarloId }
51{
52 // Nothing to do
53}
54
55Cluster::Cluster(const int layerIndex, const float3& primaryVertex, const IndexTableUtils& utils, const Cluster& other)
56 : xCoordinate{other.xCoordinate},
57 yCoordinate{other.yCoordinate},
58 zCoordinate{other.zCoordinate},
59 phi{getNormalizedPhi(
60 computePhi(xCoordinate - primaryVertex.x, yCoordinate - primaryVertex.y))},
61 radius{hypot(xCoordinate - primaryVertex.x, yCoordinate - primaryVertex.y)},
62 clusterId{other.clusterId},
63 indexTableBinIndex{utils.getBinIndex(utils.getZBinIndex(layerIndex, zCoordinate),
64 utils.getPhiBinIndex(phi))}
65{
66 // Nothing to do
67}
68
69void Cluster::Init(const int layerIndex, const float3& primaryVertex, const IndexTableUtils& utils, const Cluster& other)
70{
71 xCoordinate = other.xCoordinate;
72 yCoordinate = other.yCoordinate;
73 zCoordinate = other.zCoordinate;
74 phi = getNormalizedPhi(
75 computePhi(xCoordinate - primaryVertex.x, yCoordinate - primaryVertex.y));
76 radius = hypot(xCoordinate - primaryVertex.x, yCoordinate - primaryVertex.y);
77 clusterId = other.clusterId;
78 indexTableBinIndex = utils.getBinIndex(utils.getZBinIndex(layerIndex, zCoordinate),
79 utils.getPhiBinIndex(phi));
80}
81
82bool Cluster::operator==(const Cluster& rhs) const
83{
84 return this->xCoordinate == rhs.xCoordinate &&
85 this->yCoordinate == rhs.yCoordinate &&
86 this->zCoordinate == rhs.zCoordinate &&
87 this->phi == rhs.phi &&
88 this->radius == rhs.radius &&
89 this->clusterId == rhs.clusterId &&
91}
92
93TrackingFrameInfo::TrackingFrameInfo(float x, float y, float z, float xTF, float alpha, GPUArray<float, 2>&& posTF,
94 GPUArray<float, 3>&& covTF)
95 : xCoordinate{x}, yCoordinate{y}, zCoordinate{z}, xTrackingFrame{xTF}, alphaTrackingFrame{alpha}, positionTrackingFrame{posTF}, covarianceTrackingFrame{covTF}
96{
97 // Nothing to do
98}
99
100} // namespace its
101} // namespace o2
std::array< T, Size > GPUArray
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
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