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