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 "GPUCommonRtypes.h"
23#include "GPUCommonMath.h"
24#include "GPUCommonDef.h"
25#include "GPUCommonLogger.h"
26
27namespace o2::its
28{
29
30// tracklets are entirely determined by their two cluster idx
31struct Tracklet final {
32 GPUhdDefault() Tracklet() = default;
33 GPUhdi() Tracklet(const int firstClusterOrderingIndex, const int secondClusterOrderingIndex,
35 : firstClusterIndex(firstClusterOrderingIndex),
37 tanLambda((firstCluster.zCoordinate - secondCluster.zCoordinate) / (firstCluster.radius - secondCluster.radius)),
38 phi(o2::gpu::GPUCommonMath::ATan2(firstCluster.yCoordinate - secondCluster.yCoordinate, firstCluster.xCoordinate - secondCluster.xCoordinate)),
39 mTime(t) {}
40
41 GPUhdi() Tracklet(const int idx0, const int idx1, float tanL, float phi, const TimeEstBC& t)
42 : firstClusterIndex(idx0),
46 mTime(t) {}
47 GPUhdi() bool operator<(const Tracklet& o) const noexcept
48 {
49 return (firstClusterIndex != o.firstClusterIndex) ? firstClusterIndex < o.firstClusterIndex : secondClusterIndex < o.secondClusterIndex;
50 }
51 GPUhdi() bool operator==(const Tracklet& o) const noexcept
52 {
53 return firstClusterIndex == o.firstClusterIndex && secondClusterIndex == o.secondClusterIndex;
54 }
55 GPUhdi() bool isCompatible(const Tracklet& o) const { return mTime.isCompatible(o.mTime); }
56 GPUhd() void print() const
57 {
58 LOGP(info, "TRKLT: fClIdx:{} sClIdx:{} ts:{}+/-{} TgL={} Phi={}", firstClusterIndex, secondClusterIndex, mTime.getTimeStamp(), mTime.getTimeStampError(), tanLambda, phi);
59 }
60 GPUhd() auto& getTimeStamp() noexcept { return mTime; }
61 GPUhd() const auto& getTimeStamp() const noexcept { return mTime; }
62
63 int firstClusterIndex{constants::UnusedIndex};
68
70};
71
72} // namespace o2::its
73
74#endif /* TRACKINGITS_INCLUDE_TRACKLET_H_ */
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:34
const int idx1
Definition Tracklet.h:41
GPUhdi() bool operator<(const Tracklet &o) const noexcept
Definition Tracklet.h:47
const int const Cluster const Cluster const TimeEstBC & t
Definition Tracklet.h:35
const int secondClusterOrderingIndex
Definition Tracklet.h:33
TimeEstBC mTime
Definition Tracklet.h:67
const int float tanL
Definition Tracklet.h:41
GPUhdi() Tracklet(const int firstClusterOrderingIndex
ClassDefNV(Tracklet, 1)
GPUhdDefault() Tracklet()=default
const int const Cluster & firstCluster
Definition Tracklet.h:34
GPUhdi() bool operator
GPUhdi() Tracklet(const int idx0
const int float float phi
Definition Tracklet.h:41