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
12
#include "
DetectorsRaw/DistSTFSenderSpec.h
"
13
#include "
Framework/ConfigContext.h
"
14
#include "
Framework/DeviceSpec.h
"
15
#include "
Framework/DataRefUtils.h
"
16
#include "
Framework/Task.h
"
17
#include "
Framework/ControlService.h
"
18
#include "
Framework/Logger.h
"
19
#include "
Headers/DataHeader.h
"
20
#include "
Headers/STFHeader.h
"
21
22
using namespace
o2::framework
;
23
using namespace
o2::header
;
24
25
namespace
o2::raw
26
{
27
28
class
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
//___________________________________________________________
41
void
DistSTFSender::run
(
ProcessingContext
& pc)
42
{
43
const
auto
& tinfo = pc.
services
().
get
<
o2::framework::TimingInfo
>();
44
STFHeader
stfHeader{tinfo.tfCounter, tinfo.firstTForbit, tinfo.
runNumber
};
45
pc.
outputs
().
snapshot
(
o2::framework::Output
{
gDataOriginFLP
,
gDataDescriptionDISTSTF
, mSubSpec}, stfHeader);
46
if
(++mTFCount >= mMaxTF) {
47
pc.
services
().
get
<
ControlService
>().
endOfStream
();
48
pc.
services
().
get
<
ControlService
>().readyToQuit(QuitRequest::Me);
49
}
50
}
51
52
//_________________________________________________________
53
DataProcessorSpec
getDistSTFSenderSpec
(
int
maxTF,
unsigned
subsp)
54
{
55
return
DataProcessorSpec
{
56
"dist-stf-sender"
,
57
Inputs
{},
58
Outputs
{
OutputSpec
{
gDataOriginFLP
,
gDataDescriptionDISTSTF
, subsp}},
59
AlgorithmSpec
{adaptFromTask<DistSTFSender>(maxTF, subsp)},
60
Options
{}};
61
}
62
63
}
// namespace o2::raw
ConfigContext.h
ControlService.h
DataHeader.h
DataRefUtils.h
DeviceSpec.h
DistSTFSenderSpec.h
sends DISTSUBTIMEFRAME messages
Logger.h
STFHeader.h
Task.h
o2::framework::ControlService
Definition
ControlService.h:40
o2::framework::DataAllocator::snapshot
void snapshot(const Output &spec, T const &object)
Definition
DataAllocator.h:325
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::raw::DistSTFSender
Definition
DistSTFSenderSpec.cxx:29
o2::raw::DistSTFSender::DistSTFSender
DistSTFSender(int m, unsigned subsp)
Definition
DistSTFSenderSpec.cxx:31
o2::raw::DistSTFSender::run
void run(ProcessingContext &ctx) final
Definition
DistSTFSenderSpec.cxx:41
m
const GLfloat * m
Definition
glcorearb.h:4066
o2::header::gDataOriginFLP
constexpr o2::header::DataOrigin gDataOriginFLP
Definition
DataHeader.h:562
o2::header::gDataDescriptionDISTSTF
constexpr o2::header::DataDescription gDataDescriptionDISTSTF
Definition
DataHeader.h:603
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::Options
std::vector< ConfigParamSpec > Options
Definition
DataProcessorSpec.h:31
o2::framework::Inputs
std::vector< InputSpec > Inputs
Definition
DataProcessorSpec.h:29
o2::framework::Outputs
std::vector< OutputSpec > Outputs
Definition
DataProcessorSpec.h:30
o2::header
O2 data header classes and API, v0.1.
Definition
DetID.h:49
o2::raw
Definition
PayloadPaginator.h:24
o2::raw::getDistSTFSenderSpec
o2::framework::DataProcessorSpec getDistSTFSenderSpec(int maxTF, unsigned subsp)
Definition
DistSTFSenderSpec.cxx:53
o2::framework::AlgorithmSpec
Definition
AlgorithmSpec.h:43
o2::framework::DataProcessorSpec
Definition
DataProcessorSpec.h:41
o2::framework::OutputSpec
Definition
OutputSpec.h:33
o2::framework::Output
Definition
Output.h:27
o2::framework::TimingInfo
Definition
TimingInfo.h:24
o2::header::STFHeader
Definition
STFHeader.h:21
o2::header::STFHeader::runNumber
std::uint32_t runNumber
Definition
STFHeader.h:24
Detectors
Raw
src
DistSTFSenderSpec.cxx
Generated on Tue Feb 25 2025 17:03:08 for Project by
1.9.8