Project
Loading...
Searching...
No Matches
read-raw-file-stream-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
17
18
#include "
Framework/WorkflowSpec.h
"
19
#include "
Framework/DataSpecUtils.h
"
20
#include "
Framework/CallbackService.h
"
21
#include "
Framework/ControlService.h
"
22
#include "
Framework/Task.h
"
23
#include "
Framework/CompletionPolicy.h
"
24
#include "
Framework/CompletionPolicyHelpers.h
"
25
#include "
Framework/DispatchPolicy.h
"
26
#include "
Framework/DataProcessorSpec.h
"
27
#include "
Framework/InputRecordWalker.h
"
28
#include "
Framework/Logger.h
"
29
#include "
Framework/ConfigParamSpec.h
"
30
#include "
Framework/Variant.h
"
31
#include "
CommonUtils/ConfigurableParam.h
"
32
33
// customize dispatch policy, dispatch immediately what is ready
34
void
customize
(std::vector<o2::framework::DispatchPolicy>& policies)
35
{
36
using
DispatchOp =
o2::framework::DispatchPolicy::DispatchOp
;
37
// we customize all devices to dispatch data immediately
38
auto
readerMatcher = [](
auto
const
& spec) {
39
//
40
// std::cout << "customize reader = " << spec.name << std::endl;
41
// std::cout << "PingReader" << std::endl;
42
return
true
;
43
// return std::regex_match(spec.name.begin(), spec.name.end(), std::regex(".*-reader"));
44
};
45
auto
triggerMatcher = [](
auto
const
& query) {
46
// a bit of a hack but we want this to be configurable from the command line,
47
// however DispatchPolicy is inserted before all other setup. Triggering depending
48
// on the global variable set from the command line option. If scheduled messages
49
// are not triggered they are sent out at the end of the computation
50
// std::cout << "customize Trigger origin = " << query.origin << " description = " << query.description << std::endl;
51
// std::cout << "PingTrig" << std::endl;
52
return
true
;
53
// return gDispatchTrigger.origin == query.origin && gDispatchTrigger.description == query.description;
54
};
55
policies.push_back({
"pr-f-re"
, readerMatcher, DispatchOp::WhenReady, triggerMatcher});
56
}
57
58
// we need to add workflow options before including Framework/runDataProcessing
59
void
customize
(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
60
{
61
std::string keyvaluehelp(
"Semicolon separated key=value strings ..."
);
62
workflowOptions.push_back(
o2::framework::ConfigParamSpec
{
"configKeyValues"
,
o2::framework::VariantType::String
,
""
, {keyvaluehelp}});
63
}
64
65
#include "
Framework/runDataProcessing.h
"
66
#include "
HMPIDWorkflow/ReadRawFileSpec.h
"
67
68
using namespace
o2
;
69
using namespace
o2::framework
;
70
71
WorkflowSpec
defineDataProcessing
(
const
ConfigContext
& cx)
72
{
73
WorkflowSpec
specs;
74
o2::conf::ConfigurableParam::updateFromString
(cx.
options
().
get
<std::string>(
"configKeyValues"
));
75
// The producer to generate some data in the workflow
76
DataProcessorSpec
producer =
o2::hmpid::getReadRawFileSpec
();
77
specs.push_back(producer);
78
return
specs;
79
}
CallbackService.h
CompletionPolicyHelpers.h
CompletionPolicy.h
ConfigParamSpec.h
ConfigurableParam.h
ControlService.h
DataProcessorSpec.h
DataSpecUtils.h
DispatchPolicy.h
InputRecordWalker.h
A helper class to iteratate over all parts of all input routes.
Logger.h
ReadRawFileSpec.h
Task.h
Variant.h
WorkflowSpec.h
o2::conf::ConfigurableParam::updateFromString
static void updateFromString(std::string const &)
Definition
ConfigurableParam.cxx:433
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
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::VariantType::String
@ String
o2::framework::WorkflowSpec
std::vector< DataProcessorSpec > WorkflowSpec
Definition
HBFUtilsInitializer.h:39
o2::hmpid::getReadRawFileSpec
o2::framework::DataProcessorSpec getReadRawFileSpec(std::string inputSpec="HMP/RAWDATA")
Definition
ReadRawFileSpec.cxx:135
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
customize
void customize(std::vector< o2::framework::DispatchPolicy > &policies)
Definition
read-raw-file-stream-workflow.cxx:34
defineDataProcessing
WorkflowSpec defineDataProcessing(const ConfigContext &cx)
Definition
read-raw-file-stream-workflow.cxx:71
runDataProcessing.h
o2::framework::ConfigParamSpec
Definition
ConfigParamSpec.h:31
o2::framework::DataProcessorSpec
Definition
DataProcessorSpec.h:41
o2::framework::DispatchPolicy::DispatchOp
DispatchOp
Definition
DispatchPolicy.h:32
Detectors
HMPID
workflow
src
read-raw-file-stream-workflow.cxx
Generated on Fri Apr 11 2025 11:41:27 for Project by
1.9.8