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;
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},
33 phi{getNormalizedPhi(computePhi(x, y))},
34 radius{o2::gpu::GPUCommonMath::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},
45 phi{getNormalizedPhi(computePhi(other.xCoordinate, other.yCoordinate))},
46 radius{o2::gpu::GPUCommonMath::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},
59 phi{getNormalizedPhi(
60 computePhi(xCoordinate - primaryVertex.x, yCoordinate - primaryVertex.y))},
61 radius{o2::gpu::GPUCommonMath::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
70{
71#if !defined(GPUCA_GPUCODE_DEVICE) || (!defined(__OPENCL__) && defined(GPUCA_GPU_DEBUG_PRINT))
72 printf("Cluster: %f %f %f %f %f %d %d\n", xCoordinate, yCoordinate, zCoordinate, phi, radius, clusterId, indexTableBinIndex);
73#endif
74}
75
76TrackingFrameInfo::TrackingFrameInfo(float x, float y, float z, float xTF, float alpha, std::array<float, 2>&& posTF,
77 std::array<float, 3>&& covTF)
78 : xCoordinate{x}, yCoordinate{y}, zCoordinate{z}, xTrackingFrame{xTF}, alphaTrackingFrame{alpha}, positionTrackingFrame{posTF}, covarianceTrackingFrame{covTF}
79{
80 // Nothing to do
81}
82
84{
85#if !defined(GPUCA_GPUCODE_DEVICE) || (!defined(__OPENCL__) && defined(GPUCA_GPU_DEBUG_PRINT))
86 printf("x: %f y: %f z: %f xTF: %f alphaTF: %f posTF: %f %f covTF: %f %f %f\n",
87 xCoordinate, yCoordinate, zCoordinate, xTrackingFrame, alphaTrackingFrame,
88 positionTrackingFrame[0], positionTrackingFrame[1],
89 covarianceTrackingFrame[0], covarianceTrackingFrame[1], covarianceTrackingFrame[2]);
90#endif
91}
GPUhd() void Cluster
Definition Cluster.cxx:69
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
const float zCoordinate
Definition Constants.h:97
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Common utility functions.
VectorOfTObjectPtrs other