Project
Loading...
Searching...
No Matches
GPUTPCClusterRejection.h
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.
11
14
15#ifndef GPUTPCCLUSTERREJECTION_H
16#define GPUTPCCLUSTERREJECTION_H
17
18#include "GPUTPCGMMergerTypes.h"
19#include "GPUCommonMath.h"
20
21namespace o2::gpu
22{
24 template <class T, class S>
25 GPUdi() static bool IsTrackRejected(const T& trk, const S& param)
26 {
27 return CAMath::Abs(trk.GetParam().GetQPt() * param.qptB5Scaler) > param.rec.tpc.rejectQPtB5 || trk.MergedLooper();
28 }
29
30 template <bool C, class T = void, class S = void>
31 GPUdi() static constexpr bool GetRejectionStatus(int32_t attach, bool& physics, T* counts = nullptr, S* mev200 = nullptr)
32 {
33 (void)counts; // FIXME: Avoid incorrect -Wunused-but-set-parameter warning
34 (void)mev200;
35 bool retVal = false;
36 if (attach == 0) {
37 retVal = false;
38 } else if ((attach & gputpcgmmergertypes::attachGoodLeg) == 0) {
39 if constexpr (C) {
40 counts->nLoopers++;
41 }
42 retVal = true;
43 } else if (attach & gputpcgmmergertypes::attachHighIncl) {
44 if constexpr (C) {
45 counts->nHighIncl++;
46 }
47 retVal = true;
48 } else if (attach & gputpcgmmergertypes::attachTube) {
49 if constexpr (C) {
50 if (*mev200) {
51 counts->nTube200++;
52 } else {
53 counts->nTube++;
54 }
55 }
56 retVal = false;
57 } else if ((attach & gputpcgmmergertypes::attachGood) == 0) {
58 if constexpr (C) {
59 counts->nRejected++;
60 }
61 retVal = false;
62 } else {
63 physics = true;
64 retVal = false;
65 }
66
68 retVal = false;
69 }
70 return retVal;
71 }
72
73 GPUdi() static constexpr bool GetIsRejected(int32_t attach)
74 {
75 bool physics = false;
76 return GetRejectionStatus<false>(attach, physics);
77 }
78};
79} // namespace o2::gpu
80
81#endif
int32_t retVal
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLenum GLfloat param
Definition glcorearb.h:271
GPUdi() static const expr bool GetRejectionStatus(int32_t attach
GPUdi() static bool IsTrackRejected(const T &trk