Project
Loading...
Searching...
No Matches
ColumnDataSpecsUtils.h
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#ifndef O2_MID_COLUMNDATASPECSUTILS_H
18#define O2_MID_COLUMNDATASPECSUTILS_H
19
20#include <array>
21#include <memory>
22#include <string>
23#include <string_view>
24#include <vector>
25#include <gsl/span>
26#include "fmt/format.h"
27
30#include "Framework/InputSpec.h"
37
38namespace o2
39{
40namespace mid
41{
42namespace specs
43{
44
50std::vector<framework::InputSpec> buildStandardInputSpecs(std::string_view dataBind, std::string_view dataDesc, bool useMC);
51
59std::vector<framework::InputSpec> buildStandardInputSpecs(std::string_view dataBind, std::string_view dataDesc, std::string_view rofDesc, std::string_view labelsDesc, bool useMC);
60
66std::vector<framework::InputSpec> buildInputSpecs(std::string_view dataBind, std::string_view dataDesc, std::string_view rofDesc);
67
72std::vector<framework::OutputSpec> buildOutputSpecs(std::string_view bind, std::string_view description);
73
79std::vector<framework::OutputSpec> buildStandardOutputSpecs(std::string_view dataBind, std::string_view dataDesc, bool useMC);
80
85template <typename T>
86gsl::span<const T> getInput(framework::ProcessingContext& pc, std::string_view bind, int subSpec = -1)
87{
88 return pc.inputs().get<gsl::span<T>>(fmt::format("{}{}", bind.data(), subSpec >= 0 ? fmt::format("_{}", subSpec) : ""));
89}
90
94std::vector<framework::Output> buildOutputs(std::vector<framework::OutputSpec> outputSpecs);
95
100std::array<gsl::span<const ColumnData>, NEvTypes> getData(framework::ProcessingContext& pc, std::string_view dataBind);
101
107gsl::span<const ColumnData> getData(framework::ProcessingContext& pc, std::string_view dataBind, EventType eventType);
108
113std::array<gsl::span<const ROFRecord>, NEvTypes> getRofs(framework::ProcessingContext& pc, std::string_view dataBind);
114
120gsl::span<const ROFRecord> getRofs(framework::ProcessingContext& pc, std::string_view dataBind, EventType eventType);
121
126std::unique_ptr<const o2::dataformats::MCTruthContainer<MCLabel>> getLabels(framework::ProcessingContext& pc, std::string_view dataBind, EventType eventType = EventType::Standard);
127
128} // namespace specs
129} // namespace mid
130} // namespace o2
131
132#endif // O2_MID_COLUMNDATASPECSUTILS_H
header::DataDescription description
Strip pattern (aka digits)
Label for MID.
A helper class to iteratate over all parts of all input routes.
Definition of a container to keep Monte Carlo truth external to simulation objects.
Definition of the MID event record.
const auto & getData()
decltype(auto) get(R binding, int part=0) const
InputRecord & inputs()
The inputs associated with this processing context.
std::vector< framework::InputSpec > buildStandardInputSpecs(std::string_view dataBind, std::string_view dataDesc, bool useMC)
gsl::span< const T > getInput(framework::ProcessingContext &pc, std::string_view bind, int subSpec=-1)
std::unique_ptr< const o2::dataformats::MCTruthContainer< MCLabel > > getLabels(framework::ProcessingContext &pc, std::string_view dataBind, EventType eventType=EventType::Standard)
std::vector< framework::OutputSpec > buildStandardOutputSpecs(std::string_view dataBind, std::string_view dataDesc, bool useMC)
std::vector< framework::Output > buildOutputs(std::vector< framework::OutputSpec > outputSpecs)
std::vector< framework::InputSpec > buildInputSpecs(std::string_view dataBind, std::string_view dataDesc, std::string_view rofDesc)
std::vector< framework::OutputSpec > buildOutputSpecs(std::string_view bind, std::string_view description)
std::array< gsl::span< const ROFRecord >, NEvTypes > getRofs(framework::ProcessingContext &pc, std::string_view dataBind)
constexpr uint32_t NEvTypes
Definition ROFRecord.h:37
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...