Project
Loading...
Searching...
No Matches
DistSTFSenderSpec.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
16#include "Framework/Task.h"
18#include "Framework/Logger.h"
19#include "Headers/DataHeader.h"
20#include "Headers/STFHeader.h"
21
22using namespace o2::framework;
23using namespace o2::header;
24
25namespace o2::raw
26{
27
28class DistSTFSender : public Task
29{
30 public:
31 DistSTFSender(int m, unsigned subsp) : mMaxTF(m), mSubSpec(subsp) {}
32 void run(ProcessingContext& ctx) final;
33
34 private:
35 int mMaxTF = 1;
36 unsigned mSubSpec = 0;
37 int mTFCount = 0;
38};
39
40//___________________________________________________________
42{
43 const auto& tinfo = pc.services().get<o2::framework::TimingInfo>();
44 STFHeader stfHeader{tinfo.tfCounter, tinfo.firstTForbit, tinfo.runNumber};
46 if (++mTFCount >= mMaxTF) {
48 pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
49 }
50}
51
52//_________________________________________________________
53DataProcessorSpec getDistSTFSenderSpec(int maxTF, unsigned subsp)
54{
55 return DataProcessorSpec{
56 "dist-stf-sender",
57 Inputs{},
59 AlgorithmSpec{adaptFromTask<DistSTFSender>(maxTF, subsp)},
60 Options{}};
61}
62
63} // namespace o2::raw
sends DISTSUBTIMEFRAME messages
void snapshot(const Output &spec, T const &object)
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
DistSTFSender(int m, unsigned subsp)
void run(ProcessingContext &ctx) final
const GLfloat * m
Definition glcorearb.h:4066
constexpr o2::header::DataOrigin gDataOriginFLP
Definition DataHeader.h:562
constexpr o2::header::DataDescription gDataDescriptionDISTSTF
Definition DataHeader.h:603
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > Inputs
std::vector< OutputSpec > Outputs
O2 data header classes and API, v0.1.
Definition DetID.h:49
o2::framework::DataProcessorSpec getDistSTFSenderSpec(int maxTF, unsigned subsp)
std::uint32_t runNumber
Definition STFHeader.h:24