Project
Loading...
Searching...
No Matches
Tracklet.h
Go to the documentation of this file.
1// Copyright 2019-2026 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#ifndef TRACKINGITS_INCLUDE_TRACKLET_H_
17#define TRACKINGITS_INCLUDE_TRACKLET_H_
18
21#include "ITStracking/Cluster.h"
22#include "MathUtils/Utils.h"
23#include "GPUCommonRtypes.h"
24#include "GPUCommonMath.h"
25#include "GPUCommonDef.h"
26#include "GPUCommonLogger.h"
27
28namespace o2::its
29{
30
31// tracklets are entirely determined by their two cluster idx
32struct Tracklet final {
33 GPUhdDefault() Tracklet() = default;
34 GPUhdi() Tracklet(const int firstClusterOrderingIndex, const int secondClusterOrderingIndex,
36 : firstClusterIndex(firstClusterOrderingIndex),
38 tanLambda((firstCluster.zCoordinate - secondCluster.zCoordinate) / (firstCluster.radius - secondCluster.radius)),
39 phi(o2::math_utils::fastATan2(firstCluster.yCoordinate - secondCluster.yCoordinate, firstCluster.xCoordinate - secondCluster.xCoordinate)),
40 mTime(t) {}
41
42 GPUhdi() Tracklet(const int idx0, const int idx1, float tanL, float phi, const TimeEstBC& t)
43 : firstClusterIndex(idx0),
47 mTime(t) {}
48 GPUhdi() bool operator<(const Tracklet& o) const noexcept
49 {
50 return (firstClusterIndex != o.firstClusterIndex) ? firstClusterIndex < o.firstClusterIndex : secondClusterIndex < o.secondClusterIndex;
51 }
52 GPUhdi() bool operator==(const Tracklet& o) const noexcept
53 {
54 return firstClusterIndex == o.firstClusterIndex && secondClusterIndex == o.secondClusterIndex;
55 }
56 GPUhdi() bool isCompatible(const Tracklet& o) const { return mTime.isCompatible(o.mTime); }
57 GPUhd() void print() const
58 {
59 LOGP(info, "TRKLT: fClIdx:{} sClIdx:{} ts:{}+/-{} TgL={} Phi={}", firstClusterIndex, secondClusterIndex, mTime.getTimeStamp(), mTime.getTimeStampError(), tanLambda, phi);
60 }
61 GPUhd() auto& getTimeStamp() noexcept { return mTime; }
62 GPUhd() const auto& getTimeStamp() const noexcept { return mTime; }
63
64 int firstClusterIndex{constants::UnusedIndex};
69
71};
72
73} // namespace o2::its
74
75#endif /* TRACKINGITS_INCLUDE_TRACKLET_H_ */
General auxilliary methods.
void print() const
#define GPUhd()
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
constexpr int UnusedIndex
Definition Constants.h:32
constexpr float UnsetValue
Definition Constants.h:33
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
const int const Cluster const Cluster & secondCluster
Definition Tracklet.h:35
const int idx1
Definition Tracklet.h:42
GPUhdi() bool operator<(const Tracklet &o) const noexcept
Definition Tracklet.h:48
const int const Cluster const Cluster const TimeEstBC & t
Definition Tracklet.h:36
const int secondClusterOrderingIndex
Definition Tracklet.h:34
TimeEstBC mTime
Definition Tracklet.h:68
const int float tanL
Definition Tracklet.h:42
GPUhdi() Tracklet(const int firstClusterOrderingIndex
ClassDefNV(Tracklet, 1)
GPUhdDefault() Tracklet()=default
const int const Cluster & firstCluster
Definition Tracklet.h:35
GPUhdi() bool operator
GPUhdi() Tracklet(const int idx0
const int float float phi
Definition Tracklet.h:42