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 mParam->par.earlyTpcTransform = 0;
34 if (mConfig->configProcessing.runMC) {
35 mQA.reset(new GPUQA(nullptr, &config->configQA, mParam.get()));
36 mQA->InitO2MCData();
37 }
38 mDisplay.reset(GPUDisplayInterface::getDisplay(mFrontend.get(), nullptr, mQA.get(), mParam.get(), &mConfig->configCalib, &mConfig->configDisplay));
39}
40
42
44{
45 int32_t retVal = mDisplay->StartDisplay();
46 if (retVal) {
47 return retVal;
48 }
49 mDisplay->WaitForNextEvent();
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 do {
63 usleep(10000);
64 } while (mFrontend->getDisplayControl() == 0);
65 if (mFrontend->getDisplayControl() == 2) {
66 return 1;
67 }
68 mFrontend->setDisplayControl(0);
69 mDisplay->WaitForNextEvent();
70 return 0;
71}
72
74{
75 mFrontend->DisplayExit();
76 return 0;
77}
78
80{
81 mDisplay->UpdateCalib(calib);
82}
83
85{
86 mConfig->configGRP = *grp;
87 mParam->UpdateSettings(&mConfig->configGRP);
88 mDisplay->UpdateParam(mParam.get());
89 if (mConfig->configProcessing.runMC) {
90 mQA->UpdateParam(mParam.get());
91 }
92}
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)
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