35 GPUd()
void fillCluster(
float qtot,
float qmax, int32_t
padRow, uint8_t
sector,
float trackSnp,
float trackTgl, const
GPUParam&
param, const
GPUCalibObjectsConst&
calib,
float z,
float pad,
float relTime);
41 GPUd()
void checkSubThresh(int32_t
roc);
43 template <typename T, typename fake =
void>
45 template <typename fake>
46 struct scalingFactor<uint16_t, fake> {
47 static constexpr float factor = 4.f;
48 static constexpr float round = 0.5f;
50 template <
typename fake>
51 struct scalingFactor<float, fake> {
52 static constexpr float factor = 1.f;
53 static constexpr float round = 0.f;
55#if defined(__CUDACC__) || defined(__HIPCC__)
56 template <
typename fake>
57 struct scalingFactor<half, fake> {
58 static constexpr float factor = 1.f;
59 static constexpr float round = 0.f;
67 float mSubThreshMinTot = 0.f;
68 float mSubThreshMinMax = 0.f;
69 uint8_t mNClsROC[4] = {0};
70 uint8_t mNClsROCSubThresh[4] = {0};
95GPUdnii()
void GPUdEdx::fillCluster(
float qtot,
float qmax, int32_t padRow, uint8_t sector,
float trackSnp,
float trackTgl, const
GPUParam&
GPUrestrict()
param, const
GPUCalibObjectsConst& calib,
float z,
float pad,
float relTime)
97 if (mCount >= MAX_NCL) {
102 auto calibContainer = calib.dEdxCalibContainer;
104 const int32_t
roc =
param.tpcGeometry.GetROC(padRow);
106 float snp2 = trackSnp * trackSnp;
112 const float snp = CAMath::Abs(trackSnp);
115 const float sec2 = 1.f / (1.f - snp2);
116 const float tgl2 = trackTgl * trackTgl;
117 const float tanTheta = CAMath::Sqrt(tgl2 * sec2);
120 const uint32_t padPos = CAMath::Float2UIntRn(pad);
121 const float absRelPad = CAMath::Abs(pad - padPos);
122 const int32_t region =
param.tpcGeometry.GetRegion(padRow);
124 const float threshold = calibContainer->getZeroSupressionThreshold(sector, padRow, padPos);
125 const bool useFullGainMap = calibContainer->isUsageOfFullGainMap();
127 const float fullGainMapGain = calibContainer->getGain(sector, padRow, padPos);
128 if (useFullGainMap) {
129 qmax /= fullGainMapGain;
130 qtot /= fullGainMapGain;
132 qTotIn *= fullGainMapGain;
135 const float qMaxTopologyCorr = calibContainer->getTopologyCorrection(region,
o2::tpc::ChargeType::Max, tanTheta, snp,
z, absRelPad, relTime, threshold, qTotIn);
136 const float qTotTopologyCorr = calibContainer->getTopologyCorrection(region,
o2::tpc::ChargeType::Tot, tanTheta, snp,
z, absRelPad, relTime, threshold, qTotIn);
137 qmax /= qMaxTopologyCorr;
138 qtot /= qTotTopologyCorr;
146 qmax /= qMaxResidualCorr;
147 qtot /= qTotResidualCorr;
149 const float residualGainMapGain = calibContainer->getResidualGain(sector, padRow, padPos);
150 qmax /= residualGainMapGain;
151 qtot /= residualGainMapGain;
153 mChargeTot[mCount] = (
GPUCA_DEDX_STORAGE_TYPE)(qtot * scalingFactor<GPUCA_DEDX_STORAGE_TYPE>::factor + scalingFactor<GPUCA_DEDX_STORAGE_TYPE>::round);
154 mChargeMax[mCount++] = (
GPUCA_DEDX_STORAGE_TYPE)(qmax * scalingFactor<GPUCA_DEDX_STORAGE_TYPE>::factor + scalingFactor<GPUCA_DEDX_STORAGE_TYPE>::round);
156 if (qtot < mSubThreshMinTot) {
157 mSubThreshMinTot = qtot;
159 if (qmax < mSubThreshMinMax) {
160 mSubThreshMinMax = qmax;
164 float padlx =
param.tpcGeometry.Row2X(padRow);
165 float padly =
param.tpcGeometry.LinearPad2Y(sector, padRow, padPos);
166 o2::utils::DebugStreamer::instance()->getStreamer(
"debug_dedx",
"UPDATE") << o2::utils::DebugStreamer::instance()->getUniqueTreeName(
"tree_dedx").data()
167 <<
"qTot=" << mChargeTot[mCount - 1]
168 <<
"qMax=" << mChargeMax[mCount - 1]
169 <<
"region=" << region
170 <<
"padRow=" << padRow
171 <<
"sector=" << sector
174 <<
"tanTheta=" << tanTheta
175 <<
"trackTgl=" << trackTgl
176 <<
"sinPhi=" << trackSnp
178 <<
"absRelPad=" << absRelPad
179 <<
"relTime=" << relTime
180 <<
"threshold=" << threshold
181 <<
"qTotIn=" << qTotIn
182 <<
"qMaxTopologyCorr=" << qMaxTopologyCorr
183 <<
"qTotTopologyCorr=" << qTotTopologyCorr
184 <<
"qMaxResidualCorr=" << qMaxResidualCorr
185 <<
"qTotResidualCorr=" << qTotResidualCorr
186 <<
"residualGainMapGain=" << residualGainMapGain
187 <<
"fullGainMapGain=" << fullGainMapGain