Project
Loading...
Searching...
No Matches
AnalysisHelpers.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#ifndef o2_framework_AnalysisHelpers_H_DEFINED
12#define o2_framework_AnalysisHelpers_H_DEFINED
13
14#include "Framework/ASoA.h"
18#include "Framework/InputSpec.h"
19#include "Framework/Output.h"
21#include "Framework/OutputRef.h"
23#include "Framework/Plugins.h"
26#include "Framework/Traits.h"
27
28#include <string>
29namespace o2::soa
30{
31template <TableRef R>
32constexpr auto tableRef2InputSpec()
33{
35 o2::aod::label<R>(),
36 o2::aod::origin<R>(),
37 o2::aod::description(o2::aod::signature<R>()),
38 R.version};
39}
40
41template <TableRef R>
42constexpr auto tableRef2OutputSpec()
43{
45 framework::OutputLabel{o2::aod::label<R>()},
46 o2::aod::origin<R>(),
47 o2::aod::description(o2::aod::signature<R>()),
48 R.version};
49}
50
51template <TableRef R>
52constexpr auto tableRef2Output()
53{
54 return framework::Output{
55 o2::aod::origin<R>(),
56 o2::aod::description(o2::aod::signature<R>()),
57 R.version};
58}
59
60template <TableRef R>
61constexpr auto tableRef2OutputRef()
62{
64 o2::aod::label<R>(),
65 R.version};
66}
67
68template <TableRef R>
70{
72 std::string{"input:"} + o2::aod::label<R>(),
74 aod::sourceSpec<R>(),
75 {"\"\""}};
76}
77} // namespace o2::soa
78
79namespace o2::framework
80{
81class TableConsumer;
82
86template <typename T>
88
89template <is_producable T>
91 public:
92 using persistent_table_t = decltype([]() { if constexpr (soa::is_iterator<T>) { return typename T::parent_t{nullptr}; } else { return T{nullptr}; } }());
93 using cursor_t = decltype(std::declval<TableBuilder>().cursor<persistent_table_t>());
94
95 template <typename... Ts>
96 void operator()(Ts... args)
97 {
98 static_assert(sizeof...(Ts) == framework::pack_size(typename persistent_table_t::persistent_columns_t{}), "Argument number mismatch");
99 ++mCount;
100 cursor(0, extract(args)...);
101 }
102
104 int64_t lastIndex()
105 {
106 return mCount;
107 }
108
110 {
111 mBuilder = std::move(builder);
112 cursor = std::move(FFL(mBuilder->cursor<persistent_table_t>()));
113 mCount = -1;
114 return true;
115 }
116
117 void setLabel(const char* label)
118 {
119 mBuilder->setLabel(label);
120 }
121
124 void reserve(int64_t size)
125 {
126 mBuilder->reserve(typename persistent_table_t::column_types{}, size);
127 }
128
129 void release()
130 {
131 mBuilder.release();
132 }
133
134 decltype(FFL(std::declval<cursor_t>())) cursor;
135
136 private:
137 template <typename A>
138 requires requires { &A::globalIndex; }
139 static decltype(auto) extract(A const& arg)
140 {
141 return arg.globalIndex();
142 }
143
144 template <typename A>
145 static decltype(auto) extract(A const& arg)
146 {
147 return arg;
148 }
149
153 LifetimeHolder<TableBuilder> mBuilder = nullptr;
154 int64_t mCount = -1;
155};
156
158template <soa::is_table T>
159consteval auto typeWithRef() -> T
160{
161}
162
163template <soa::is_iterator T>
164consteval auto typeWithRef() -> typename T::parent_t
165{
166}
167
168template <typename T>
169 requires soa::is_table<T> || soa::is_iterator<T>
171 using table_t = decltype(typeWithRef<T>());
172 using metadata = aod::MetadataTrait<o2::aod::Hash<table_t::ref.desc_hash>>::metadata;
173
174 static OutputSpec const spec()
175 {
176 return OutputSpec{OutputLabel{aod::label<table_t::ref>()}, o2::aod::origin<table_t::ref>(), o2::aod::description(o2::aod::signature<table_t::ref>()), table_t::ref.version};
177 }
178
179 static OutputRef ref()
180 {
181 return OutputRef{aod::label<table_t::ref>(), table_t::ref.version};
182 }
183};
184
189template <is_producable T>
191};
192
193template <typename T>
194concept is_produces = requires(T t) { typename T::cursor_t; typename T::persistent_table_t; &T::cursor; };
195
205};
206
207template <typename T>
208concept is_produces_group = std::derived_from<T, ProducesGroup>;
209
211template <soa::is_metadata M, soa::TableRef Ref>
213 using metadata = M;
214 constexpr static auto sources = M::sources;
215
216 template <soa::TableRef R>
217 static constexpr auto base_spec()
218 {
219 return soa::tableRef2InputSpec<R>();
220 }
221
222 static auto base_specs()
223 {
224 return []<size_t... Is>(std::index_sequence<Is...>) -> std::vector<InputSpec> {
225 return {base_spec<sources[Is]>()...};
226 }(std::make_index_sequence<sources.size()>{});
227 }
228
229 constexpr auto spec() const
230 {
231 return soa::tableRef2OutputSpec<Ref>();
232 }
233
234 constexpr auto output() const
235 {
236 return soa::tableRef2Output<Ref>();
237 }
238
239 constexpr auto ref() const
240 {
241 return soa::tableRef2OutputRef<Ref>();
242 }
243};
244
247template <typename T>
248concept is_spawnable = soa::has_metadata<aod::MetadataTrait<o2::aod::Hash<T::ref.desc_hash>>> && soa::has_extension<typename aod::MetadataTrait<o2::aod::Hash<T::ref.desc_hash>>::metadata>;
249
250template <is_spawnable T>
251constexpr auto transformBase()
252{
253 using metadata = typename aod::MetadataTrait<o2::aod::Hash<T::ref.desc_hash>>::metadata;
255}
256
257template <is_spawnable T>
258struct Spawns : decltype(transformBase<T>()) {
259 using spawnable_t = T;
260 using metadata = decltype(transformBase<T>())::metadata;
261 using extension_t = typename metadata::extension_table_t;
262 using base_table_t = typename metadata::base_table_t;
263 using expression_pack_t = typename metadata::expression_pack_t;
264
265 constexpr auto pack()
266 {
267 return expression_pack_t{};
268 }
269
270 typename T::table_t* operator->()
271 {
272 return table.get();
273 }
274 typename T::table_t const& operator*() const
275 {
276 return *table;
277 }
278
280 {
281 return extension->asArrowTable();
282 }
283 std::shared_ptr<typename T::table_t> table = nullptr;
284 std::shared_ptr<extension_t> extension = nullptr;
285};
286
287template <typename T>
288concept is_spawns = requires(T t) {
289 typename T::metadata;
290 requires std::same_as<decltype(t.pack()), typename T::expression_pack_t>;
291};
292
297struct Exclusive {
298};
299struct Sparse {
300};
301
302namespace
303{
304template <typename T, typename Key>
305inline std::shared_ptr<arrow::ChunkedArray> getIndexToKey(arrow::Table* table)
306{
307 using IC = framework::pack_element_t<framework::has_type_at_conditional_v<soa::is_binding_compatible, Key>(typename T::external_index_columns_t{}), typename T::external_index_columns_t>;
308 return table->column(framework::has_type_at_v<IC>(typename T::persistent_columns_t{}));
309}
310
311template <soa::is_column C>
312struct ColumnTrait {
313 using column_t = C;
314
315 static consteval auto listSize()
316 {
317 if constexpr (std::same_as<typename C::type, std::vector<int>>) {
318 return -1;
319 } else if constexpr (std::same_as<int[2], typename C::type>) {
320 return 2;
321 } else {
322 return 1;
323 }
324 }
325
326 template <typename T, typename Key>
327 static std::shared_ptr<SelfIndexColumnBuilder> makeColumnBuilder(arrow::Table* table, arrow::MemoryPool* pool)
328 {
329 if constexpr (!std::same_as<T, Key>) {
330 return std::make_shared<IndexColumnBuilder>(getIndexToKey<T, Key>(table), C::columnLabel(), listSize(), pool);
331 } else {
332 return std::make_shared<SelfIndexColumnBuilder>(C::columnLabel(), pool);
333 }
334 }
335};
336
337template <typename Key, typename C>
338struct Reduction {
339 using type = typename std::conditional<soa::is_binding_compatible_v<Key, typename C::binding_t>(), SelfIndexColumnBuilder, IndexColumnBuilder>::type;
340};
341
342template <typename Key, typename C>
343using reduced_t = Reduction<Key, C>::type;
344} // namespace
345
346template <typename Kind>
348 template <typename Key, size_t N, std::array<soa::TableRef, N> refs, typename C1, typename... Cs>
349 static auto indexBuilder(const char* label, std::vector<std::shared_ptr<arrow::Table>>&& tables, framework::pack<C1, Cs...>)
350 {
351 auto pool = arrow::default_memory_pool();
352 SelfIndexColumnBuilder self{C1::columnLabel(), pool};
353 std::unique_ptr<ChunkedArrayIterator> keyIndex = nullptr;
354 if constexpr (!Key::template hasOriginal<refs[0]>()) {
355 keyIndex = std::make_unique<ChunkedArrayIterator>(tables[0]->column(o2::aod::MetadataTrait<o2::aod::Hash<refs[0].desc_hash>>::metadata::template getIndexPosToKey<Key>()));
356 }
357
358 auto sq = std::make_index_sequence<sizeof...(Cs)>();
359
360 auto columnBuilders = [&tables, &pool ]<size_t... Is>(std::index_sequence<Is...>) -> std::array<std::shared_ptr<framework::SelfIndexColumnBuilder>, sizeof...(Cs)>
361 {
362 return {[](arrow::Table* table, arrow::MemoryPool* pool) {
363 using T = framework::pack_element_t<Is, framework::pack<Cs...>>;
364 if constexpr (!Key::template hasOriginal<refs[Is + 1]>()) {
365 constexpr auto pos = o2::aod::MetadataTrait<o2::aod::Hash<refs[Is + 1].desc_hash>>::metadata::template getIndexPosToKey<Key>();
366 return std::make_shared<IndexColumnBuilder>(table->column(pos), T::columnLabel(), ColumnTrait<T>::listSize(), pool);
367 } else {
368 return std::make_shared<SelfIndexColumnBuilder>(T::columnLabel(), pool);
369 }
370 }(tables[Is + 1].get(), pool)...};
371 }
372 (sq);
373
374 std::array<bool, sizeof...(Cs)> finds;
375
376 for (int64_t counter = 0; counter < tables[0]->num_rows(); ++counter) {
377 int64_t idx = -1;
378 if constexpr (Key::template hasOriginal<refs[0]>()) {
379 idx = counter;
380 } else {
381 idx = keyIndex->valueAt(counter);
382 }
383 finds = [&idx, &columnBuilders]<size_t... Is>(std::index_sequence<Is...>) {
384 return std::array{
385 [&idx, &columnBuilders]() {
386 using T = typename framework::pack_element_t<Is, framework::pack<Cs...>>;
387 return std::static_pointer_cast<reduced_t<Key, T>>(columnBuilders[Is])->template find<T>(idx);
388 }()...};
389 }(sq);
390 if constexpr (std::same_as<Kind, Sparse>) {
391 [&idx, &columnBuilders]<size_t... Is>(std::index_sequence<Is...>) {
392 ([&idx, &columnBuilders]() {
393 using T = typename framework::pack_element_t<Is, framework::pack<Cs...>>;
394 return std::static_pointer_cast<reduced_t<Key, T>>(columnBuilders[Is])->template fill<T>(idx); }(), ...);
395 }(sq);
396 self.fill<C1>(counter);
397 } else if constexpr (std::same_as<Kind, Exclusive>) {
398 if (std::none_of(finds.begin(), finds.end(), [](bool const x) { return x == false; })) {
399 [&idx, &columnBuilders]<size_t... Is>(std::index_sequence<Is...>) {
400 ([&idx, &columnBuilders]() {
401 using T = typename framework::pack_element_t<Is, framework::pack<Cs...>>;
402 return std::static_pointer_cast<reduced_t<Key, T>>(columnBuilders[Is])->template fill<T>(idx);
403 }(),
404 ...);
405 }(sq);
406 self.fill<C1>(counter);
407 }
408 }
409 }
410
411 return [&label, &columnBuilders, &self]<size_t... Is>(std::index_sequence<Is...>) {
412 return makeArrowTable(label,
413 {self.template result<C1>(), [&columnBuilders]() {
414 using T = typename framework::pack_element_t<Is, framework::pack<Cs...>>;
415 return std::static_pointer_cast<reduced_t<Key, T>>(columnBuilders[Is])->template result<T>();
416 }()...},
417 {self.field(), [&columnBuilders]() {
418 using T = typename framework::pack_element_t<Is, framework::pack<Cs...>>;
419 return std::static_pointer_cast<reduced_t<Key, T>>(columnBuilders[Is])->field();
420 }()...});
421 }(sq);
422 }
423};
424
426
427template <soa::is_index_table T>
428constexpr auto transformBase()
429{
430 using metadata = typename aod::MetadataTrait<o2::aod::Hash<T::ref.desc_hash>>::metadata;
432}
433
434template <soa::is_index_table T>
435struct Builds : decltype(transformBase<T>()) {
436 using buildable_t = T;
437 using metadata = decltype(transformBase<T>())::metadata;
438 using IP = std::conditional_t<metadata::exclusive, IndexBuilder<Exclusive>, IndexBuilder<Sparse>>;
439 using Key = metadata::Key;
440 using H = typename T::first_t;
441 using Ts = typename T::rest_t;
442 using index_pack_t = metadata::index_pack_t;
443
445 {
446 return table.get();
447 }
448 T const& operator*() const
449 {
450 return *table;
451 }
452
454 {
455 return table->asArrowTable();
456 }
457 std::shared_ptr<T> table = nullptr;
458
459 constexpr auto pack()
460 {
461 return index_pack_t{};
462 }
463
464 template <typename Key, typename... Cs>
465 auto build(framework::pack<Cs...>, std::vector<std::shared_ptr<arrow::Table>>&& tables)
466 {
467 this->table = std::make_shared<T>(IP::template indexBuilder<Key, metadata::sources.size(), metadata::sources>(o2::aod::label<T::ref>(), std::forward<std::vector<std::shared_ptr<arrow::Table>>>(tables), framework::pack<Cs...>{}));
468 return (this->table != nullptr);
469 }
470};
471
472template <typename T>
473concept is_builds = requires(T t) {
474 typename T::metadata;
475 typename T::Key;
476 requires std::same_as<decltype(t.pack()), typename T::index_pack_t>;
477};
478
486template <typename T>
487struct OutputObj {
488 using obj_t = T;
489
491 : object(std::make_shared<T>(t)),
492 label(t.GetName()),
493 policy{policy_},
494 sourceType{sourceType_},
495 mTaskHash{0}
496 {
497 }
498
500 : object(nullptr),
501 label(label_),
502 policy{policy_},
503 sourceType{sourceType_},
504 mTaskHash{0}
505 {
506 }
507
508 void setObject(T const& t)
509 {
510 object = std::make_shared<T>(t);
511 object->SetName(label.c_str());
512 }
513
514 void setObject(T&& t)
515 {
516 object = std::make_shared<T>(t);
517 object->SetName(label.c_str());
518 }
519
520 void setObject(T* t)
521 {
522 object.reset(t);
523 object->SetName(label.c_str());
524 }
525
526 void setObject(std::shared_ptr<T> t)
527 {
528 object = t;
529 object->SetName(label.c_str());
530 }
531
532 void setHash(uint32_t hash)
533 {
534 mTaskHash = hash;
535 }
536
539 {
541 auto lhash = runtime_hash(label.c_str());
542 std::memset(desc.str, '_', 16);
543 std::stringstream s;
544 s << std::hex << lhash;
545 s << std::hex << mTaskHash;
546 s << std::hex << reinterpret_cast<uint64_t>(this);
547 std::memcpy(desc.str, s.str().c_str(), 12);
548 return OutputSpec{OutputLabel{label}, "ATSK", desc, 0, Lifetime::QA};
549 }
550
552 {
553 return object.get();
554 }
555
557 {
558 return *object.get();
559 }
560
561 OutputRef ref(uint16_t index, uint16_t max)
562 {
563 return OutputRef{std::string{label}, 0,
565 }
566
567 std::shared_ptr<T> object;
568 std::string label;
571 uint32_t mTaskHash;
572};
573
574template <typename T>
575concept is_outputobj = requires(T t) {
576 &T::setHash;
577 &T::spec;
578 &T::ref;
579 requires std::same_as<decltype(t.operator->()), typename T::obj_t*>;
580 requires std::same_as<decltype(t.object), std::shared_ptr<typename T::obj_t>>;
581};
582
586template <typename T>
587struct Service {
588 using service_t = T;
590
591 decltype(auto) operator->() const
592 {
594 return service->get();
595 } else {
596 return service;
597 }
598 }
599};
600
601template <typename T>
602concept is_service = requires(T t) {
603 requires std::same_as<decltype(t.service), typename T::service_t*>;
604 &T::operator->;
605};
606
608{
609 return std::make_unique<o2::soa::Filtered<std::decay_t<decltype(table)>>>(std::vector{table}, std::forward<soa::SelectionVector>(selection));
610}
611
613{
614 return std::make_unique<o2::soa::Filtered<std::decay_t<decltype(table)>>>(std::vector{table.asArrowTable()}, std::forward<soa::SelectionVector>(selection));
615}
616
617void initializePartitionCaches(std::set<uint32_t> const& hashes, std::shared_ptr<arrow::Schema> const& schema, expressions::Filter const& filter, gandiva::NodePtr& tree, gandiva::FilterPtr& gfilter);
618
619template <typename T>
620struct Partition {
621 using content_t = T;
622 Partition(expressions::Node&& filter_) : filter{std::forward<expressions::Node>(filter_)}
623 {
624 }
625
626 Partition(expressions::Node&& filter_, T const& table)
627 : filter{std::forward<expressions::Node>(filter_)}
628 {
629 setTable(table);
630 }
631
632 void intializeCaches(std::set<uint32_t> const& hashes, std::shared_ptr<arrow::Schema> const& schema)
633 {
634 initializePartitionCaches(hashes, schema, filter, tree, gfilter);
635 }
636
637 void bindTable(T const& table)
638 {
639 intializeCaches(T::table_t::hashes(), table.asArrowTable()->schema());
640 if (dataframeChanged) {
642 dataframeChanged = false;
643 }
644 }
645
646 template <typename... Ts>
647 void bindExternalIndices(Ts*... tables)
648 {
649 if (mFiltered != nullptr) {
650 mFiltered->bindExternalIndices(tables...);
651 }
652 }
653
654 template <typename E>
656 {
657 if (mFiltered != nullptr) {
658 mFiltered->bindInternalIndicesTo(ptr);
659 }
660 }
661
663 {
665 }
666
667 [[nodiscard]] std::shared_ptr<arrow::Table> asArrowTable() const
668 {
669 return mFiltered->asArrowTable();
670 }
671
673 {
674 return mFiltered.get();
675 }
676
677 template <typename T1>
678 [[nodiscard]] auto rawSliceBy(o2::framework::Preslice<T1> const& container, int value) const
679 {
680 return mFiltered->rawSliceBy(container, value);
681 }
682
683 [[nodiscard]] auto sliceByCached(framework::expressions::BindingNode const& node, int value, o2::framework::SliceCache& cache) const
684 {
685 return mFiltered->sliceByCached(node, value, cache);
686 }
687
689 {
690 return mFiltered->sliceByCachedUnsorted(node, value, cache);
691 }
692
693 template <typename T1, typename Policy, bool OPT>
694 [[nodiscard]] auto sliceBy(o2::framework::PresliceBase<T1, Policy, OPT> const& container, int value) const
695 {
696 return mFiltered->sliceBy(container, value);
697 }
698
700 std::unique_ptr<o2::soa::Filtered<T>> mFiltered = nullptr;
701 gandiva::NodePtr tree = nullptr;
703 bool dataframeChanged = true;
704
710 {
711 return mFiltered->begin();
712 }
714 {
715 return mFiltered->end();
716 }
718 {
719 return mFiltered->begin();
720 }
722 {
723 return mFiltered->end();
724 }
725
726 int64_t size() const
727 {
728 return mFiltered->size();
729 }
730};
731
732template <typename T>
733concept is_partition = requires(T t) {
734 &T::updatePlaceholders;
735 requires std::same_as<decltype(t.filter), expressions::Filter>;
736 requires std::same_as<decltype(t.mFiltered), std::unique_ptr<o2::soa::Filtered<typename T::content_t>>>;
737};
738} // namespace o2::framework
739
740namespace o2::soa
741{
743template <soa::is_table T, soa::is_spawnable_column... Cs>
744auto Extend(T const& table)
745{
746 using output_t = Join<T, soa::Table<o2::aod::Hash<"JOIN"_h>, o2::aod::Hash<"JOIN/0"_h>, o2::aod::Hash<"JOIN"_h>, Cs...>>;
747 return output_t{{o2::framework::spawner(framework::pack<Cs...>{}, {table.asArrowTable()}, "dynamicExtension"), table.asArrowTable()}, 0};
748}
749
752template <soa::is_table T, soa::is_dynamic_column... Cs>
753auto Attach(T const& table)
754{
755 using output_t = Join<T, o2::soa::Table<o2::aod::Hash<"JOIN"_h>, o2::aod::Hash<"JOIN/0"_h>, o2::aod::Hash<"JOIN"_h>, Cs...>>;
756 return output_t{{table.asArrowTable()}, table.offset()};
757}
758} // namespace o2::soa
759
760#endif // o2_framework_AnalysisHelpers_H_DEFINED
uint16_t pos
Definition RawData.h:3
uint32_t gfilter
Definition RawData.h:6
constexpr uint32_t runtime_hash(char const *str)
TBranch * ptr
Definition A.h:16
iterator const_iterator
Definition ASoA.h:3556
T::template iterator_template_o< FilteredIndexPolicy, self_t > iterator
Definition ASoA.h:3554
Helper to check if a type T is an iterator.
Definition ASoA.h:1246
GLint GLenum GLint x
Definition glcorearb.h:403
GLuint64EXT * result
Definition glcorearb.h:5662
GLsizeiptr size
Definition glcorearb.h:659
GLuint index
Definition glcorearb.h:781
GLsizei const GLfloat * value
Definition glcorearb.h:819
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
GLuint GLsizei const GLchar * label
Definition glcorearb.h:2519
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition glcorearb.h:1308
GLuint object
Definition glcorearb.h:4041
GLsizei GLenum * sources
Definition glcorearb.h:2516
GLuint counter
Definition glcorearb.h:3987
std::shared_ptr< gandiva::Filter > FilterPtr
Definition Expressions.h:47
std::variant< OriginValueMatcher, DescriptionValueMatcher, SubSpecificationTypeValueMatcher, std::unique_ptr< DataDescriptorMatcher >, ConstantValueMatcher, StartTimeValueMatcher > Node
gandiva::Selection createSelection(std::shared_ptr< arrow::Table > const &table, Filter const &expression)
Function for creating gandiva selection from our internal filter tree.
void updatePlaceholders(Filter &filter, InitContext &context)
Update placeholder nodes from context.
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
auto spawner(std::vector< std::shared_ptr< arrow::Table > > &&tables, const char *name)
Expression-based column generator to materialize columns.
typename pack_element< I, T >::type pack_element_t
Definition Pack.h:56
constexpr std::size_t pack_size(pack< Ts... > const &)
template function to determine number of types in a pack
Definition Pack.h:28
constexpr auto transformBase()
This helper struct allows you to declare index tables to be created in a task.
memfun_type< decltype(&F::operator())>::type FFL(F const &func)
auto getTableFromFilter(soa::is_filtered_table auto const &table, soa::SelectionVector &&selection)
consteval auto typeWithRef() -> T
Helper to define output for a Table.
OutputObjHandlingPolicy
Policy enum to determine OutputObj handling when writing.
void initializePartitionCaches(std::set< uint32_t > const &hashes, std::shared_ptr< arrow::Schema > const &schema, expressions::Filter const &filter, gandiva::NodePtr &tree, gandiva::FilterPtr &gfilter)
std::shared_ptr< arrow::Table > makeArrowTable(const char *label, std::vector< std::shared_ptr< arrow::ChunkedArray > > &&columns, std::vector< std::shared_ptr< arrow::Field > > &&fields)
SelectionVector selectionToVector(gandiva::Selection const &sel)
Definition ASoA.cxx:43
constexpr auto tableRef2InputSpec()
constexpr auto tableRef2Output()
std::vector< int64_t > SelectionVector
Definition ASoA.h:406
auto Attach(T const &table)
constexpr auto tableRef2ConfigParamSpec()
auto Extend(T const &table)
On-the-fly adding of expression columns.
constexpr auto tableRef2OutputSpec()
constexpr auto tableRef2OutputRef()
@ C
Definition Defs.h:36
Defining DataPointCompositeObject explicitly as copiable.
std::shared_ptr< T > table
constexpr auto pack()
typename T::first_t H
T const & operator*() const
auto build(framework::pack< Cs... >, std::vector< std::shared_ptr< arrow::Table > > &&tables)
metadata::index_pack_t index_pack_t
typename T::rest_t Ts
decltype(transformBase< T >())::metadata metadata
static auto indexBuilder(const char *label, std::vector< std::shared_ptr< arrow::Table > > &&tables, framework::pack< C1, Cs... >)
static OutputSpec const spec()
aod::MetadataTrait< o2::aod::Hash< table_t::ref.desc_hash > >::metadata metadata
decltype(typeWithRef< T >()) table_t
O2 header for OutputObj metadata.
OutputObj(T &&t, OutputObjHandlingPolicy policy_=OutputObjHandlingPolicy::AnalysisObject, OutputObjSourceType sourceType_=OutputObjSourceType::OutputObjSource)
void setObject(std::shared_ptr< T > t)
OutputObjSourceType sourceType
OutputRef ref(uint16_t index, uint16_t max)
std::shared_ptr< T > object
OutputObj(std::string const &label_, OutputObjHandlingPolicy policy_=OutputObjHandlingPolicy::AnalysisObject, OutputObjSourceType sourceType_=OutputObjSourceType::OutputObjSource)
OutputSpec const spec()
OutputObjHandlingPolicy policy
void setHash(uint32_t hash)
Partition(expressions::Node &&filter_, T const &table)
typename o2::soa::Filtered< T >::const_iterator filtered_const_iterator
void bindTable(T const &table)
filtered_const_iterator begin() const
auto rawSliceBy(o2::framework::Preslice< T1 > const &container, int value) const
auto sliceByCached(framework::expressions::BindingNode const &node, int value, o2::framework::SliceCache &cache) const
void intializeCaches(std::set< uint32_t > const &hashes, std::shared_ptr< arrow::Schema > const &schema)
Partition(expressions::Node &&filter_)
typename o2::soa::Filtered< T >::iterator filtered_iterator
o2::soa::Filtered< T > * operator->()
typename o2::soa::Filtered< T >::iterator iterator
auto sliceBy(o2::framework::PresliceBase< T1, Policy, OPT > const &container, int value) const
std::shared_ptr< arrow::Table > asArrowTable() const
o2::soa::RowViewSentinel end() const
void updatePlaceholders(InitContext &context)
std::unique_ptr< o2::soa::Filtered< T > > mFiltered
expressions::Filter filter
o2::soa::RowViewSentinel end()
auto sliceByCachedUnsorted(framework::expressions::BindingNode const &node, int value, o2::framework::SliceCache &cache) const
typename o2::soa::Filtered< T >::const_iterator const_iterator
gandiva::FilterPtr gfilter
void bindExternalIndices(Ts *... tables)
filtered_iterator begin()
T::table_t * operator->()
std::shared_ptr< extension_t > extension
T::table_t const & operator*() const
typename metadata::base_table_t base_table_t
typename metadata::expression_pack_t expression_pack_t
constexpr auto pack()
decltype(transformBase< T >())::metadata metadata
std::shared_ptr< typename T::table_t > table
typename metadata::extension_table_t extension_t
Helper template for table transformations.
constexpr auto spec() const
constexpr auto output() const
static constexpr auto base_spec()
constexpr auto ref() const
int64_t lastIndex()
Last index inserted in the table.
decltype(FFL(std::declval< cursor_t >())) cursor
bool resetCursor(LifetimeHolder< TableBuilder > builder)
void setLabel(const char *label)
decltype([]() { if constexpr(soa::is_iterator< T >) { return typename T::parent_t{nullptr} persistent_table_t
decltype(std::declval< TableBuilder >().cursor< persistent_table_t >()) cursor_t
An expression tree node corresponding to a column binding.
A struct, containing the root of the expression tree.
a move-only header stack with serialized headers This is the flat buffer where all the headers in a m...
Definition Stack.h:36
constexpr size_t max
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))