Project
Loading...
Searching...
No Matches
GPUDisplay.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 "GPUDisplay.h"
16#include "frontend/GPUDisplayInfo.inc"
17
18#include "GPUTPCDef.h"
19#include "HandMadeMath.h"
20
21#include <vector>
22#include <memory>
23#include <cstring>
24#include <stdexcept>
25#include <mutex>
26#include <condition_variable>
27
28#ifndef _WIN32
29#include "../utils/linux_helpers.h"
30#endif
31
32#include "GPUChainTracking.h"
33#include "GPUQA.h"
34#include "GPUTPCTrackingData.h"
35#include "GPUChainTracking.h"
36#include "GPUTPCTrack.h"
37#include "GPUTPCTracker.h"
38#include "GPUTPCGMMergedTrack.h"
39#include "GPUO2DataTypes.h"
40#include "GPUSettings.h"
41
44#include "helpers/GPUDisplayColors.inc"
45
46constexpr hmm_mat4 MY_HMM_IDENTITY = {{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}}};
47
48using namespace o2::gpu;
49
50const GPUSettingsDisplay& GPUDisplay::GetConfig(GPUChainTracking* chain)
51{
52 static GPUSettingsDisplay defaultConfig;
53 return (chain && chain->mConfigDisplay) ? *chain->mConfigDisplay : defaultConfig;
54}
55
56const GPUSettingsProcessing& GPUDisplay::GetProcessingConfig(GPUChainTracking* chain)
57{
58 static GPUSettingsProcessing defaultConfig;
59 return chain ? chain->GetProcessingSettings() : defaultConfig;
60}
61
62GPUDisplay::GPUDisplay(GPUDisplayFrontend* frontend, GPUChainTracking* chain, GPUQA* qa, const GPUParam* param, const GPUCalibObjectsConst* calib, const GPUSettingsDisplay* config, const GPUSettingsProcessing* proc) : GPUDisplayInterface(), mFrontend(frontend), mChain(chain), mConfig(config ? *config : GetConfig(chain)), mProcessingSettings(proc ? *proc : GetProcessingConfig(chain)), mQA(qa)
63{
64 mViewMatrix = std::make_unique<hmm_mat4>();
65 mModelMatrix = std::make_unique<hmm_mat4>();
66 mParam = param ? param : &mChain->GetParam();
67 mCalib = calib;
68 mCfgL = mConfig.light;
69 mCfgH = mConfig.heavy;
70 mCfgR = mConfig.renderer;
71 mBackend.reset(GPUDisplayBackend::getBackend(mConfig.displayRenderer.c_str()));
72 if (!mBackend) {
73 throw std::runtime_error("Error obtaining display backend");
74 }
75 mBackend->mDisplay = this;
76 frontend->mDisplay = this;
77 frontend->mBackend = mBackend.get();
78}
79
80void GPUDisplay::calcXYZ(const float* matrix)
81{
82 mXYZ[0] = -(matrix[0] * matrix[12] + matrix[1] * matrix[13] + matrix[2] * matrix[14]);
83 mXYZ[1] = -(matrix[4] * matrix[12] + matrix[5] * matrix[13] + matrix[6] * matrix[14]);
84 mXYZ[2] = -(matrix[8] * matrix[12] + matrix[9] * matrix[13] + matrix[10] * matrix[14]);
85
86 mAngle[0] = -asinf(matrix[6]); // Invert rotY*rotX*rotZ
87 float A = cosf(mAngle[0]);
88 if (fabsf(A) > 0.005) {
89 mAngle[1] = atan2f(-matrix[2] / A, matrix[10] / A);
90 mAngle[2] = atan2f(matrix[4] / A, matrix[5] / A);
91 } else {
92 mAngle[1] = 0; // Gimbal lock: yaw and roll rotate around the same axis, all in roll
93 mAngle[2] = atan2f(-matrix[1], matrix[0]);
94 }
95
96 mRPhiTheta[0] = sqrtf(mXYZ[0] * mXYZ[0] + mXYZ[1] * mXYZ[1] + mXYZ[2] * mXYZ[2]);
97 mRPhiTheta[1] = atan2f(mXYZ[0], mXYZ[2]);
98 mRPhiTheta[2] = atan2f(mXYZ[1], sqrtf(mXYZ[0] * mXYZ[0] + mXYZ[2] * mXYZ[2]));
99
100 createQuaternionFromMatrix(mQuat, matrix);
101
102 /*float mAngle[1] = -asinf(matrix[2]); //Calculate Y-axis angle - for rotX*rotY*rotZ
103 float C = cosf( angle_y );
104 if (fabsf(C) > 0.005) //Gimball lock?
105 {
106 mAngle[0] = atan2f(-matrix[6] / C, matrix[10] / C);
107 mAngle[2] = atan2f(-matrix[1] / C, matrix[0] / C);
108 }
109 else
110 {
111 mAngle[0] = 0; //set x-angle
112 mAngle[2] = atan2f(matrix[4], matrix[5]);
113 }*/
114}
115
116void GPUDisplay::SetCollisionFirstCluster(uint32_t collision, int32_t sector, int32_t cluster)
117{
118 mNCollissions = std::max<uint32_t>(mNCollissions, collision + 1);
119 mOverlayTFClusters.resize(mNCollissions);
120 mOverlayTFClusters[collision][sector] = cluster;
121}
122
123void GPUDisplay::mAnimationCloseAngle(float& newangle, float lastAngle)
124{
125 const float delta = lastAngle > newangle ? (2 * CAMath::Pi()) : (-2 * CAMath::Pi());
126 while (fabsf(newangle + delta - lastAngle) < fabsf(newangle - lastAngle)) {
127 newangle += delta;
128 }
129}
130void GPUDisplay::mAnimateCloseQuaternion(float* v, float lastx, float lasty, float lastz, float lastw)
131{
132 float distPos2 = (lastx - v[0]) * (lastx - v[0]) + (lasty - v[1]) * (lasty - v[1]) + (lastz - v[2]) * (lastz - v[2]) + (lastw - v[3]) * (lastw - v[3]);
133 float distNeg2 = (lastx + v[0]) * (lastx + v[0]) + (lasty + v[1]) * (lasty + v[1]) + (lastz + v[2]) * (lastz + v[2]) + (lastw + v[3]) * (lastw + v[3]);
134 if (distPos2 > distNeg2) {
135 for (int32_t i = 0; i < 4; i++) {
136 v[i] = -v[i];
137 }
138 }
139}
140
141void GPUDisplay::ResizeScene(int32_t width, int32_t height, bool init)
142{
143 if (height == 0) { // Prevent A Divide By Zero By
144 height = 1; // Making Height Equal One
145 }
146
147 mBackend->resizeScene(width, height);
148
149 if (init) {
150 mCfgC.resetScene.store(true);
151 *mViewMatrix = MY_HMM_IDENTITY;
152 *mModelMatrix = MY_HMM_IDENTITY;
153 }
154}
155
156void GPUDisplay::updateConfig()
157{
158 mBackend->setQuality();
159 mBackend->setDepthBuffer();
160}
161
162inline void GPUDisplay::drawVertices(const vboList& v, const GPUDisplayBackend::drawType t)
163{
164 mNDrawCalls += mBackend->drawVertices(v, t);
165}
166
168{
169 int32_t retVal = initFailure;
170 try {
171 if (!initFailure) {
172 retVal = InitDisplay_internal();
173 }
174 if (retVal == 0) {
175 buildConfig();
176 if (mConfig.listFrontendOptionHandling) {
177 mFrontend->listConfig();
178 }
179 }
180 } catch (const std::runtime_error& e) {
181 GPUError("%s", e.what());
182 retVal = 1;
183 }
184 mOldCfg = {mCfgH, mCfgL, mCfgR};
185 std::unique_lock lock(mFrontend->mExitStateMutex);
186 mInitResult = retVal == 0 ? 1 : -1;
187 mFrontend->mDisplayRunning = retVal == 0; // Only after successful initialization, StopDisplay waits for it to become false again
188 mFrontend->mInitCV.notify_all();
189 mFrontend->mInitCV.wait(lock, [this] { return mFrontend->mStartDisplayDone; }); // Both threads have finished their initialization
190 return (retVal);
191}
192
193int32_t GPUDisplay::InitDisplay_internal()
194{
195 mThreadBuffers.resize(getNumThreads());
196 mThreadTracks.resize(getNumThreads());
197 if (mBackend->InitBackend()) {
198 return 1;
199 }
200 mYFactor = mBackend->getYFactor();
201 int32_t height = 0, width = 0;
202 mFrontend->getSize(width, height);
203 if (height == 0 || width == 0) {
206 }
207 ResizeScene(width, height, true);
208 return 0;
209}
210
212{
213 mBackend->ExitBackend();
214}
215
217{
218 // Make sure event gets not overwritten during display
219 mSemLockDisplay.Lock();
220
221 int32_t retVal = 0;
222 if (mChain) {
223 mIOPtrs = &mChain->mIOPtrs;
224 mCalib = &mChain->GetCalib();
225 }
226 if (!mIOPtrs) {
227 mNCollissions = 0;
228 } else if (!mOverlayTFClusters.size()) {
229 mNCollissions = std::max(1u, mIOPtrs->nMCInfosTPCCol);
230 }
231 if (mCfgL.showCollision >= mNCollissions) { // Fewer collisions in the new event
232 mCfgL.showCollision = -1;
233 mUpdateDrawCommands = true;
234 }
235 try {
236 DrawGLScene_internal(suspended);
237 } catch (const std::runtime_error& e) {
238 GPUError("Runtime error %s during display", e.what());
239 retVal = 1;
240 }
241
242 if (mLoadAndShowEvent) {
243 {
244 std::lock_guard<std::mutex> lock(mMutexLoadAndShowEvent);
245 mLoadAndShowEvent = false;
246 }
247 mCVLoadAndShowEvent.notify_one();
248 mNEventsShown++;
249 }
250 mSemLockDisplay.Unlock();
251
252 return retVal;
253}
254
255void GPUDisplay::DrawGLScene_cameraAndAnimation(bool suspended, float animateTime, float& mixSlaveImage, hmm_mat4& nextViewMatrix)
256{
257 HighResTimer timer(mUpdateVertexLists && mChain->GetProcessingSettings().debugLevel >= 2);
258 int32_t mMouseWheelTmp = mFrontend->mMouseWheel;
259 if (mCfgC.showConsole && mMouseWheelTmp) { // Scrolls the console instead of zooming, one line per step (100)
260 mFrontend->mConsole->scroll(mMouseWheelTmp / 100 ? mMouseWheelTmp / 100 : (mMouseWheelTmp > 0) - (mMouseWheelTmp < 0));
261 mMouseWheelTmp = 0;
262 }
263 mFrontend->mMouseWheel = 0;
264 bool lookOrigin = mCfgR.camLookOrigin ^ mFrontend->keyMapDown(mFrontend->KEY_MAP_FOCUS_ORIGIN);
265 bool yUp = mCfgR.camYUp ^ mFrontend->keyMapDown(mFrontend->KEY_MAP_FOCUS_ORIENT_UP) ^ lookOrigin;
266 bool rotateModelTPC = mCfgO.rotateAroundZ || mFrontend->keyMapDown(mFrontend->KEY_MAP_ROTATE_AROUND_Z);
267 bool rotateModel = rotateModelTPC || mCfgO.rotateModel || mFrontend->keyMapDown(mFrontend->KEY_MAP_ROTATE_MODEL);
268
269 // Calculate rotation / translation scaling factors
270 float scalefactor = mFrontend->mKeys[mFrontend->KEY_SHIFT] ? 0.2f : 1.0f;
271 float rotatescalefactor = scalefactor * 0.25f;
272 if (mCfgL.drawSector != -1) {
273 scalefactor *= 0.2f;
274 }
275 float* const mViewMatrixP = &mViewMatrix->Elements[0][0];
276 float sqrdist = sqrtf(sqrtf(mViewMatrixP[12] * mViewMatrixP[12] + mViewMatrixP[13] * mViewMatrixP[13] + mViewMatrixP[14] * mViewMatrixP[14]) * GL_SCALE_FACTOR) * 0.8f;
277 if (sqrdist < 0.2f) {
278 sqrdist = 0.2f;
279 }
280 if (sqrdist > 5.f) {
281 sqrdist = 5.f;
282 }
283 scalefactor *= sqrdist;
284
285 // Perform new rotation / translation / animation
286
287 if (animateCamera(suspended, animateTime, mixSlaveImage, nextViewMatrix)) {
288 // Do nothing else
289 } else if (mCfgC.resetScene.load()) {
290 const float initialZpos = mCfgH.projectXY ? 16 : (mParam->par.continuousTracking ? (mMaxClusterZ * GL_SCALE_FACTOR + 8) : 8);
291 nextViewMatrix = nextViewMatrix * HMM_Translate({{0, 0, -initialZpos}});
292 *mViewMatrix = MY_HMM_IDENTITY;
293 *mModelMatrix = MY_HMM_IDENTITY;
294
295 mCfgL.pointSize = 2.0f;
296 mCfgL.lineWidth = 1.4f;
297 mCfgL.drawSector = -1;
298 mCfgL.showCollision = -1;
299 mCfgH.xzAdd = 0;
300 mCfgR.camLookOrigin = mCfgR.camYUp = false;
301 mAngleRollOrigin = -1e9f;
302 mCfgR.fov = 45.f;
303 mUpdateDrawCommands = true;
304
305 mCfgC.resetScene.store(false);
306 } else {
307 float moveZ = scalefactor * ((float)mMouseWheelTmp / 150 + (float)(mFrontend->keyMapDown(mFrontend->KEY_MAP_FORWARD) - mFrontend->keyMapDown(mFrontend->KEY_MAP_BACKWARD)) * (!mFrontend->mKeys[mFrontend->KEY_SHIFT]) * 0.2f * mFPSScale);
308 float moveY = scalefactor * ((float)(mFrontend->keyMapDown(mFrontend->KEY_MAP_STRAFE_DOWN) - mFrontend->keyMapDown(mFrontend->KEY_MAP_STRAFE_UP)) * (!mFrontend->mKeys[mFrontend->KEY_SHIFT]) * 0.2f * mFPSScale);
309 float moveX = scalefactor * ((float)(mFrontend->keyMapDown(mFrontend->KEY_MAP_STRAFE_LEFT) - mFrontend->keyMapDown(mFrontend->KEY_MAP_STRAFE_RIGHT)) * (!mFrontend->mKeys[mFrontend->KEY_SHIFT]) * 0.2f * mFPSScale);
310 float rotRoll = rotatescalefactor * mFPSScale * 2 * (mFrontend->keyMapDown(mFrontend->KEY_MAP_ROTATE_LEFT) - mFrontend->keyMapDown(mFrontend->KEY_MAP_ROTATE_RIGHT)) * (!mFrontend->mKeys[mFrontend->KEY_SHIFT]);
311 float rotYaw = rotatescalefactor * mFPSScale * 2 * (mFrontend->keyMapDown(mFrontend->KEY_MAP_ROTATE_YAW_RIGHT) - mFrontend->keyMapDown(mFrontend->KEY_MAP_ROTATE_YAW_LEFT)) * (!mFrontend->mKeys[mFrontend->KEY_SHIFT]);
312 float rotPitch = rotatescalefactor * mFPSScale * 2 * (mFrontend->keyMapDown(mFrontend->KEY_MAP_ROTATE_PITCH_DOWN) - mFrontend->keyMapDown(mFrontend->KEY_MAP_ROTATE_PITCH_UP)) * (!mFrontend->mKeys[mFrontend->KEY_SHIFT]);
313
314 float mouseScale = 1920.f / std::max<float>(1920.f, mBackend->mScreenWidth);
315 if ((mFrontend->mMouseDnR && mFrontend->mMouseDn) || mFrontend->mMouseDnM) {
316 moveZ += -scalefactor * mouseScale * ((float)mFrontend->mMouseMvY - (float)mFrontend->mMouseDnY) / 4;
317 rotRoll += -rotatescalefactor * mouseScale * ((float)mFrontend->mMouseMvX - (float)mFrontend->mMouseDnX);
318 } else if (mFrontend->mMouseDnR) {
319 moveX += scalefactor * 0.5f * mouseScale * ((float)mFrontend->mMouseDnX - (float)mFrontend->mMouseMvX) / 4;
320 moveY += scalefactor * 0.5f * mouseScale * ((float)mFrontend->mMouseMvY - (float)mFrontend->mMouseDnY) / 4;
321 } else if (mFrontend->mMouseDn) {
322 rotYaw += rotatescalefactor * mouseScale * ((float)mFrontend->mMouseMvX - (float)mFrontend->mMouseDnX);
323 rotPitch += rotatescalefactor * mouseScale * ((float)mFrontend->mMouseMvY - (float)mFrontend->mMouseDnY);
324 }
325
326 if (mFrontend->keyMapDown(mFrontend->KEY_MAP_CHANGE_ANIMATION_INTERVAL)) {
327 mCfgO.animationDelay += moveX;
328 if (mCfgO.animationDelay < 0.05f) {
329 mCfgO.animationDelay = 0.05f;
330 } else if (mCfgO.animationDelay > 20.f) {
331 mCfgO.animationDelay = 20.f;
332 }
333 moveX = 0.f;
334 moveY = 0.f;
335 SetInfo("Animation delay set to %1.2f", mCfgO.animationDelay);
336 }
337
338 if (yUp) {
339 mAngleRollOrigin = 0;
340 } else if (!lookOrigin) {
341 mAngleRollOrigin = -1e6;
342 }
343 if (lookOrigin) {
344 if (!yUp) {
345 if (mAngleRollOrigin < -1e6) {
346 mAngleRollOrigin = yUp ? 0.f : -mAngle[2];
347 }
348 mAngleRollOrigin += rotRoll;
349 nextViewMatrix = nextViewMatrix * HMM_Rotate(mAngleRollOrigin, {{0, 0, 1}});
350 float tmpX = moveX, tmpY = moveY;
351 moveX = tmpX * cosf(mAngle[2]) - tmpY * sinf(mAngle[2]);
352 moveY = tmpX * sinf(mAngle[2]) + tmpY * cosf(mAngle[2]);
353 }
354
355 const float x = mXYZ[0], y = mXYZ[1], z = mXYZ[2];
356 float r = sqrtf(x * x + +y * y + z * z);
357 float r2 = sqrtf(x * x + z * z);
358 float phi = atan2f(z, x);
359 phi += moveX * 0.1f;
360 float theta = atan2f(mXYZ[1], r2);
361 theta -= moveY * 0.1f;
362 const float max_theta = CAMath::Pi() / 2 - 0.01f;
363 if (theta >= max_theta) {
364 theta = max_theta;
365 } else if (theta <= -max_theta) {
366 theta = -max_theta;
367 }
368 if (moveZ >= r - 0.1f) {
369 moveZ = r - 0.1f;
370 }
371 r -= moveZ;
372 r2 = r * cosf(theta);
373 mXYZ[0] = r2 * cosf(phi);
374 mXYZ[2] = r2 * sinf(phi);
375 mXYZ[1] = r * sinf(theta);
376
377 if (yUp) {
378 nextViewMatrix = MY_HMM_IDENTITY;
379 }
380 nextViewMatrix = nextViewMatrix * HMM_LookAt({{mXYZ[0], mXYZ[1], mXYZ[2]}}, {{0, 0, 0}}, {{0, 1, 0}});
381 } else {
382 nextViewMatrix = nextViewMatrix * HMM_Translate({{moveX, moveY * mYFactor, moveZ}});
383 if (!rotateModel) {
384 nextViewMatrix = nextViewMatrix * cameraRotation({rotYaw, rotPitch, yUp ? 0.f : rotRoll}); // Keyboard and mouse, as rotateCamera
385 }
386 nextViewMatrix = nextViewMatrix * *mViewMatrix; // Apply previous translation / rotation
387 if (yUp) {
388 calcXYZ(&nextViewMatrix.Elements[0][0]);
389 nextViewMatrix = HMM_Rotate(mAngle[2] * 180.f / CAMath::Pi(), {{0, 0, 1}}) * nextViewMatrix;
390 }
391 if (rotateModel) {
392 if (rotYaw != 0.f) {
393 *mModelMatrix = HMM_Rotate(rotYaw, {{nextViewMatrix.Elements[0][1], nextViewMatrix.Elements[1][1], nextViewMatrix.Elements[2][1]}}) * *mModelMatrix;
394 }
395 if (rotPitch != 0.f) {
396 *mModelMatrix = HMM_Rotate(rotPitch, {{nextViewMatrix.Elements[0][0], nextViewMatrix.Elements[1][0], nextViewMatrix.Elements[2][0]}}) * *mModelMatrix;
397 }
398 if (rotRoll != 0.f) {
399 if (rotateModelTPC) {
400 *mModelMatrix = HMM_Rotate(-rotRoll, {{0, 0, 1}}) * *mModelMatrix;
401 } else {
402 *mModelMatrix = HMM_Rotate(-rotRoll, {{nextViewMatrix.Elements[0][2], nextViewMatrix.Elements[1][2], nextViewMatrix.Elements[2][2]}}) * *mModelMatrix;
403 }
404 }
405 }
406 }
407
408 // Graphichs Options
409 float minSize = 0.4f / (mCfgR.drawQualityDownsampleFSAA > 1 ? mCfgR.drawQualityDownsampleFSAA : 1);
410 int32_t deltaLine = (mFrontend->keyMapDown(mFrontend->KEY_MAP_INCREASE_WIDTH) - mFrontend->keyMapDown(mFrontend->KEY_MAP_DECREASE_WIDTH)) * mFrontend->mKeys[mFrontend->KEY_SHIFT];
411 mCfgL.lineWidth += (float)deltaLine * mFPSScale * 0.02f * mCfgL.lineWidth;
412 if (mCfgL.lineWidth < minSize) {
413 mCfgL.lineWidth = minSize;
414 }
415 if (deltaLine) {
416 SetInfo("%s line width: %f", deltaLine > 0 ? "Increasing" : "Decreasing", mCfgL.lineWidth);
417 mUpdateDrawCommands = true;
418 }
419 minSize *= 2;
420 int32_t deltaPoint = (mFrontend->keyMapDown(mFrontend->KEY_MAP_INCREASE_WIDTH) - mFrontend->keyMapDown(mFrontend->KEY_MAP_DECREASE_WIDTH)) * !mFrontend->mKeys[mFrontend->KEY_SHIFT];
421 mCfgL.pointSize += (float)deltaPoint * mFPSScale * 0.02f * mCfgL.pointSize;
422 if (mCfgL.pointSize < minSize) {
423 mCfgL.pointSize = minSize;
424 }
425 if (deltaPoint) {
426 SetInfo("%s point size: %f", deltaPoint > 0 ? "Increasing" : "Decreasing", mCfgL.pointSize);
427 mUpdateDrawCommands = true;
428 }
429 }
430
431 // Store position
432 if (animateTime < 0) {
433 *mViewMatrix = nextViewMatrix;
434 calcXYZ(&mViewMatrix->Elements[0][0]);
435 }
436
437 if (mFrontend->mMouseDn || mFrontend->mMouseDnR || mFrontend->mMouseDnM) {
438 mFrontend->mMouseDnX = mFrontend->mMouseMvX;
439 mFrontend->mMouseDnY = mFrontend->mMouseMvY;
440 }
441 if (timer.IsRunning()) {
442 GPUInfo("Display Time: Camera:\t\t%6.0f us", timer.GetCurrentElapsedTime(true) * 1e6);
443 }
444}
445
446void GPUDisplay::DrawGLScene_drawCommands()
447{
448#define LOOP_SECTOR for (int32_t iSector = (mCfgL.drawSector == -1 ? 0 : (mCfgL.drawRelatedSectors ? (mCfgL.drawSector % (NSECTORS / 4)) : mCfgL.drawSector)); iSector < NSECTORS; iSector += (mCfgL.drawSector == -1 ? 1 : (mCfgL.drawRelatedSectors ? (NSECTORS / 4) : NSECTORS)))
449#define LOOP_SECTOR2 for (int32_t iSector = (mCfgL.drawSector == -1 ? 0 : (mCfgL.drawRelatedSectors ? (mCfgL.drawSector % (NSECTORS / 4)) : mCfgL.drawSector)) % (NSECTORS / 2); iSector < NSECTORS / 2; iSector += (mCfgL.drawSector == -1 ? 1 : (mCfgL.drawRelatedSectors ? (NSECTORS / 4) : NSECTORS)))
450#define LOOP_COLLISION for (int32_t iCol = (mCfgL.showCollision == -1 ? 0 : mCfgL.showCollision); iCol < mNCollissions; iCol += (mCfgL.showCollision == -1 ? 1 : mNCollissions))
451#define LOOP_COLLISION_COL(cmd) \
452 LOOP_COLLISION \
453 { \
454 if (mCfgL.colorCollisions) { \
455 SetCollisionColor(iCol); \
456 } \
457 cmd; \
458 }
459
460 if (mCfgL.drawGrid) {
461 if (mCfgL.drawTPC) {
462 SetColorGrid();
463 LOOP_SECTOR drawVertices(mGlDLGrid[iSector], GPUDisplayBackend::LINES);
464 }
465 if (mCfgL.drawTRD) {
466 SetColorGridTRD();
467 LOOP_SECTOR2 drawVertices(mGlDLGridTRD[iSector], GPUDisplayBackend::LINES);
468 }
469 }
470 if (mCfgL.drawClusters) {
471 if (mCfgL.drawTRD) {
472 SetColorTRD();
473 mBackend->lineWidthFactor(2);
474 LOOP_SECTOR LOOP_COLLISION_COL(drawVertices(mGlDLPoints[iSector][tTRDCLUSTER][iCol], GPUDisplayBackend::LINES));
475 if (mCfgL.drawFinal && mCfgL.colorClusters) {
476 SetColorFinal();
477 }
478 LOOP_SECTOR LOOP_COLLISION_COL(drawVertices(mGlDLPoints[iSector][tTRDATTACHED][iCol], GPUDisplayBackend::LINES));
479 mBackend->lineWidthFactor(1);
480 }
481 if (mCfgL.drawTOF) {
482 SetColorTOF();
483 mBackend->pointSizeFactor(2);
484 // LOOP_SECTOR LOOP_COLLISION_COL(drawVertices(mGlDLPoints[iSector][tTOFCLUSTER][iCol], GPUDisplayBackend::POINTS));
485 drawVertices(mGlDLPoints[0][tTOFCLUSTER][0], GPUDisplayBackend::POINTS);
486 mBackend->pointSizeFactor(1);
487 }
488 if (mCfgL.drawITS) {
489 SetColorITS();
490 // LOOP_SECTOR LOOP_COLLISION_COL(drawVertices(mGlDLPoints[iSector][tITSCLUSTER][iCol], GPUDisplayBackend::POINTS));
491 drawVertices(mGlDLPoints[0][tITSCLUSTER][0], GPUDisplayBackend::POINTS);
492 }
493 if (mCfgL.drawTPC) {
494 SetColorClusters();
495 LOOP_SECTOR LOOP_COLLISION_COL(drawVertices(mGlDLPoints[iSector][tCLUSTER][iCol], GPUDisplayBackend::POINTS));
496
497 if (mCfgL.drawInitLinks) {
498 if (mCfgL.excludeClusters) {
499 goto skip1;
500 }
501 if (mCfgL.colorClusters) {
502 SetColorInitLinks();
503 }
504 }
505 LOOP_SECTOR LOOP_COLLISION_COL(drawVertices(mGlDLPoints[iSector][tINITLINK][iCol], GPUDisplayBackend::POINTS));
506
507 if (mCfgL.drawLinks) {
508 if (mCfgL.excludeClusters) {
509 goto skip1;
510 }
511 if (mCfgL.colorClusters) {
512 SetColorLinks();
513 }
514 } else {
515 SetColorClusters();
516 }
517 LOOP_SECTOR LOOP_COLLISION_COL(drawVertices(mGlDLPoints[iSector][tLINK][iCol], GPUDisplayBackend::POINTS));
518
519 if (mCfgL.drawSeeds) {
520 if (mCfgL.excludeClusters) {
521 goto skip1;
522 }
523 if (mCfgL.colorClusters) {
524 SetColorSeeds();
525 }
526 }
527 LOOP_SECTOR LOOP_COLLISION_COL(drawVertices(mGlDLPoints[iSector][tSEED][iCol], GPUDisplayBackend::POINTS));
528
529 skip1:
530 SetColorClusters();
531 if (mCfgL.drawTracklets) {
532 if (mCfgL.excludeClusters) {
533 goto skip2;
534 }
535 if (mCfgL.colorClusters) {
536 SetColorTracklets();
537 }
538 }
539 LOOP_SECTOR LOOP_COLLISION_COL(drawVertices(mGlDLPoints[iSector][tTRACKLET][iCol], GPUDisplayBackend::POINTS));
540
541 if (mCfgL.drawTracks) {
542 if (mCfgL.excludeClusters) {
543 goto skip2;
544 }
545 if (mCfgL.colorClusters) {
546 SetColorTracks();
547 }
548 }
549 LOOP_SECTOR LOOP_COLLISION_COL(drawVertices(mGlDLPoints[iSector][tSECTORTRACK][iCol], GPUDisplayBackend::POINTS));
550
551 skip2:;
552 if (mCfgL.drawExtrapolatedTracks) {
553 if (mCfgL.excludeClusters) {
554 goto skip3;
555 }
556 if (mCfgL.colorClusters) {
557 SetColorExtrapolatedTracks();
558 }
559 } else {
560 SetColorClusters();
561 }
562 LOOP_SECTOR LOOP_COLLISION_COL(drawVertices(mGlDLPoints[iSector][tEXTRAPOLATEDTRACK][iCol], GPUDisplayBackend::POINTS));
563 SetColorClusters();
564
565 if (mCfgL.drawFinal && mCfgL.propagateTracks < 2) {
566 if (mCfgL.excludeClusters) {
567 goto skip3;
568 }
569 if (mCfgL.colorClusters) {
570 SetColorFinal();
571 }
572 }
573 LOOP_SECTOR LOOP_COLLISION_COL(drawVertices(mGlDLPoints[iSector][tFINALTRACK][iCol], GPUDisplayBackend::POINTS));
574 skip3:;
575 }
576 }
577
578 if (!mCfgH.clustersOnly && mCfgL.excludeClusters != 1) {
579 if (mCfgL.drawTPC) {
580 if (mCfgL.drawInitLinks) {
581 SetColorInitLinks();
582 LOOP_SECTOR drawVertices(mGlDLLines[iSector][tINITLINK], GPUDisplayBackend::LINES);
583 }
584 if (mCfgL.drawLinks) {
585 SetColorLinks();
586 LOOP_SECTOR drawVertices(mGlDLLines[iSector][tLINK], GPUDisplayBackend::LINES);
587 }
588 if (mCfgL.drawSeeds) {
589 SetColorSeeds();
590 LOOP_SECTOR drawVertices(mGlDLLines[iSector][tSEED], GPUDisplayBackend::LINE_STRIP);
591 }
592 if (mCfgL.drawTracklets) {
593 SetColorTracklets();
594 LOOP_SECTOR drawVertices(mGlDLLines[iSector][tTRACKLET], GPUDisplayBackend::LINE_STRIP);
595 }
596 if (mCfgL.drawTracks) {
597 SetColorTracks();
598 LOOP_SECTOR drawVertices(mGlDLLines[iSector][tSECTORTRACK], GPUDisplayBackend::LINE_STRIP);
599 }
600 if (mCfgL.drawExtrapolatedTracks) {
601 SetColorExtrapolatedTracks();
602 LOOP_SECTOR drawVertices(mGlDLLines[iSector][tEXTRAPOLATEDTRACK], GPUDisplayBackend::LINE_STRIP);
603 }
604 }
605 if (mCfgL.drawFinal) {
606 SetColorFinal();
608 {
609 if (mCfgL.colorCollisions) {
610 SetCollisionColor(iCol);
611 }
612 if (mCfgL.propagateTracks < 2) {
613 drawVertices(mGlDLFinal[iSector][iCol][0], GPUDisplayBackend::LINE_STRIP);
614 }
615 if (mCfgL.propagateTracks > 0 && mCfgL.propagateTracks < 3) {
616 drawVertices(mGlDLFinal[iSector][iCol][1], GPUDisplayBackend::LINE_STRIP);
617 }
618 if (mCfgL.propagateTracks == 2) {
619 drawVertices(mGlDLFinal[iSector][iCol][2], GPUDisplayBackend::LINE_STRIP);
620 }
621 if (mCfgL.propagateTracks == 3) {
622 drawVertices(mGlDLFinal[iSector][iCol][3], GPUDisplayBackend::LINE_STRIP);
623 }
624 }
625 if (mCfgH.drawTracksAndFilter ? (mCfgH.drawTPCTracks || mCfgH.drawTRDTracks || mCfgH.drawTOFTracks) : mCfgH.drawITSTracks) {
626 drawVertices(mGlDLFinalITS, GPUDisplayBackend::LINE_STRIP);
627 }
628 }
629 if (mCfgH.markClusters || mCfgH.markAdjacentClusters || mCfgH.markFakeClusters) {
630 if (mCfgH.markFakeClusters) {
631 mBackend->pointSizeFactor(3);
632 }
633 SetColorMarked();
634 LOOP_SECTOR LOOP_COLLISION drawVertices(mGlDLPoints[iSector][tMARKED][iCol], GPUDisplayBackend::POINTS);
635 if (mCfgH.markFakeClusters) {
636 mBackend->pointSizeFactor(1);
637 }
638 }
639 }
640}
641
642void GPUDisplay::DrawGLScene_internal(bool suspended, float animateTime, bool renderToMixBuffer) // negative time = no mixing
643{
644 if (mCfgC.requestScreenshot || mCfgO.animateScreenshot) {
645 const uint32_t factor = std::max(1, mCfgR.drawQualityDownsampleFSAA) * std::max(1, mCfgR.screenshotScaleFactor);
646 if (std::max(mBackend->mScreenWidth, mBackend->mScreenHeight) * factor > mBackend->mMaxRenderSize) {
647 GPUError("Screenshot not taken: requested render size %u x %u (window x FSAA x screenshot scale) exceeds the maximum size %u x %u", mBackend->mScreenWidth * factor, mBackend->mScreenHeight * factor, mBackend->mMaxRenderSize, mBackend->mMaxRenderSize);
648 mCfgC.requestScreenshot = false;
649 mCfgO.animateScreenshot = 0;
650 }
651 }
652 const bool animateScreenshot = mCfgO.animateScreenshot && mAnimate; // Copy, the animation resets animateScreenshot in its last frame
653 const bool screenshotFrame = mCfgC.requestScreenshot || animateScreenshot; // Also for the mix pass (animateTime >= 0), which must use the same render size
654 const bool doScreenshot = screenshotFrame && animateTime < 0;
655
656 updateOptions();
657 if (animateTime < 0 && (mUpdateEventData || mCfgC.resetScene.load() || mUpdateVertexLists) && mIOPtrs) {
658 disableUnsupportedOptions();
659 }
660 if (mUpdateEventData || mUpdateVertexLists) {
661 mUpdateDrawCommands = true;
662 }
663
664 HighResTimer timerDraw(mUpdateVertexLists);
665 if (animateTime < 0 && (mUpdateEventData || mCfgC.resetScene.load()) && mIOPtrs) {
666 timerDraw.ResetStart();
667 DrawGLScene_updateEventData();
668 mTimerFPS.ResetStart();
669 mFramesDoneFPS = 0;
670 mFPSScaleadjust = 0;
671 mUpdateVertexLists = true;
672 mUpdateEventData = false;
673 }
674
675 hmm_mat4 nextViewMatrix = MY_HMM_IDENTITY;
676 float mixSlaveImage = 0.f;
677 DrawGLScene_cameraAndAnimation(suspended, animateTime, mixSlaveImage, nextViewMatrix);
678
679 // Prepare Event
680 if (mUpdateVertexLists && mIOPtrs) {
681 size_t totalVertizes = DrawGLScene_updateVertexList();
682 if (timerDraw.IsRunning()) {
683 printf("Event visualization time: %'d us (vertices %'ld / %'ld bytes)\n", (int32_t)(timerDraw.GetCurrentElapsedTime() * 1000000.), (int64_t)totalVertizes, (int64_t)(totalVertizes * sizeof(mVertexBuffer[0][0])));
684 }
685 }
686
687 if (suspended) {
688 return;
689 }
690
691 // Draw Event
692 nextViewMatrix = nextViewMatrix * *mModelMatrix;
693 const float zFar = ((mParam->par.continuousTracking ? (mMaxClusterZ * GL_SCALE_FACTOR) : 8.f) + 50.f) * 2.f;
694 const float aspect = mBackend->mRenderHeight ? (float)mBackend->mRenderWidth / (float)mBackend->mRenderHeight : 1.f; // No render size with the None backend
695 const hmm_mat4 proj = HMM_Perspective(mCfgR.fov, aspect, 0.1f, zFar);
696 if (!mBackend->prepareDraw(proj, nextViewMatrix, screenshotFrame, renderToMixBuffer, mixSlaveImage)) {
697 return; // No image available (e.g. hidden window), retry with the next frame
698 }
699 mBackend->pointSizeFactor(1);
700 mBackend->lineWidthFactor(1);
701
702 if (mUpdateDrawCommands || mBackend->backendNeedRedraw()) {
703 mNDrawCalls = 0;
704 DrawGLScene_drawCommands();
705 }
706
707 if (mCfgL.drawField) {
708 mBackend->drawField();
709 }
710
711 mUpdateDrawCommands = false;
712 mUpdateRenderPipeline = false;
713 mBackend->finishDraw(doScreenshot, renderToMixBuffer, mixSlaveImage);
714
715 if (animateTime < 0) {
716 mFramesDone++;
717 mFramesDoneFPS++;
718 double fpstime = mTimerFPS.GetCurrentElapsedTime();
719 char info[1024];
720 float fps = (double)mFramesDoneFPS / fpstime;
721 snprintf(info, 1024,
722 "FPS:%8.2f (Sector: %d, 1:Clusters %d, 2:Prelinks %d, 3:Links %d, 4:Seeds %d, 5:Tracklets %d, 6:Tracks %d, 7:GTracks %d, 8:Merger %d) (%d frames, %d draw calls) "
723 "(X %1.2f Y %1.2f Z %1.2f / R %1.2f Phi %1.1f Theta %1.1f) / Yaw %1.1f Pitch %1.1f Roll %1.1f - Size: %ux%u",
724 fps, mCfgL.drawSector, mCfgL.drawClusters, mCfgL.drawInitLinks, mCfgL.drawLinks, mCfgL.drawSeeds, mCfgL.drawTracklets, mCfgL.drawTracks, mCfgL.drawExtrapolatedTracks, mCfgL.drawFinal, mFramesDone, mNDrawCalls, mXYZ[0], mXYZ[1], mXYZ[2], mRPhiTheta[0], mRPhiTheta[1] * 180 / CAMath::Pi(),
725 mRPhiTheta[2] * 180 / CAMath::Pi(), mAngle[1] * 180 / CAMath::Pi(), mAngle[0] * 180 / CAMath::Pi(), mAngle[2] * 180 / CAMath::Pi(), mBackend->mScreenWidth, mBackend->mScreenHeight);
726 if (fpstime > 1.) {
727 if (mCfgO.printInfoText & 2) {
728 GPUInfo("%s", info);
729 }
730 if (mFPSScaleadjust++) {
731 mFPSScale = 60 / fps;
732 }
733 mTimerFPS.ResetStart();
734 mFramesDoneFPS = 0;
735 }
736
737 const float consoleFraction = consoleVerticalFraction();
738 const bool drawText = (mCfgO.printInfoText & 1) || consoleFraction > 0.f;
739 if (drawText) {
740 mBackend->updateFontScale(mFrontend->getDisplayScale());
741 mBackend->prepareText();
742 }
743 if (mCfgO.printInfoText & 1 || mCfgO.printInfoTextGUI) {
744 showInfo(info);
745 }
746 if (consoleFraction > 0.f) {
747 const bool open = mCfgC.showConsole && mConsoleTimer.GetCurrentElapsedTime() >= mConfig.internal.consoleDelay; // Cursor only when fully open
748 if (!open) {
749 mConsoleCursorTimer.Reset();
750 } else if (!mConsoleCursorTimer.IsRunning() || mConsoleCursorPos != mFrontend->mConsole->mConsoleTextPos) { // Blinking restarts visible when the cursor moves
751 mConsoleCursorTimer.ResetStart();
752 mConsoleCursorPos = mFrontend->mConsole->mConsoleTextPos;
753 }
754 const bool cursor = open && std::fmod(mConsoleCursorTimer.GetCurrentElapsedTime(), 1.0) < 0.5;
755 auto& console = *mFrontend->mConsole;
756 console.mVisibleLines = mBackend->GLDrawConsole(consoleFraction, console.mConsoleHistory, console.shownText(), cursor ? (int32_t)console.mConsoleTextPos : -1, console.mScroll);
757 }
758 if (drawText) {
759 mBackend->finishText();
760 }
761 mFrontend->mConsole->consoleLimitHistory(mConfig.internal.consoleHistorySize);
762 }
763
764 mBackend->finishFrame(doScreenshot, renderToMixBuffer, mixSlaveImage);
765 if (doScreenshot) {
766 mCfgC.requestScreenshot = false;
767 std::vector<char> pixels = mBackend->getPixels();
768 char tmpFileName[48];
769 if (animateScreenshot) {
770 snprintf(tmpFileName, 48, "%d_%05d.bmp", mAnimationExport, mAnimationFrame);
771 }
772 DoScreenshot(animateScreenshot ? (mCfgO.mscreenShotName + tmpFileName).c_str() : mScreenshotFile.c_str(), pixels);
773 }
774}
775
777{
778 if (ptrs) {
779 mIOPtrs = ptrs;
780 }
781 if (mMaxClusterZ <= 0) {
782 mCfgC.resetScene.store(true);
783 }
784 mUpdateEventData = true;
785 mLoadAndShowEvent = true;
786 mSemLockDisplay.Unlock();
787}
788
789void GPUDisplay::BlockTillNextEvent() { mSemLockDisplay.Lock(); }
790
792{
793 mSemLockDisplay.Trylock();
794 mSemLockDisplay.Unlock();
795}
796
798{
799 std::unique_lock<std::mutex> lock(mMutexLoadAndShowEvent);
800 while (mLoadAndShowEvent) {
801 mCVLoadAndShowEvent.wait(lock);
802 }
803}
804
806{
807 mLoadAndShowEvent = true;
808 return mFrontend->StartDisplay();
809}
size_t minSize
int32_t i
#define LOOP_COLLISION
#define LOOP_SECTOR2
constexpr hmm_mat4 MY_HMM_IDENTITY
#define LOOP_COLLISION_COL(cmd)
#define LOOP_SECTOR
uint32_t iSector
int32_t retVal
GPUChain * chain
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual sector
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char e
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone proc
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by factor
configStandalone Reconstruction rec_tpc float
HMM_INLINE hmm_mat4 HMM_Perspective(float FOV, float AspectRatio, float Near, float Far)
HMM_INLINE hmm_mat4 HMM_Translate(hmm_vec3 Translation)
HMM_EXTERN hmm_mat4 HMM_LookAt(hmm_vec3 Eye, hmm_vec3 Center, hmm_vec3 Up)
HMM_EXTERN hmm_mat4 HMM_Rotate(float Angle, hmm_vec3 Axis)
Definition A.h:16
void Reset()
Definition timer.cxx:108
double GetCurrentElapsedTime(bool reset=false)
Definition timer.cxx:117
int32_t IsRunning()
Definition timer.h:34
void ResetStart()
Definition timer.cxx:70
GPUTrackingInOutPointers & mIOPtrs
const GPUCalibObjectsConst & GetCalib() const
Definition GPUChain.h:65
const GPUSettingsProcessing & GetProcessingSettings() const
Definition GPUChain.h:76
const GPUParam & GetParam() const
Definition GPUChain.h:63
static GPUDisplayBackend * getBackend(const char *type)
virtual void getSize(int32_t &width, int32_t &height)
static constexpr int32_t INIT_WIDTH
bool keyMapDown(uint32_t id) const
static constexpr int32_t INIT_HEIGHT
virtual float getDisplayScale() const
std::atomic< bool > mDisplayRunning
std::condition_variable mInitCV
GPUDisplay(GPUDisplayFrontend *frontend, GPUChainTracking *chain, GPUQA *qa, const GPUParam *param=nullptr, const GPUCalibObjectsConst *calib=nullptr, const GPUSettingsDisplay *config=nullptr, const GPUSettingsProcessing *proc=nullptr)
void SetCollisionFirstCluster(uint32_t collision, int32_t sector, int32_t cluster) override
const GPUParam * param()
Definition GPUDisplay.h:87
GPUDisplayControl mCfgC
Definition GPUDisplay.h:93
int32_t StartDisplay() override
int32_t DrawGLScene(bool suspended=false)
GPUDisplayFrontend * frontend()
Definition GPUDisplay.h:89
void BlockTillNextEvent() override
int32_t InitDisplay(bool initFailure=false)
GPUDisplayOptions mCfgO
Definition GPUDisplay.h:92
void ShowNextEvent(const GPUTrackingInOutPointers *ptrs=nullptr) override
void WaitTillEventShown() override
void ResizeScene(int32_t width, int32_t height, bool init=false)
int32_t Trylock()
Definition qsem.cxx:57
int32_t Unlock()
Definition qsem.cxx:48
int32_t Lock()
Definition qsem.cxx:39
GLint GLenum GLint x
Definition glcorearb.h:403
GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble zFar
Definition glcorearb.h:4077
const GLdouble * v
Definition glcorearb.h:832
GLint GLsizei GLsizei height
Definition glcorearb.h:270
GLint GLsizei width
Definition glcorearb.h:270
GLint y
Definition glcorearb.h:270
GLint GLint GLsizei GLint GLenum GLenum const void * pixels
Definition glcorearb.h:275
GLenum GLfloat param
Definition glcorearb.h:271
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
float Elements[4][4]