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
27#ifndef GPUCA_GPUCODE_DEVICE
28#ifndef GPU_NO_FMT
29#include <string>
30#include <fmt/format.h>
31#endif
32#endif
33
34namespace o2::its
35{
36
37struct Tracklet final {
38 GPUhdDefault() Tracklet() = default;
39 GPUhdi() Tracklet(const int, const int, const Cluster&, const Cluster&, const TimeEstBC& t);
40 GPUhdi() Tracklet(const int, const int, float tanL, float phi, const TimeEstBC& t);
41 GPUhdDefault() bool operator==(const Tracklet&) const = default;
42 GPUhdi() unsigned char isEmpty() const
43 {
44 return firstClusterIndex < 0 || secondClusterIndex < 0;
45 }
46 GPUhdi() bool isCompatible(const Tracklet& o) const { return mTime.isCompatible(o.mTime); }
47 GPUhdi() unsigned char operator<(const Tracklet&) const;
48 GPUhd() void print() const
49 {
50 LOGP(info, "TRKLT: fClIdx:{} sClIdx:{} ts:{}+/-{} TgL={} Phi={}", firstClusterIndex, secondClusterIndex, mTime.getTimeStamp(), mTime.getTimeStampError(), tanLambda, phi);
51 }
52 GPUhd() auto& getTimeStamp() noexcept { return mTime; }
53 GPUhd() const auto& getTimeStamp() const noexcept { return mTime; }
54
57 float tanLambda{-999};
58 float phi{-999};
60
62};
63
64GPUhdi() Tracklet::Tracklet(const int firstClusterOrderingIndex, const int secondClusterOrderingIndex,
65 const Cluster& firstCluster, const Cluster& secondCluster, const TimeEstBC& t)
66 : firstClusterIndex(firstClusterOrderingIndex),
67 secondClusterIndex(secondClusterOrderingIndex),
68 tanLambda((firstCluster.zCoordinate - secondCluster.zCoordinate) /
69 (firstCluster.radius - secondCluster.radius)),
70 phi(o2::gpu::GPUCommonMath::ATan2(firstCluster.yCoordinate - secondCluster.yCoordinate,
71 firstCluster.xCoordinate - secondCluster.xCoordinate)),
72 mTime(t)
73{
74 // Nothing to do
75}
76
77GPUhdi() Tracklet::Tracklet(const int idx0, const int idx1, float tanL, float phi, const TimeEstBC& t)
78 : firstClusterIndex(idx0),
79 secondClusterIndex(idx1),
80 tanLambda(tanL),
81 phi(phi),
82 mTime(t)
83{
84 // Nothing to do
85}
86
87GPUhdi() unsigned char Tracklet::operator<(const Tracklet& t) const
88{
89 if (isEmpty()) {
90 return false;
91 }
92 return true;
93}
94
95} // namespace o2::its
96
97#endif /* TRACKINGITS_INCLUDE_TRACKLET_H_ */
void print() const
constexpr int UnusedIndex
Definition Constants.h:35
GPUhdi() int IndexTableUtils< nLayers >
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
GPUhdi() unsigned char operator<(const Tracklet &) const
GPUhd() void print() const
Definition Tracklet.h:48
const const Cluster const Cluster const TimeEstBC & t
Definition Tracklet.h:39
GPUhd() const auto &getTimeStamp() const noexcept
Definition Tracklet.h:53
const float tanL
Definition Tracklet.h:40
TimeEstBC mTime
Definition Tracklet.h:59
const float float phi
Definition Tracklet.h:40
ClassDefNV(Tracklet, 1)
GPUhdi() bool isCompatible(const Tracklet &o) const
Definition Tracklet.h:46
GPUhdDefault() Tracklet()=default
GPUhd() auto &getTimeStamp() noexcept
Definition Tracklet.h:52
GPUhdi() Tracklet(const int