Project
Loading...
Searching...
No Matches
o2TwoTimers.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/ConfigParamSpec.h
"
12
#include "
Framework/DataTakingContext.h
"
13
#include "
Framework/CompletionPolicyHelpers.h
"
14
#include "
Framework/DeviceSpec.h
"
15
#include "
Framework/RawDeviceService.h
"
16
#include "
Framework/ControlService.h
"
17
#include "
Framework/Configurable.h
"
18
#include "
Framework/RunningWorkflowInfo.h
"
19
#include "
Framework/CallbackService.h
"
20
#include "
Framework/RateLimiter.h
"
21
#include "
Framework/ConfigContext.h
"
22
#include <fairmq/Device.h>
23
24
#include <iostream>
25
#include <chrono>
26
#include <thread>
27
#include <vector>
28
29
using namespace
o2::framework
;
30
#include "
Framework/runDataProcessing.h
"
31
32
// This is how you can define your processing in a declarative way
33
WorkflowSpec
defineDataProcessing
(
ConfigContext
const
& specs)
34
{
35
DataProcessorSpec
timer1{
36
.
name
=
"timer1"
,
37
.inputs = {
InputSpec
{
"x"
,
"TIM"
,
"A1"
, Lifetime::Timer}},
38
.outputs = {
OutputSpec
{{
"output"
},
"TST"
,
"A1"
}},
39
.algorithm =
AlgorithmSpec
{
adaptStateless
(
40
[](
DataAllocator
& outputs,
RawDeviceService
& device,
DataTakingContext
& context,
ProcessingContext
& pcx) {
41
auto
& aData = outputs.
make
<
int
>(
OutputRef
{
"output"
}, 1);
42
LOG
(info) <<
"timer1: "
<< aData[0];
43
})},
44
.options = {
45
ConfigParamSpec
{
"some-device-param"
, VariantType::Int, 1, {
"Some device parameter"
}},
46
}};
47
DataProcessorSpec
timer2{
48
.
name
=
"timer2"
,
49
.inputs = {
InputSpec
{
"x"
,
"TIM"
,
"A1"
, Lifetime::Timer}},
50
.outputs = {
OutputSpec
{{
"output"
},
"TST"
,
"A2"
}},
51
.algorithm =
AlgorithmSpec
{
adaptStateless
(
52
[](
DataAllocator
& outputs,
RawDeviceService
& device,
DataTakingContext
& context,
ProcessingContext
& pcx) {
53
auto
& aData = outputs.
make
<
int
>(
OutputRef
{
"output"
}, 1);
54
LOG
(info) <<
"timer2: "
<< aData[0];
55
})},
56
.options = {
57
ConfigParamSpec
{
"some-device-param"
, VariantType::Int, 1, {
"Some device parameter"
}},
58
}};
59
60
return
workflow::concat
(
WorkflowSpec
{timer1, timer2});
61
}
CallbackService.h
CompletionPolicyHelpers.h
ConfigContext.h
ConfigParamSpec.h
Configurable.h
ControlService.h
DataTakingContext.h
DeviceSpec.h
RateLimiter.h
RawDeviceService.h
RunningWorkflowInfo.h
o2::framework::ConfigContext
Definition
ConfigContext.h:24
o2::framework::DataAllocator
Definition
DataAllocator.h:135
o2::framework::DataAllocator::make
decltype(auto) make(const Output &spec, Args... args)
Definition
DataAllocator.h:166
o2::framework::ProcessingContext
Definition
ProcessingContext.h:27
o2::framework::RawDeviceService
Definition
RawDeviceService.h:28
o2::framework::workflow::concat
WorkflowSpec concat(T &&t, ARGS &&... args)
Definition
WorkflowSpec.h:129
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::WorkflowSpec
std::vector< DataProcessorSpec > WorkflowSpec
Definition
HBFUtilsInitializer.h:39
o2::framework::adaptStateless
AlgorithmSpec::ProcessCallback adaptStateless(LAMBDA l)
Definition
AlgorithmSpec.h:229
defineDataProcessing
WorkflowSpec defineDataProcessing(ConfigContext const &specs)
This function hooks up the the workflow specifications into the DPL driver.
Definition
o2TwoTimers.cxx:33
runDataProcessing.h
o2::framework::AlgorithmSpec
Definition
AlgorithmSpec.h:43
o2::framework::ConfigParamSpec
Definition
ConfigParamSpec.h:31
o2::framework::DataProcessorSpec
Definition
DataProcessorSpec.h:41
o2::framework::DataProcessorSpec::name
std::string name
Definition
DataProcessorSpec.h:42
o2::framework::DataTakingContext
Definition
DataTakingContext.h:30
o2::framework::InputSpec
Definition
InputSpec.h:31
o2::framework::OutputRef
Definition
OutputRef.h:29
o2::framework::OutputSpec
Definition
OutputSpec.h:33
LOG
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
Framework
TestWorkflows
src
o2TwoTimers.cxx
Generated on Tue Feb 25 2025 23:16:41 for Project by
1.9.8