Project
Loading...
Searching...
No Matches
GPUdEdx.cxx
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#include "GPUdEdx.h"
16#include "GPUTPCGeometry.h"
17#include "GPUdEdxInfo.h"
18#include "GPUCommonAlgorithm.h"
19#include "GPUParam.h"
20
21using namespace o2::gpu;
22
23#ifndef GPUCA_GPUCODE_DEVICE
25{
26 new (this) GPUdEdx;
27}
28#endif
29
31{
32 checkSubThresh(255);
33 const int32_t truncLow = param.rec.tpc.dEdxTruncLow;
34 const int32_t truncHigh = param.rec.tpc.dEdxTruncHigh;
35 const int32_t countIROC = mNClsROC[0];
36 const int32_t countOROC1 = mNClsROC[1];
37 const int32_t countOROC2 = mNClsROC[2];
38 const int32_t countOROC3 = mNClsROC[3];
39 output.dEdxTotIROC = GetSortTruncMean(mChargeTot + countOROC3 + countOROC2 + countOROC1, countIROC, truncLow, truncHigh);
40 output.dEdxTotOROC1 = GetSortTruncMean(mChargeTot + countOROC3 + countOROC2, countOROC1, truncLow, truncHigh);
41 output.dEdxTotOROC2 = GetSortTruncMean(mChargeTot + countOROC3, countOROC2, truncLow, truncHigh);
42 output.dEdxTotOROC3 = GetSortTruncMean(mChargeTot, countOROC3, truncLow, truncHigh);
43 output.dEdxTotTPC = GetSortTruncMean(mChargeTot, mCount, truncLow, truncHigh);
44 output.dEdxMaxIROC = GetSortTruncMean(mChargeMax + countOROC3 + countOROC2 + countOROC1, countIROC, truncLow, truncHigh);
45 output.dEdxMaxOROC1 = GetSortTruncMean(mChargeMax + countOROC3 + countOROC2, countOROC1, truncLow, truncHigh);
46 output.dEdxMaxOROC2 = GetSortTruncMean(mChargeMax + countOROC3, countOROC2, truncLow, truncHigh);
47 output.dEdxMaxOROC3 = GetSortTruncMean(mChargeMax, countOROC3, truncLow, truncHigh);
48 output.dEdxMaxTPC = GetSortTruncMean(mChargeMax, mCount, truncLow, truncHigh);
49 output.NHitsIROC = countIROC - mNClsROCSubThresh[0];
50 output.NHitsSubThresholdIROC = countIROC;
51 output.NHitsOROC1 = countOROC1 - mNClsROCSubThresh[1];
52 output.NHitsSubThresholdOROC1 = countOROC1;
53 output.NHitsOROC2 = countOROC2 - mNClsROCSubThresh[2];
54 output.NHitsSubThresholdOROC2 = countOROC2;
55 output.NHitsOROC3 = countOROC3 - mNClsROCSubThresh[3];
56 output.NHitsSubThresholdOROC3 = countOROC3;
57}
58
59GPUd() float GPUdEdx::GetSortTruncMean(GPUCA_DEDX_STORAGE_TYPE* GPUrestrict() array, int32_t count, int32_t trunclow, int32_t trunchigh)
60{
61 trunclow = count * trunclow / 128;
62 trunchigh = count * trunchigh / 128;
63 if (trunclow >= trunchigh) {
64 return (0.f);
65 }
66 CAAlgo::sort(array, array + count);
67 float mean = 0;
68 for (int32_t i = trunclow; i < trunchigh; i++) {
69 mean += (float)array[i] * (1.f / scalingFactor<GPUCA_DEDX_STORAGE_TYPE>::factor);
70 }
71 return (mean / (trunchigh - trunclow));
72}
int32_t i
#define GPUrestrict()
GPUd() void GPUdEdx
Definition GPUdEdx.cxx:24
void output(const std::map< std::string, ChannelStat > &channels)
Definition rawdump.cxx:197
GLint GLsizei count
Definition glcorearb.h:399
GLenum array
Definition glcorearb.h:4274
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLenum GLfloat param
Definition glcorearb.h:271
double mean(std::vector< double >::const_iterator first, std::vector< double >::const_iterator last)
vec clear()