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#include "GPUCommonMath.h"
16#include "GPUCommonArray.h"
17
18#include "ITStracking/Cluster.h"
22
23using namespace o2::its;
24
25using math_utils::computePhi;
26using math_utils::getNormalizedPhi;
27
28Cluster::Cluster(const float x, const float y, const float z, const int index)
29 : xCoordinate{x},
30 yCoordinate{y},
31 zCoordinate{z},
32 phi{getNormalizedPhi(computePhi(x, y))},
33 radius{o2::gpu::GPUCommonMath::Hypot(x, y)},
34 clusterId{index},
35 indexTableBinIndex{0}
36{
37 // Nothing to do
38}
39
40Cluster::Cluster(const int layerIndex, const IndexTableUtils& utils, const Cluster& other)
41 : xCoordinate{other.xCoordinate},
42 yCoordinate{other.yCoordinate},
43 zCoordinate{other.zCoordinate},
44 phi{getNormalizedPhi(computePhi(other.xCoordinate, other.yCoordinate))},
45 radius{o2::gpu::GPUCommonMath::Hypot(other.xCoordinate, other.yCoordinate)},
46 clusterId{other.clusterId},
47 indexTableBinIndex{utils.getBinIndex(utils.getZBinIndex(layerIndex, zCoordinate),
48 utils.getPhiBinIndex(phi))}
49//, montecarloId{ other.montecarloId }
50{
51 // Nothing to do
52}
53
54Cluster::Cluster(const int layerIndex, const float3& primaryVertex, const IndexTableUtils& utils, const Cluster& other)
55 : xCoordinate{other.xCoordinate},
56 yCoordinate{other.yCoordinate},
57 zCoordinate{other.zCoordinate},
58 phi{getNormalizedPhi(
59 computePhi(xCoordinate - primaryVertex.x, yCoordinate - primaryVertex.y))},
60 radius{o2::gpu::GPUCommonMath::Hypot(xCoordinate - primaryVertex.x, yCoordinate - primaryVertex.y)},
61 clusterId{other.clusterId},
62 indexTableBinIndex{utils.getBinIndex(utils.getZBinIndex(layerIndex, zCoordinate),
63 utils.getPhiBinIndex(phi))}
64{
65 // Nothing to do
66}
67
69{
70#if !defined(GPUCA_GPUCODE_DEVICE) || (!defined(__OPENCL__) && defined(GPUCA_GPU_DEBUG_PRINT))
71 printf("Cluster: %f %f %f %f %f %d %d\n", xCoordinate, yCoordinate, zCoordinate, phi, radius, clusterId, indexTableBinIndex);
72#endif
73}
74
75TrackingFrameInfo::TrackingFrameInfo(float x, float y, float z, float xTF, float alpha, std::array<float, 2>&& posTF,
76 std::array<float, 3>&& covTF)
77 : xCoordinate{x}, yCoordinate{y}, zCoordinate{z}, xTrackingFrame{xTF}, alphaTrackingFrame{alpha}, positionTrackingFrame{posTF}, covarianceTrackingFrame{covTF}
78{
79 // Nothing to do
80}
81
83{
84#if !defined(GPUCA_GPUCODE_DEVICE) || (!defined(__OPENCL__) && defined(GPUCA_GPU_DEBUG_PRINT))
85 printf("x: %f y: %f z: %f xTF: %f alphaTF: %f posTF: %f %f covTF: %f %f %f\n",
86 xCoordinate, yCoordinate, zCoordinate, xTrackingFrame, alphaTrackingFrame,
87 positionTrackingFrame[0], positionTrackingFrame[1],
88 covarianceTrackingFrame[0], covarianceTrackingFrame[1], covarianceTrackingFrame[2]);
89#endif
90}
GPUhd() void Cluster
Definition Cluster.cxx:68
void print() const
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLint GLenum GLint x
Definition glcorearb.h:403
GLuint index
Definition glcorearb.h:781
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
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.
VectorOfTObjectPtrs other