Project
Loading...
Searching...
No Matches
o2NullSink.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/ConfigContext.h
"
12
#include "
Framework/ControlService.h
"
13
#include "
Framework/DataProcessorSpec.h
"
14
#include "
Framework/DataSpecUtils.h
"
15
#include "
Framework/Logger.h
"
16
#include "
Framework/ParallelContext.h
"
17
#include "
Framework/DataDescriptorQueryBuilder.h
"
18
19
#include <chrono>
20
#include <thread>
21
#include <vector>
22
25
using namespace
o2::framework
;
26
27
void
customize
(std::vector<ConfigParamSpec>& options)
28
{
29
options.push_back(
o2::framework::ConfigParamSpec
{
"name"
, VariantType::String,
"null"
, {
"name for the dataprocessor"
}});
30
options.push_back(
o2::framework::ConfigParamSpec
{
"dataspec"
, VariantType::String,
""
, {
"inputs for the dataprocessor"
}});
31
};
32
33
#include "
Framework/runDataProcessing.h
"
34
35
// This is a simple consumer / producer workflow where both are
36
// stateful, i.e. they have context which comes from their initialization.
37
WorkflowSpec
defineDataProcessing
(
ConfigContext
const
& context)
38
{
39
WorkflowSpec
workflow;
40
// This is an example of how we can parallelize by subSpec.
41
// templatedProducer will be instanciated 32 times and the lambda function
42
// passed to the parallel statement will be applied to each one of the
43
// instances in order to modify it. Parallel will also make sure the name of
44
// the instance is amended from "some-producer" to "some-producer-<index>".
45
auto
name
= context.
options
().
get
<std::string>(
"name"
);
46
auto
inputsDesc = context.
options
().
get
<std::string>(
"dataspec"
);
47
auto
inputs =
DataDescriptorQueryBuilder::parse
(inputsDesc.c_str());
48
49
workflow.push_back(
DataProcessorSpec
{
50
name
,
51
inputs,
52
{},
53
AlgorithmSpec
{[](
ProcessingContext
& ctx) {}}});
54
55
return
workflow;
56
}
ConfigContext.h
ControlService.h
DataDescriptorQueryBuilder.h
DataProcessorSpec.h
DataSpecUtils.h
Logger.h
ParallelContext.h
o2::framework::ConfigContext
Definition
ConfigContext.h:24
o2::framework::ConfigContext::options
ConfigParamRegistry & options() const
Definition
ConfigContext.h:28
o2::framework::ConfigParamRegistry::get
T get(const char *key) const
Definition
ConfigParamRegistry.h:98
o2::framework::ProcessingContext
Definition
ProcessingContext.h:27
name
GLuint const GLchar * name
Definition
glcorearb.h:781
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::WorkflowSpec
std::vector< DataProcessorSpec > WorkflowSpec
Definition
HBFUtilsInitializer.h:39
defineDataProcessing
WorkflowSpec defineDataProcessing(ConfigContext const &context)
This function hooks up the the workflow specifications into the DPL driver.
Definition
o2NullSink.cxx:37
customize
void customize(std::vector< ConfigParamSpec > &options)
Definition
o2NullSink.cxx:27
runDataProcessing.h
o2::framework::AlgorithmSpec
Definition
AlgorithmSpec.h:43
o2::framework::ConfigParamSpec
Definition
ConfigParamSpec.h:31
o2::framework::DataDescriptorQueryBuilder::parse
static std::vector< InputSpec > parse(const char *s="")
Definition
DataDescriptorQueryBuilder.cxx:55
o2::framework::DataProcessorSpec
Definition
DataProcessorSpec.h:41
Framework
Core
src
o2NullSink.cxx
Generated on Tue Feb 25 2025 23:16:40 for Project by
1.9.8