diff --git a/analogical.h b/analogical.h index 81e8d2ed..f51583a5 100644 --- a/analogical.h +++ b/analogical.h @@ -1155,7 +1155,7 @@ template class input : public source { decltype(auto) read_column(const ana::dataset::range &part, const std::string &name); - virtual partition allocate() = 0; + virtual partition parallelize() = 0; virtual double normalize(); }; @@ -3858,7 +3858,7 @@ ana::dataset::reader ana::dataflow::open(Args &&...args) { m_source = std::move(source); // 1. allocate the dataset partition - this->m_partition = ds->allocate(); + this->m_partition = ds->parallelize(); // 2. truncate entries to limit this->m_partition.truncate(this->m_nrows); // 3. merge parts to concurrency limit @@ -3990,7 +3990,7 @@ auto ana::dataflow::agg(Args &&...args) -> delayed> { return delayed>( *this, this->m_processors.get_lockstep_node( [&args...](dataset::processor &proc) { - return proc.template book(std::forward(args)...); + return proc.template agg(std::forward(args)...); })); } diff --git a/docs/demo/hww/notebook.md b/docs/demo/hww/notebook.md index f8c50ad6..a5bb2d6a 100644 --- a/docs/demo/hww/notebook.md +++ b/docs/demo/hww/notebook.md @@ -118,14 +118,14 @@ auto cut_2lsf_wwcr = cut_2lsf.filter("wwcr")(mll > mll_cut); // path = "2lsf/cr ``` ```cpp title="Book histograms" // Hist<1,float> is user-implemented. -auto pth_hist = df.book>("pth",100,0,400).fill(pth).at(cut_2los); +auto pth_hist = df.agg>("pth",100,0,400).fill(pth).at(cut_2los); // also at "2ldf/wwcr", "2lsf/wwcr" auto l1n2_pt_hists_wwcrs = l1n2_pt_hist.at(cut_2lsf_sr, cut_2lsf_wwcr); ``` ```cpp title="(Optional) Dump out results" // booked at multiple selections -auto pth_hists = df.book>("pth",100,0,400).fill(pth).at(cut_2los, cut_2ldf, cut_2lsf); +auto pth_hists = df.agg>("pth",100,0,400).fill(pth).at(cut_2los, cut_2ldf, cut_2lsf); // want to write histogram at each selection, using its path as sub-folders auto out_file = TFile::Open("hww_hists.root","recreate"); @@ -163,7 +163,7 @@ cut_2l.has_variation("sf_var"); // true // ... -auto mll_vars = df.book>("mll",50,0,100).fill(mll).at(cut_2los); +auto mll_vars = df.agg>("mll",50,0,100).fill(mll).at(cut_2los); mll_vars.has_variation("lp4_up"); // true : mll & cut_2los varied mll_vars.has_variation("sf_var"); // true : mll nominal & cut_2los varied ``` @@ -176,7 +176,7 @@ mll_vars["lp4_up"]->Draw("same"); ```cpp title="Booking multiple selections and variations at once" // mll contains variations = {lp4_up, sf_var} // booked at selections = {cut_2ldf, cut_2lsf} -auto mll_channels_vars = df.book>("mll",50,0,200).fill(mll).at(cut_2ldf, cut_2lsf); +auto mll_channels_vars = df.agg>("mll",50,0,200).fill(mll).at(cut_2ldf, cut_2lsf); // specify variation name, followed by selection path mll_channels_vars.nominal()["2ldf"]->GetEntries(); diff --git a/docs/features/column/column.md b/docs/features/column/column.md index d2242bb6..419ab260 100644 --- a/docs/features/column/column.md +++ b/docs/features/column/column.md @@ -24,7 +24,7 @@ Consider the following JSON data: json(const nlohmann::json &data); ~json() = default; - ana::dataset::partition allocate(); + ana::dataset::partition parallelize(); template std::unique_ptr> read(const ana::dataset::range &part, @@ -58,7 +58,7 @@ Consider the following JSON data: const std::string &name) : m_data(data), m_name(name) {} - ana::dataset::partition ana::json::allocate() { + ana::dataset::partition ana::json::parallelize() { ana::dataset::partition parts; auto nentries = m_data.size(); for (unsigned int i = 0; i < nentries; ++i) { diff --git a/include/ana/interface/aggregation_experiment.h b/include/ana/interface/aggregation_experiment.h index 41eaf816..316aa7b4 100644 --- a/include/ana/interface/aggregation_experiment.h +++ b/include/ana/interface/aggregation_experiment.h @@ -19,7 +19,7 @@ class aggregation::experiment : public selection::cutflow { public: template - std::unique_ptr> book(Args &&...args); + std::unique_ptr> agg(Args &&...args); template auto select_aggregation(booker const &bkr, const selection &sel) @@ -56,7 +56,7 @@ inline void ana::aggregation::experiment::clear_aggregations() { template std::unique_ptr> -ana::aggregation::experiment::book(Args &&...args) { +ana::aggregation::experiment::agg(Args &&...args) { auto bkr = std::make_unique>(std::forward(args)...); return bkr; } diff --git a/include/ana/interface/dataflow.h b/include/ana/interface/dataflow.h index 5052319a..9d7145c3 100644 --- a/include/ana/interface/dataflow.h +++ b/include/ana/interface/dataflow.h @@ -407,7 +407,7 @@ auto ana::dataflow::agg(Args &&...args) -> delayed> { return delayed>( *this, lockstep::get_node( [&args...](dataset::processor *proc) { - return proc->template book(std::forward(args)...); + return proc->template agg(std::forward(args)...); }, this->m_processors)); } diff --git a/include/ana/interface/lazy.h b/include/ana/interface/lazy.h index 1ff655ce..7d120ee9 100644 --- a/include/ana/interface/lazy.h +++ b/include/ana/interface/lazy.h @@ -177,7 +177,7 @@ class lazy : public systematic::resolver>, template , bool> = false> - auto result() const; + auto result() const -> decltype(std::declval().get_result()); template , bool> = @@ -316,7 +316,8 @@ auto ana::lazy::book(Aggs &&...aggs) const { template template , bool>> -auto ana::lazy::result() const { +auto ana::lazy::result() const + -> decltype(std::declval().get_result()) { this->m_df->analyze(); this->merge_results(); return this->get_model()->get_result(); diff --git a/tests/test-selection.cxx b/tests/test-selection.cxx index 7cb57d9a..35b1ef71 100644 --- a/tests/test-selection.cxx +++ b/tests/test-selection.cxx @@ -71,7 +71,7 @@ TEST_CASE("correctness & consistency of selections") { auto cut_a2 = weighted_entries.filter("a2")(cut_ab && cut_a); auto cut_b2 = weighted_entries.filter("b2")(cut_ab && cut_b); - // auto sumw_a = df.book().at(cut_a); + // auto sumw_a = df.agg().at(cut_a); auto sumw_a = cut_a.book(df.agg()); auto sumw_one = df.agg().book(cut_a, cut_b, cut_c);