Project
Loading...
Searching...
No Matches
decoded-digits-writer-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
16
17
#include <string>
18
#include <vector>
19
#include "
Framework/Variant.h
"
20
#include "
Framework/ConfigParamSpec.h
"
21
#include "
Framework/CompletionPolicyHelpers.h
"
22
23
using namespace
o2::framework
;
24
25
// we need to add workflow options before including Framework/runDataProcessing
26
void
customize
(std::vector<ConfigParamSpec>& workflowOptions)
27
{
28
std::vector<ConfigParamSpec>
29
options{
30
{
"mid-digits-output-filename"
, VariantType::String,
"mid-digits-decoded.root"
, {
"Decoded digits output file"
}},
31
{
"mid-digits-tree-name"
, VariantType::String,
"middigits"
, {
"Name of tree in digits file"
}}};
32
workflowOptions.insert(workflowOptions.end(), options.begin(), options.end());
33
}
34
35
void
customize
(std::vector<o2::framework::CompletionPolicy>& policies)
36
{
37
// ordered policies for the writers
38
policies.push_back(
CompletionPolicyHelpers::consumeWhenAllOrdered
(
".*(?:MID|mid).*[W,w]riter.*"
));
39
}
40
41
#include "
Framework/runDataProcessing.h
"
42
#include "
DPLUtils/MakeRootTreeWriterSpec.h
"
43
#include "
DataFormatsMID/ColumnData.h
"
44
#include "
DataFormatsMID/ROFRecord.h
"
45
46
WorkflowSpec
defineDataProcessing
(
ConfigContext
const
& cfgc)
47
{
48
auto
outputFilename = cfgc.
options
().
get
<std::string>(
"mid-digits-output-filename"
);
49
auto
treeFilename = cfgc.
options
().
get
<std::string>(
"mid-digits-tree-name"
);
50
WorkflowSpec
specs;
51
specs.emplace_back(
MakeRootTreeWriterSpec
(
"MIDDigitWriter"
,
52
outputFilename.c_str(),
53
treeFilename.c_str(),
54
-1,
55
MakeRootTreeWriterSpec::BranchDefinition<std::vector<o2::mid::ColumnData>
>{
InputSpec
{
"mid_data"
,
o2::header::gDataOriginMID
,
"DATA"
, 0},
"MIDDigit"
},
56
MakeRootTreeWriterSpec::BranchDefinition<std::vector<o2::mid::ColumnData>
>{
InputSpec
{
"mid_data_1"
,
o2::header::gDataOriginMID
,
"DATA"
, 1},
"MIDNoise"
},
57
MakeRootTreeWriterSpec::BranchDefinition<std::vector<o2::mid::ColumnData>
>{
InputSpec
{
"mid_data_2"
,
o2::header::gDataOriginMID
,
"DATA"
, 2},
"MIDDead"
},
58
MakeRootTreeWriterSpec::BranchDefinition<std::vector<o2::mid::ROFRecord>
>{
InputSpec
{
"mid_data_rof"
,
o2::header::gDataOriginMID
,
"DATAROF"
, 0},
"MIDROFRecords"
},
59
MakeRootTreeWriterSpec::BranchDefinition<std::vector<o2::mid::ROFRecord>
>{
InputSpec
{
"mid_data_rof_1"
,
o2::header::gDataOriginMID
,
"DATAROF"
, 1},
"MIDROFRecordsNoise"
},
60
MakeRootTreeWriterSpec::BranchDefinition<std::vector<o2::mid::ROFRecord>
>{
InputSpec
{
"mid_data_rof_2"
,
o2::header::gDataOriginMID
,
"DATAROF"
, 2},
"MIDROFRecordsDead"
})());
61
62
return
specs;
63
}
ColumnData.h
Strip pattern (aka digits)
CompletionPolicyHelpers.h
ConfigParamSpec.h
ROFRecord.h
Definition of the MID event record.
MakeRootTreeWriterSpec.h
Configurable generator for RootTreeWriter processor spec.
Variant.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::MakeRootTreeWriterSpec
Generate a processor spec for the RootTreeWriter utility.
Definition
MakeRootTreeWriterSpec.h:196
defineDataProcessing
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
Definition
decoded-digits-writer-workflow.cxx:46
customize
void customize(std::vector< ConfigParamSpec > &workflowOptions)
Definition
decoded-digits-writer-workflow.cxx:26
o2::header::gDataOriginMID
constexpr o2::header::DataOrigin gDataOriginMID
Definition
DataHeader.h:573
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::WorkflowSpec
std::vector< DataProcessorSpec > WorkflowSpec
Definition
HBFUtilsInitializer.h:39
runDataProcessing.h
o2::framework::CompletionPolicyHelpers::consumeWhenAllOrdered
static CompletionPolicy consumeWhenAllOrdered(const char *name, CompletionPolicy::Matcher matcher)
as consumeWhenAll, but ensures that records are processed with incremental timeSlice (DataHeader::sta...
Definition
CompletionPolicyHelpers.cxx:174
o2::framework::InputSpec
Definition
InputSpec.h:31
o2::framework::MakeRootTreeWriterSpec::BranchDefinition
Definition
MakeRootTreeWriterSpec.h:273
Detectors
MUON
MID
Workflow
src
decoded-digits-writer-workflow.cxx
Generated on Tue Feb 25 2025 23:16:24 for Project by
1.9.8