Project
Loading...
Searching...
No Matches
raw-debug-workflow.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
21
22
#include <iostream>
23
#include "
Framework/WorkflowSpec.h
"
24
#include "
Framework/DataSpecUtils.h
"
25
#include "
Framework/CallbackService.h
"
26
#include "
Framework/ControlService.h
"
27
#include "
Framework/Task.h
"
28
29
#include "
Framework/ConfigParamSpec.h
"
30
#include "
Framework/CompletionPolicyHelpers.h
"
31
32
#include "
Headers/RAWDataHeader.h
"
33
#include "
DetectorsRaw/RDHUtils.h
"
34
#include "
DPLUtils/DPLRawParser.h
"
35
36
using namespace
o2::framework
;
37
38
void
customize
(std::vector<ConfigParamSpec>& workflowOptions)
39
{
40
workflowOptions.push_back(
ConfigParamSpec
{
"dataspec"
, VariantType::String,
"TF:MCH/RAWDATA"
, {
"selection string for the input data"
}});
41
}
42
43
#include "
Framework/runDataProcessing.h
"
44
45
using namespace
o2
;
46
using namespace
o2::framework
;
47
using
RDH
=
o2::header::RDHAny
;
48
49
namespace
o2
50
{
51
namespace
mch
52
{
53
namespace
raw
54
{
55
56
//=======================
57
// Data parser
58
class
DataParserTask
59
{
60
public
:
61
DataParserTask
(std::string spec) : mInputSpec(spec) {}
62
63
//_________________________________________________________________________________________________
64
void
init
(
framework::InitContext
& ic)
65
{
66
}
67
68
void
decodeBuffer
(gsl::span<const std::byte> page){};
69
70
//_________________________________________________________________________________________________
71
void
run
(
framework::ProcessingContext
& pc)
72
{
73
// get the input buffer
74
DPLRawParser
parser(pc.
inputs
(),
o2::framework::select
(mInputSpec.c_str()));
75
76
int
nRDH = 0;
77
78
const
std::byte* raw =
nullptr
;
79
for
(
auto
it = parser.
begin
(),
end
= parser.
end
(); it !=
end
; ++it) {
80
raw =
reinterpret_cast<
const
std::byte*
>
(it.raw());
81
if
(!raw) {
82
continue
;
83
}
84
85
auto
* rdh =
reinterpret_cast<
const
RDH
*
>
(raw);
86
87
if
(nRDH == 0) {
88
std::cout << std::endl
89
<<
"---------------"
<< std::endl;
90
o2::raw::RDHUtils::printRDH
(rdh);
91
//std::cout << "......." << std::endl;
92
}
93
nRDH += 1;
94
}
95
96
if
(
false
&& raw) {
97
auto
* rdh =
reinterpret_cast<
const
RDH
*
>
(raw);
98
o2::raw::RDHUtils::printRDH
(rdh);
99
}
100
std::cout <<
"---------------"
<< std::endl;
101
}
102
103
private
:
104
std::string mInputSpec;
105
};
106
107
}
// namespace raw
108
}
// namespace mch
109
}
// end namespace o2
110
111
WorkflowSpec
defineDataProcessing
(
const
ConfigContext
& config)
112
{
113
auto
inputSpec = config.
options
().
get
<std::string>(
"dataspec"
);
114
115
WorkflowSpec
specs;
116
117
o2::mch::raw::DataParserTask
task(inputSpec);
118
DataProcessorSpec
parser{
119
"RawParser"
,
120
o2::framework::select
(inputSpec.c_str()),
121
Outputs
{},
122
AlgorithmSpec
{adaptFromTask<o2::mch::raw::DataParserTask>(std::move(task))},
123
Options
{}};
124
125
specs.push_back(parser);
126
127
return
specs;
128
}
CallbackService.h
CompletionPolicyHelpers.h
ConfigParamSpec.h
ControlService.h
DPLRawParser.h
A raw page parser for DPL input.
DataSpecUtils.h
RAWDataHeader.h
Definition of the RAW Data Header.
RDHUtils.h
Task.h
WorkflowSpec.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::DPLRawParser
The parser handles transparently input in the format of raw pages.
Definition
DPLRawParser.h:68
o2::framework::DPLRawParser::end
const_iterator end() const
Definition
DPLRawParser.h:334
o2::framework::DPLRawParser::begin
const_iterator begin() const
Definition
DPLRawParser.h:329
o2::framework::InitContext
Definition
InitContext.h:25
o2::framework::ProcessingContext
Definition
ProcessingContext.h:27
o2::framework::ProcessingContext::inputs
InputRecord & inputs()
The inputs associated with this processing context.
Definition
ProcessingContext.h:37
o2::mch::raw::DataParserTask
Definition
raw-debug-workflow.cxx:59
o2::mch::raw::DataParserTask::run
void run(framework::ProcessingContext &pc)
Definition
raw-debug-workflow.cxx:71
o2::mch::raw::DataParserTask::decodeBuffer
void decodeBuffer(gsl::span< const std::byte > page)
Definition
raw-debug-workflow.cxx:68
o2::mch::raw::DataParserTask::init
void init(framework::InitContext &ic)
Definition
raw-debug-workflow.cxx:64
o2::mch::raw::DataParserTask::DataParserTask
DataParserTask(std::string spec)
Definition
raw-debug-workflow.cxx:61
end
GLuint GLuint end
Definition
glcorearb.h:469
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::WorkflowSpec
std::vector< DataProcessorSpec > WorkflowSpec
Definition
HBFUtilsInitializer.h:39
o2::framework::select
std::vector< InputSpec > select(char const *matcher="")
Definition
WorkflowSpec.cxx:152
o2::framework::Outputs
std::vector< OutputSpec > Outputs
Definition
DataProcessorSpec.h:30
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
defineDataProcessing
WorkflowSpec defineDataProcessing(const ConfigContext &config)
Definition
raw-debug-workflow.cxx:111
customize
void customize(std::vector< ConfigParamSpec > &workflowOptions)
Definition
raw-debug-workflow.cxx:38
runDataProcessing.h
Options
Definition
TreeMergerTool.cxx:26
o2::framework::AlgorithmSpec
Definition
AlgorithmSpec.h:43
o2::framework::ConfigParamSpec
Definition
ConfigParamSpec.h:31
o2::framework::DataProcessorSpec
Definition
DataProcessorSpec.h:41
o2::header::RAWDataHeaderV7
Definition
RAWDataHeader.h:71
o2::header::RDHAny
Definition
RDHAny.h:29
o2::raw::RDHUtils::printRDH
static void printRDH(const RDHv4 &rdh)
Definition
RDHUtils.cxx:26
Detectors
MUON
MCH
Workflow
src
raw-debug-workflow.cxx
Generated on Tue Feb 25 2025 23:16:24 for Project by
1.9.8