Skip to content

Conversation

@aalkin
Copy link
Member

@aalkin aalkin commented Jul 26, 2021

  • ifnode(condition, then, else) operation is added to expressions
  • these can be nested
  • all three arguments can be arbitrary valid expressions
  • condition needs to have boolean result, then and else should return similar types (ideally the same - both floats, or both boolean, etc.)
  • Added a test
  • Added conditionalExpressions.cxx tutorial example (note that it uses bitwise operations in filter expression and thus will only work 'as is' with arrow > 3.0)

@jgrosseo this is fully functional

* `ifnode(condition, then, else)` operation is added to expressions
* these can be nested
* all three arguments can be arbitrary valid expressions
* `condition` needs to have boolean result, `then` and `else` should return
  similar types (ideally the same - both floats, or both boolean, etc.)
* Added a test
* Added `conditionalExpressions.cxx` tutorial example (note that it uses
  bitwise operations in filter expression and thus will only work as is
  with arrow > 3)
@aalkin aalkin requested review from a team, iarsene and jgrosseo as code owners July 26, 2021 17:36
jgrosseo
jgrosseo previously approved these changes Jul 26, 2021
Copy link
Collaborator

@jgrosseo jgrosseo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@jgrosseo
Copy link
Collaborator

Mac is not happy... /System/Volumes/Data/build/ci_checks/alice_ci_0/o2/sw/SOURCES/O2/6753/0/Analysis/Tasks/PWGLF/spectraTPCPiKaPr.cxx:52:9: error: value of type 'o2::framework::expressions::Node' is not contextually convertible to 'bool' if (abs(nsigma) > cfgNSigmaCut) {

@aalkin
Copy link
Member Author

aalkin commented Jul 27, 2021

There was an issue with operations between configurables and literal values. In the filter expressions one would may need to use .node() for configurables to ensure that it will be updated and not just used as default. The normal usage in if () will be unaffected.

@ktf ktf merged commit 18eb5f3 into AliceO2Group:dev Jul 27, 2021
skundu692 pushed a commit to skundu692/AliceO2 that referenced this pull request Aug 10, 2021
`ifnode(condition, then, else)` operation is added to expressions. These can be nested and all three arguments can be arbitrary valid expressions. `condition` needs to have boolean result, `then` and `else` should return similar types (ideally the same - both floats, or both boolean, etc.). A `conditionalExpressions.cxx` tutorial example is added (note that it uses bitwise operations in filter expression and thus will only work as is with arrow > 3).
EmilGorm pushed a commit to EmilGorm/AliceO2 that referenced this pull request Nov 22, 2021
`ifnode(condition, then, else)` operation is added to expressions. These can be nested and all three arguments can be arbitrary valid expressions. `condition` needs to have boolean result, `then` and `else` should return similar types (ideally the same - both floats, or both boolean, etc.). A `conditionalExpressions.cxx` tutorial example is added (note that it uses bitwise operations in filter expression and thus will only work as is with arrow > 3).
@aalkin aalkin deleted the add-conditional-node branch May 30, 2022 08:48
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