Skip to content

Conversation

@aalkin
Copy link
Member

@aalkin aalkin commented Apr 11, 2025

Introducing a "binned" expression node that can be used in configurable expression columns. The syntax is the following:
binned(bins_vector, parameters_vector, binned_expression, parametrized_expression, out_of_bounds_expression), where

  • bins_vector is a float or double vector with bin lower edges and the rightmost upper edge as a final element, containing nbins + 1 elements in total
  • parameters_vector is a flat vector with parameter values for the parametrized expression, grouped by parameter, meaning that first you have parameter0 for all bins, then parameter1 for all bins, etc. Can be empty.
  • binned_expression determines the quantity that needs to be compared with bin edges. It can be a generic expression or a single column, e.g. aod::track::phi
  • parametrized_experssion is the expression that needs to be computed for all rows of the original table, parameters can be used as par(<number>), starting from par(0). The consistency with the parameters_vector is not checked.
  • out_of_bounds_expression provides the value for the binned quantity is outside of the bounds determined by bins vector, it should have the same return type as the parametrized expression but otherwise is a generic expression

This is equivalent to the following code

      if (binned_exp < bins_vector[0]) {
        return out_expression;
      }
      for (auto i = 0U; i < bins_vector.size() - 1; ++i) {
        if (binned_exp < bins_vector[i + 1]) {
          return parametrized_expression(parameters_vector);
        }
      }
      return out_expression;

@aalkin aalkin requested a review from a team as a code owner April 11, 2025 12:03
@github-actions
Copy link
Contributor

REQUEST FOR PRODUCTION RELEASES:
To request your PR to be included in production software, please add the corresponding labels called "async-" to your PR. Add the labels directly (if you have the permissions) or add a comment of the form (note that labels are separated by a ",")

+async-label <label1>, <label2>, !<label3> ...

This will add <label1> and <label2> and removes <label3>.

The following labels are available
async-2023-pbpb-apass4
async-2023-pp-apass4
async-2024-pp-apass1
async-2022-pp-apass7
async-2024-pp-cpass0
async-2024-PbPb-apass1
async-2024-ppRef-apass1
async-2024-PbPb-apass2
async-2023-PbPb-apass5

@alibuild
Copy link
Collaborator

Error while checking build/O2/fullCI_slc9 for 2e8a918 at 2025-04-11 15:30:

## sw/BUILD/O2-latest/log
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:8: error: 'stack' is not a member of 'std'
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:24: error: expected primary-expression before '>' token
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:26: error: 'path' was not declared in this scope; did you mean 'boost::property_tree::path'?
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:8: error: 'stack' is not a member of 'std'
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:24: error: expected primary-expression before '>' token
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:26: error: 'path' was not declared in this scope; did you mean 'boost::property_tree::path'?
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:8: error: 'stack' is not a member of 'std'
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:24: error: expected primary-expression before '>' token
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:26: error: 'path' was not declared in this scope; did you mean 'boost::property_tree::path'?
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:8: error: 'stack' is not a member of 'std'
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:24: error: expected primary-expression before '>' token
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:26: error: 'path' was not declared in this scope; did you mean 'boost::property_tree::path'?
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:8: error: 'stack' is not a member of 'std'
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:24: error: expected primary-expression before '>' token
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:26: error: 'path' was not declared in this scope; did you mean 'boost::property_tree::path'?
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:8: error: 'stack' is not a member of 'std'
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:24: error: expected primary-expression before '>' token
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:26: error: 'path' was not declared in this scope; did you mean 'boost::property_tree::path'?
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:8: error: 'stack' is not a member of 'std'
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:24: error: expected primary-expression before '>' token
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:26: error: 'path' was not declared in this scope; did you mean 'boost::property_tree::path'?
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:8: error: 'stack' is not a member of 'std'
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:24: error: expected primary-expression before '>' token
/sw/SOURCES/O2/14174-slc9_x86-64/0/Framework/Core/include/Framework/Expressions.h:271:26: error: 'path' was not declared in this scope; did you mean 'boost::property_tree::path'?
ninja: build stopped: subcommand failed.

Full log here.

@alibuild
Copy link
Collaborator

Error while checking build/O2/fullCI_slc9 for 95f5ecd at 2025-04-12 01:27:

## sw/BUILD/O2Physics-latest/log
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:


## sw/BUILD/O2-full-system-test-latest/log
Detected critical problem in logfile sim.log


## sw/BUILD/o2checkcode-latest/log
--
========== List of errors found ==========
++ GRERR=0
++ grep -v clang-diagnostic-error error-log.txt
++ grep ' error:'
++ GRERR=1
++ [[ 1 == 0 ]]
++ mkdir -p /sw/INSTALLROOT/12a60ac62573ff11e574c9c5f1797716b8c1b3ce/slc9_x86-64/o2checkcode/1.0-local139/etc/modulefiles
++ cat
--

Full log here.

aalkin added 2 commits April 12, 2025 15:51
Fix logic:
* bins are defined as [lower : upper)
* separate "less than lower" node
@alibuild
Copy link
Collaborator

Error while checking build/O2/fullCI_slc9 for 8d2f417 at 2025-04-12 18:00:

## sw/BUILD/O2Physics-latest/log
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:


## sw/BUILD/O2-full-system-test-latest/log
Detected critical problem in logfile sim.log


## sw/BUILD/o2checkcode-latest/log
--
========== List of errors found ==========
++ GRERR=0
++ grep -v clang-diagnostic-error error-log.txt
++ grep ' error:'
++ GRERR=1
++ [[ 1 == 0 ]]
++ mkdir -p /sw/INSTALLROOT/1327cab8212f5349648a315606001c6b6badcdf9/slc9_x86-64/o2checkcode/1.0-local158/etc/modulefiles
++ cat
--

Full log here.

@alibuild
Copy link
Collaborator

Error while checking build/O2/fullCI_slc9 for 3b50806 at 2025-04-12 19:09:

## sw/BUILD/O2Physics-latest/log
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:


## sw/BUILD/O2-full-system-test-latest/log
Detected critical problem in logfile sim.log


## sw/BUILD/o2checkcode-latest/log
--
========== List of errors found ==========
++ GRERR=0
++ grep -v clang-diagnostic-error error-log.txt
++ grep ' error:'
grep: error-log.txt: binary file matches
++ GRERR=1
++ [[ 1 == 0 ]]
++ mkdir -p /sw/INSTALLROOT/86a4df76988663c419fc0ea7b21562aab416cb07/slc9_x86-64/o2checkcode/1.0-local159/etc/modulefiles
++ cat
--

Full log here.

@ktf ktf merged commit 466ba06 into AliceO2Group:dev Apr 15, 2025
12 checks passed
@ktf
Copy link
Member

ktf commented Apr 15, 2025

Feature not used. Unit test added. Merging on @jackal1-66 request.

@aalkin aalkin deleted the binned-expression branch December 11, 2025 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants