Project
Loading...
Searching...
No Matches
NoInpDummyOutSpec.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
13
14
#include <vector>
15
#include "
GlobalTrackingWorkflowHelpers/NoInpDummyOutSpec.h
"
16
#include "
Framework/ConfigParamRegistry.h
"
17
#include "
Framework/Task.h
"
18
#include "
Framework/CCDBParamSpec.h
"
19
#include "
Framework/ControlService.h
"
20
#include "
Framework/DeviceSpec.h
"
21
22
using namespace
o2::framework
;
23
24
namespace
o2
25
{
26
namespace
globaltracking
27
{
28
29
class
NoInpDummyOut
:
public
Task
30
{
31
public
:
32
NoInpDummyOut
() =
default
;
33
~NoInpDummyOut
()
override
=
default
;
34
void
init
(
InitContext
& ic)
final
;
35
void
run
(
ProcessingContext
& pc)
final
;
36
37
private
:
38
int
mLoops = -1;
39
};
40
41
void
NoInpDummyOut::init
(
InitContext
& ic)
42
{
43
mLoops = ic.
options
().
get
<
int
>(
"max-loops"
);
44
}
45
46
void
NoInpDummyOut::run
(
ProcessingContext
& pc)
47
{
48
static
int
counter
= 0;
49
// send just once dummy output to trigger the ccdb-fetcher
50
pc.
outputs
().
make
<std::vector<char>>(
Output
{
"GLO"
,
"DUMMY_OUT"
, 0});
51
if
(mLoops >= 0 && ++
counter
>= mLoops) {
52
pc.
services
().
get
<
o2::framework::ControlService
>().
endOfStream
();
53
pc.
services
().
get
<
o2::framework::ControlService
>().readyToQuit(
framework::QuitRequest::Me
);
54
}
55
}
56
57
DataProcessorSpec
getNoInpDummyOutSpec
(
int
nloop)
58
{
59
std::vector<OutputSpec> outputs = {{
"GLO"
,
"DUMMY_OUT"
, 0, Lifetime::Timeframe}};
60
return
DataProcessorSpec
{
61
"no-inp-dummy-out"
,
62
{},
63
outputs,
64
AlgorithmSpec
{adaptFromTask<NoInpDummyOut>()},
65
Options
{
ConfigParamSpec
{
"max-loops"
, VariantType::Int, nloop, {
"max number of loops"
}}}};
66
}
67
68
}
// namespace globaltracking
69
}
// namespace o2
CCDBParamSpec.h
ConfigParamRegistry.h
ControlService.h
DeviceSpec.h
NoInpDummyOutSpec.h
Task.h
o2::framework::ConfigParamRegistry::get
T get(const char *key) const
Definition
ConfigParamRegistry.h:98
o2::framework::ControlService
Definition
ControlService.h:40
o2::framework::DataAllocator::make
decltype(auto) make(const Output &spec, Args... args)
Definition
DataAllocator.h:166
o2::framework::InitContext
Definition
InitContext.h:25
o2::framework::InitContext::options
ConfigParamRegistry const & options()
Definition
InitContext.h:33
o2::framework::ProcessingContext
Definition
ProcessingContext.h:27
o2::framework::ProcessingContext::outputs
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
Definition
ProcessingContext.h:41
o2::framework::ProcessingContext::services
ServiceRegistryRef services()
The services registry associated with this processing context.
Definition
ProcessingContext.h:39
o2::framework::ServiceRegistryRef::get
T & get() const
Definition
ServiceRegistryRef.h:85
o2::framework::Task
Definition
Task.h:32
o2::framework::Task::endOfStream
virtual void endOfStream(EndOfStreamContext &context)
This is invoked whenever we have an EndOfStream event.
Definition
Task.h:43
o2::globaltracking::NoInpDummyOut
Definition
NoInpDummyOutSpec.cxx:30
o2::globaltracking::NoInpDummyOut::~NoInpDummyOut
~NoInpDummyOut() override=default
o2::globaltracking::NoInpDummyOut::NoInpDummyOut
NoInpDummyOut()=default
o2::globaltracking::NoInpDummyOut::run
void run(ProcessingContext &pc) final
Definition
NoInpDummyOutSpec.cxx:46
o2::globaltracking::NoInpDummyOut::init
void init(InitContext &ic) final
Definition
NoInpDummyOutSpec.cxx:41
counter
GLuint counter
Definition
glcorearb.h:3987
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::QuitRequest::Me
@ Me
Only quit this data processor.
o2::framework::Options
std::vector< ConfigParamSpec > Options
Definition
DataProcessorSpec.h:31
o2::globaltracking::getNoInpDummyOutSpec
framework::DataProcessorSpec getNoInpDummyOutSpec(int nloop=-1)
create a processor spec
Definition
NoInpDummyOutSpec.cxx:57
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
o2::framework::AlgorithmSpec
Definition
AlgorithmSpec.h:43
o2::framework::ConfigParamSpec
Definition
ConfigParamSpec.h:31
o2::framework::DataProcessorSpec
Definition
DataProcessorSpec.h:41
o2::framework::Output
Definition
Output.h:27
Detectors
GlobalTrackingWorkflow
helpers
src
NoInpDummyOutSpec.cxx
Generated on Tue Feb 25 2025 17:02:58 for Project by
1.9.8