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
20namespace o2::gpu
21{
23 template <bool C, class T = void, class S = void>
24 static constexpr inline bool GetProtectionStatus(int32_t attach, bool& physics, bool& protect, T* counts = nullptr, S* mev200 = nullptr)
25 {
26 (void)counts; // Avoid incorrect -Wunused-but-set-parameter warning
27 (void)mev200;
28 if (attach == 0) {
29 return false;
30 } else if ((attach & gputpcgmmergertypes::attachGoodLeg) == 0) {
31 if constexpr (C) {
32 counts->nLoopers++;
33 }
34 return true;
35 } else if (attach & gputpcgmmergertypes::attachHighIncl) {
36 if constexpr (C) {
37 counts->nHighIncl++;
38 }
39 return true;
40 } else if (attach & gputpcgmmergertypes::attachTube) {
41 protect = true;
42 if constexpr (C) {
43 if (*mev200) {
44 counts->nTube200++;
45 } else {
46 counts->nTube++;
47 }
48 }
49 return false;
50 } else if ((attach & gputpcgmmergertypes::attachGood) == 0) {
51 protect = true;
52 if constexpr (C) {
53 counts->nRejected++;
54 }
55 return false;
56 } else {
57 physics = true;
58 return false;
59 }
60 }
61
62 static constexpr inline bool GetIsRejected(int32_t attach)
63 {
64 bool physics = false, protect = false;
65 return GetProtectionStatus<false>(attach, physics, protect);
66 }
67};
68} // namespace o2::gpu
69
70#endif
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
static constexpr bool GetIsRejected(int32_t attach)
static constexpr bool GetProtectionStatus(int32_t attach, bool &physics, bool &protect, T *counts=nullptr, S *mev200=nullptr)