Project
Loading...
Searching...
No Matches
GPUO2InterfaceDisplay.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 "GPUParam.h"
17#include "GPUQA.h"
20#include <unistd.h>
21
22using namespace o2::gpu;
23using namespace o2::tpc;
24
26{
27 mConfig.reset(new GPUO2InterfaceConfiguration(*config));
28 mFrontend.reset(GPUDisplayFrontendInterface::getFrontend(mConfig->configDisplay.displayFrontend.c_str()));
29 mConfig->configProcessing.eventDisplay = mFrontend.get();
30 mConfig->configDisplay.showTPCTracksFromO2Format = true;
31 mParam.reset(new GPUParam);
32 mParam->SetDefaults(&config->configGRP, &config->configReconstruction, &config->configProcessing, nullptr);
33 if (mConfig->configProcessing.runMC) {
34 mQA.reset(new GPUQA(nullptr, &config->configQA, mParam.get()));
35 mQA->InitO2MCData();
36 }
37 mDisplay.reset(GPUDisplayInterface::getDisplay(mFrontend.get(), nullptr, mQA.get(), mParam.get(), &mConfig->configCalib, &mConfig->configDisplay, &mConfig->configProcessing));
38}
39
41
43{
44 int32_t retVal = mDisplay->StartDisplay();
45 if (retVal) {
46 return retVal;
47 }
48 mDisplay->WaitTillEventShown();
49 mDisplay->BlockTillNextEvent();
50 return 0;
51}
52
54{
55 std::unique_ptr<GPUTrackingInOutPointers> tmpPtr;
56 if (mConfig->configProcessing.runMC) {
57 tmpPtr = std::make_unique<GPUTrackingInOutPointers>(*ptrs);
58 mQA->InitO2MCData(tmpPtr.get());
59 ptrs = tmpPtr.get();
60 }
61 mDisplay->ShowNextEvent(ptrs);
62 mDisplay->WaitTillEventShown();
63 do {
64 usleep(10000);
65 } while (mFrontend->getDisplayControl() == 0);
66 if (mFrontend->getDisplayControl() == 2) {
67 return 1;
68 }
69 mFrontend->setDisplayControl(0);
70 mDisplay->BlockTillNextEvent();
71 return 0;
72}
73
75{
76 mFrontend->DisplayExit();
77 return 0;
78}
79
81{
82 mDisplay->UpdateCalib(calib);
83}
84
86{
87 mConfig->configGRP = *grp;
88 mParam->UpdateSettings(&mConfig->configGRP);
89 mDisplay->UpdateParam(mParam.get());
90 if (mConfig->configProcessing.runMC) {
91 mQA->UpdateParam(mParam.get());
92 }
93}
int32_t retVal
static GPUDisplayFrontendInterface * getFrontend(const char *type)
static GPUDisplayInterface * getDisplay(GPUDisplayFrontendInterface *frontend, GPUChainTracking *chain, GPUQA *qa, const GPUParam *param=nullptr, const GPUCalibObjectsConst *calib=nullptr, const GPUSettingsDisplay *config=nullptr, const GPUSettingsProcessing *proc=nullptr)
int32_t show(const GPUTrackingInOutPointers *ptrs)
GPUO2InterfaceDisplay(const GPUO2InterfaceConfiguration *config=nullptr)
void UpdateCalib(const GPUCalibObjectsConst *calib)
void UpdateGRP(const GPUSettingsGRP *grp)
Global TPC definitions and constants.
Definition SimTraits.h:167