Hello, everyone!
I have a problem while using the Define() function in rdataframe.
Here is the thing. I want to use other conditional statements inside define().
I had problems with complex data:
data file: test2.root (215.8 KB)
cpp file: dataframe_define_test_2.cpp (378 Bytes)
as @ikabadzhov says if ("MDz2<0") should be if (z < 0).
The reason why if ("MDz2<0") compiles (and always evaluates to true, so your function always returns 0) is that the string "MDz2<0" is of type const char * (pointer to array of characters) and if ("some_string") then is equivalent to if (bool(addressof("some_string)) == true) (i.e. you are actually testing that the address of the string is positive). Classic C++ shenanigans.