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>
17#include "Framework/Task.h"
21
22using namespace o2::framework;
23
24namespace o2
25{
26namespace globaltracking
27{
28
29class 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
42{
43 mLoops = ic.options().get<int>("max-loops");
44}
45
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) {
54 }
55}
56
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
decltype(auto) make(const Output &spec, Args... args)
ConfigParamRegistry const & options()
Definition InitContext.h:33
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
ServiceRegistryRef services()
The services registry associated with this processing context.
virtual void endOfStream(EndOfStreamContext &context)
This is invoked whenever we have an EndOfStream event.
Definition Task.h:43
~NoInpDummyOut() override=default
void run(ProcessingContext &pc) final
void init(InitContext &ic) final
GLuint counter
Definition glcorearb.h:3987
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
@ Me
Only quit this data processor.
std::vector< ConfigParamSpec > Options
framework::DataProcessorSpec getNoInpDummyOutSpec(int nloop=-1)
create a processor spec
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...