Skip to content
Prev Previous commit
Next Next commit
[TDF] Use SelectColumns instead of GetBranchNames in Min,Max,Mean
  • Loading branch information
eguiraud committed Jul 13, 2017
commit c1adef50fd67daabf176dd842d4e8fcfe8ef500f
12 changes: 6 additions & 6 deletions tree/treeplayer/inc/ROOT/TDFInterface.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -962,9 +962,9 @@ public:
template <typename T = TDFDetail::TInferType>
TResultProxy<double> Min(std::string_view branchName = "")
{
auto bl = GetBranchNames<T>({branchName}, "calculate the minimum");
const auto userColumns = branchName.empty() ? ColumnNames_t() : ColumnNames_t({std::string(branchName)});
auto minV = std::make_shared<double>(std::numeric_limits<double>::max());
return CreateAction<TDFInternal::ActionTypes::Min, T>(bl, minV);
return CreateAction<TDFInternal::ActionTypes::Min, T>(userColumns, minV);
}

////////////////////////////////////////////////////////////////////////////
Expand All @@ -979,9 +979,9 @@ public:
template <typename T = TDFDetail::TInferType>
TResultProxy<double> Max(std::string_view branchName = "")
{
auto bl = GetBranchNames<T>({branchName}, "calculate the maximum");
const auto userColumns = branchName.empty() ? ColumnNames_t() : ColumnNames_t({std::string(branchName)});
auto maxV = std::make_shared<double>(std::numeric_limits<double>::min());
return CreateAction<TDFInternal::ActionTypes::Max, T>(bl, maxV);
return CreateAction<TDFInternal::ActionTypes::Max, T>(userColumns, maxV);
}

////////////////////////////////////////////////////////////////////////////
Expand All @@ -996,9 +996,9 @@ public:
template <typename T = TDFDetail::TInferType>
TResultProxy<double> Mean(std::string_view branchName = "")
{
auto bl = GetBranchNames<T>({branchName}, "calculate the mean");
const auto userColumns = branchName.empty() ? ColumnNames_t() : ColumnNames_t({std::string(branchName)});
auto meanV = std::make_shared<double>(0);
return CreateAction<TDFInternal::ActionTypes::Mean, T>(bl, meanV);
return CreateAction<TDFInternal::ActionTypes::Mean, T>(userColumns, meanV);
}

////////////////////////////////////////////////////////////////////////////
Expand Down