Project
Loading...
Searching...
No Matches
test_SimpleTracksED.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#include "Framework/InputSpec.h"
18#include "Framework/Logger.h"
20
21#include <DebugGUI/DebugGUI.h>
22#include <DebugGUI/Sokol3DUtils.h>
23#include <DebugGUI/imgui.h>
24
25#include <chrono>
26#include <iostream>
27#include <thread>
28
29using namespace o2::framework;
31
33{
34 return WorkflowSpec{
35 {"trackDisplay",
36 Inputs{
37 {"Collisions", "AOD", "COLLISION"}},
38 Outputs{},
40 [](CallbackService& callbacks) {
41 void* window = initGUI("A test window");
42 auto count = std::make_shared<int>(0);
43 sokol::init3DContext(window);
44
45 auto guiCallback = [count]() {
46 ImGui::Begin("Some sub-window");
47 ImGui::Text("Counter value: %i", *count);
48 ImGui::End();
49 sokol::render3D();
50 };
51 callbacks.set<CallbackService::Id::ClockTick>(
52 [count, window, guiCallback]() {
53 (*count)++; window ? pollGUI(window, guiCallback) : false; });
54 return adaptStateless([count](InputRecord& inputs, ControlService& control) {
55 auto input = inputs.get<TableConsumer>("Collisions");
56
57 o2::aod::Collisions myCollisions{{input->asArrowTable()}};
58
59 for (auto& collision : myCollisions) {
60 LOGF(info, "CollisionId %d", collision.globalIndex());
61 }
62
63 if (*count > 1000) {
64 control.readyToQuit(QuitRequest::All);
65 }
66 });
67 })}}};
68}
void readyToQuit(bool all)
Compatibility with old API.
The input API of the Data Processing Layer This class holds the inputs which are valid for processing...
decltype(auto) get(R binding, int part=0) const
std::shared_ptr< arrow::Table > asArrowTable()
Return the table in the message as a arrow::Table instance.
GLint GLsizei count
Definition glcorearb.h:399
Collisions_001 Collisions
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
AlgorithmSpec::ProcessCallback adaptStateless(LAMBDA l)
std::vector< InputSpec > Inputs
std::vector< OutputSpec > Outputs
AlgorithmSpec::InitCallback adaptStateful(LAMBDA l)
the main header struct
Definition DataHeader.h:618
WorkflowSpec defineDataProcessing(ConfigContext const &)
This function hooks up the the workflow specifications into the DPL driver.