22#ifdef GPUCA_STANDALONE
37template <
bool WEIGHT,
class T,
class S,
class U = T>
41 GPUTPCTrkLbl(
const S*
v,
float maxFake = 0.1f) : mClusterLabels(
v), mTrackMCMaxFake(maxFake) { mLabels.reserve(5); };
51 if constexpr (std::is_same<T, AliHLTTPCClusterMCWeight>::value) {
52 for (uint32_t
i = 0;
i <
sizeof(mClusterLabels[elementId]) /
sizeof(mClusterLabels[elementId].fClusterID[0]);
i++) {
53 const auto& element = mClusterLabels[elementId].fClusterID[
i];
54 if (element.fMCID >= 0) {
55 if constexpr (WEIGHT) {
56 mTotalWeight += element.fWeight;
59 for (uint32_t l = 0; l < mLabels.size(); l++) {
60 if (mLabels[l].
first.fMCID == element.fMCID) {
62 if constexpr (WEIGHT) {
63 mLabels[l].first.fWeight += element.fWeight;
70 mLabels.emplace_back(element, 1);
75 for (
const auto& element : mClusterLabels->getLabels(elementId)) {
77 for (uint32_t l = 0; l < mLabels.size(); l++) {
78 if (mLabels[l].
first == element) {
85 mLabels.emplace_back(element, 1);
91 inline U
computeLabel(
float* labelWeight =
nullptr,
float* totalWeight =
nullptr, int32_t*
maxCount =
nullptr)
93 if (mLabels.size() == 0) {
96 uint32_t bestLabelNum = 0, bestLabelCount = 0;
97 for (uint32_t
j = 0;
j < mLabels.size();
j++) {
98 if (mLabels[
j].second > bestLabelCount) {
100 bestLabelCount = mLabels[
j].second;
103 auto& bestLabel = mLabels[bestLabelNum].first;
104 if constexpr (std::is_same<T, AliHLTTPCClusterMCWeight>::value && WEIGHT) {
105 *labelWeight = bestLabel.fWeight;
106 *totalWeight = mTotalWeight;
114 if (bestLabelCount < (1.f - mTrackMCMaxFake) * mNCl) {
122 const S* mClusterLabels;
123 std::vector<std::pair<T, uint32_t>> mLabels;
124 const float mTrackMCMaxFake;
126 float mTotalWeight = 0.f;
135#ifdef GPUCA_TPC_GEOMETRY_O2
138#ifdef GPUCA_STANDALONE
147template <
bool WEIGHT = false,
class U =
void,
class T,
template <
class>
class S,
typename... Args>
148static inline auto GPUTPCTrkLbl(
const S<T>*
x, Args... args)
150 if constexpr (std::is_same<U, void>::value) {
151 return internal::GPUTPCTrkLbl<WEIGHT, T, S<T>>(
x, args...);
153 return internal::GPUTPCTrkLbl<WEIGHT, T, S<T>, U>(
x, args...);
157template <
bool WEIGHT =
false,
class U =
void,
typename... Args>
162 if constexpr (std::is_same<U, void>::value) {
163 return internal::GPUTPCTrkLbl<WEIGHT, T, S>(
x, args...);
165 return internal::GPUTPCTrkLbl<WEIGHT, T, S, U>(
x, args...);
GPUTPCTrkLbl(const GPUTPCTrkLbl &)=default
void addLabel(uint32_t elementId)
GPUTPCTrkLbl(const S *v, float maxFake=0.1f)
U computeLabel(float *labelWeight=nullptr, float *totalWeight=nullptr, int32_t *maxCount=nullptr)
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLboolean GLboolean GLboolean GLboolean a
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
GPUTPCTrkLbl_ret()=default