Project
Loading...
Searching...
No Matches
FV0TFProcessor-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
12
#include <
Framework/ConfigContext.h
>
13
#include "
Framework/DeviceSpec.h
"
14
#include "
Framework/WorkflowSpec.h
"
15
#include "
Framework/Task.h
"
16
#include "
DataFormatsFV0/ChannelData.h
"
17
#include "
DataFormatsFV0/Digit.h
"
18
#include "
DataFormatsFV0/FV0CalibrationInfoObject.h
"
19
20
using namespace
o2::framework
;
21
22
namespace
o2::fv0
23
{
24
25
class
FV0TFProcessor
final :
public
o2::framework::Task
26
{
27
28
public
:
29
void
run
(
o2::framework::ProcessingContext
& pc)
final
30
{
31
auto
creationTime = pc.services().get<
o2::framework::TimingInfo
>().creation;
// approximate time in ms
32
auto
channels
= pc.inputs().get<gsl::span<o2::fv0::ChannelData>>(
"channels"
);
33
auto
digits
= pc.inputs().get<gsl::span<o2::fv0::Digit>>(
"digits"
);
34
auto
& calib_data = pc.outputs().make<std::vector<o2::fv0::FV0CalibrationInfoObject>>(
o2::framework::OutputRef
{
"calib"
, 0});
35
calib_data.reserve(
channels
.size());
36
37
for
(
const
auto
& channel :
channels
) {
38
calib_data.emplace_back(channel.ChId, channel.CFDTime, channel.QTCAmpl, uint64_t(creationTime));
39
}
40
}
41
};
42
43
}
// namespace o2::fv0
44
45
void
customize
(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
46
{
47
std::vector<ConfigParamSpec> options;
48
options.push_back(
ConfigParamSpec
{
"dispatcher-mode"
, VariantType::Bool,
false
, {
"Dispatcher mode (FV0/SUB_DIGITSCH and FV0/SUB_DIGITSBC DPL channels should be applied as dispatcher output)."
}});
49
std::swap(workflowOptions, options);
50
}
51
52
#include "
Framework/runDataProcessing.h
"
53
54
WorkflowSpec
defineDataProcessing
(
ConfigContext
const
& cfgc)
55
{
56
Inputs
inputs{};
57
if
(cfgc.
options
().
get
<
bool
>(
"dispatcher-mode"
)) {
58
inputs.push_back(
InputSpec
{{
"channels"
},
"FV0"
,
"SUB_DIGITSCH"
});
59
inputs.push_back(
InputSpec
{{
"digits"
},
"FV0"
,
"SUB_DIGITSBC"
});
60
}
else
{
61
inputs.push_back(
InputSpec
{{
"channels"
},
"FV0"
,
"DIGITSCH"
});
62
inputs.push_back(
InputSpec
{{
"digits"
},
"FV0"
,
"DIGITSBC"
});
63
}
64
DataProcessorSpec
dataProcessorSpec{
65
"FV0TFProcessor"
,
66
inputs,
67
Outputs
{
68
{{
"calib"
},
"FV0"
,
"CALIB_INFO"
}},
69
AlgorithmSpec
{adaptFromTask<o2::fv0::FV0TFProcessor>()},
70
Options
{}};
71
72
WorkflowSpec
workflow;
73
workflow.emplace_back(dataProcessorSpec);
74
return
workflow;
75
}
ConfigContext.h
Digit.h
Class to describe fired triggered and/or stored channels for the BC and to refer to channel data.
DeviceSpec.h
ChannelData.h
Container class to store time and charge values of single FV0 channel.
FV0CalibrationInfoObject.h
customize
void customize(std::vector< o2::framework::ConfigParamSpec > &workflowOptions)
Definition
FV0TFProcessor-Workflow.cxx:45
defineDataProcessing
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
Definition
FV0TFProcessor-Workflow.cxx:54
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::ProcessingContext
Definition
ProcessingContext.h:27
o2::framework::Task
Definition
Task.h:32
o2::fv0::FV0TFProcessor
Definition
FV0TFProcessor-Workflow.cxx:26
o2::fv0::FV0TFProcessor::run
void run(o2::framework::ProcessingContext &pc) final
Definition
FV0TFProcessor-Workflow.cxx:29
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::WorkflowSpec
std::vector< DataProcessorSpec > WorkflowSpec
Definition
HBFUtilsInitializer.h:39
o2::framework::Inputs
std::vector< InputSpec > Inputs
Definition
DataProcessorSpec.h:29
o2::framework::Outputs
std::vector< OutputSpec > Outputs
Definition
DataProcessorSpec.h:30
o2::fv0
Definition
SimTraits.h:151
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::framework::InputSpec
Definition
InputSpec.h:31
o2::framework::OutputRef
Definition
OutputRef.h:29
o2::framework::TimingInfo
Definition
TimingInfo.h:24
channels
std::vector< ChannelData > channels
Definition
test_ctf_io_fdd.cxx:39
digits
std::vector< Digit > digits
Definition
test_ctf_io_hmpid.cxx:40
Detectors
FIT
FV0
calibration
workflow
FV0TFProcessor-Workflow.cxx
Generated on Tue Feb 25 2025 23:16:15 for Project by
1.9.8