18#define GPUSETTINGS_DISPLAY
19#define GPUSETTINGS_DISPLAYCONTROL
30#include <condition_variable>
44class GPUTPCGMPropagator;
72 const GPUSettingsDisplayRenderer&
cfgR()
const {
return mCfgR; }
73 const GPUSettingsDisplayLight&
cfgL()
const {
return mCfgL; }
74 const GPUSettingsDisplayHeavy&
cfgH()
const {
return mCfgH; }
75 const GPUSettingsDisplay&
cfg()
const {
return mConfig; }
97 void buildConfigKeys();
98 void buildConfigInfo();
99 void buildConfigQtGUI();
101 static constexpr int32_t NSECTORS = o2::tpc::constants::MAXSECTOR;
102 static constexpr float GL_SCALE_FACTOR = (1.f / 100.f);
104 static constexpr const int32_t N_POINTS_TYPE = 15;
105 static constexpr const int32_t N_POINTS_TYPE_TPC = 9;
106 static constexpr const int32_t N_POINTS_TYPE_TRD = 2;
107 static constexpr const int32_t N_POINTS_TYPE_TOF = 2;
108 static constexpr const int32_t N_POINTS_TYPE_ITS = 2;
109 static constexpr const int32_t N_LINES_TYPE = 7;
110 static constexpr const int32_t N_FINAL_TYPE = 4;
111 static constexpr int32_t TRACK_TYPE_ID_LIMIT = 100;
112 static const std::array<std::string, 7> ANIMATION_MODE_NAMES_SHORT, ANIMATION_MODE_NAMES_LONG;
113 enum PointTypes { tCLUSTER = 0,
119 tEXTRAPOLATEDTRACK = 6,
128 enum LineTypes { RESERVED = 0 };
132 struct threadVertexBuffer {
137 threadVertexBuffer() :
buffer()
153 struct animationVector {
155 GPUSettingsDisplayLight cfgL;
161 opengl_spline() : ma(), mb(), mc(), md(), mx() {}
163 float evaluate(
float x);
164 void setVerbose() { mVerbose =
true; }
168 bool mVerbose =
false;
171 static const GPUSettingsDisplay& GetConfig(GPUChainTracking*
chain);
172 static const GPUSettingsProcessing& GetProcessingConfig(GPUChainTracking*
chain);
174 void DrawGLScene_internal(
bool suspended,
float animateTime = -1.f,
bool renderToMixBuffer =
false);
175 void DrawGLScene_updateEventData();
176 void DrawGLScene_cameraAndAnimation(
bool suspended,
float animateTime,
float& mixSlaveImage,
hmm_mat4& nextViewMatrix);
177 size_t DrawGLScene_updateVertexList();
178 void DrawGLScene_drawCommands();
179 int32_t InitDisplay_internal();
181 void updateOptions();
182 void disableUnsupportedOptions();
184 std::string trackFilterName()
const;
186 const GPUTRDGeometry* trdGeometry();
187 const GPUTrackingInOutPointers* mIOPtrs =
nullptr;
190 template <
typename... Args>
191 void SetInfo(Args... args);
192 void PrintGLHelpText(
float colorValue);
193 void calcXYZ(
const float*);
194 void mAnimationCloseAngle(
float& newangle,
float lastAngle);
195 void mAnimateCloseQuaternion(
float*
v,
float lastx,
float lasty,
float lastz,
float lastw);
198 void SaveGLAnimation();
199 void LoadGLAnimation();
200 void takeScreenshot();
202 void setAnimationPoint();
203 void setCamera(
const float (&xyz)[3],
const float (&angles)[3]);
204 void addAnimationPoint(
const float (&xyz)[3],
const float (&angles)[3]);
205 bool lookAt(
const float (&
target)[3]);
206 void rotateCamera(
const float (&angles)[3]);
207 hmm_mat4 cameraRotation(
const float (&angles)[3])
const;
208 void resetAnimation();
209 void removeAnimationPoint(
int32_t i = -1);
210 void StopAnimation();
211 void selectAnimationPoint(
int32_t i);
212 void setAnimationPointsFromGUI(
const GPUDisplayMultiSliderValue& points);
213 void updateAnimationPointsGUI();
214 void animationPointValues(
const animationVector& p,
int32_t mode,
const float* last,
float (&vals)[8]);
216 void startAnimation();
217 int32_t animateCamera(
bool suspended,
float& animateTime,
float& mixSlaveImage,
hmm_mat4& nextViewMatrix);
218 void showInfo(
const char* info);
219 float consoleVerticalFraction();
220 void ActivateColor();
224 void SetColorClusters();
225 void SetColorInitLinks();
226 void SetColorLinks();
227 void SetColorSeeds();
228 void SetColorTracklets();
229 void SetColorTracks();
230 void SetColorExtrapolatedTracks();
231 void SetColorFinal();
233 void SetColorGridTRD();
234 void SetColorMarked();
242 vboList DrawLinks(
const GPUTPCTracker& tracker,
int32_t id,
bool dodown =
false);
243 vboList DrawSeeds(
const GPUTPCTracker& tracker);
244 vboList DrawTracklets(
const GPUTPCTracker& tracker);
245 vboList DrawTracks(
const GPUTPCTracker& tracker,
int32_t global);
247 GPUDisplay::vboList DrawFinalITS();
250 vboList DrawGrid(
const GPUTPCTracker& tracker);
252 void DoScreenshot(
const char*
filename, std::vector<char>&
pixels,
float animateTime = -1.f);
254 void createQuaternionFromMatrix(
float*
v,
const float* mat);
256 void GLPrintText(
const char*
s,
float x,
float y,
float r,
float g,
float b,
float a,
uint32_t nCharacters = 0,
bool fromBotton =
true);
259 std::unique_ptr<GPUDisplayBackend> mBackend;
260 GPUChainTracking* mChain =
nullptr;
261 const GPUParam* mParam =
nullptr;
263 const GPUSettingsDisplay& mConfig;
264 GPUSettingsDisplayLight mCfgL;
265 GPUSettingsDisplayHeavy mCfgH;
266 GPUSettingsDisplayRenderer mCfgR;
267 std::tuple<GPUSettingsDisplayHeavy, GPUSettingsDisplayLight, GPUSettingsDisplayRenderer> mOldCfg;
268 const GPUSettingsProcessing& mProcessingSettings;
271 qSem mSemLockDisplay;
272 std::mutex mMutexLoadAndShowEvent;
273 std::condition_variable mCVLoadAndShowEvent;
279 bool mUseMultiVBO =
false;
281 std::array<float, 4> mDrawColor = {1.f, 1.f, 1.f, 1.f};
283 float mAngleRollOrigin = -1e9;
284 float mMaxClusterZ = -1;
286 std::unique_ptr<hmm_mat4> mViewMatrix, mModelMatrix;
298 std::vector<std::array<uint32_t, N_POINTS_TYPE_TPC>> mClusterBufferSizeCache[NSECTORS];
300 std::unique_ptr<float4[]> mGlobalPosPtr;
301 std::unique_ptr<float4[]> mGlobalPosPtrTRD;
302 std::unique_ptr<float4[]> mGlobalPosPtrTRD2;
303 std::unique_ptr<float4[]> mGlobalPosPtrITS;
304 std::unique_ptr<float4[]> mGlobalPosPtrTOF;
311 int32_t mNMaxSpacePointsTRD = 0;
315 int32_t mCurrentSpacePointsTRD = 0;
316 int32_t mCurrentClustersITS = 0;
317 int32_t mCurrentClustersTOF = 0;
320 std::vector<bool> mTrackFilter;
322 volatile bool mUpdateTrackFilter =
false;
323 std::string mTrackFilterMacroLoaded;
324 bool mUpdateGUIOptions =
false;
325 volatile bool mUpdateVertexLists =
true;
326 volatile bool mUpdateEventData =
false;
327 volatile bool mUpdateDrawCommands =
true;
328 volatile bool mUpdateRenderPipeline =
false;
329 volatile bool mLoadAndShowEvent =
false;
331 bool mTracksArePropagated =
false;
336 int32_t mAnimationLastBase = 0;
337 int32_t mAnimationMixBase = -1;
340 std::vector<std::array<opengl_spline, 8>> mAnimationSplines;
342 char mInfoText2[1024];
343 std::string mGUIInfoStatus;
344 std::string mGUIInfoText;
346 HighResTimer mInfoText2Timer, mInfoHelpTimer, mConsoleTimer;
349 bool mConsoleShown =
false;
351 std::vector<threadVertexBuffer> mThreadBuffers;
352 std::vector<std::vector<std::array<std::array<vecpod<int32_t>, 2>, NSECTORS>>> mThreadTracks;
355 float mFPSScale = 1, mFPSScaleadjust = 0;
356 int32_t mFramesDone = 0, mFramesDoneFPS = 0;
358 vboList mGlDLLines[NSECTORS][N_LINES_TYPE];
360 vboList mGlDLFinalITS;
362 vboList mGlDLGrid[NSECTORS];
363 vboList mGlDLGridTRD[NSECTORS / 2];
365 std::string mScreenshotFile;
367 float mYFactor = 1.0f;
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 s
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 Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_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 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
std::tuple< uint32_t, uint32_t, int32_t > vboList
const GPUSettingsDisplayLight & cfgL() const
void SetCollisionFirstCluster(uint32_t collision, int32_t sector, int32_t cluster) override
const GPUSettingsDisplayHeavy & cfgH() const
~GPUDisplay() override=default
int32_t updateRenderPipeline() const
void UpdateCalib(const GPUCalibObjectsConst *calib) override
const GPUSettingsDisplayRenderer & cfgR() const
friend class GPUDisplayFrontend
vecpod< vtx > * vertexBuffer()
GPUDisplay(const GPUDisplay &)=delete
int32_t StartDisplay() override
int32_t DrawGLScene(bool suspended=false)
int32_t & drawTextFontSize()
void UpdateParam(const GPUParam *param) override
int32_t updateDrawCommands() const
GPUDisplayFrontend * frontend()
const vecpod< uint32_t > * vertexBufferCount() const
const GPUSettingsDisplay & cfg() const
void BlockTillNextEvent() override
int32_t InitDisplay(bool initFailure=false)
void ShowNextEvent(const GPUTrackingInOutPointers *ptrs=nullptr) override
void HandleKey(uint8_t key, bool external=false, bool bypassConsole=false)
vecpod< int32_t > * vertexBufferStart()
GPUDisplayBackend * backend() const
void HandleExternalGUIKey(int32_t key, bool bypassConsole=false)
void WaitTillEventShown() override
void ResizeScene(int32_t width, int32_t height, bool init=false)
void checkAndApplyConfigChanges()
const GPUSettingsProcessing & GetProcessingSettings() const
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean b
GLint GLint GLsizei GLint GLenum GLenum const void * pixels
GLboolean GLboolean GLboolean GLboolean a
GLdouble GLdouble GLdouble z
ConcreteParserVariants< PageSize, BOUNDS_CHECKS > create(T const *buffer, size_t size)
create a raw parser depending on version of RAWDataHeader found at beginning of data
std::vector< InputSpec > select(char const *matcher="")
GPUCalibObjectsTemplate< ConstPtr > GPUCalibObjectsConst
vtx(float a, float b, float c)
typename std::vector< T, vecpod_allocator< T > > vecpod