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
15#include "Framework/Task.h"
19
20using namespace o2::framework;
21
22namespace o2::fv0
23{
24
26{
27
28 public:
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
45void 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
53
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}
Class to describe fired triggered and/or stored channels for the BC and to refer to channel data.
Container class to store time and charge values of single FV0 channel.
void customize(std::vector< o2::framework::ConfigParamSpec > &workflowOptions)
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
ConfigParamRegistry & options() const
void run(o2::framework::ProcessingContext &pc) final
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
std::vector< InputSpec > Inputs
std::vector< OutputSpec > Outputs
std::vector< ChannelData > channels
std::vector< Digit > digits