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
40template <int nLayers>
41Cluster::Cluster(const int layerIndex, const IndexTableUtils<nLayers>& 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{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
55template <int nLayers>
56Cluster::Cluster(const int layerIndex, const float3& primaryVertex, const IndexTableUtils<nLayers>& utils, const Cluster& other)
57 : xCoordinate{other.xCoordinate},
58 yCoordinate{other.yCoordinate},
59 zCoordinate{other.zCoordinate},
60 phi{getNormalizedPhi(
61 computePhi(xCoordinate - primaryVertex.x, yCoordinate - primaryVertex.y))},
62 radius{o2::gpu::GPUCommonMath::Hypot(xCoordinate - primaryVertex.x, yCoordinate - primaryVertex.y)},
63 clusterId{other.clusterId},
64 indexTableBinIndex{utils.getBinIndex(utils.getZBinIndex(layerIndex, zCoordinate),
65 utils.getPhiBinIndex(phi))}
66{
67 // Nothing to do
68}
69
71{
72#if !defined(GPUCA_GPUCODE_DEVICE) || (!defined(__OPENCL__) && defined(GPUCA_GPU_DEBUG_PRINT))
73 printf("Cluster: %f %f %f %f %f %d %d\n", xCoordinate, yCoordinate, zCoordinate, phi, radius, clusterId, indexTableBinIndex);
74#endif
75}
76
77TrackingFrameInfo::TrackingFrameInfo(float x, float y, float z, float xTF, float alpha, std::array<float, 2>&& posTF,
78 std::array<float, 3>&& covTF)
79 : xCoordinate{x}, yCoordinate{y}, zCoordinate{z}, xTrackingFrame{xTF}, alphaTrackingFrame{alpha}, positionTrackingFrame{posTF}, covarianceTrackingFrame{covTF}
80{
81 // Nothing to do
82}
83
85{
86#if !defined(GPUCA_GPUCODE_DEVICE) || (!defined(__OPENCL__) && defined(GPUCA_GPU_DEBUG_PRINT))
87 printf("x: %f y: %f z: %f xTF: %f alphaTF: %f posTF: %f %f covTF: %f %f %f\n",
88 xCoordinate, yCoordinate, zCoordinate, xTrackingFrame, alphaTrackingFrame,
89 positionTrackingFrame[0], positionTrackingFrame[1],
90 covarianceTrackingFrame[0], covarianceTrackingFrame[1], covarianceTrackingFrame[2]);
91#endif
92}
GPUhd() void Cluster
Definition Cluster.cxx:70
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