1616#define GPUTPCCLUSTERREJECTION_H
1717
1818#include " GPUTPCGMMergerTypes.h"
19+ #include " GPUCommonMath.h"
1920
2021namespace o2 ::gpu
2122{
2223struct GPUTPCClusterRejection {
24+ template <class T , class S >
25+ static inline 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+
2330 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 )
31+ static constexpr inline bool GetRejectionStatus (int32_t attach, bool & physics, T* counts = nullptr , S* mev200 = nullptr )
2532 {
2633 (void )counts; // FIXME: Avoid incorrect -Wunused-but-set-parameter warning
2734 (void )mev200;
@@ -39,7 +46,6 @@ struct GPUTPCClusterRejection {
3946 }
4047 retVal = true ;
4148 } else if (attach & gputpcgmmergertypes::attachTube) {
42- protect = true ;
4349 if constexpr (C) {
4450 if (*mev200) {
4551 counts->nTube200 ++;
@@ -49,7 +55,6 @@ struct GPUTPCClusterRejection {
4955 }
5056 retVal = false ;
5157 } else if ((attach & gputpcgmmergertypes::attachGood) == 0 ) {
52- protect = true ;
5358 if constexpr (C) {
5459 counts->nRejected ++;
5560 }
@@ -60,16 +65,15 @@ struct GPUTPCClusterRejection {
6065 }
6166
6267 if (attach & gputpcgmmergertypes::attachProtect) {
63- protect = true ;
6468 retVal = false ;
6569 }
6670 return retVal;
6771 }
6872
6973 static constexpr inline bool GetIsRejected (int32_t attach)
7074 {
71- bool physics = false , protect = false ;
72- return GetProtectionStatus <false >(attach, physics, protect );
75+ bool physics = false ;
76+ return GetRejectionStatus <false >(attach, physics);
7377 }
7478};
7579} // namespace o2::gpu
0 commit comments