Project
Loading...
Searching...
No Matches
test_Concepts.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 <TH1.h>
13#include "Framework/ASoA.h"
18#include "Framework/Condition.h"
20
21#include <catch_amalgamated.hpp>
22
23using namespace o2::framework;
24using namespace o2::soa;
25using namespace o2;
26
27struct P {
29 {
30 }
31
33};
34
35TEST_CASE("IdentificationConcepts")
36{
37 // ASoA
38 int i;
39 REQUIRE(not_void<decltype(i)>);
40
41 REQUIRE(is_persistent_column<o2::aod::track::CollisionId>);
42
43 REQUIRE(is_self_index_column<o2::aod::mcparticle::DaughtersIdSlice>);
44
45 REQUIRE(!is_index_column<o2::aod::mcparticle::DaughtersIdSlice>);
46 REQUIRE(is_index_column<o2::aod::track::CollisionId>);
47 REQUIRE(is_index_column<o2::aod::indices::CollisionIds>);
48
51
52 REQUIRE(has_parent_t<o2::aod::Track>);
53
54 REQUIRE(is_metadata<o2::aod::TracksIUExtensionMetadata>);
55
56 REQUIRE(is_metadata_trait<o2::aod::MetadataTrait<o2::aod::Hash<"TRACK/0"_h>>>);
57
59
60 REQUIRE(has_extension<o2::aod::MetadataTrait<o2::aod::Hash<"EXTRACK/0"_h>>::metadata>);
61
62 REQUIRE(is_spawnable_column<o2::aod::track::Pt>);
63
64 REQUIRE(is_indexing_column<Index<>>);
65
66 REQUIRE(is_dynamic_column<o2::aod::track::Energy<o2::aod::track::Signed1Pt, o2::aod::track::Tgl>>);
67
68 REQUIRE(is_marker_column<o2::soa::Marker<1>>);
69
70 REQUIRE(is_column<o2::aod::track::Pt>);
71 REQUIRE(is_column<Index<>>);
72 REQUIRE(is_column<o2::aod::track::Energy<o2::aod::track::Signed1Pt, o2::aod::track::Tgl>>);
73 REQUIRE(is_column<o2::soa::Marker<1>>);
74
75 REQUIRE(is_table<o2::aod::Collisions>);
76
77 REQUIRE(is_iterator<o2::aod::Collision>);
78
79 REQUIRE(with_originals<o2::aod::Collisions>);
80
81 REQUIRE(with_sources<o2::aod::MetadataTrait<o2::aod::Hash<"MA_RN3_SP/0"_h>>::metadata>);
82
83 REQUIRE(with_base_table<o2::aod::Tracks>);
84
85 REQUIRE(is_index_table<o2::aod::Run3MatchedSparse>);
86
87 Preslice<o2::aod::Tracks> ps = o2::aod::track::collisionId;
88 REQUIRE(is_preslice<decltype(ps)>);
89
90 REQUIRE(has_filtered_policy<soa::Filtered<o2::aod::Tracks>::iterator>);
91
92 REQUIRE(is_filtered_iterator<soa::Filtered<o2::aod::Tracks>::iterator>);
93
94 REQUIRE(is_filtered_table<soa::Filtered<o2::aod::Tracks>>);
95
96 REQUIRE(is_filtered<soa::Filtered<o2::aod::Tracks>::iterator>);
97 REQUIRE(is_filtered<soa::Filtered<o2::aod::Tracks>>);
98
99 REQUIRE(is_not_filtered_table<o2::aod::Collisions>);
100
101 REQUIRE(is_join<o2::aod::Tracks>);
102
103 auto tl = []() -> SmallGroups<o2::aod::Collisions> { return {std::vector<std::shared_ptr<arrow::Table>>{}, SelectionVector{}, 0}; };
104 REQUIRE(is_smallgroups<decltype(tl())>);
105
106 // AnalysisHelpers
107 REQUIRE(is_producable<o2::aod::Collisions>);
108
110 REQUIRE(is_produces<decltype(prod)>);
111
112 struct : ProducesGroup {
114 } prodg;
115 REQUIRE(is_produces_group<decltype(prodg)>);
116
117 REQUIRE(is_spawnable<o2::aod::Tracks>);
118
120 REQUIRE(is_spawns<decltype(spw)>);
121
123 REQUIRE(is_builds<decltype(bld)>);
124
125 OutputObj<TH1F> oo{"test"};
126 REQUIRE(is_outputobj<decltype(oo)>);
127
129 REQUIRE(is_service<decltype(srv)>);
130
131 Partition<o2::aod::Tracks> part = o2::aod::track::collisionId >= 0;
132 REQUIRE(is_partition<decltype(part)>);
133
134 // AnalysisTask
136 REQUIRE(is_enumeration<decltype(en)>);
137
138 // Condition
139 Condition<int> c{""};
140 REQUIRE(is_condition<decltype(c)>);
141
142 struct : ConditionGroup {
144 } cg;
145 REQUIRE(is_condition_group<decltype(cg)>);
146
147 // Configurable
148 Configurable<int> cc{"", 1, ""};
149 REQUIRE(is_configurable<decltype(cc)>);
150
151 ConfigurableAxis ca{"", {0, 1, 2, 3}, ""};
152 REQUIRE(is_configurable_axis<decltype(ca)>);
153
154 REQUIRE(is_process_configurable<decltype(P::doprocess1)>);
155
156 struct : ConfigurableGroup {
157 Configurable<int> c{"", 1, ""};
158 } ccg;
159 REQUIRE(is_configurable_group<decltype(ccg)>);
160
161 // Expressions
162 expressions::Filter f = o2::aod::track::pt > 1.0f;
163 REQUIRE(expressions::is_filter<decltype(f)>);
164
166 REQUIRE(is_combinations_generator<C>);
167}
int32_t i
uint32_t c
Definition RawData.h:2
T::template iterator_template_o< FilteredIndexPolicy, self_t > iterator
Definition ASoA.h:3559
hash identification concepts
Definition ASoA.h:363
GLdouble f
Definition glcorearb.h:310
Collisions_001 Collisions
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< int64_t > SelectionVector
Definition ASoA.h:411
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
void process1(aod::Collisions const &)
PROCESS_SWITCH(P, process1, "", true)
A struct, containing the root of the expression tree.
std::vector< o2::mch::ChannelCode > cc
TEST_CASE("IdentificationConcepts")