From b34e2a396bb73b5e4572b09184dc948bb86a541b Mon Sep 17 00:00:00 2001 From: <> Date: Sat, 11 Nov 2023 03:20:24 +0000 Subject: [PATCH] Deployed b9b8ab4 with MkDocs version: 1.5.3 --- .nojekyll | 0 404.html | 944 +++ analogical/aggregation__logic_8h/index.html | 1023 +++ .../aggregation__logic_8h_source/index.html | 1012 +++ analogical/annotated/index.html | 1002 +++ analogical/class_member_enums/index.html | 963 +++ analogical/class_member_functions/index.html | 1231 +++ analogical/class_member_typedefs/index.html | 1005 +++ analogical/class_member_variables/index.html | 1014 +++ analogical/class_members/index.html | 1260 ++++ .../index.html | 1105 +++ .../index.html | 1131 +++ analogical/classana_1_1dataflow/index.html | 2683 +++++++ .../classana_1_1dataset_1_1column/index.html | 1291 ++++ .../classana_1_1dataset_1_1input/index.html | 1397 ++++ .../classana_1_1dataset_1_1player/index.html | 1336 ++++ .../classana_1_1dataset_1_1reader/index.html | 966 +++ .../classana_1_1dataset_1_1source/index.html | 1048 +++ analogical/classana_1_1delayed/index.html | 1595 ++++ .../classana_1_1delayed_1_1varied/index.html | 1432 ++++ analogical/classana_1_1lazy/index.html | 1955 +++++ .../classana_1_1lazy_1_1varied/index.html | 1417 ++++ analogical/classes/index.html | 1090 +++ analogical/column__definition_8h/index.html | 1023 +++ .../column__definition_8h_source/index.html | 1023 +++ analogical/dataflow_8h/index.html | 1041 +++ analogical/dataflow_8h_source/index.html | 1522 ++++ analogical/dataset_8h/index.html | 1043 +++ analogical/dataset_8h_source/index.html | 1021 +++ analogical/dataset__column_8h/index.html | 1026 +++ .../dataset__column_8h_source/index.html | 1021 +++ analogical/dataset__input_8h/index.html | 1030 +++ .../dataset__input_8h_source/index.html | 1047 +++ analogical/dataset__player_8h/index.html | 1026 +++ .../dataset__player_8h_source/index.html | 999 +++ analogical/delayed_8h/index.html | 1024 +++ analogical/delayed_8h_source/index.html | 1295 ++++ analogical/delayed__varied_8h/index.html | 1024 +++ .../delayed__varied_8h_source/index.html | 1184 +++ .../index.html | 1035 +++ .../index.html | 995 +++ .../index.html | 995 +++ analogical/files/index.html | 985 +++ analogical/functions/index.html | 963 +++ analogical/hierarchy/index.html | 1020 +++ analogical/lazy_8h/index.html | 1233 +++ analogical/lazy_8h_source/index.html | 1301 ++++ analogical/lazy__varied_8h/index.html | 1161 +++ analogical/lazy__varied_8h_source/index.html | 1229 +++ analogical/links/index.html | 978 +++ analogical/macros/index.html | 1000 +++ analogical/modules/index.html | 963 +++ analogical/namespace_member_enums/index.html | 963 +++ .../namespace_member_functions/index.html | 982 +++ .../namespace_member_typedefs/index.html | 993 +++ .../namespace_member_variables/index.html | 995 +++ analogical/namespace_members/index.html | 1030 +++ analogical/namespaceaggregation/index.html | 965 +++ analogical/namespaceana/index.html | 1327 ++++ .../namespaceana_1_1aggregation/index.html | 995 +++ analogical/namespaceana_1_1column/index.html | 995 +++ analogical/namespaceana_1_1dataset/index.html | 1015 +++ .../namespaceana_1_1op__check/index.html | 965 +++ analogical/namespacecolumn/index.html | 965 +++ analogical/namespacelockstep/index.html | 965 +++ analogical/namespaces/index.html | 977 +++ analogical/namespacestd/index.html | 965 +++ analogical/namespacesystematic/index.html | 965 +++ analogical/pages/index.html | 963 +++ .../structana_1_1dataset_1_1first/index.html | 1067 +++ .../structana_1_1is__unique__ptr/index.html | 967 +++ .../index.html | 967 +++ analogical/variables/index.html | 963 +++ assets/agg_book_sels.png | Bin 0 -> 250726 bytes assets/dataflow.png | Bin 0 -> 74849 bytes assets/hww_hists.png | Bin 0 -> 466064 bytes assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.81fa17fe.min.js | 29 + assets/javascripts/bundle.81fa17fe.min.js.map | 7 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.el.min.js | 1 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.he.min.js | 1 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++++++ .../workers/search.f886a092.min.js | 42 + .../workers/search.f886a092.min.js.map | 7 + assets/mll_varied.png | Bin 0 -> 26139 bytes assets/pth_varied.png | Bin 0 -> 27760 bytes assets/sel_book_aggs.png | Bin 0 -> 169543 bytes assets/stylesheets/main.4b4a2bd9.min.css | 1 + assets/stylesheets/main.4b4a2bd9.min.css.map | 1 + assets/stylesheets/palette.356b1318.min.css | 1 + .../stylesheets/palette.356b1318.min.css.map | 1 + assets/variation.png | Bin 0 -> 125896 bytes demo/hww/notebook/index.html | 1265 ++++ features/aggregation/aggregation/index.html | 1260 ++++ features/aggregation/experiment/index.html | 1071 +++ features/basic/index.html | 1088 +++ features/column/column/index.html | 1466 ++++ features/column/computation/index.html | 1076 +++ features/dataflow/dataflow/index.html | 1063 +++ features/lazy/index.html | 1016 +++ features/multithread/index.html | 1022 +++ features/selection/cutflow/index.html | 1092 +++ features/selection/selection/index.html | 1200 +++ features/sensitivity/variation/index.html | 1176 +++ features/sensitivity/vary/index.html | 1249 +++ home/design/index.html | 1029 +++ home/installation/index.html | 1172 +++ home/quick/index.html | 1032 +++ index.html | 1013 +++ javascripts/mathjax.js | 16 + sitemap.xml | 3 + sitemap.xml.gz | Bin 0 -> 127 bytes stylesheets/extra.css | 3 + 144 files changed, 106698 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 analogical/aggregation__logic_8h/index.html create mode 100644 analogical/aggregation__logic_8h_source/index.html create mode 100644 analogical/annotated/index.html create mode 100644 analogical/class_member_enums/index.html create mode 100644 analogical/class_member_functions/index.html create mode 100644 analogical/class_member_typedefs/index.html create mode 100644 analogical/class_member_variables/index.html create mode 100644 analogical/class_members/index.html create mode 100644 analogical/classana_1_1aggregation_1_1logic_3_01T_07Obs_8_8_8_08_4/index.html create mode 100644 analogical/classana_1_1column_1_1definition_3_01Ret_07Vals_8_8_8_08_4/index.html create mode 100644 analogical/classana_1_1dataflow/index.html create mode 100644 analogical/classana_1_1dataset_1_1column/index.html create mode 100644 analogical/classana_1_1dataset_1_1input/index.html create mode 100644 analogical/classana_1_1dataset_1_1player/index.html create mode 100644 analogical/classana_1_1dataset_1_1reader/index.html create mode 100644 analogical/classana_1_1dataset_1_1source/index.html create mode 100644 analogical/classana_1_1delayed/index.html create mode 100644 analogical/classana_1_1delayed_1_1varied/index.html create mode 100644 analogical/classana_1_1lazy/index.html create mode 100644 analogical/classana_1_1lazy_1_1varied/index.html create mode 100644 analogical/classes/index.html create mode 100644 analogical/column__definition_8h/index.html create mode 100644 analogical/column__definition_8h_source/index.html create mode 100644 analogical/dataflow_8h/index.html create mode 100644 analogical/dataflow_8h_source/index.html create mode 100644 analogical/dataset_8h/index.html create mode 100644 analogical/dataset_8h_source/index.html create mode 100644 analogical/dataset__column_8h/index.html create mode 100644 analogical/dataset__column_8h_source/index.html create mode 100644 analogical/dataset__input_8h/index.html create mode 100644 analogical/dataset__input_8h_source/index.html create mode 100644 analogical/dataset__player_8h/index.html create mode 100644 analogical/dataset__player_8h_source/index.html create mode 100644 analogical/delayed_8h/index.html create mode 100644 analogical/delayed_8h_source/index.html create mode 100644 analogical/delayed__varied_8h/index.html create mode 100644 analogical/delayed__varied_8h_source/index.html create mode 100644 analogical/dir_84eaba6853347baf08a3d8bdb9ae76ed/index.html create mode 100644 analogical/dir_94c1dbed684461364b7a5c1bafc6ad0d/index.html create mode 100644 analogical/dir_d44c64559bbebec7f509842c48db8b23/index.html create mode 100644 analogical/files/index.html create mode 100644 analogical/functions/index.html create mode 100644 analogical/hierarchy/index.html create mode 100644 analogical/lazy_8h/index.html create mode 100644 analogical/lazy_8h_source/index.html create mode 100644 analogical/lazy__varied_8h/index.html create mode 100644 analogical/lazy__varied_8h_source/index.html create mode 100644 analogical/links/index.html create mode 100644 analogical/macros/index.html create mode 100644 analogical/modules/index.html create mode 100644 analogical/namespace_member_enums/index.html create mode 100644 analogical/namespace_member_functions/index.html create mode 100644 analogical/namespace_member_typedefs/index.html create mode 100644 analogical/namespace_member_variables/index.html create mode 100644 analogical/namespace_members/index.html create mode 100644 analogical/namespaceaggregation/index.html create mode 100644 analogical/namespaceana/index.html create mode 100644 analogical/namespaceana_1_1aggregation/index.html create mode 100644 analogical/namespaceana_1_1column/index.html create mode 100644 analogical/namespaceana_1_1dataset/index.html create mode 100644 analogical/namespaceana_1_1op__check/index.html create mode 100644 analogical/namespacecolumn/index.html create mode 100644 analogical/namespacelockstep/index.html create mode 100644 analogical/namespaces/index.html create mode 100644 analogical/namespacestd/index.html create mode 100644 analogical/namespacesystematic/index.html create mode 100644 analogical/pages/index.html create mode 100644 analogical/structana_1_1dataset_1_1first/index.html create mode 100644 analogical/structana_1_1is__unique__ptr/index.html create mode 100644 analogical/structana_1_1is__unique__ptr_3_01std_1_1unique__ptr_3_01T_01_4_01_4/index.html create mode 100644 analogical/variables/index.html create mode 100644 assets/agg_book_sels.png create mode 100644 assets/dataflow.png create mode 100644 assets/hww_hists.png create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.81fa17fe.min.js create mode 100644 assets/javascripts/bundle.81fa17fe.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.el.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.he.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.f886a092.min.js create mode 100644 assets/javascripts/workers/search.f886a092.min.js.map create mode 100644 assets/mll_varied.png create mode 100644 assets/pth_varied.png create mode 100644 assets/sel_book_aggs.png create mode 100644 assets/stylesheets/main.4b4a2bd9.min.css create mode 100644 assets/stylesheets/main.4b4a2bd9.min.css.map create mode 100644 assets/stylesheets/palette.356b1318.min.css create mode 100644 assets/stylesheets/palette.356b1318.min.css.map create mode 100644 assets/variation.png create mode 100644 demo/hww/notebook/index.html create mode 100644 features/aggregation/aggregation/index.html create mode 100644 features/aggregation/experiment/index.html create mode 100644 features/basic/index.html create mode 100644 features/column/column/index.html create mode 100644 features/column/computation/index.html create mode 100644 features/dataflow/dataflow/index.html create mode 100644 features/lazy/index.html create mode 100644 features/multithread/index.html create mode 100644 features/selection/cutflow/index.html create mode 100644 features/selection/selection/index.html create mode 100644 features/sensitivity/variation/index.html create mode 100644 features/sensitivity/vary/index.html create mode 100644 home/design/index.html create mode 100644 home/installation/index.html create mode 100644 home/quick/index.html create mode 100644 index.html create mode 100644 javascripts/mathjax.js create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz create mode 100644 stylesheets/extra.css diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/404.html b/404.html new file mode 100644 index 00000000..a7d10d8f --- /dev/null +++ b/404.html @@ -0,0 +1,944 @@ + + + +
+ + + + + + + + + + + + + + +FileList > ana > interface > aggregation_logic.h
+Go to the source code of this file
+#include "aggregation.h"
#include "aggregation_output.h"
#include "column.h"
Type | +Name | +
---|---|
namespace | +ana |
+
Type | +Name | +
---|---|
class | +logic< T(Obs...)> <typename T, Obs> Counter output to be filled with columns using arbitrary logic. |
+
The documentation for this class was generated from the following file include/ana/interface/aggregation_logic.h
File List > ana > interface > aggregation_logic.h
+Go to the documentation of this file
+#pragma once
+
+#include "aggregation.h"
+#include "aggregation_output.h"
+
+namespace ana {
+
+template <typename T, typename... Obs>
+class aggregation::logic<T(Obs...)> : public aggregation::output<T> {
+
+public:
+ using vartup_type = std::tuple<ana::variable<Obs>...>;
+
+public:
+ logic() = default;
+ virtual ~logic() = default;
+
+ virtual void fill(ana::observable<Obs>... observables, double w) = 0;
+ virtual void count(double w) final override;
+
+ template <typename... Vals> void enter_columns(term<Vals> const &...cols);
+
+protected:
+ std::vector<vartup_type> m_fills;
+};
+
+} // namespace ana
+
+#include "column.h"
+
+template <typename T, typename... Obs>
+template <typename... Vals>
+void ana::aggregation::logic<T(Obs...)>::enter_columns(
+ term<Vals> const &...cols) {
+ static_assert(sizeof...(Obs) == sizeof...(Vals),
+ "dimension mis-match between filled variables & columns.");
+ m_fills.emplace_back(cols...);
+}
+
+template <typename T, typename... Obs>
+void ana::aggregation::logic<T(Obs...)>::count(double w) {
+ for (unsigned int ifill = 0; ifill < m_fills.size(); ++ifill) {
+ std::apply(
+ [this, w](const variable<Obs> &...obs) { this->fill(obs..., w); },
+ m_fills[ifill]);
+ }
+}
+
Here are the classes, structs, unions and interfaces with brief descriptions:
+Nothing related to Class Member Enums found.
+ + + + + + +template <typename T typename T, typename... Obs>
+ClassList > ana > aggregation > logic< T(Obs...)>
+Counter output to be filled with columns using arbitrary logic. More...
+#include <aggregation_logic.h>
Inherits the following classes: aggregation::output< T >
+Type | +Name | +
---|---|
typedef std::tuple< ana::variable< Obs >... > | +vartup_type |
+
Type | +Name | +
---|---|
virtual void | +count (double w) override |
+
void | +enter_columns (term< Vals > const &... cols) |
+
virtual void | +fill (ana::observable< Obs >... observables, double w) = 0 Perform the counting operation for an entry. |
+
+ | logic () = default |
+
virtual | +~logic () = default |
+
Type | +Name | +
---|---|
std::vector< vartup_type > | +m_fills |
+
Template parameters:
+Obs...
Input column data types. template<typename... Vals>
+void ana::aggregation::logic< T(Obs...)>::enter_columns (
+ term< Vals > const &... cols
+)
+
Perform the counting operation for an entry. +
virtual void ana::aggregation::logic< T(Obs...)>::fill (
+ ana::observable< Obs >... observables,
+ double w
+) = 0
+
Parameters:
+observables
The observable
of each input column. weight
The weight value of the booked selection for the passed entry.This operation is performed N times for a passed entry, where N is the number of fill
calls made to its lazy
operation, each with its the set of input columns as provided then.
The documentation for this class was generated from the following file include/ana/interface/aggregation_logic.h
template <typename Ret typename Ret, typename... Vals>
+ClassList > ana > column > definition< Ret(Vals...)>
+Column with user-defined return value type and evaluation dataset. More...
+#include <column_definition.h>
Inherits the following classes: column::calculation< Ret >
+Type | +Name | +
---|---|
typedef std::tuple< observable< Vals >... > | +obstuple_type |
+
typedef std::tuple< variable< Vals >... > | +vartuple_type |
+
Type | +Name | +
---|---|
virtual Ret | +calculate () override const |
+
+ | definition () = default |
+
virtual Ret | +evaluate (observable< Vals >... args) const = 0 |
+
void | +set_arguments (const cell< Ins > &... args) |
+
virtual | +~definition () = default |
+
Type | +Name | +
---|---|
vartuple_type | +m_arguments |
+
Type | +Name | +
---|---|
+ | definition (Args &&... args) |
+
Template parameters:
+T
return value type. virtual Ret ana::column::definition< Ret(Vals...)>::evaluate (
+ observable< Vals >... args
+) const = 0
+
template<typename... Ins>
+void ana::column::definition< Ret(Vals...)>::set_arguments (
+ const cell< Ins > &... args
+)
+
template<typename... Args>
+ana::column::definition< Ret(Vals...)>::definition (
+ Args &&... args
+)
+
The documentation for this class was generated from the following file include/ana/interface/column_definition.h
Type | +Name | +
---|---|
auto | +agg (Args &&... args) |
+
auto | +channel (const std::string & name) |
+
auto | +channel (const std::string & name, F callable) |
+
auto | +channel (const std::string & name, F callable) |
+
auto | +constant (Val const & val) Define a constant. |
+
auto | +constant (Args &&... args) |
+
+ | dataflow () Default constructor. |
+
+ | dataflow (Kwd kwarg) Constructor with one keyword argument. |
+
+ | dataflow (Kwd1 kwarg1, Kwd2 kwarg2) |
+
+ | dataflow (Kwd1 kwarg1, Kwd2 kwarg2, Kwd3 kwarg3) |
+
+ | dataflow (dataflow const &) = delete |
+
+ | dataflow (dataflow &&) = default |
+
auto | +define (Args &&... args) Define a custom definition or representation. |
+
auto | +define (F const & callable) Define an equation. |
+
auto | +filter (const std::string & name) |
+
auto | +filter (const std::string & name, F callable) |
+
auto | +open (Args &&... args) Open a dataset input. |
+
dataflow & | +operator= (dataflow const &) = delete |
+
dataflow & | +operator= (dataflow &&) = default |
+
auto | +select (const std::string & name, F callable) |
+
auto | +vary (lazy< column::template constant< Val > > const & nom, Vars const &... vars) |
+
auto | +vary (delayed< column::template evaluator< Col > > && nom, Vars const &... vars) |
+
auto | +weight (const std::string & name) |
+
auto | +weight (const std::string & name, F callable) |
+
+ | ~dataflow () = default |
+
Type | +Name | +
---|---|
bool | +m_analyzed |
+
multithread::configuration | +m_mtcfg |
+
double | +m_norm |
+
long long | +m_nrows |
+
std::vector< std::unique_ptr< operation > > | +m_operations |
+
dataset::partition | +m_partition |
+
lockstep::node< dataset::range > | +m_parts |
+
lockstep::node< dataset::player > | +m_players |
+
lockstep::node< dataset::processor > | +m_processors |
+
std::unique_ptr< dataset::source > | +m_source |
+
double | +m_weight |
+
Type | +Name | +
---|---|
void | +accept_kwarg (Kwd const & kwarg) |
+
void | +add_operation (lockstep::node< operation > act) |
+
void | +add_operation (std::unique_ptr< operation > act) |
+
void | +analyze () |
+
auto | +apply_selection (delayed< selection::applicator< Eqn > > const & calc, lazy< Cols > const &... columns) |
+
auto | +channel (lazy< selection > const & prev, const std::string & name, F callable) |
+
auto | +channel (lazy< selection > const & prev, const std::string & name) |
+
auto | +evaluate_column (delayed< column::evaluator< Def > > const & calc, lazy< Cols > const &... columns) |
+
auto | +read (dataset::input< DS > & ds, const std::string & name) |
+
void | +reset () |
+
auto | +select (lazy< selection > const & prev, const std::string & name) |
+
auto | +select (lazy< selection > const & prev, const std::string & name, F callable) |
+
auto | +select_aggregation (delayed< aggregation::booker< Cnt > > const & bkr, lazy< selection > const & sel) |
+
auto | +select_aggregations (delayed< aggregation::booker< Cnt > > const & bkr, lazy< Sels > const &... sels) |
+
void | +vary_constant (Lazy & syst, const std::string & name, std::tuple< Args... > args) |
+
void | +vary_evaluator (Eval & syst, const std::string & name, std::tuple< Args... > args) |
+
template<typename Cnt typename Cnt, typename... Args>
+auto ana::dataflow::agg (
+ Args &&... args
+)
+
template<typename F typename F>
+auto ana::dataflow::channel (
+ const std::string & name,
+ F callable
+)
+
template<typename Sel typename Sel, typename F typename F>
+auto ana::dataflow::channel (
+ const std::string & name,
+ F callable
+)
+
Define a constant. +
+Template parameters:
+Val
Constant data type. Parameters:
+value
Constant data value. Returns:
+The lazy
defined constant.
template<typename Val typename Val, typename... Args>
+auto ana::dataflow::constant (
+ Args &&... args
+)
+
Constructor with one keyword argument. +
+Template parameters:
+Kwd
Keyword argument type.A keyword argument can be:
+* ana::sample::weight(float)
+* ana::dataset::first(unsigned int)
+* ana::multithread::enable(unsigned int)
template<typename Kwd1 typename Kwd1, typename Kwd2 typename Kwd2>
+ana::dataflow::dataflow (
+ Kwd1 kwarg1,
+ Kwd2 kwarg2
+)
+
template<typename Kwd1 typename Kwd1, typename Kwd2 typename Kwd2, typename Kwd3 typename Kwd3>
+ana::dataflow::dataflow (
+ Kwd1 kwarg1,
+ Kwd2 kwarg2,
+ Kwd3 kwarg3
+)
+
Define a custom definition or representation. +
template<typename Def typename Def, typename... Args>
+auto ana::dataflow::define (
+ Args &&... args
+)
+
Template parameters:
+Def
The full definition/representation user-implementation. Parameters:
+args
Constructor arguments for the definition/representation. Returns:
+The lazy
definition "evaluator" to be evaluated with input columns.
Define an equation. +
+Template parameters:
+F
Any function/functor/callable type. Parameters:
+callable
The function/functor/callable object used as the expression. Returns:
+The lazy
equation "evaluator" to be evaluated with input columns.
template<typename F typename F>
+auto ana::dataflow::filter (
+ const std::string & name,
+ F callable
+)
+
Open a dataset input. +
template<typename DS typename DS, typename... Args>
+auto ana::dataflow::open (
+ Args &&... args
+)
+
Template parameters:
+DS
Dataset input. Args...
Dataset input constructor arguments Returns:
+Dataset reader
+template<typename Sel typename Sel, typename F typename F>
+auto ana::dataflow::select (
+ const std::string & name,
+ F callable
+)
+
template<typename Val typename Val, typename... Vars>
+auto ana::dataflow::vary (
+ lazy < column::template constant < Val > > const & nom,
+ Vars const &... vars
+)
+
template<typename Col typename Col, typename... Vars>
+auto ana::dataflow::vary (
+ delayed < column::template evaluator< Col > > && nom,
+ Vars const &... vars
+)
+
template<typename F typename F>
+auto ana::dataflow::weight (
+ const std::string & name,
+ F callable
+)
+
template<typename Eqn typename Eqn, typename... Cols>
+auto ana::dataflow::apply_selection (
+ delayed < selection::applicator< Eqn > > const & calc,
+ lazy < Cols > const &... columns
+)
+
template<typename Sel typename Sel, typename F typename F>
+auto ana::dataflow::channel (
+ lazy < selection > const & prev,
+ const std::string & name,
+ F callable
+)
+
template<typename Sel typename Sel>
+auto ana::dataflow::channel (
+ lazy < selection > const & prev,
+ const std::string & name
+)
+
template<typename Def typename Def, typename... Cols>
+auto ana::dataflow::evaluate_column (
+ delayed < column::evaluator< Def > > const & calc,
+ lazy < Cols > const &... columns
+)
+
template<typename DS typename DS, typename Val typename Val>
+auto ana::dataflow::read (
+ dataset::input < DS > & ds,
+ const std::string & name
+)
+
template<typename Sel typename Sel>
+auto ana::dataflow::select (
+ lazy < selection > const & prev,
+ const std::string & name
+)
+
template<typename Sel typename Sel, typename F typename F>
+auto ana::dataflow::select (
+ lazy < selection > const & prev,
+ const std::string & name,
+ F callable
+)
+
template<typename Cnt typename Cnt>
+auto ana::dataflow::select_aggregation (
+ delayed < aggregation::booker< Cnt > > const & bkr,
+ lazy < selection > const & sel
+)
+
template<typename Cnt typename Cnt, typename... Sels>
+auto ana::dataflow::select_aggregations (
+ delayed < aggregation::booker< Cnt > > const & bkr,
+ lazy < Sels > const &... sels
+)
+
template<typename Val typename Val, typename Lazy typename Lazy, typename... Args>
+void ana::dataflow::vary_constant (
+ Lazy & syst,
+ const std::string & name,
+ std::tuple< Args... > args
+)
+
template<typename Col typename Col, typename Eval typename Eval, typename... Args>
+void ana::dataflow::vary_evaluator (
+ Eval & syst,
+ const std::string & name,
+ std::tuple< Args... > args
+)
+
The documentation for this class was generated from the following file include/ana/interface/dataflow.h
template <typename T typename T>
+ClassList > ana > dataset > column
+Read columns from a dataset. More...
+#include <dataset_column.h>
Inherits the following classes: ana::term< T >
+Type | +Name | +
---|---|
+ | column () |
+
virtual void | +execute (const range & part, unsigned long long entry) override |
+
virtual T const & | +read (const range & part, unsigned long long entry) const = 0 Read the value of the column at current entry. |
+
virtual T const & | +value () override const Get the value of the column at current entry. |
+
virtual | +~column () = default |
+
Type | +Name | +
---|---|
T const * | +m_addr |
+
unsigned long long | +m_entry |
+
const range * | +m_part |
+
bool | +m_updated |
+
Template parameters:
+T
column data type. virtual void ana::dataset::column::execute (
+ const range & part,
+ unsigned long long entry
+) override
+
Read the value of the column at current entry. +
virtual T const & ana::dataset::column::read (
+ const range & part,
+ unsigned long long entry
+) const = 0
+
Returns:
+Column value
+Get the value of the column at current entry. +
+Returns:
+Column value
+The documentation for this class was generated from the following file include/ana/interface/dataset_column.h
template <typename DS typename DS>
+ClassList > ana > dataset > input
+Inherits the following classes: ana::dataset::source
+Type | +Name | +
---|---|
virtual partition | +allocate () = 0 |
+
virtual double | +normalize () |
+
std::unique_ptr< ana::dataset::player > | +open (const ana::dataset::range & part) |
+
decltype(auto) | +open_player (const range & part) |
+
decltype(auto) | +read_column (const ana::dataset::range & part, const std::string & name) |
+
virtual | +~input () = default |
+
Type | +Name | +
---|---|
virtual void | +finalize () |
+
virtual void | +initialize () |
+
virtual | +~source () = default |
+
std::unique_ptr< ana::dataset::player > ana::dataset::input::open (
+ const ana::dataset::range & part
+)
+
template<typename Val typename Val>
+decltype(auto) ana::dataset::input::read_column (
+ const ana::dataset::range & part,
+ const std::string & name
+)
+
The documentation for this class was generated from the following file include/ana/interface/dataset_input.h
ClassList > ana > dataset > player
+Inherits the following classes: operation
+Type | +Name | +
---|---|
virtual void | +execute (const range &, unsigned long long) override |
+
virtual void | +finalize (const range &) override |
+
virtual void | +initialize (const range &) override |
+
+ | player () = default |
+
virtual | +~player () = default |
+
inline virtual void ana::dataset::player::execute (
+ const range &,
+ unsigned long long
+) override
+
The documentation for this class was generated from the following file include/ana/interface/dataset_player.h
ClassList > ana > dataset > source
+Inherited by the following classes: ana::dataset::input
+Type | +Name | +
---|---|
virtual void | +finalize () |
+
virtual void | +initialize () |
+
virtual | +~source () = default |
+
The documentation for this class was generated from the following file include/ana/interface/dataset_input.h
template <typename Bkr typename Bkr>
+ +A node that instantiates a lazy action. More...
+#include <delayed.h>
Inherits the following classes: systematic::resolver< delayed< Bkr > >, lockstep::node< Bkr >
+Type | +Name | +
---|---|
class | +varied Varied version of a delayed node. |
+
Type | +Name | +
---|---|
auto | +apply (Nodes &&... columns) const Apply the selection's expression based on input columns. |
+
auto | +book (Node && selection) const Book the aggregation at a selection. |
+
auto | +book (Nodes &&... nodes) const |
+
+ | delayed (dataflow & dataflow, lockstep::node< Bkr > && operation) |
+
+ | delayed (delayed< V > && other) |
+
auto | +evaluate (Nodes &&... columns) const Evaluate the column out of existing ones. |
+
auto | +fill (Nodes &&... columns) const Fill the aggregation with input columns. |
+
virtual bool | +has_variation (const std::string & var_name) override const |
+
auto | +list_selection_paths () const |
+
virtual std::set< std::string > | +list_variation_names () override const |
+
virtual delayed const & | +nominal () override const |
+
auto | +operator() (Args &&... columns) const Shorthand for evaluate() andapply() for column and selection respectively. |
+
delayed & | +operator= (delayed< V > && other) |
+
auto | +operator[] (const std::string & selection_path) const Access a aggregation booked at a selection path. |
+
virtual void | +set_variation (const std::string & var_name, delayed && var) override |
+
virtual delayed const & | +variation (const std::string & var_name) override const |
+
virtual | +~delayed () = default |
+
Type | +Name | +
---|---|
auto | +apply_selection (Nodes const &... columns) const |
+
auto | +apply_selection (Nodes const &... columns) const |
+
auto | +evaluate_column (Nodes const &... columns) const Evaluate a column definition out of nominal input columns. |
+
auto | +evaluate_column (Nodes const &... columns) const Evaluate a column definition out of at least one varied input columns. |
+
auto | +evaluate_or_apply (Args &&... columns) const |
+
auto | +evaluate_or_apply (Args &&... columns) const |
+
auto | +fill_aggregation (Nodes const &... columns) const |
+
auto | +fill_aggregation (Nodes const &... columns) const |
+
auto | +get_aggregation (const std::string & selection_path) const |
+
auto | +select_aggregation (Node const & sel) const Book an aggregation at a nominal selection. |
+
auto | +select_aggregation (Node const & sel) const Book an aggregation at a varied selection. |
+
auto | +select_aggregations (Nodes const &... sels) const |
+
auto | +select_aggregations (Nodes const &... sels) const |
+
A delayed node requires additional inputs to instantiate a lazy action.
+Template parameters:
+Bkr
Booker that instantiates a lazy action. Apply the selection's expression based on input columns. +
template<typename... Nodes, typename V typename V, std::enable_if_t< ana::selection::template is_applicator_v< V >, bool > std::enable_if_t< ana::selection::template is_applicator_v< V >, bool >>
+inline auto ana::delayed::apply (
+ Nodes &&... columns
+) const
+
Parameters:
+columns
Input columns. Returns:
+Applied selection.
+Book the aggregation at a selection. +
template<typename Node typename Node>
+inline auto ana::delayed::book (
+ Node && selection
+) const
+
Parameters:
+selection
Selection to be counted. Returns:
+The aggregation booked at the selection.
+Evaluate the column out of existing ones. +
template<typename... Nodes, typename V typename V, std::enable_if_t< ana::column::template is_evaluator_v< V >, bool > std::enable_if_t< ana::column::template is_evaluator_v< V >, bool >>
+inline auto ana::delayed::evaluate (
+ Nodes &&... columns
+) const
+
Parameters:
+columns
Input columns. Returns:
+Evaluated column.
+Fill the aggregation with input columns. +
template<typename... Nodes, typename V typename V, std::enable_if_t< ana::aggregation::template is_booker_v< V >, bool > std::enable_if_t< ana::aggregation::template is_booker_v< V >, bool >>
+inline auto ana::delayed::fill (
+ Nodes &&... columns
+) const
+
Parameters:
+columns
Input columns Returns:
+The aggregation filled with input columns.
+template<typename V typename V, std::enable_if_t< ana::aggregation::template is_bookkeeper_v< V >, bool > std::enable_if_t< ana::aggregation::template is_bookkeeper_v< V >, bool >>
+inline auto ana::delayed::list_selection_paths () const
+
Returns:
+The list of booked selection paths.
+Shorthand for evaluate()
andapply()
for column and selection respectively.
+
template<typename... Args, typename V typename V, std::enable_if_t< column::template is_evaluator_v< V >||selection::template is_applicator_v< V >, bool > std::enable_if_t< column::template is_evaluator_v< V >||selection::template is_applicator_v< V >, bool >>
+inline auto ana::delayed::operator() (
+ Args &&... columns
+) const
+
Parameters:
+columns
The input columns. Returns:
+The evaluated/applied column/selection.
+template<typename V typename V>
+inline delayed & ana::delayed::operator= (
+ delayed < V > && other
+)
+
Access a aggregation booked at a selection path. +
template<typename... Args, typename V typename V, std::enable_if_t< aggregation::template is_bookkeeper_v< V >, bool > std::enable_if_t< aggregation::template is_bookkeeper_v< V >, bool >>
+inline auto ana::delayed::operator[] (
+ const std::string & selection_path
+) const
+
Parameters:
+selection_path
The selection path. Returns:
+The aggregation.
+virtual void ana::delayed::set_variation (
+ const std::string & var_name,
+ delayed && var
+) override
+
virtual delayed const & ana::delayed::variation (
+ const std::string & var_name
+) override const
+
template<typename... Nodes, typename V typename V, std::enable_if_t< selection::template is_applicator_v< V > &&ana::has_no_variation_v< Nodes... >, bool > std::enable_if_t< selection::template is_applicator_v< V > &&ana::has_no_variation_v< Nodes... >, bool >>
+inline auto ana::delayed::apply_selection (
+ Nodes const &... columns
+) const
+
template<typename... Nodes, typename V typename V, std::enable_if_t< selection::template is_applicator_v< V > &&ana::has_variation_v< Nodes... >, bool > std::enable_if_t< selection::template is_applicator_v< V > &&ana::has_variation_v< Nodes... >, bool >>
+inline auto ana::delayed::apply_selection (
+ Nodes const &... columns
+) const
+
template<typename... Nodes, typename V typename V, std::enable_if_t< ana::column::template is_evaluator_v< V > &&ana::has_no_variation_v< Nodes... >, bool > std::enable_if_t< ana::column::template is_evaluator_v< V > &&ana::has_no_variation_v< Nodes... >, bool >>
+inline auto ana::delayed::evaluate_column (
+ Nodes const &... columns
+) const
+
template<typename... Nodes, typename V typename V, std::enable_if_t< ana::column::template is_evaluator_v< V > &&ana::has_variation_v< Nodes... >, bool > std::enable_if_t< ana::column::template is_evaluator_v< V > &&ana::has_variation_v< Nodes... >, bool >>
+inline auto ana::delayed::evaluate_column (
+ Nodes const &... columns
+) const
+
template<typename... Args, typename V typename V, std::enable_if_t< column::template is_evaluator_v< V >, bool > std::enable_if_t< column::template is_evaluator_v< V >, bool >>
+inline auto ana::delayed::evaluate_or_apply (
+ Args &&... columns
+) const
+
template<typename... Args, typename V typename V, std::enable_if_t< selection::template is_applicator_v< V >, bool > std::enable_if_t< selection::template is_applicator_v< V >, bool >>
+inline auto ana::delayed::evaluate_or_apply (
+ Args &&... columns
+) const
+
template<typename... Nodes, typename V typename V, std::enable_if_t< ana::aggregation::template is_booker_v< V > &&ana::has_no_variation_v< Nodes... >, bool > std::enable_if_t< ana::aggregation::template is_booker_v< V > &&ana::has_no_variation_v< Nodes... >, bool >>
+inline auto ana::delayed::fill_aggregation (
+ Nodes const &... columns
+) const
+
template<typename... Nodes, typename V typename V, std::enable_if_t< ana::aggregation::template is_booker_v< V > &&has_variation_v< Nodes... >, bool > std::enable_if_t< ana::aggregation::template is_booker_v< V > &&has_variation_v< Nodes... >, bool >>
+inline auto ana::delayed::fill_aggregation (
+ Nodes const &... columns
+) const
+
template<typename V typename V, std::enable_if_t< ana::aggregation::template is_bookkeeper_v< V >, bool > std::enable_if_t< ana::aggregation::template is_bookkeeper_v< V >, bool >>
+inline auto ana::delayed::get_aggregation (
+ const std::string & selection_path
+) const
+
template<typename Node typename Node, typename V typename V, std::enable_if_t< ana::aggregation::template is_booker_v< V > &&ana::is_nominal_v< Node >, bool > std::enable_if_t< ana::aggregation::template is_booker_v< V > &&ana::is_nominal_v< Node >, bool >>
+inline auto ana::delayed::select_aggregation (
+ Node const & sel
+) const
+
template<typename Node typename Node, typename V typename V, std::enable_if_t< ana::aggregation::template is_booker_v< V > &&ana::is_varied_v< Node >, bool > std::enable_if_t< ana::aggregation::template is_booker_v< V > &&ana::is_varied_v< Node >, bool >>
+inline auto ana::delayed::select_aggregation (
+ Node const & sel
+) const
+
template<typename... Nodes, typename V typename V, std::enable_if_t< ana::aggregation::template is_booker_v< V > &&ana::has_no_variation_v< Nodes... >, bool > std::enable_if_t< ana::aggregation::template is_booker_v< V > &&ana::has_no_variation_v< Nodes... >, bool >>
+inline auto ana::delayed::select_aggregations (
+ Nodes const &... sels
+) const
+
template<typename... Nodes, typename V typename V, std::enable_if_t< ana::aggregation::template is_booker_v< V > &&has_variation_v< Nodes... >, bool > std::enable_if_t< ana::aggregation::template is_booker_v< V > &&has_variation_v< Nodes... >, bool >>
+inline auto ana::delayed::select_aggregations (
+ Nodes const &... sels
+) const
+
The documentation for this class was generated from the following file include/ana/interface/delayed.h
ClassList > ana > delayed > varied
+Varied version of a delayed node. More...
+#include <delayed_varied.h>
Inherits the following classes: systematic::resolver< delayed< Bld > >
+Type | +Name | +
---|---|
auto | +apply (Nodes const &... columns) |
+
auto | +book (Node const & selection) Book the aggregation logic at a selection. |
+
auto | +book (Nodes const &... selections) Book the aggregation logic at multiple selections. |
+
auto | +evaluate (Args &&... args) |
+
auto | +fill (Nodes const &... columns) Fill the aggregation with input columns. |
+
virtual bool | +has_variation (const std::string & var_name) override const |
+
virtual std::set< std::string > | +list_variation_names () override const |
+
virtual delayed const & | +nominal () override const |
+
auto | +operator() (Args &&... args) Evaluate/apply the column definition/selection with input columns. |
+
varied & | +operator= (varied &&) = default |
+
auto | +operator[] (const std::string & var_name) const Access the delayed of a specific systematic variation. |
+
virtual void | +set_variation (const std::string & var_name, delayed && var) override |
+
virtual delayed const & | +variation (const std::string & var_name) override const |
+
+ | varied (delayed< Bld > && nom) |
+
+ | varied (varied &&) = default |
+
+ | ~varied () = default |
+
Type | +Name | +
---|---|
delayed< Bld > | +m_nominal |
+
std::unordered_map< std::string, delayed< Bld > > | +m_variation_map |
+
std::set< std::string > | +m_variation_names |
+
A delayed varied operation is functionally equivalent to a delayed node, except that it contains multiple nodes corresponding to nominal and systematic variations.
+template<typename... Nodes, typename V typename V, std::enable_if_t< ana::selection::template is_applicator_v< V >, bool > std::enable_if_t< ana::selection::template is_applicator_v< V >, bool >>
+auto ana::delayed::varied::apply (
+ Nodes const &... columns
+)
+
Book the aggregation logic at a selection. +
template<typename Node typename Node, typename V typename V, std::enable_if_t< ana::aggregation::template is_booker_v< V >, bool > std::enable_if_t< ana::aggregation::template is_booker_v< V >, bool >>
+auto ana::delayed::varied::book (
+ Node const & selection
+)
+
Parameters:
+selection
Lazy selection to book aggregation at. Returns:
+Lazy aggregation booked at selection.
+Book the aggregation logic at multiple selections. +
template<typename... Nodes, typename V typename V, std::enable_if_t< ana::aggregation::template is_booker_v< V >, bool > std::enable_if_t< ana::aggregation::template is_booker_v< V >, bool >>
+auto ana::delayed::varied::book (
+ Nodes const &... selections
+)
+
Parameters:
+selection
Lazy selection to book aggregations at. Returns:
+Delayed aggregation containing booked lazy aggregations.
+template<typename... Args, typename V typename V, std::enable_if_t< ana::column::template is_evaluator_v< V >, bool > std::enable_if_t< ana::column::template is_evaluator_v< V >, bool >>
+auto ana::delayed::varied::evaluate (
+ Args &&... args
+)
+
Fill the aggregation with input columns. +
template<typename... Nodes, typename V typename V, std::enable_if_t< ana::aggregation::template is_booker_v< V >, bool > std::enable_if_t< ana::aggregation::template is_booker_v< V >, bool >>
+auto ana::delayed::varied::fill (
+ Nodes const &... columns
+)
+
Parameters:
+columns...
Input columns to fill the aggregation with. Returns:
+A new delayed aggregation node with input columns filled.
+virtual bool ana::delayed::varied::has_variation (
+ const std::string & var_name
+) override const
+
Evaluate/apply the column definition/selection with input columns. +
+Parameters:
+args...
Lazy input columns Returns:
+Lazy column definition
+Access the delayed of a specific systematic variation. +
template<typename V typename V, std::enable_if_t< ana::aggregation::template is_bookkeeper_v< V >, bool > std::enable_if_t< ana::aggregation::template is_bookkeeper_v< V >, bool >>
+auto ana::delayed::varied::operator[] (
+ const std::string & var_name
+) const
+
Parameters:
+var_name
Name of the systematic variation. Returns:
+Delayed node corresponding to systematic variation.
+virtual void ana::delayed::varied::set_variation (
+ const std::string & var_name,
+ delayed && var
+) override
+
virtual delayed const & ana::delayed::varied::variation (
+ const std::string & var_name
+) override const
+
The documentation for this class was generated from the following file include/ana/interface/delayed_varied.h
template <typename Action typename Action>
+ +Inherits the following classes: systematic::resolver< lazy< Action > >, lockstep::view< Action >
+Type | +Name | +
---|---|
class | +varied Variations of a lazy operation to be performed in an dataflow. |
+
Type | +Name | +
---|---|
typedef Action | +operation_type |
+
Type | +Name | +
---|---|
auto | +book (Agg && agg) const |
+
auto | +book (Aggs &&... aggs) const |
+
auto | +channel (const std::string & name, Args &&... args) const |
+
auto | +filter (const std::string & name, Args &&... args) const |
+
virtual bool | +has_variation (const std::string & var_name) override const |
+
+ | lazy (dataflow & dataflow, const lockstep::view< Action > & operation) |
+
+ | lazy (dataflow & dataflow, const lockstep::node< Action > & operation) |
+
+ | lazy (const lazy &) = default |
+
+ | lazy (lazy< Derived > const & derived) |
+
virtual std::set< std::string > | +list_variation_names () override const |
+
virtual lazy const & | +nominal () override const |
+
auto | +operator-> () const |
+
lazy & | +operator= (const lazy &) = default |
+
lazy & | +operator= (lazy< Derived > const & derived) |
+
ana::lazy< Action > & | +operator= (lazy< Derived > const & derived) |
+
std::string | +path () const |
+
auto | +result () const |
+
virtual void | +set_variation (const std::string & var_name, lazy && var) override |
+
virtual lazy const & | +variation (const std::string & var_name) override const |
+
auto | +weight (const std::string & name, Args &&... args) const |
+
virtual | +~lazy () = default |
+
Type | +Name | +
---|---|
void | +merge_results () const |
+
template<typename... Args>
+auto ana::lazy::channel (
+ const std::string & name,
+ Args &&... args
+) const
+
template<typename... Args>
+auto ana::lazy::filter (
+ const std::string & name,
+ Args &&... args
+) const
+
template<typename Derived typename Derived>
+ana::lazy::lazy (
+ lazy < Derived > const & derived
+)
+
template<typename V typename V, std::enable_if_t< ana::aggregation::template has_output_v< V >, bool > std::enable_if_t< ana::aggregation::template has_output_v< V >, bool >>
+inline auto ana::lazy::operator-> () const
+
template<typename Derived typename Derived>
+lazy & ana::lazy::operator= (
+ lazy < Derived > const & derived
+)
+
template<typename Derived typename Derived>
+ana::lazy < Action > & ana::lazy::operator= (
+ lazy < Derived > const & derived
+)
+
template<typename V typename V, std::enable_if_t< is_selection_v< V >, bool > std::enable_if_t< is_selection_v< V >, bool >>
+inline std::string ana::lazy::path () const
+
template<typename V typename V, std::enable_if_t< ana::aggregation::template has_output_v< V >, bool > std::enable_if_t< ana::aggregation::template has_output_v< V >, bool >>
+auto ana::lazy::result () const
+
template<typename... Args>
+auto ana::lazy::weight (
+ const std::string & name,
+ Args &&... args
+) const
+
template<typename V typename V, std::enable_if_t< ana::aggregation::template has_output_v< V >, bool > std::enable_if_t< ana::aggregation::template has_output_v< V >, bool >>
+void ana::lazy::merge_results () const
+
The documentation for this class was generated from the following file include/ana/interface/lazy.h
ClassList > ana > lazy > varied
+Variations of a lazy operation to be performed in an dataflow. More...
+#include <lazy_varied.h>
Inherits the following classes: systematic::resolver< lazy< Act > >
+Type | +Name | +
---|---|
typedef typename decltype(std::declval< dataflow >().filter(std::declval< std::string >(), std::declval< Args >()...))::varied | +delayed_varied_selection_applicator_t |
+
typedef typename lazy< Act >::operation_type | +operation_type |
+
Type | +Name | +
---|---|
auto | +book (Agg && agg) |
+
auto | +book (Aggs &&... aggs) |
+
auto | +channel (const std::string & name, Args &&... arguments) |
+
auto | +filter (const std::string & name, Args &&... arguments) |
+
virtual bool | +has_variation (const std::string & var_name) override const |
+
virtual std::set< std::string > | +list_variation_names () override const |
+
virtual lazy const & | +nominal () override const |
+
auto | +operator[] (const std::string & var_name) const |
+
virtual void | +set_variation (const std::string & var_name, lazy && var) override |
+
virtual lazy const & | +variation (const std::string & var_name) override const |
+
+ | varied (lazy< Act > const & nom) |
+
auto | +weight (const std::string & name, Args &&... arguments) |
+
+ | ~varied () = default |
+
Type | +Name | +
---|---|
lazy< Act > | +m_nom |
+
std::unordered_map< std::string, lazy< Act > > | +m_var_map |
+
std::set< std::string > | +m_var_names |
+
Template parameters:
+T
Input dataset type U
Actions to be performed lazily.A varied
node can be treated identical to a lazy
one, except that it contains multiple variations of the operation as dictated by the analyzer that propagate through the rest of the analysis.
using ana::lazy< Action >::varied::delayed_varied_selection_applicator_t = typename decltype(std::declval<dataflow>().filter( std::declval<std::string>(), std::declval<Args>()...))::varied;
+
template<typename Agg typename Agg, typename V typename V, std::enable_if_t< ana::is_selection_v< V >, bool > std::enable_if_t< ana::is_selection_v< V >, bool >>
+auto ana::lazy::varied::book (
+ Agg && agg
+)
+
template<typename... Aggs, typename V typename V, std::enable_if_t< ana::is_selection_v< V >, bool > std::enable_if_t< ana::is_selection_v< V >, bool >>
+auto ana::lazy::varied::book (
+ Aggs &&... aggs
+)
+
template<typename... Args, typename V typename V, std::enable_if_t< ana::is_selection_v< V >, bool > std::enable_if_t< ana::is_selection_v< V >, bool >>
+auto ana::lazy::varied::channel (
+ const std::string & name,
+ Args &&... arguments
+)
+
template<typename... Args, typename V typename V, std::enable_if_t< ana::is_selection_v< V >, bool > std::enable_if_t< ana::is_selection_v< V >, bool >>
+auto ana::lazy::varied::filter (
+ const std::string & name,
+ Args &&... arguments
+)
+
template<typename V typename V, std::enable_if_t< ana::is_column_v< V >||ana::aggregation::template has_output_v< V >, bool > std::enable_if_t< ana::is_column_v< V >||ana::aggregation::template has_output_v< V >, bool >>
+auto ana::lazy::varied::operator[] (
+ const std::string & var_name
+) const
+
virtual void ana::lazy::varied::set_variation (
+ const std::string & var_name,
+ lazy && var
+) override
+
virtual lazy const & ana::lazy::varied::variation (
+ const std::string & var_name
+) override const
+
template<typename... Args, typename V typename V, std::enable_if_t< ana::is_selection_v< V >, bool > std::enable_if_t< ana::is_selection_v< V >, bool >>
+auto ana::lazy::varied::weight (
+ const std::string & name,
+ Args &&... arguments
+)
+
The documentation for this class was generated from the following file include/ana/interface/lazy_varied.h
FileList > ana > interface > column_definition.h
+Go to the source code of this file
+#include <memory>
#include <tuple>
#include "column_calculation.h"
Type | +Name | +
---|---|
namespace | +ana |
+
Type | +Name | +
---|---|
class | +definition< Ret(Vals...)> <typename Ret, Vals> Column with user-defined return value type and evaluation dataset. |
+
The documentation for this class was generated from the following file include/ana/interface/column_definition.h
File List > ana > interface > column_definition.h
+Go to the documentation of this file
+#pragma once
+
+#include <memory>
+#include <tuple>
+
+#include "column_calculation.h"
+
+namespace ana {
+
+template <typename Ret, typename... Vals>
+class column::definition<Ret(Vals...)> : public column::calculation<Ret> {
+
+public:
+ using vartuple_type = std::tuple<variable<Vals>...>;
+ using obstuple_type = std::tuple<observable<Vals>...>;
+
+public:
+ definition() = default;
+ virtual ~definition() = default;
+
+protected:
+ template <typename... Args> definition(Args &&...args);
+
+public:
+ virtual Ret calculate() const final override;
+ virtual Ret evaluate(observable<Vals>... args) const = 0;
+
+ template <typename... Ins> void set_arguments(const cell<Ins> &...args);
+
+protected:
+ vartuple_type m_arguments;
+};
+
+} // namespace ana
+
+template <typename Ret, typename... Vals>
+template <typename... Args>
+ana::column::definition<Ret(Vals...)>::definition(Args &&...args)
+ : calculation<Ret>(std::forward<Args>(args)...) {}
+
+template <typename Ret, typename... Vals>
+template <typename... Ins>
+void ana::column::definition<Ret(Vals...)>::set_arguments(
+ cell<Ins> const &...args) {
+ static_assert(sizeof...(Vals) == sizeof...(Ins));
+ m_arguments = std::make_tuple(std::invoke(
+ [](const cell<Ins> &args) -> variable<Vals> {
+ return variable<Vals>(args);
+ },
+ args)...);
+}
+
+template <typename Ret, typename... Vals>
+Ret ana::column::definition<Ret(Vals...)>::calculate() const {
+ return std::apply(
+ [this](const variable<Vals> &...args) { return this->evaluate(args...); },
+ m_arguments);
+}
+
FileList > ana > interface > dataflow.h
+Go to the source code of this file
+#include <memory>
#include <set>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include "multithread.h"
#include "sample.h"
#include "aggregation.h"
#include "column.h"
#include "dataset.h"
#include "selection.h"
#include "systematic.h"
#include "dataset_partition.h"
#include "delayed.h"
#include "lazy.h"
#include "lazy_varied.h"
#include "dataset_range.h"
#include "dataset_reader.h"
#include "systematic_resolver.h"
#include "systematic_variation.h"
Type | +Name | +
---|---|
namespace | +ana |
+
Type | +Name | +
---|---|
class | +dataflow |
+
The documentation for this class was generated from the following file include/ana/interface/dataflow.h
File List > ana > interface > dataflow.h
+Go to the documentation of this file
+#pragma once
+
+#include <memory>
+#include <set>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <vector>
+
+#include "multithread.h"
+#include "sample.h"
+
+#include "aggregation.h"
+#include "column.h"
+#include "dataset.h"
+#include "selection.h"
+#include "systematic.h"
+
+#include "dataset_partition.h"
+
+namespace ana {
+
+template <typename T> class lazy;
+
+template <typename U> class delayed;
+
+class dataflow {
+
+public:
+ template <typename> friend class dataset::reader;
+ template <typename> friend class lazy;
+ template <typename> friend class delayed;
+
+public:
+ dataflow();
+ ~dataflow() = default;
+
+ template <typename Kwd> dataflow(Kwd kwarg);
+ template <typename Kwd1, typename Kwd2> dataflow(Kwd1 kwarg1, Kwd2 kwarg2);
+ template <typename Kwd1, typename Kwd2, typename Kwd3>
+ dataflow(Kwd1 kwarg1, Kwd2 kwarg2, Kwd3 kwarg3);
+
+ dataflow(dataflow const &) = delete;
+ dataflow &operator=(dataflow const &) = delete;
+
+ dataflow(dataflow &&) = default;
+ dataflow &operator=(dataflow &&) = default;
+
+ template <typename DS, typename... Args>
+ auto open(Args &&...args) -> dataset::reader<DS>;
+
+ template <typename Val>
+ auto constant(Val const &val) -> lazy<column::constant<Val>>;
+ template <typename Val, typename... Args>
+ auto constant(Args &&...args) -> lazy<column::constant<Val>>;
+
+ template <typename Def, typename... Args> auto define(Args &&...args);
+
+ template <typename F> auto define(F const &callable);
+
+ auto filter(const std::string &name);
+ auto weight(const std::string &name);
+
+ template <typename F> auto filter(const std::string &name, F callable);
+ template <typename F>
+ auto weight(const std::string &name, F callable)
+ -> delayed<selection::template custom_applicator_t<F>>;
+
+ auto channel(const std::string &name);
+ template <typename F> auto channel(const std::string &name, F callable);
+
+ template <typename Sel, typename F>
+ auto select(const std::string &name, F callable)
+ -> delayed<selection::template custom_applicator_t<F>>;
+ template <typename Sel, typename F>
+ auto channel(const std::string &name, F callable)
+ -> delayed<selection::template custom_applicator_t<F>>;
+
+ template <typename Cnt, typename... Args>
+ auto agg(Args &&...args) -> delayed<aggregation::booker<Cnt>>;
+
+ template <typename Val, typename... Vars>
+ auto vary(lazy<column::template constant<Val>> const &nom,
+ Vars const &...vars);
+
+ template <typename Col, typename... Vars>
+ auto vary(delayed<column::template evaluator<Col>> &&nom,
+ Vars const &...vars);
+
+protected:
+ template <typename Kwd> void accept_kwarg(Kwd const &kwarg);
+
+ void analyze();
+ void reset();
+
+ template <typename DS, typename Val>
+ auto read(dataset::input<DS> &ds, const std::string &name)
+ -> lazy<read_column_t<DS, Val>>;
+
+ template <typename Def, typename... Cols>
+ auto evaluate_column(delayed<column::evaluator<Def>> const &calc,
+ lazy<Cols> const &...columns) -> lazy<Def>;
+ template <typename Eqn, typename... Cols>
+ auto apply_selection(delayed<selection::applicator<Eqn>> const &calc,
+ lazy<Cols> const &...columns) -> lazy<selection>;
+ template <typename Cnt>
+ auto select_aggregation(delayed<aggregation::booker<Cnt>> const &bkr,
+ lazy<selection> const &sel) -> lazy<Cnt>;
+ template <typename Cnt, typename... Sels>
+ auto select_aggregations(delayed<aggregation::booker<Cnt>> const &bkr,
+ lazy<Sels> const &...sels)
+ -> delayed<aggregation::bookkeeper<Cnt>>;
+
+ template <typename Sel>
+ auto select(lazy<selection> const &prev, const std::string &name);
+ template <typename Sel, typename F>
+ auto select(lazy<selection> const &prev, const std::string &name, F callable)
+ -> delayed<selection::template custom_applicator_t<F>>;
+
+ template <typename Sel, typename F>
+ auto channel(lazy<selection> const &prev, const std::string &name, F callable)
+ -> delayed<selection::template custom_applicator_t<F>>;
+ template <typename Sel>
+ auto channel(lazy<selection> const &prev, const std::string &name);
+
+ template <typename Col, typename Eval, typename... Args>
+ void vary_evaluator(Eval &syst, const std::string &name,
+ std::tuple<Args...> args);
+
+ template <typename Val, typename Lazy, typename... Args>
+ void vary_constant(Lazy &syst, const std::string &name,
+ std::tuple<Args...> args);
+
+ void add_operation(lockstep::node<operation> act);
+ void add_operation(std::unique_ptr<operation> act);
+
+protected:
+ multithread::configuration m_mtcfg;
+ long long m_nrows;
+ double m_weight;
+
+ dataset::partition m_partition;
+ double m_norm;
+
+ std::unique_ptr<dataset::source> m_source;
+
+ lockstep::node<dataset::range> m_parts;
+ lockstep::node<dataset::player> m_players;
+ lockstep::node<dataset::processor> m_processors;
+
+ std::vector<std::unique_ptr<operation>> m_operations;
+ bool m_analyzed;
+};
+
+template <typename T> using operation_t = typename T::nominal_type;
+
+} // namespace ana
+
+#include "delayed.h"
+#include "lazy.h"
+#include "lazy_varied.h"
+
+#include "dataset_range.h"
+#include "dataset_reader.h"
+
+#include "systematic_resolver.h"
+#include "systematic_variation.h"
+
+inline ana::dataflow::dataflow()
+ : m_mtcfg(ana::multithread::disable()), m_nrows(-1), m_weight(1.0),
+ m_source(nullptr), m_analyzed(false) {}
+
+template <typename Kwd> ana::dataflow::dataflow(Kwd kwarg) : dataflow() {
+ this->accept_kwarg<Kwd>(kwarg);
+}
+
+template <typename Kwd1, typename Kwd2>
+ana::dataflow::dataflow(Kwd1 kwarg1, Kwd2 kwarg2) : dataflow() {
+ static_assert(!std::is_same_v<Kwd1, Kwd2>, "repeated keyword arguments.");
+ this->accept_kwarg<Kwd1>(kwarg1);
+ this->accept_kwarg<Kwd2>(kwarg2);
+}
+
+template <typename Kwd> void ana::dataflow::accept_kwarg(Kwd const &kwarg) {
+ constexpr bool is_mt = std::is_same_v<Kwd, multithread::configuration>;
+ constexpr bool is_weight = std::is_same_v<Kwd, sample::weight>;
+ constexpr bool is_nrows = std::is_same_v<Kwd, dataset::first>;
+ if constexpr (is_mt) {
+ this->m_mtcfg = kwarg;
+ } else if (is_weight) {
+ this->m_weight = kwarg.value;
+ } else if (is_nrows) {
+ this->m_nrows = kwarg.nrows;
+ } else {
+ static_assert(is_mt || is_weight || is_nrows,
+ "unrecognized keyword argument");
+ }
+}
+
+template <typename Kwd1, typename Kwd2, typename Kwd3>
+ana::dataflow::dataflow(Kwd1 kwarg1, Kwd2 kwarg2, Kwd3 kwarg3) : dataflow() {
+ static_assert(!std::is_same_v<Kwd1, Kwd2>, "repeated keyword arguments.");
+ static_assert(!std::is_same_v<Kwd1, Kwd3>, "repeated keyword arguments.");
+ static_assert(!std::is_same_v<Kwd2, Kwd3>, "repeated keyword arguments.");
+ this->accept_kwarg<Kwd1>(kwarg1);
+ this->accept_kwarg<Kwd2>(kwarg2);
+ this->accept_kwarg<Kwd3>(kwarg3);
+}
+
+template <typename DS, typename... Args>
+auto ana::dataflow::open(Args &&...args) -> ana::dataset::reader<DS> {
+
+ if (m_source) {
+ std::runtime_error("opening multiple datasets is not yet supported.");
+ }
+
+ auto source = std::make_unique<DS>(std::forward<Args>(args)...);
+ auto ds = source.get();
+ m_source = std::move(source);
+
+ // 1. allocate the dataset partition
+ this->m_partition = ds->allocate();
+ // 2. truncate entries to limit
+ this->m_partition.truncate(this->m_nrows);
+ // 3. merge parts to concurrency limit
+ this->m_partition.merge(this->m_mtcfg.concurrency);
+ // 4. normalize scale
+ this->m_norm = ds->normalize();
+
+ // put partition into slots
+ this->m_parts.clear_slots();
+ // model reprents whole dataset
+ this->m_parts.set_model(
+ std::make_unique<dataset::range>(this->m_partition.total()));
+ // each slot takes a part
+ for (unsigned int ipart = 0; ipart < m_partition.size(); ++ipart) {
+ this->m_parts.add_slot(
+ std::make_unique<dataset::range>(this->m_partition[ipart]));
+ }
+
+ // open dataset reader and processor for each thread
+ // slot for each partition range
+ this->m_players = lockstep::get_node(
+ [ds](dataset::range *part) { return ds->open_player(*part); },
+ this->m_parts);
+ this->m_processors = lockstep::node<dataset::processor>(
+ m_parts.concurrency(), this->m_weight / this->m_norm);
+
+ return dataset::reader<DS>(*this, *ds);
+}
+
+template <typename DS, typename Val>
+auto ana::dataflow::read(dataset::input<DS> &ds, const std::string &name)
+ -> lazy<read_column_t<DS, Val>> {
+ auto act = lockstep::get_node(
+ [name, &ds](dataset::processor *proc, dataset::range *part) {
+ return proc->template read<DS, Val>(std::ref(ds), *part, name);
+ },
+ this->m_processors, this->m_parts);
+ auto lzy = lazy<read_column_t<DS, Val>>(*this, act);
+ this->add_operation(std::move(act));
+ return lzy;
+}
+
+template <typename Val>
+auto ana::dataflow::constant(Val const &val)
+ -> lazy<ana::column::constant<Val>> {
+ auto act = lockstep::get_node(
+ [&val](dataset::processor *proc) {
+ return proc->template constant<Val>(val);
+ },
+ this->m_processors);
+ auto lzy = lazy<column::constant<Val>>(*this, act);
+ this->add_operation(std::move(act));
+ return lzy;
+}
+
+template <typename Val, typename... Args>
+auto ana::dataflow::constant(Args &&...args)
+ -> lazy<ana::column::constant<Val>> {
+ auto act = lockstep::get_node(
+ [args...](dataset::processor *proc) {
+ return proc->template constant<Val>(std::forward<Args>(args)...);
+ },
+ this->m_processors);
+ auto lzy = lazy<column::constant<Val>>(*this, act);
+ this->add_operation(std::move(act));
+ return lzy;
+}
+
+template <typename Def, typename... Args>
+auto ana::dataflow::define(Args &&...args) {
+ return delayed<ana::column::template evaluator_t<Def>>(
+ *this,
+ lockstep::get_node(
+ [&args...](dataset::processor *proc) {
+ return proc->template define<Def>(std::forward<Args>(args)...);
+ },
+ this->m_processors));
+}
+
+template <typename F> auto ana::dataflow::define(F const &callable) {
+ return delayed<ana::column::template evaluator_t<F>>(
+ *this, lockstep::get_node(
+ [callable](dataset::processor *proc) {
+ return proc->template define(callable);
+ },
+ this->m_processors));
+}
+
+inline auto ana::dataflow::filter(const std::string &name) {
+ auto callable = [](double x) { return x; };
+ return this->template select<selection::cut, decltype(callable)>(name,
+ callable);
+}
+
+inline auto ana::dataflow::weight(const std::string &name) {
+ auto callable = [](double x) { return x; };
+ return this->template select<selection::weight, decltype(callable)>(name,
+ callable);
+}
+
+inline auto ana::dataflow::channel(const std::string &name) {
+ auto callable = [](double x) { return x; };
+ return this->template channel<selection::cut, decltype(callable)>(name,
+ callable);
+}
+
+template <typename F>
+auto ana::dataflow::filter(const std::string &name, F callable) {
+ return this->template select<selection::cut, F>(name, callable);
+}
+
+template <typename F>
+auto ana::dataflow::weight(const std::string &name, F callable)
+ -> delayed<selection::template custom_applicator_t<F>> {
+ return this->template select<selection::weight, F>(name, callable);
+}
+
+template <typename F>
+auto ana::dataflow::channel(const std::string &name, F callable) {
+ return this->template channel<selection::cut, F>(name, callable);
+}
+
+template <typename Sel, typename F>
+auto ana::dataflow::select(const std::string &name, F callable)
+ -> delayed<selection::template custom_applicator_t<F>> {
+ return delayed<selection::template custom_applicator_t<F>>(
+ *this, lockstep::get_node(
+ [name, callable](dataset::processor *proc) {
+ return proc->template select<Sel>(nullptr, name, callable);
+ },
+ this->m_processors));
+}
+
+template <typename Sel, typename F>
+auto ana::dataflow::channel(const std::string &name, F callable)
+ -> delayed<selection::template custom_applicator_t<F>> {
+ return delayed<selection::template custom_applicator_t<F>>(
+ *this, lockstep::get_node(
+ [name, callable](dataset::processor *proc) {
+ return proc->template channel<Sel>(nullptr, name, callable);
+ },
+ this->m_processors));
+}
+
+template <typename Cnt, typename... Args>
+auto ana::dataflow::agg(Args &&...args) -> delayed<aggregation::booker<Cnt>> {
+ return delayed<aggregation::booker<Cnt>>(
+ *this, lockstep::get_node(
+ [&args...](dataset::processor *proc) {
+ return proc->template book<Cnt>(std::forward<Args>(args)...);
+ },
+ this->m_processors));
+}
+
+template <typename Sel>
+auto ana::dataflow::select(lazy<selection> const &prev,
+ const std::string &name) {
+ auto callable = [](double x) { return x; };
+ return this->template select<Sel, decltype(callable)>(prev, name, callable);
+}
+
+template <typename Sel>
+auto ana::dataflow::channel(lazy<selection> const &prev,
+ const std::string &name) {
+ auto callable = [](double x) { return x; };
+ return this->template channel<Sel, decltype(callable)>(prev, name, callable);
+}
+
+template <typename Sel, typename F>
+auto ana::dataflow::select(lazy<selection> const &prev, const std::string &name,
+ F callable)
+ -> delayed<selection::template custom_applicator_t<F>> {
+ return delayed<selection::template custom_applicator_t<F>>(
+ *this,
+ lockstep::get_node(
+ [name, callable](dataset::processor *proc, selection const *prev) {
+ return proc->template select<Sel>(prev, name, callable);
+ },
+ this->m_processors, prev));
+}
+
+template <typename Sel, typename F>
+auto ana::dataflow::channel(lazy<selection> const &prev,
+ const std::string &name, F callable)
+ -> delayed<selection::template custom_applicator_t<F>> {
+ return delayed<selection::template custom_applicator_t<F>>(
+ *this,
+ lockstep::get_node(
+ [name, callable](dataset::processor *proc, selection const *prev) {
+ return proc->template channel<Sel>(prev, name, callable);
+ },
+ this->m_processors, prev));
+}
+
+template <typename Def, typename... Cols>
+auto ana::dataflow::evaluate_column(delayed<column::evaluator<Def>> const &calc,
+ lazy<Cols> const &...columns) -> lazy<Def> {
+ auto act = lockstep::get_node(
+ [](dataset::processor *proc, column::evaluator<Def> *calc,
+ Cols const *...cols) {
+ return proc->template evaluate_column(*calc, *cols...);
+ },
+ this->m_processors, calc, columns...);
+ auto lzy = lazy<Def>(*this, act);
+ this->add_operation(std::move(act));
+ return lzy;
+}
+
+template <typename Eqn, typename... Cols>
+auto ana::dataflow::apply_selection(
+ delayed<selection::applicator<Eqn>> const &calc,
+ lazy<Cols> const &...columns) -> lazy<selection> {
+ auto act = lockstep::get_node(
+ [](dataset::processor *proc, selection::applicator<Eqn> *calc,
+ Cols *...cols) {
+ return proc->template apply_selection(*calc, *cols...);
+ },
+ this->m_processors, calc, columns...);
+ auto lzy = lazy<selection>(*this, act);
+ this->add_operation(std::move(act));
+ return lzy;
+}
+
+template <typename Cnt>
+auto ana::dataflow::select_aggregation(
+ delayed<aggregation::booker<Cnt>> const &bkr, lazy<selection> const &sel)
+ -> lazy<Cnt> {
+ // any time a new aggregation is booked, means the dataflow must run: so reset
+ // its status
+ this->reset();
+ auto act = lockstep::get_node(
+ [](dataset::processor *proc, aggregation::booker<Cnt> *bkr,
+ const selection *sel) { return proc->select_aggregation(*bkr, *sel); },
+ this->m_processors, bkr, sel);
+ auto lzy = lazy<Cnt>(*this, act);
+ this->add_operation(std::move(act));
+ return lzy;
+}
+
+template <typename Cnt, typename... Sels>
+auto ana::dataflow::select_aggregations(
+ delayed<aggregation::booker<Cnt>> const &bkr, lazy<Sels> const &...sels)
+ -> delayed<aggregation::bookkeeper<Cnt>> {
+ // any time a new aggregation is booked, means the dataflow must run: so reset
+ // its status
+ this->reset();
+
+ using delayed_bookkeeper_type = delayed<aggregation::bookkeeper<Cnt>>;
+ auto bkpr = delayed_bookkeeper_type(
+ *this, lockstep::get_node(
+ [this](dataset::processor *proc, aggregation::booker<Cnt> *bkr,
+ Sels const *...sels) {
+ // get bookkeeper and aggregations
+ auto bkpr_and_cntrs =
+ proc->select_aggregations(*bkr, *sels...);
+
+ // add each aggregation to this dataflow
+ for (auto &&cntr : bkpr_and_cntrs.second) {
+ this->add_operation(std::move(cntr));
+ }
+
+ // take the bookkeeper
+ return std::move(bkpr_and_cntrs.first);
+ },
+ this->m_processors, bkr, sels...));
+ return bkpr;
+}
+
+inline void ana::dataflow::analyze() {
+ // do not analyze if already done
+ if (m_analyzed)
+ return;
+
+ // ignore future analyze() requests until reset() is called
+ m_analyzed = true;
+
+ m_source->initialize();
+
+ this->m_mtcfg.run(
+ [](dataset::processor *proc, dataset::player *plyr,
+ const dataset::range *part) { proc->process(*plyr, *part); },
+ this->m_processors, this->m_players, this->m_parts);
+
+ m_source->finalize();
+
+ // clear aggregations so they are not run more than once
+ this->m_processors.call_all_slots(
+ [](dataset::processor *proc) { proc->clear_aggregations(); });
+}
+
+inline void ana::dataflow::reset() { m_analyzed = false; }
+
+template <typename Val, typename... Vars>
+auto ana::dataflow::vary(lazy<column::template constant<Val>> const &nom,
+ Vars const &...vars) {
+ typename lazy<column::template constant<Val>>::varied syst(nom);
+ ((this->vary_constant<Val>(syst, vars.name(), vars.args())), ...);
+ return syst;
+}
+
+template <typename Val, typename Lazy, typename... Args>
+void ana::dataflow::vary_constant(Lazy &syst, const std::string &name,
+ std::tuple<Args...> args) {
+ auto var = std::apply(
+ [this](Args... args) { return this->constant<Val>(args...); }, args);
+ syst.set_variation(name, std::move(var));
+}
+
+template <typename Col, typename... Vars>
+auto ana::dataflow::vary(delayed<column::template evaluator<Col>> &&nom,
+ Vars const &...vars) {
+ typename delayed<column::template evaluator<Col>>::varied syst(
+ std::move(nom));
+ ((this->vary_evaluator<Col>(syst, vars.name(), vars.args())), ...);
+ return syst;
+}
+
+template <typename Col, typename Eval, typename... Args>
+void ana::dataflow::vary_evaluator(Eval &syst, const std::string &name,
+ std::tuple<Args...> args) {
+ auto var = std::apply(
+ [this](Args... args) { return this->define<Col>(args...); }, args);
+ syst.set_variation(name, std::move(var));
+}
+
+inline void ana::dataflow::add_operation(lockstep::node<operation> operation) {
+ m_operations.emplace_back(std::move(operation.m_model));
+ for (unsigned int i = 0; i < operation.concurrency(); ++i) {
+ m_operations.emplace_back(std::move(operation.m_slots[i]));
+ }
+}
+
+inline void ana::dataflow::add_operation(std::unique_ptr<operation> operation) {
+ m_operations.emplace_back(std::move(operation));
+}
+
FileList > ana > interface > dataset.h
+Go to the source code of this file
+#include <cassert>
#include <iostream>
#include <iterator>
#include <memory>
#include <numeric>
#include <string>
#include <vector>
#include "multithread.h"
#include "column.h"
#include "dataset_player.h"
#include "dataset_range.h"
Type | +Name | +
---|---|
namespace | +ana |
+
namespace | +dataset |
+
Type | +Name | +
---|---|
struct | +first |
+
struct | +is_unique_ptr <typename T> |
+
struct | +is_unique_ptr< std::unique_ptr< T > > <typename T> |
+
The documentation for this class was generated from the following file include/ana/interface/dataset.h
File List > ana > interface > dataset.h
+Go to the documentation of this file
+#pragma once
+
+#include <cassert>
+#include <iostream>
+#include <iterator>
+#include <memory>
+#include <numeric>
+#include <string>
+#include <vector>
+
+#include "multithread.h"
+
+namespace ana {
+
+namespace dataset {
+
+struct range;
+
+struct partition;
+
+template <typename T> class input;
+
+class player;
+
+template <typename T> class reader;
+
+template <typename T> class column;
+
+struct first {
+ first(long long nrows) : nrows(nrows) {}
+ long long nrows;
+};
+
+} // namespace dataset
+
+template <typename T>
+using open_player_t = typename decltype(std::declval<T const &>().open_player(
+ std::declval<const ana::dataset::range &>()))::element_type;
+
+template <typename T, typename Val>
+using read_column_t =
+ typename decltype(std::declval<T>().template read_column<Val>(
+ std::declval<dataset::range const &>(),
+ std::declval<std::string const &>()))::element_type;
+
+template <typename T> struct is_unique_ptr : std::false_type {};
+template <typename T>
+struct is_unique_ptr<std::unique_ptr<T>> : std::true_type {};
+template <typename T>
+static constexpr bool is_unique_ptr_v = is_unique_ptr<T>::value;
+
+} // namespace ana
+
+#include "column.h"
+#include "dataset_player.h"
+#include "dataset_range.h"
+
FileList > ana > interface > dataset_column.h
+Go to the source code of this file
+#include "column.h"
#include "dataset.h"
Type | +Name | +
---|---|
namespace | +ana |
+
namespace | +dataset |
+
Type | +Name | +
---|---|
class | +column <typename T> Read columns from a dataset. |
+
The documentation for this class was generated from the following file include/ana/interface/dataset_column.h
File List > ana > interface > dataset_column.h
+Go to the documentation of this file
+#pragma once
+
+#include "column.h"
+
+namespace ana {
+
+namespace dataset {
+
+struct range;
+
+template <typename T> class column : public ana::term<T> {
+
+public:
+ column();
+ virtual ~column() = default;
+
+ virtual T const &read(const range &part, unsigned long long entry) const = 0;
+
+ virtual T const &value() const override;
+
+ virtual void execute(const range &part,
+ unsigned long long entry) final override;
+
+protected:
+ mutable T const *m_addr;
+ mutable bool m_updated;
+
+ const range *m_part;
+ unsigned long long m_entry;
+};
+
+} // namespace dataset
+
+} // namespace ana
+
+#include "dataset.h"
+
+template <typename T>
+ana::dataset::column<T>::column()
+ : m_addr(nullptr), m_updated(false), m_part(nullptr), m_entry(0) {}
+
+template <typename T> T const &ana::dataset::column<T>::value() const {
+ if (!this->m_updated) {
+ m_addr = &(this->read(*this->m_part, m_entry));
+ m_updated = true;
+ }
+ return *m_addr;
+}
+
+template <typename T>
+void ana::dataset::column<T>::execute(const ana::dataset::range &part,
+ unsigned long long entry) {
+ this->m_part = ∂
+ this->m_entry = entry;
+ this->m_updated = false;
+}
+
FileList > ana > interface > dataset_input.h
+Go to the source code of this file
+#include "dataset.h"
#include "dataset_player.h"
Type | +Name | +
---|---|
namespace | +ana |
+
namespace | +dataset |
+
Type | +Name | +
---|---|
class | +input <typename DS> |
+
class | +source |
+
The documentation for this class was generated from the following file include/ana/interface/dataset_input.h
File List > ana > interface > dataset_input.h
+Go to the documentation of this file
+#pragma once
+
+#include "dataset.h"
+
+namespace ana {
+namespace dataset {
+
+class source {
+public:
+ virtual ~source() = default;
+ virtual void initialize();
+ virtual void finalize();
+};
+
+template <typename DS> class input : public source {
+
+public:
+ virtual ~input() = default;
+
+ decltype(auto) open_player(const range &part);
+ std::unique_ptr<ana::dataset::player> open(const ana::dataset::range &part);
+
+ template <typename Val>
+ decltype(auto) read_column(const ana::dataset::range &part,
+ const std::string &name);
+
+ virtual partition allocate() = 0;
+ virtual double normalize();
+};
+
+} // namespace dataset
+
+} // namespace ana
+
+#include "dataset_player.h"
+
+inline void ana::dataset::source::initialize() {}
+
+inline void ana::dataset::source::finalize() {}
+
+template <typename DS> inline double ana::dataset::input<DS>::normalize() {
+ return 1.0;
+}
+
+template <typename DS>
+decltype(auto)
+ana::dataset::input<DS>::open_player(const ana::dataset::range &part) {
+
+ using result_type = decltype(static_cast<DS *>(this)->open(part));
+ static_assert(is_unique_ptr_v<result_type>,
+ "method must return a std::unique_ptr");
+
+ using player_type = typename result_type::element_type;
+ static_assert(std::is_base_of_v<player, player_type>,
+ "must be an implementation of dataest player");
+
+ return static_cast<DS *>(this)->open(part);
+}
+
+template <typename DS>
+template <typename Val>
+decltype(auto)
+ana::dataset::input<DS>::read_column(const ana::dataset::range &part,
+ const std::string &name) {
+
+ // using result_type =
+ // decltype(static_cast<DS *>(this)->template read<Val>(part, name));
+ // static_assert(is_unique_ptr_v<result_type>,
+ // "method must return a std::unique_ptr");
+
+ // using column_type = typename result_type::element_type;
+ // static_assert(std::is_base_of_v<column<Val>, column_type>,
+ // "must be an implementation of dataset column");
+
+ return static_cast<DS *>(this)->template read<Val>(part, name);
+}
+
+template <typename DS>
+std::unique_ptr<ana::dataset::player>
+ana::dataset::input<DS>::open(const ana::dataset::range &) {
+ return std::make_unique<ana::dataset::player>();
+}
+
FileList > ana > interface > dataset_player.h
+Go to the source code of this file
+#include "operation.h"
#include "dataset.h"
Type | +Name | +
---|---|
namespace | +ana |
+
namespace | +dataset |
+
Type | +Name | +
---|---|
class | +player |
+
The documentation for this class was generated from the following file include/ana/interface/dataset_player.h
File List > ana > interface > dataset_player.h
+Go to the documentation of this file
+#pragma once
+
+#include "operation.h"
+
+namespace ana {
+
+namespace dataset {
+
+struct range;
+
+class player : public operation {
+
+public:
+ player() = default;
+ virtual ~player() = default;
+
+public:
+ virtual void initialize(const range &) override;
+ virtual void execute(const range &, unsigned long long) override;
+ virtual void finalize(const range &) override;
+};
+
+} // namespace dataset
+
+} // namespace ana
+
+#include "dataset.h"
+
+inline void ana::dataset::player::initialize(const ana::dataset::range &) {}
+
+inline void ana::dataset::player::execute(const ana::dataset::range &,
+ unsigned long long) {}
+
+inline void ana::dataset::player::finalize(const ana::dataset::range &) {}
+
FileList > ana > interface > delayed.h
+Go to the source code of this file
+#include "dataflow.h"
#include "lazy.h"
#include "lazy_varied.h"
#include "systematic_resolver.h"
Type | +Name | +
---|---|
namespace | +ana |
+
Type | +Name | +
---|---|
class | +delayed <typename Bkr> A node that instantiates a lazy action. |
+
The documentation for this class was generated from the following file include/ana/interface/delayed.h
File List > ana > interface > delayed.h
+Go to the documentation of this file
+#pragma once
+
+#include "dataflow.h"
+#include "lazy.h"
+#include "lazy_varied.h"
+#include "systematic_resolver.h"
+
+namespace ana {
+
+template <typename T> class delayed;
+
+template <typename U>
+static constexpr std::true_type check_lazy(lazy<U> const &);
+static constexpr std::false_type check_lazy(...);
+template <typename U>
+static constexpr std::true_type check_delayed(delayed<U> const &);
+static constexpr std::false_type check_delayed(...);
+
+template <typename V>
+static constexpr bool is_nominal_v =
+ (decltype(check_lazy(std::declval<V>()))::value ||
+ decltype(check_delayed(std::declval<V>()))::value);
+template <typename V> static constexpr bool is_varied_v = !is_nominal_v<V>;
+
+template <typename... Args>
+static constexpr bool has_no_variation_v = (is_nominal_v<Args> && ...);
+template <typename... Args>
+static constexpr bool has_variation_v = (is_varied_v<Args> || ...);
+
+template <typename Bkr>
+class delayed : public systematic::resolver<delayed<Bkr>>,
+ public lockstep::node<Bkr> {
+
+public:
+ class varied;
+
+public:
+ delayed(dataflow &dataflow, lockstep::node<Bkr> &&operation)
+ : systematic::resolver<delayed<Bkr>>::resolver(dataflow),
+ lockstep::node<Bkr>::node(std::move(operation)) {}
+
+ virtual ~delayed() = default;
+
+ template <typename V>
+ delayed(delayed<V> &&other)
+ : systematic::resolver<delayed<Bkr>>::resolver(*other.m_df),
+ lockstep::node<Bkr>::node(std::move(other)) {}
+
+ template <typename V> delayed &operator=(delayed<V> &&other) {
+ this->m_df = other.m_df;
+ lockstep::node<Bkr>::operator=(std::move(other));
+ return *this;
+ }
+
+ virtual void set_variation(const std::string &var_name,
+ delayed &&var) override;
+
+ virtual delayed const &nominal() const override;
+ virtual delayed const &variation(const std::string &var_name) const override;
+
+ virtual bool has_variation(const std::string &var_name) const override;
+ virtual std::set<std::string> list_variation_names() const override;
+
+ template <
+ typename... Nodes, typename V = Bkr,
+ std::enable_if_t<ana::column::template is_evaluator_v<V>, bool> = false>
+ auto evaluate(Nodes &&...columns) const
+ -> decltype(std::declval<delayed<V>>().evaluate_column(
+ std::forward<Nodes>(columns)...)) {
+ return this->evaluate_column(std::forward<Nodes>(columns)...);
+ }
+
+ template <typename... Nodes, typename V = Bkr,
+ std::enable_if_t<ana::selection::template is_applicator_v<V>,
+ bool> = false>
+ auto apply(Nodes &&...columns) const
+ -> decltype(std::declval<delayed<V>>().apply_selection(
+ std::forward<Nodes>(columns)...)) {
+ return this->apply_selection(std::forward<Nodes>(columns)...);
+ }
+
+ template <
+ typename... Nodes, typename V = Bkr,
+ std::enable_if_t<ana::aggregation::template is_booker_v<V>, bool> = false>
+ auto fill(Nodes &&...columns) const
+ -> decltype(std::declval<delayed<V>>().fill_aggregation(
+ std::declval<Nodes>()...)) {
+ return this->fill_aggregation(std::forward<Nodes>(columns)...);
+ }
+
+ template <typename Node> auto book(Node &&selection) const {
+ return this->select_aggregation(std::forward<Node>(selection));
+ }
+
+ template <typename... Nodes> auto book(Nodes &&...nodes) const {
+ static_assert(aggregation::template is_booker_v<Bkr>,
+ "not a aggregation (booker)");
+ return this->select_aggregations(std::forward<Nodes>(nodes)...);
+ }
+
+ template <typename V = Bkr,
+ std::enable_if_t<ana::aggregation::template is_bookkeeper_v<V>,
+ bool> = false>
+ auto list_selection_paths() const -> std::set<std::string> {
+ return lockstep::get_value(
+ [](Bkr const *bkpr) { return bkpr->list_selection_paths(); },
+ std::cref(*this));
+ }
+
+ template <typename... Args, typename V = Bkr,
+ std::enable_if_t<column::template is_evaluator_v<V> ||
+ selection::template is_applicator_v<V>,
+ bool> = false>
+ auto operator()(Args &&...columns) const
+ -> decltype(std::declval<delayed<V>>().evaluate_or_apply(
+ std::forward<Args>(std::declval<Args &&>())...)) {
+ return this->evaluate_or_apply(std::forward<Args>(columns)...);
+ }
+
+ template <
+ typename... Args, typename V = Bkr,
+ std::enable_if_t<aggregation::template is_bookkeeper_v<V>, bool> = false>
+ auto operator[](const std::string &selection_path) const
+ -> lazy<aggregation::booked_t<V>> {
+ return this->get_aggregation(selection_path);
+ }
+
+protected:
+ template <typename... Nodes, typename V = Bkr,
+ std::enable_if_t<ana::column::template is_evaluator_v<V> &&
+ ana::has_no_variation_v<Nodes...>,
+ bool> = false>
+ auto evaluate_column(Nodes const &...columns) const
+ -> lazy<column::template evaluated_t<V>> {
+ return this->m_df->evaluate_column(*this, columns...);
+ }
+
+ template <typename... Nodes, typename V = Bkr,
+ std::enable_if_t<ana::column::template is_evaluator_v<V> &&
+ ana::has_variation_v<Nodes...>,
+ bool> = false>
+ auto evaluate_column(Nodes const &...columns) const ->
+ typename lazy<column::template evaluated_t<V>>::varied {
+
+ using varied_type = typename lazy<column::template evaluated_t<V>>::varied;
+
+ auto nom = this->m_df->evaluate_column(*this, columns.nominal()...);
+ auto syst = varied_type(std::move(nom));
+
+ for (auto const &var_name : list_all_variation_names(columns...)) {
+ auto var =
+ this->m_df->evaluate_column(*this, columns.variation(var_name)...);
+ syst.set_variation(var_name, std::move(var));
+ }
+
+ return syst;
+ }
+
+ template <typename Node, typename V = Bkr,
+ std::enable_if_t<ana::aggregation::template is_booker_v<V> &&
+ ana::is_nominal_v<Node>,
+ bool> = false>
+ auto select_aggregation(Node const &sel) const
+ -> lazy<aggregation::booked_t<V>> {
+ // nominal
+ return this->m_df->select_aggregation(*this, sel);
+ }
+
+ template <typename Node, typename V = Bkr,
+ std::enable_if_t<ana::aggregation::template is_booker_v<V> &&
+ ana::is_varied_v<Node>,
+ bool> = false>
+ auto select_aggregation(Node const &sel) const ->
+ typename lazy<aggregation::booked_t<V>>::varied {
+ using varied_type = typename lazy<aggregation::booked_t<V>>::varied;
+ auto syst =
+ varied_type(this->m_df->select_aggregation(*this, sel.nominal()));
+ for (auto const &var_name : list_all_variation_names(sel)) {
+ syst.set_variation(var_name, this->m_df->select_aggregation(
+ *this, sel.variation(var_name)));
+ }
+ return syst;
+ }
+
+ template <typename... Nodes, typename V = Bkr,
+ std::enable_if_t<ana::aggregation::template is_booker_v<V> &&
+ ana::has_no_variation_v<Nodes...>,
+ bool> = false>
+ auto select_aggregations(Nodes const &...sels) const
+ -> delayed<aggregation::bookkeeper<aggregation::booked_t<V>>> {
+ // nominal
+ return this->m_df->select_aggregations(*this, sels...);
+ }
+
+ template <typename... Nodes, typename V = Bkr,
+ std::enable_if_t<ana::aggregation::template is_booker_v<V> &&
+ has_variation_v<Nodes...>,
+ bool> = false>
+ auto select_aggregations(Nodes const &...sels) const -> typename delayed<
+ aggregation::bookkeeper<aggregation::booked_t<V>>>::varied {
+ // variations
+ using varied_type = typename delayed<
+ aggregation::bookkeeper<aggregation::booked_t<V>>>::varied;
+ auto syst =
+ varied_type(this->m_df->select_aggregations(*this, sels.nominal()...));
+ for (auto const &var_name : list_all_variation_names(sels...)) {
+ syst.set_variation(var_name, this->m_df->select_aggregations(
+ *this, sels.variation(var_name)...));
+ }
+ return syst;
+ }
+
+ template <typename V = Bkr,
+ std::enable_if_t<ana::aggregation::template is_bookkeeper_v<V>,
+ bool> = false>
+ auto get_aggregation(const std::string &selection_path) const
+ -> lazy<aggregation::booked_t<V>> {
+ return lazy<aggregation::booked_t<V>>(
+ *this->m_df, lockstep::get_view(
+ [selection_path](V *bkpr) {
+ return bkpr->get_aggregation(selection_path);
+ },
+ *this));
+ }
+
+ template <typename... Args, typename V = Bkr,
+ std::enable_if_t<column::template is_evaluator_v<V>, bool> = false>
+ auto evaluate_or_apply(Args &&...columns) const
+ -> decltype(std::declval<delayed<V>>().evaluate(
+ std::forward<Args>(std::declval<Args &&>())...)) {
+ return this->evaluate(std::forward<Args>(columns)...);
+ }
+
+ template <
+ typename... Args, typename V = Bkr,
+ std::enable_if_t<selection::template is_applicator_v<V>, bool> = false>
+ auto evaluate_or_apply(Args &&...columns) const
+ -> decltype(std::declval<delayed<V>>().apply(
+ std::forward<Args>(std::declval<Args &&>())...)) {
+ return this->apply(std::forward<Args>(columns)...);
+ }
+
+ template <typename... Nodes, typename V = Bkr,
+ std::enable_if_t<ana::aggregation::template is_booker_v<V> &&
+ ana::has_no_variation_v<Nodes...>,
+ bool> = false>
+ auto fill_aggregation(Nodes const &...columns) const -> delayed<V> {
+ // nominal
+ return delayed<V>(
+ *this->m_df,
+ lockstep::get_node(
+ [](V *fillable, typename Nodes::operation_type *...cols) {
+ return fillable->book_fill(*cols...);
+ },
+ *this, columns...));
+ }
+
+ template <typename... Nodes, typename V = Bkr,
+ std::enable_if_t<ana::aggregation::template is_booker_v<V> &&
+ has_variation_v<Nodes...>,
+ bool> = false>
+ auto fill_aggregation(Nodes const &...columns) const -> varied {
+ auto syst = varied(std::move(this->fill_aggregation(columns.nominal()...)));
+ for (auto const &var_name : list_all_variation_names(columns...)) {
+ syst.set_variation(var_name, std::move(this->fill_aggregation(
+ columns.variation(var_name)...)));
+ }
+ return syst;
+ }
+
+ template <typename... Nodes, typename V = Bkr,
+ std::enable_if_t<selection::template is_applicator_v<V> &&
+ ana::has_no_variation_v<Nodes...>,
+ bool> = false>
+ auto apply_selection(Nodes const &...columns) const -> lazy<selection> {
+ // nominal
+ return this->m_df->apply_selection(*this, columns...);
+ }
+
+ template <typename... Nodes, typename V = Bkr,
+ std::enable_if_t<selection::template is_applicator_v<V> &&
+ ana::has_variation_v<Nodes...>,
+ bool> = false>
+ auto apply_selection(Nodes const &...columns) const ->
+ typename lazy<selection>::varied {
+ // variations
+ using varied_type = typename lazy<selection>::varied;
+ auto syst =
+ varied_type(this->nominal().apply_selection(columns.nominal()...));
+ auto var_names = list_all_variation_names(columns...);
+ for (auto const &var_name : var_names) {
+ syst.set_variation(var_name, this->variation(var_name).apply_selection(
+ columns.variation(var_name)...));
+ }
+ return syst;
+ }
+};
+
+} // namespace ana
+
+template <typename Bkr>
+void ana::delayed<Bkr>::set_variation(const std::string &, delayed<Bkr> &&) {
+ // should never be called
+ throw std::logic_error("cannot set variation to a lazy operation");
+}
+
+template <typename Bkr>
+auto ana::delayed<Bkr>::nominal() const -> delayed const & {
+ // this is nominal
+ return *this;
+}
+
+template <typename Bkr>
+auto ana::delayed<Bkr>::variation(const std::string &) const
+ -> delayed const & {
+ // propagation of variations must occur "transparently"
+ return *this;
+}
+
+template <typename Bkr>
+std::set<std::string> ana::delayed<Bkr>::list_variation_names() const {
+ // no variations to list
+ return std::set<std::string>();
+}
+
+template <typename Bkr>
+bool ana::delayed<Bkr>::has_variation(const std::string &) const {
+ // always false
+ return false;
+}
+
FileList > ana > interface > delayed_varied.h
+Go to the source code of this file
+#include "delayed.h"
#include "dataflow.h"
#include "lazy.h"
#include "selection.h"
Type | +Name | +
---|---|
namespace | +ana |
+
Type | +Name | +
---|---|
class | +varied Varied version of a delayed node. |
+
The documentation for this class was generated from the following file include/ana/interface/delayed_varied.h
File List > ana > interface > delayed_varied.h
+Go to the documentation of this file
+#pragma once
+
+#include "delayed.h"
+
+namespace ana {
+
+template <typename Bld>
+class delayed<Bld>::varied : public systematic::resolver<delayed<Bld>> {
+
+public:
+ varied(delayed<Bld> &&nom);
+ ~varied() = default;
+
+ varied(varied &&) = default;
+ varied &operator=(varied &&) = default;
+
+ virtual void set_variation(const std::string &var_name,
+ delayed &&var) override;
+
+ virtual delayed const &nominal() const override;
+ virtual delayed const &variation(const std::string &var_name) const override;
+
+ virtual bool has_variation(const std::string &var_name) const override;
+ virtual std::set<std::string> list_variation_names() const override;
+
+public:
+ template <
+ typename... Args, typename V = Bld,
+ std::enable_if_t<ana::column::template is_evaluator_v<V>, bool> = false>
+ auto evaluate(Args &&...args) ->
+ typename ana::lazy<column::template evaluated_t<V>>::varied;
+
+ template <typename... Nodes, typename V = Bld,
+ std::enable_if_t<ana::selection::template is_applicator_v<V>,
+ bool> = false>
+ auto apply(Nodes const &...columns) -> typename lazy<selection>::varied;
+
+ template <
+ typename... Nodes, typename V = Bld,
+ std::enable_if_t<ana::aggregation::template is_booker_v<V>, bool> = false>
+ auto fill(Nodes const &...columns) -> varied;
+
+ template <
+ typename Node, typename V = Bld,
+ std::enable_if_t<ana::aggregation::template is_booker_v<V>, bool> = false>
+ auto book(Node const &selection) ->
+ typename lazy<aggregation::booked_t<V>>::varied;
+
+ template <
+ typename... Nodes, typename V = Bld,
+ std::enable_if_t<ana::aggregation::template is_booker_v<V>, bool> = false>
+ auto book(Nodes const &...selections) -> typename delayed<
+ aggregation::bookkeeper<aggregation::booked_t<V>>>::varied;
+
+ template <typename... Args>
+ auto operator()(Args &&...args) ->
+ typename lazy<typename decltype(std::declval<delayed<Bld>>().operator()(
+ std::forward<Args>(args).nominal()...))::operation_type>::varied;
+
+ template <typename V = Bld,
+ std::enable_if_t<ana::aggregation::template is_bookkeeper_v<V>,
+ bool> = false>
+ auto operator[](const std::string &var_name) const -> delayed<V> const &;
+
+protected:
+ delayed<Bld> m_nominal;
+ std::unordered_map<std::string, delayed<Bld>> m_variation_map;
+ std::set<std::string> m_variation_names;
+};
+
+} // namespace ana
+
+#include "dataflow.h"
+#include "lazy.h"
+#include "selection.h"
+
+template <typename Bld>
+ana::delayed<Bld>::varied::varied(delayed<Bld> &&nom)
+ : systematic::resolver<delayed<Bld>>::resolver(*nom.m_df),
+ m_nominal(std::move(nom)) {}
+
+template <typename Bld>
+void ana::delayed<Bld>::varied::set_variation(const std::string &var_name,
+ delayed &&var) {
+ m_variation_map.insert(std::move(std::make_pair(var_name, std::move(var))));
+ m_variation_names.insert(var_name);
+}
+
+template <typename Bld>
+auto ana::delayed<Bld>::varied::nominal() const -> delayed const & {
+ return m_nominal;
+}
+
+template <typename Bld>
+auto ana::delayed<Bld>::varied::variation(const std::string &var_name) const
+ -> delayed const & {
+ return (this->has_variation(var_name) ? m_variation_map.at(var_name)
+ : m_nominal);
+}
+
+template <typename Bld>
+bool ana::delayed<Bld>::varied::has_variation(
+ const std::string &var_name) const {
+ return m_variation_map.find(var_name) != m_variation_map.end();
+}
+
+template <typename Bld>
+std::set<std::string> ana::delayed<Bld>::varied::list_variation_names() const {
+ return m_variation_names;
+}
+
+template <typename Bld>
+template <typename V,
+ std::enable_if_t<ana::aggregation::template is_bookkeeper_v<V>, bool>>
+auto ana::delayed<Bld>::varied::operator[](const std::string &var_name) const
+ -> delayed<V> const & {
+ if (!this->has_variation(var_name)) {
+ throw std::out_of_range("variation does not exist");
+ }
+ return this->variation(var_name);
+}
+
+template <typename Bld>
+template <typename... Args, typename V,
+ std::enable_if_t<ana::column::template is_evaluator_v<V>, bool>>
+auto ana::delayed<Bld>::varied::evaluate(Args &&...args) ->
+ typename ana::lazy<column::template evaluated_t<V>>::varied {
+ using varied_type =
+ typename ana::lazy<column::template evaluated_t<V>>::varied;
+ auto syst = varied_type(
+ this->nominal().evaluate(std::forward<Args>(args).nominal()...));
+ for (auto const &var_name :
+ list_all_variation_names(*this, std::forward<Args>(args)...)) {
+ syst.set_variation(var_name,
+ variation(var_name).evaluate(
+ std::forward<Args>(args).variation(var_name)...));
+ }
+ return syst;
+}
+
+template <typename Bld>
+template <typename... Nodes, typename V,
+ std::enable_if_t<ana::selection::template is_applicator_v<V>, bool>>
+auto ana::delayed<Bld>::varied::apply(Nodes const &...columns) ->
+ typename lazy<selection>::varied {
+
+ using varied_type = typename lazy<selection>::varied;
+ auto syst = varied_type(this->nominal().apply(columns.nominal()...));
+
+ for (auto const &var_name : list_all_variation_names(*this, columns...)) {
+ syst.set_variation(
+ var_name, variation(var_name).apply(columns.variation(var_name)...));
+ }
+
+ return syst;
+}
+
+template <typename Bld>
+template <typename... Nodes, typename V,
+ std::enable_if_t<ana::aggregation::template is_booker_v<V>, bool>>
+auto ana::delayed<Bld>::varied::fill(Nodes const &...columns) -> varied {
+ auto syst = varied(std::move(this->nominal().fill(columns.nominal()...)));
+ for (auto const &var_name : list_all_variation_names(*this, columns...)) {
+ syst.set_variation(var_name, std::move(variation(var_name).fill(
+ columns.variation(var_name)...)));
+ }
+ return syst;
+}
+
+template <typename Bld>
+template <typename Node, typename V,
+ std::enable_if_t<ana::aggregation::template is_booker_v<V>, bool>>
+auto ana::delayed<Bld>::varied::book(Node const &selection) ->
+ typename lazy<aggregation::booked_t<V>>::varied {
+ using varied_type = typename lazy<aggregation::booked_t<V>>::varied;
+ auto syst = varied_type(this->nominal().book(selection.nominal()));
+ for (auto const &var_name : list_all_variation_names(*this, selection)) {
+ syst.set_variation(var_name,
+ variation(var_name).book(selection.variation(var_name)));
+ }
+ return syst;
+}
+
+template <typename Bld>
+template <typename... Nodes, typename V,
+ std::enable_if_t<ana::aggregation::template is_booker_v<V>, bool>>
+auto ana::delayed<Bld>::varied::book(Nodes const &...selections) ->
+ typename delayed<
+ aggregation::bookkeeper<aggregation::booked_t<V>>>::varied {
+ using varied_type = typename delayed<
+ aggregation::bookkeeper<aggregation::booked_t<V>>>::varied;
+ auto syst = varied_type(this->nominal().book(selections.nominal()...));
+ for (auto const &var_name : list_all_variation_names(*this, selections...)) {
+ syst.set_variation(
+ var_name, variation(var_name).book(selections.variation(var_name)...));
+ }
+ return syst;
+}
+
+template <typename Bld>
+template <typename... Args>
+auto ana::delayed<Bld>::varied::operator()(Args &&...args) ->
+ typename lazy<typename decltype(std::declval<delayed<Bld>>().operator()(
+ std::forward<Args>(args).nominal()...))::operation_type>::varied {
+
+ using varied_type =
+ typename lazy<typename decltype(std::declval<delayed<Bld>>().operator()(
+ std::forward<Args>(args).nominal()...))::operation_type>::varied;
+
+ auto syst = varied_type(
+ this->nominal().operator()(std::forward<Args>(args).nominal()...));
+ for (auto const &var_name :
+ list_all_variation_names(*this, std::forward<Args>(args)...)) {
+ syst.set_variation(var_name,
+ variation(var_name).operator()(
+ std::forward<Args>(args).variation(var_name)...));
+ }
+ return syst;
+}
+
Type | +Name | +
---|---|
file | +aggregation_logic.h |
+
file | +column_definition.h |
+
file | +dataflow.h |
+
file | +dataset.h |
+
file | +dataset_column.h |
+
file | +dataset_input.h |
+
file | +dataset_player.h |
+
file | +delayed.h |
+
file | +delayed_varied.h |
+
file | +lazy.h |
+
file | +lazy_varied.h |
+
The documentation for this class was generated from the following file include/ana/interface/
Here is a list of all files with brief descriptions:
+Nothing related to Functions found.
+ + + + + + +This inheritance list is sorted roughly, but not completely, alphabetically:
+FileList > ana > interface > lazy.h
+Go to the source code of this file
+#include <iostream>
#include <set>
#include <type_traits>
#include "dataflow.h"
#include "systematic_resolver.h"
#include "column.h"
#include "delayed.h"
#include "lazy_varied.h"
Type | +Name | +
---|---|
namespace | +ana |
+
namespace | +op_check |
+
Type | +Name | +
---|---|
class | +lazy <typename Action> |
+
Type | +Name | +
---|---|
define | +CHECK_FOR_BINARY_OP (op_name, op_symbol) |
+
define | +CHECK_FOR_SUBSCRIPT_OP () |
+
define | +CHECK_FOR_UNARY_OP (op_name, op_symbol) |
+
define | +DEFINE_LAZY_BINARY_OP (op_name, op_symbol) |
+
define | +DEFINE_LAZY_SUBSCRIPT_OP () |
+
define | +DEFINE_LAZY_UNARY_OP (op_name, op_symbol) |
+
#define CHECK_FOR_BINARY_OP (
+ op_name,
+ op_symbol
+) struct has_no_##op_name {}; \
+ template <typename T, typename Arg> \
+ has_no_##op_name operator op_symbol(const T &, const Arg &); \
+ template <typename T, typename Arg = T> struct has_##op_name { \
+ enum { \
+ value = !std::is_same<decltype(std::declval<T>() \
+ op_symbol std::declval<Arg>()), \
+ has_no_##op_name>::value \
+ }; \
+ }; \
+ template <typename T, typename Arg = T> \
+ static constexpr bool has_##op_name##_v = has_##op_name<T, Arg>::value;
+
#define CHECK_FOR_SUBSCRIPT_OP (
+
+) template <class T, class Index> struct has_subscript_impl { \
+ template <class T1, class IndexDeduced = Index, \
+ class Reference = decltype(( \
+ *std::declval<T *>())[std::declval<IndexDeduced>()]), \
+ typename = typename std::enable_if< \
+ !std::is_void<Reference>::value>::type> \
+ static std::true_type test(int); \
+ template <class> static std::false_type test(...); \
+ using type = decltype(test<T>(0)); \
+ }; \
+ template <class T, class Index> \
+ using has_subscript = typename has_subscript_impl<T, Index>::type; \
+ template <class T, class Index> \
+ static constexpr bool has_subscript_v = has_subscript<T, Index>::value;
+
#define CHECK_FOR_UNARY_OP (
+ op_name,
+ op_symbol
+) struct has_no_##op_name {}; \
+ template <typename T> has_no_##op_name operator op_symbol(const T &); \
+ template <typename T> struct has_##op_name { \
+ enum { \
+ value = !std::is_same<decltype(op_symbol std::declval<T>()), \
+ has_no_##op_name>::value \
+ }; \
+ }; \
+ template <typename T> \
+ static constexpr bool has_##op_name##_v = has_##op_name<T>::value;
+
#define DEFINE_LAZY_BINARY_OP (
+ op_name,
+ op_symbol
+) template < \
+ typename Arg, typename V = Action, \
+ std::enable_if_t<ana::is_column_v<V> && \
+ ana::is_column_v<typename Arg::operation_type> && \
+ op_check::has_##op_name##_v< \
+ cell_value_t<V>, \
+ cell_value_t<typename Arg::operation_type>>, \
+ bool> = false> \
+ auto operator op_symbol(Arg const &arg) const { \
+ return this->m_df \
+ ->define([](cell_value_t<V> const &me, \
+ cell_value_t<typename Arg::operation_type> const &you) { \
+ return me op_symbol you; \
+ }) \
+ .evaluate(*this, arg); \
+ }
+
#define DEFINE_LAZY_SUBSCRIPT_OP (
+
+) template < \
+ typename Arg, typename V = Action, \
+ std::enable_if_t<is_column_v<V> && \
+ op_check::has_subscript_v< \
+ cell_value_t<V>, \
+ cell_value_t<typename Arg::operation_type>>, \
+ bool> = false> \
+ auto operator[](Arg const &arg) const { \
+ return this->m_df->define( \
+ [](cell_value_t<V> me, \
+ cell_value_t<typename Arg::operation_type> index) { \
+ return me[index]; \
+ })(*this, arg); \
+ }
+
#define DEFINE_LAZY_UNARY_OP (
+ op_name,
+ op_symbol
+) template <typename V = Action, \
+ std::enable_if_t<ana::is_column_v<V> && \
+ op_check::has_##op_name##_v<cell_value_t<V>>, \
+ bool> = false> \
+ auto operator op_symbol() const { \
+ return this->m_df \
+ ->define([](cell_value_t<V> const &me) { return (op_symbol me); }) \
+ .evaluate(*this); \
+ }
+
The documentation for this class was generated from the following file include/ana/interface/lazy.h
File List > ana > interface > lazy.h
+Go to the documentation of this file
+#pragma once
+
+#include <iostream>
+#include <set>
+#include <type_traits>
+
+#include "dataflow.h"
+#include "systematic_resolver.h"
+
+#define CHECK_FOR_BINARY_OP(op_name, op_symbol) \
+ struct has_no_##op_name {}; \
+ template <typename T, typename Arg> \
+ has_no_##op_name operator op_symbol(const T &, const Arg &); \
+ template <typename T, typename Arg = T> struct has_##op_name { \
+ enum { \
+ value = !std::is_same<decltype(std::declval<T>() \
+ op_symbol std::declval<Arg>()), \
+ has_no_##op_name>::value \
+ }; \
+ }; \
+ template <typename T, typename Arg = T> \
+ static constexpr bool has_##op_name##_v = has_##op_name<T, Arg>::value;
+
+#define DEFINE_LAZY_BINARY_OP(op_name, op_symbol) \
+ template < \
+ typename Arg, typename V = Action, \
+ std::enable_if_t<ana::is_column_v<V> && \
+ ana::is_column_v<typename Arg::operation_type> && \
+ op_check::has_##op_name##_v< \
+ cell_value_t<V>, \
+ cell_value_t<typename Arg::operation_type>>, \
+ bool> = false> \
+ auto operator op_symbol(Arg const &arg) const { \
+ return this->m_df \
+ ->define([](cell_value_t<V> const &me, \
+ cell_value_t<typename Arg::operation_type> const &you) { \
+ return me op_symbol you; \
+ }) \
+ .evaluate(*this, arg); \
+ }
+
+#define CHECK_FOR_UNARY_OP(op_name, op_symbol) \
+ struct has_no_##op_name {}; \
+ template <typename T> has_no_##op_name operator op_symbol(const T &); \
+ template <typename T> struct has_##op_name { \
+ enum { \
+ value = !std::is_same<decltype(op_symbol std::declval<T>()), \
+ has_no_##op_name>::value \
+ }; \
+ }; \
+ template <typename T> \
+ static constexpr bool has_##op_name##_v = has_##op_name<T>::value;
+
+#define DEFINE_LAZY_UNARY_OP(op_name, op_symbol) \
+ template <typename V = Action, \
+ std::enable_if_t<ana::is_column_v<V> && \
+ op_check::has_##op_name##_v<cell_value_t<V>>, \
+ bool> = false> \
+ auto operator op_symbol() const { \
+ return this->m_df \
+ ->define([](cell_value_t<V> const &me) { return (op_symbol me); }) \
+ .evaluate(*this); \
+ }
+
+#define CHECK_FOR_SUBSCRIPT_OP() \
+ template <class T, class Index> struct has_subscript_impl { \
+ template <class T1, class IndexDeduced = Index, \
+ class Reference = decltype(( \
+ *std::declval<T *>())[std::declval<IndexDeduced>()]), \
+ typename = typename std::enable_if< \
+ !std::is_void<Reference>::value>::type> \
+ static std::true_type test(int); \
+ template <class> static std::false_type test(...); \
+ using type = decltype(test<T>(0)); \
+ }; \
+ template <class T, class Index> \
+ using has_subscript = typename has_subscript_impl<T, Index>::type; \
+ template <class T, class Index> \
+ static constexpr bool has_subscript_v = has_subscript<T, Index>::value;
+
+#define DEFINE_LAZY_SUBSCRIPT_OP() \
+ template < \
+ typename Arg, typename V = Action, \
+ std::enable_if_t<is_column_v<V> && \
+ op_check::has_subscript_v< \
+ cell_value_t<V>, \
+ cell_value_t<typename Arg::operation_type>>, \
+ bool> = false> \
+ auto operator[](Arg const &arg) const { \
+ return this->m_df->define( \
+ [](cell_value_t<V> me, \
+ cell_value_t<typename Arg::operation_type> index) { \
+ return me[index]; \
+ })(*this, arg); \
+ }
+
+namespace ana {
+
+namespace op_check {
+CHECK_FOR_UNARY_OP(logical_not, !)
+CHECK_FOR_UNARY_OP(minus, -)
+CHECK_FOR_BINARY_OP(addition, +)
+CHECK_FOR_BINARY_OP(subtroperation, -)
+CHECK_FOR_BINARY_OP(multiplication, *)
+CHECK_FOR_BINARY_OP(division, /)
+CHECK_FOR_BINARY_OP(remainder, %)
+CHECK_FOR_BINARY_OP(greater_than, >)
+CHECK_FOR_BINARY_OP(less_than, <)
+CHECK_FOR_BINARY_OP(greater_than_or_equal_to, >=)
+CHECK_FOR_BINARY_OP(less_than_or_equal_to, <=)
+CHECK_FOR_BINARY_OP(equality, ==)
+CHECK_FOR_BINARY_OP(inequality, !=)
+CHECK_FOR_BINARY_OP(logical_and, &&)
+CHECK_FOR_BINARY_OP(logical_or, ||)
+CHECK_FOR_SUBSCRIPT_OP()
+} // namespace op_check
+
+template <typename Action>
+class lazy : public systematic::resolver<lazy<Action>>,
+ public lockstep::view<Action> {
+
+public:
+ class varied;
+
+public:
+ using operation_type = Action;
+
+public:
+ friend class dataflow;
+ template <typename> friend class lazy;
+
+public:
+ lazy(dataflow &dataflow, const lockstep::view<Action> &operation)
+ : systematic::resolver<lazy<Action>>::resolver(dataflow),
+ lockstep::view<Action>::view(operation) {}
+ lazy(dataflow &dataflow, const lockstep::node<Action> &operation)
+ : systematic::resolver<lazy<Action>>::resolver(dataflow),
+ lockstep::view<Action>::view(operation) {}
+
+ lazy(const lazy &) = default;
+ lazy &operator=(const lazy &) = default;
+
+ template <typename Derived> lazy(lazy<Derived> const &derived);
+ template <typename Derived> lazy &operator=(lazy<Derived> const &derived);
+
+ virtual ~lazy() = default;
+
+ virtual void set_variation(const std::string &var_name, lazy &&var) override;
+
+ virtual lazy const &nominal() const override;
+ virtual lazy const &variation(const std::string &var_name) const override;
+
+ virtual bool has_variation(const std::string &var_name) const override;
+ virtual std::set<std::string> list_variation_names() const override;
+
+ template <typename... Args>
+ auto filter(const std::string &name, Args &&...args) const;
+
+ template <typename... Args>
+ auto weight(const std::string &name, Args &&...args) const;
+
+ template <typename... Args>
+ auto channel(const std::string &name, Args &&...args) const;
+
+ template <typename Agg> auto book(Agg &&agg) const;
+ template <typename... Aggs> auto book(Aggs &&...aggs) const;
+
+ template <typename V = Action,
+ std::enable_if_t<is_selection_v<V>, bool> = false>
+ std::string path() const {
+ return lockstep::get_value(
+ [](const selection &me) { return me.get_path(); }, std::cref(*this));
+ }
+
+ template <typename V = Action,
+ std::enable_if_t<ana::aggregation::template has_output_v<V>, bool> =
+ false>
+ auto result() const;
+
+ template <typename V = Action,
+ std::enable_if_t<ana::aggregation::template has_output_v<V>, bool> =
+ false>
+ auto operator->() const -> decltype(std::declval<V>().get_result()) {
+ return this->result();
+ }
+
+ DEFINE_LAZY_SUBSCRIPT_OP()
+ DEFINE_LAZY_UNARY_OP(logical_not, !)
+ DEFINE_LAZY_UNARY_OP(minus, -)
+ DEFINE_LAZY_BINARY_OP(equality, ==)
+ DEFINE_LAZY_BINARY_OP(inequality, !=)
+ DEFINE_LAZY_BINARY_OP(addition, +)
+ DEFINE_LAZY_BINARY_OP(subtroperation, -)
+ DEFINE_LAZY_BINARY_OP(multiplication, *)
+ DEFINE_LAZY_BINARY_OP(division, /)
+ DEFINE_LAZY_BINARY_OP(logical_or, ||)
+ DEFINE_LAZY_BINARY_OP(logical_and, &&)
+ DEFINE_LAZY_BINARY_OP(greater_than, >)
+ DEFINE_LAZY_BINARY_OP(less_than, <)
+ DEFINE_LAZY_BINARY_OP(greater_than_or_equal_to, >=)
+ DEFINE_LAZY_BINARY_OP(less_than_or_equal_to, <=)
+
+protected:
+ template <typename V = Action,
+ std::enable_if_t<ana::aggregation::template has_output_v<V>, bool> =
+ false>
+ void merge_results() const;
+};
+
+} // namespace ana
+
+#include "column.h"
+#include "delayed.h"
+#include "lazy_varied.h"
+
+template <typename Action>
+template <typename Derived>
+ana::lazy<Action>::lazy(lazy<Derived> const &derived)
+ : ana::systematic::resolver<lazy<Action>>(*derived.m_df),
+ ana::lockstep::view<Action>(derived) {
+ this->m_df = derived.m_df;
+}
+
+template <typename Action>
+template <typename Derived>
+ana::lazy<Action> &ana::lazy<Action>::operator=(lazy<Derived> const &derived) {
+ lockstep::view<Action>::operator=(derived);
+ this->m_df = derived.m_df;
+ return *this;
+}
+
+template <typename Action>
+void ana::lazy<Action>::set_variation(const std::string &, lazy &&) {
+ // should never be called
+ throw std::logic_error("cannot set variation to a lazy operation");
+}
+
+template <typename Action>
+auto ana::lazy<Action>::nominal() const -> lazy const & {
+ // this is nominal
+ return *this;
+}
+
+template <typename Action>
+auto ana::lazy<Action>::variation(const std::string &) const -> lazy const & {
+ // propagation of variations must occur "transparently"
+ return *this;
+}
+
+template <typename Action>
+std::set<std::string> ana::lazy<Action>::list_variation_names() const {
+ // no variations to list
+ return std::set<std::string>();
+}
+
+template <typename Action>
+bool ana::lazy<Action>::has_variation(const std::string &) const {
+ // always false
+ return false;
+}
+
+template <typename Action>
+template <typename... Args>
+auto ana::lazy<Action>::filter(const std::string &name, Args &&...args) const {
+ if constexpr (std::is_base_of_v<selection, Action>) {
+ return this->m_df->template select<selection::cut>(
+ *this, name, std::forward<Args>(args)...);
+ } else {
+ static_assert(std::is_base_of_v<selection, Action>,
+ "filter must be called from a selection");
+ }
+}
+
+template <typename Action>
+template <typename... Args>
+auto ana::lazy<Action>::weight(const std::string &name, Args &&...args) const {
+ if constexpr (std::is_base_of_v<selection, Action>) {
+ return this->m_df->template select<selection::weight>(
+ *this, name, std::forward<Args>(args)...);
+ } else {
+ static_assert(std::is_base_of_v<selection, Action>,
+ "weight must be called from a selection");
+ }
+}
+
+template <typename Action>
+template <typename... Args>
+auto ana::lazy<Action>::channel(const std::string &name, Args &&...args) const {
+ if constexpr (std::is_base_of_v<selection, Action>) {
+ return this->m_df->template channel<selection::weight>(
+ *this, name, std::forward<Args>(args)...);
+ } else {
+ static_assert(std::is_base_of_v<selection, Action>,
+ "channel must be called from a selection");
+ }
+}
+
+template <typename Action>
+template <typename Agg>
+auto ana::lazy<Action>::book(Agg &&agg) const {
+ static_assert(std::is_base_of_v<selection, Action>,
+ "book must be called from a selection");
+ return agg.book(*this);
+}
+
+template <typename Action>
+template <typename... Aggs>
+auto ana::lazy<Action>::book(Aggs &&...aggs) const {
+ static_assert(std::is_base_of_v<selection, Action>,
+ "book must be called from a selection");
+ return std::make_tuple((aggs.book(*this), ...));
+}
+
+template <typename Action>
+template <typename V,
+ std::enable_if_t<ana::aggregation::template has_output_v<V>, bool>>
+auto ana::lazy<Action>::result() const {
+ this->m_df->analyze();
+ this->merge_results();
+ return this->get_model()->get_result();
+}
+
+template <typename Action>
+template <typename V,
+ std::enable_if_t<ana::aggregation::template has_output_v<V>, bool> e>
+void ana::lazy<Action>::merge_results() const {
+ auto model = this->get_model();
+ if (!model->is_merged()) {
+ std::vector<std::decay_t<decltype(model->get_result())>> results;
+ results.reserve(this->concurrency());
+ for (size_t islot = 0; islot < this->concurrency(); ++islot) {
+ results.push_back(this->get_slot(islot)->get_result());
+ }
+ model->merge_results(results);
+ }
+}
+
FileList > ana > interface > lazy_varied.h
+Go to the source code of this file
+#include <set>
#include <type_traits>
#include <unordered_map>
#include <utility>
#include "lazy.h"
#include "systematic_resolver.h"
#include "selection.h"
Type | +Name | +
---|---|
namespace | +ana |
+
Type | +Name | +
---|---|
class | +varied Variations of a lazy operation to be performed in an dataflow. |
+
Type | +Name | +
---|---|
define | +DECLARE_LAZY_VARIED_BINARY_OP (op_symbol) |
+
define | +DECLARE_LAZY_VARIED_UNARY_OP (op_symbol) |
+
define | +DEFINE_LAZY_VARIED_BINARY_OP (op_symbol) |
+
define | +DEFINE_LAZY_VARIED_UNARY_OP (op_name, op_symbol) |
+
#define DECLARE_LAZY_VARIED_BINARY_OP (
+ op_symbol
+) template <typename Arg> \
+ auto operator op_symbol(Arg &&b) const->typename lazy< \
+ typename decltype(std::declval<lazy<Act>>().operator op_symbol( \
+ std::forward<Arg>(b).nominal()))::operation_type>::varied;
+
#define DECLARE_LAZY_VARIED_UNARY_OP (
+ op_symbol
+) template <typename V = Act, \
+ std::enable_if_t<ana::is_column_v<V>, bool> = false> \
+ auto operator op_symbol() const->typename lazy< \
+ typename decltype(std::declval<lazy<V>>(). \
+ operator op_symbol())::operation_type>::varied;
+
#define DEFINE_LAZY_VARIED_BINARY_OP (
+ op_symbol
+) template <typename Act> \
+ template <typename Arg> \
+ auto ana::lazy <Act>::varied::operator op_symbol(Arg &&b) const-> \
+ typename lazy< \
+ typename decltype(std::declval<lazy<Act>>().operator op_symbol( \
+ std::forward<Arg>(b).nominal()))::operation_type>::varied { \
+ auto syst = typename lazy< \
+ typename decltype(std::declval<lazy<Act>>().operator op_symbol( \
+ std::forward<Arg>(b).nominal()))::operation_type>:: \
+ varied(this->nominal().operator op_symbol( \
+ std::forward<Arg>(b).nominal())); \
+ for (auto const &var_name : \
+ list_all_variation_names(*this, std::forward<Arg>(b))) { \
+ syst.set_variation(var_name, \
+ variation(var_name).operator op_symbol( \
+ std::forward<Arg>(b).variation(var_name))); \
+ } \
+ return syst; \
+ }
+
#define DEFINE_LAZY_VARIED_UNARY_OP (
+ op_name,
+ op_symbol
+) template <typename Act> \
+ template <typename V, std::enable_if_t<ana::is_column_v<V>, bool>> \
+ auto ana::lazy <Act>::varied::operator op_symbol() const->typename lazy< \
+ typename decltype(std::declval<lazy<V>>(). \
+ operator op_symbol())::operation_type>::varied { \
+ auto syst = typename lazy< \
+ typename decltype(std::declval<lazy<V>>().operator op_symbol()):: \
+ operation_type>::varied(this->nominal().operator op_symbol()); \
+ for (auto const &var_name : list_all_variation_names(*this)) { \
+ syst.set_variation(var_name, variation(var_name).operator op_symbol()); \
+ } \
+ return syst; \
+ }
+
The documentation for this class was generated from the following file include/ana/interface/lazy_varied.h
File List > ana > interface > lazy_varied.h
+Go to the documentation of this file
+#pragma once
+
+#include <set>
+#include <type_traits>
+#include <unordered_map>
+#include <utility>
+
+#include "lazy.h"
+#include "systematic_resolver.h"
+
+#define DECLARE_LAZY_VARIED_BINARY_OP(op_symbol) \
+ template <typename Arg> \
+ auto operator op_symbol(Arg &&b) const->typename lazy< \
+ typename decltype(std::declval<lazy<Act>>().operator op_symbol( \
+ std::forward<Arg>(b).nominal()))::operation_type>::varied;
+#define DEFINE_LAZY_VARIED_BINARY_OP(op_symbol) \
+ template <typename Act> \
+ template <typename Arg> \
+ auto ana::lazy<Act>::varied::operator op_symbol(Arg &&b) const-> \
+ typename lazy< \
+ typename decltype(std::declval<lazy<Act>>().operator op_symbol( \
+ std::forward<Arg>(b).nominal()))::operation_type>::varied { \
+ auto syst = typename lazy< \
+ typename decltype(std::declval<lazy<Act>>().operator op_symbol( \
+ std::forward<Arg>(b).nominal()))::operation_type>:: \
+ varied(this->nominal().operator op_symbol( \
+ std::forward<Arg>(b).nominal())); \
+ for (auto const &var_name : \
+ list_all_variation_names(*this, std::forward<Arg>(b))) { \
+ syst.set_variation(var_name, \
+ variation(var_name).operator op_symbol( \
+ std::forward<Arg>(b).variation(var_name))); \
+ } \
+ return syst; \
+ }
+#define DECLARE_LAZY_VARIED_UNARY_OP(op_symbol) \
+ template <typename V = Act, \
+ std::enable_if_t<ana::is_column_v<V>, bool> = false> \
+ auto operator op_symbol() const->typename lazy< \
+ typename decltype(std::declval<lazy<V>>(). \
+ operator op_symbol())::operation_type>::varied;
+#define DEFINE_LAZY_VARIED_UNARY_OP(op_name, op_symbol) \
+ template <typename Act> \
+ template <typename V, std::enable_if_t<ana::is_column_v<V>, bool>> \
+ auto ana::lazy<Act>::varied::operator op_symbol() const->typename lazy< \
+ typename decltype(std::declval<lazy<V>>(). \
+ operator op_symbol())::operation_type>::varied { \
+ auto syst = typename lazy< \
+ typename decltype(std::declval<lazy<V>>().operator op_symbol()):: \
+ operation_type>::varied(this->nominal().operator op_symbol()); \
+ for (auto const &var_name : list_all_variation_names(*this)) { \
+ syst.set_variation(var_name, variation(var_name).operator op_symbol()); \
+ } \
+ return syst; \
+ }
+
+namespace ana {
+
+template <typename Act>
+class lazy<Act>::varied : public systematic::resolver<lazy<Act>> {
+
+public:
+ using operation_type = typename lazy<Act>::operation_type;
+
+ template <typename... Args>
+ using delayed_varied_selection_applicator_t =
+ typename decltype(std::declval<dataflow>().filter(
+ std::declval<std::string>(), std::declval<Args>()...))::varied;
+
+public:
+ varied(lazy<Act> const &nom);
+ ~varied() = default;
+
+ virtual void set_variation(const std::string &var_name, lazy &&var) override;
+
+ virtual lazy const &nominal() const override;
+ virtual lazy const &variation(const std::string &var_name) const override;
+
+ virtual bool has_variation(const std::string &var_name) const override;
+ virtual std::set<std::string> list_variation_names() const override;
+
+ template <typename... Args, typename V = Act,
+ std::enable_if_t<ana::is_selection_v<V>, bool> = false>
+ auto filter(const std::string &name, Args &&...arguments)
+ -> delayed_varied_selection_applicator_t<Args...>;
+
+ template <typename... Args, typename V = Act,
+ std::enable_if_t<ana::is_selection_v<V>, bool> = false>
+ auto weight(const std::string &name, Args &&...arguments)
+ -> delayed_varied_selection_applicator_t<Args...>;
+
+ template <typename... Args, typename V = Act,
+ std::enable_if_t<ana::is_selection_v<V>, bool> = false>
+ auto channel(const std::string &name, Args &&...arguments)
+ -> delayed_varied_selection_applicator_t<Args...>;
+
+ template <typename Agg, typename V = Act,
+ std::enable_if_t<ana::is_selection_v<V>, bool> = false>
+ auto book(Agg &&agg);
+
+ template <typename... Aggs, typename V = Act,
+ std::enable_if_t<ana::is_selection_v<V>, bool> = false>
+ auto book(Aggs &&...aggs);
+
+ template <typename V = Act,
+ std::enable_if_t<ana::is_column_v<V> ||
+ ana::aggregation::template has_output_v<V>,
+ bool> = false>
+ auto operator[](const std::string &var_name) const -> lazy<V>;
+
+ DECLARE_LAZY_VARIED_UNARY_OP(-)
+ DECLARE_LAZY_VARIED_UNARY_OP(!)
+
+ DECLARE_LAZY_VARIED_BINARY_OP(+)
+ DECLARE_LAZY_VARIED_BINARY_OP(-)
+ DECLARE_LAZY_VARIED_BINARY_OP(*)
+ DECLARE_LAZY_VARIED_BINARY_OP(/)
+ DECLARE_LAZY_VARIED_BINARY_OP(<)
+ DECLARE_LAZY_VARIED_BINARY_OP(>)
+ DECLARE_LAZY_VARIED_BINARY_OP(<=)
+ DECLARE_LAZY_VARIED_BINARY_OP(>=)
+ DECLARE_LAZY_VARIED_BINARY_OP(==)
+ DECLARE_LAZY_VARIED_BINARY_OP(&&)
+ DECLARE_LAZY_VARIED_BINARY_OP(||)
+ DECLARE_LAZY_VARIED_BINARY_OP([])
+
+protected:
+ lazy<Act> m_nom;
+ std::unordered_map<std::string, lazy<Act>> m_var_map;
+ std::set<std::string> m_var_names;
+};
+
+} // namespace ana
+
+#include "selection.h"
+
+template <typename Act>
+ana::lazy<Act>::varied::varied(lazy<Act> const &nom)
+ : systematic::resolver<lazy<Act>>::resolver(*nom.m_df), m_nom(nom) {}
+
+template <typename Act>
+void ana::lazy<Act>::varied::set_variation(const std::string &var_name,
+ lazy &&var) {
+ m_var_map.insert(std::make_pair(var_name, std::move(var)));
+ m_var_names.insert(var_name);
+}
+
+template <typename Act>
+auto ana::lazy<Act>::varied::nominal() const -> lazy const & {
+ return m_nom;
+}
+
+template <typename Act>
+auto ana::lazy<Act>::varied::variation(const std::string &var_name) const
+ -> lazy const & {
+ return (this->has_variation(var_name) ? m_var_map.at(var_name) : m_nom);
+}
+
+template <typename Act>
+bool ana::lazy<Act>::varied::has_variation(const std::string &var_name) const {
+ return m_var_map.find(var_name) != m_var_map.end();
+}
+
+template <typename Act>
+std::set<std::string> ana::lazy<Act>::varied::list_variation_names() const {
+ return m_var_names;
+}
+
+template <typename Act>
+template <typename... Args, typename V,
+ std::enable_if_t<ana::is_selection_v<V>, bool>>
+auto ana::lazy<Act>::varied::filter(const std::string &name,
+ Args &&...arguments)
+ -> delayed_varied_selection_applicator_t<Args...> {
+
+ using varied_type = delayed_varied_selection_applicator_t<Args...>;
+
+ auto syst = varied_type(
+ this->nominal().filter(name, std::forward<Args>(arguments)...));
+
+ for (auto const &var_name : this->list_variation_names()) {
+ syst.set_variation(var_name, this->variation(var_name).filter(
+ name, std::forward<Args>(arguments)...));
+ }
+ return syst;
+}
+
+template <typename Act>
+template <typename... Args, typename V,
+ std::enable_if_t<ana::is_selection_v<V>, bool>>
+auto ana::lazy<Act>::varied::weight(const std::string &name,
+ Args &&...arguments)
+ -> delayed_varied_selection_applicator_t<Args...> {
+
+ using varied_type = delayed_varied_selection_applicator_t<Args...>;
+
+ auto syst = varied_type(
+ this->nominal().weight(name, std::forward<Args>(arguments)...));
+
+ for (auto const &var_name : this->list_variation_names()) {
+ syst.set_variation(var_name, this->variation(var_name).weight(
+ name, std::forward<Args>(arguments)...));
+ }
+ return syst;
+}
+
+template <typename Act>
+template <typename... Args, typename V,
+ std::enable_if_t<ana::is_selection_v<V>, bool>>
+auto ana::lazy<Act>::varied::channel(const std::string &name,
+ Args &&...arguments)
+ -> delayed_varied_selection_applicator_t<Args...> {
+ using varied_type = delayed_varied_selection_applicator_t<Args...>;
+ auto syst = varied_type(
+ this->nominal().channel(name, std::forward<Args>(arguments)...));
+ for (auto const &var_name : this->list_variation_names()) {
+ syst.set_variation(var_name, this->variation(var_name).channel(
+ name, std::forward<Args>(arguments)...));
+ }
+ return syst;
+}
+
+template <typename Act>
+template <typename Agg, typename V,
+ std::enable_if_t<ana::is_selection_v<V>, bool>>
+auto ana::lazy<Act>::varied::book(Agg &&agg) {
+ return agg.book(*this);
+}
+
+template <typename Act>
+template <typename... Aggs, typename V,
+ std::enable_if_t<ana::is_selection_v<V>, bool>>
+auto ana::lazy<Act>::varied::book(Aggs &&...aggs) {
+ return std::make_tuple((aggs.book(*this), ...));
+}
+
+template <typename Act>
+template <typename V,
+ std::enable_if_t<ana::is_column_v<V> ||
+ ana::aggregation::template has_output_v<V>,
+ bool>>
+auto ana::lazy<Act>::varied::operator[](const std::string &var_name) const
+ -> lazy<V> {
+ if (!this->has_variation(var_name)) {
+ throw std::out_of_range("variation does not exist");
+ }
+ return this->variation(var_name);
+}
+
+DEFINE_LAZY_VARIED_UNARY_OP(minus, -)
+DEFINE_LAZY_VARIED_UNARY_OP(logical_not, !)
+
+DEFINE_LAZY_VARIED_BINARY_OP(+)
+DEFINE_LAZY_VARIED_BINARY_OP(-)
+DEFINE_LAZY_VARIED_BINARY_OP(*)
+DEFINE_LAZY_VARIED_BINARY_OP(/)
+DEFINE_LAZY_VARIED_BINARY_OP(<)
+DEFINE_LAZY_VARIED_BINARY_OP(>)
+DEFINE_LAZY_VARIED_BINARY_OP(<=)
+DEFINE_LAZY_VARIED_BINARY_OP(>=)
+DEFINE_LAZY_VARIED_BINARY_OP(==)
+DEFINE_LAZY_VARIED_BINARY_OP(&&)
+DEFINE_LAZY_VARIED_BINARY_OP(||)
+DEFINE_LAZY_VARIED_BINARY_OP([])
+
No modules found.
+ + + + + + +Nothing related to Namespace Member Enums found.
+ + + + + + +The documentation for this class was generated from the following file [generated]
Type | +Name | +
---|---|
namespace | +aggregation |
+
namespace | +column |
+
namespace | +dataset |
+
namespace | +op_check |
+
Type | +Name | +
---|---|
class | +dataflow |
+
class | +delayed <typename Bkr> A node that instantiates a lazy action. |
+
struct | +is_unique_ptr <typename T> |
+
struct | +is_unique_ptr< std::unique_ptr< T > > <typename T> |
+
class | +lazy <typename Action> |
+
Type | +Name | +
---|---|
typedef typename decltype(std::declval< T const & >().open_player(std::declval< const ana::dataset::range & >()))::element_type | +open_player_t |
+
typedef typename T::nominal_type | +operation_t |
+
typedef typename decltype(std::declval< T >().template read_column< Val >(std::declval< dataset::range const & >(), std::declval< std::string const & >()))::element_type | +read_column_t |
+
Type | +Name | +
---|---|
constexpr bool | +has_no_variation_v = = (is_nominal_v<Args> && ...) |
+
constexpr bool | +has_variation_v = = (is_varied_v<Args> || ...) |
+
constexpr bool | +is_nominal_v = = | +
(decltype(check_lazy(std::declval<V>()))::value || | ++ |
decltype(check_delayed(std::declval<V>()))::value) |
++ |
constexpr bool | +is_unique_ptr_v = = is_unique_ptr<T>::value |
+
constexpr bool | +is_varied_v = = !is_nominal_v<V> |
+
Type | +Name | +
---|---|
constexpr std::true_type | +check_delayed (delayed< U > const &) |
+
constexpr std::false_type | +check_delayed (...) |
+
constexpr std::true_type | +check_lazy (lazy< U > const &) |
+
constexpr std::false_type | +check_lazy (...) |
+
using ana::open_player_t = typedef typename decltype(std::declval<T const &>().open_player( std::declval<const ana::dataset::range &>()))::element_type;
+
using ana::read_column_t = typedef typename decltype(std::declval<T>().template read_column<Val>( std::declval<dataset::range const &>(), std::declval<std::string const &>()))::element_type;
+
template<typename U typename U>
+static constexpr std::true_type ana::check_delayed (
+ delayed < U > const &
+)
+
template<typename U typename U>
+static constexpr std::true_type ana::check_lazy (
+ lazy < U > const &
+)
+
The documentation for this class was generated from the following file include/ana/interface/aggregation_logic.h
Namespace List > ana > aggregation
+Type | +Name | +
---|---|
class | +logic< T(Obs...)> <typename T, Obs> Counter output to be filled with columns using arbitrary logic. |
+
The documentation for this class was generated from the following file [generated]
Namespace List > ana > column
+Type | +Name | +
---|---|
class | +definition< Ret(Vals...)> <typename Ret, Vals> Column with user-defined return value type and evaluation dataset. |
+
The documentation for this class was generated from the following file [generated]
Namespace List > ana > dataset
+Type | +Name | +
---|---|
class | +column <typename T> Read columns from a dataset. |
+
struct | +first |
+
class | +input <typename DS> |
+
class | +player |
+
class | +reader <typename T> |
+
class | +source |
+
The documentation for this class was generated from the following file include/ana/interface/dataset.h
Namespace List > ana > op_check
+The documentation for this class was generated from the following file include/ana/interface/lazy.h
The documentation for this class was generated from the following file [generated]
The documentation for this class was generated from the following file [generated]
Here is a list of all namespaces with brief descriptions:
+The documentation for this class was generated from the following file [generated]
The documentation for this class was generated from the following file [generated]
Here is a list of all related documentation pages:
+ + + + + + +ClassList > ana > dataset > first
+Type | +Name | +
---|---|
long long | +nrows |
+
Type | +Name | +
---|---|
+ | first (long long nrows) |
+
The documentation for this class was generated from the following file include/ana/interface/dataset.h
template <typename T typename T>
+ClassList > ana > is_unique_ptr
+Inherits the following classes: std::false_type
+The documentation for this class was generated from the following file include/ana/interface/dataset.h
template <typename T typename T>
+ClassList > ana > is_unique_ptr< std::unique_ptr< T > >
+Inherits the following classes: std::true_type
+The documentation for this class was generated from the following file include/ana/interface/dataset.h
Nothing related to Variables found.
+ + + + + + +