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