I’m using the TTree.Draw command to create histograms (so far, so common). However there is a problem when trying to use an array that might either be empty or have one entry in the selection such that events are either accepted when:
the vector is empty OR (it has one entry AND the value is below a threshold).
Looking at the results it seems that this is equivalent to just evaluating the second expression
(it has one entry AND the value is below a threshold)
My current understanding is that ROOT always evaluates the full expression and rejects it because the value cannot be accessed for comparison. Would there be a way to circumvent this (for example stopping the evaluation after the first ORed expression succeds)?
Building the combined expression out of seperate TCut objects or using a ternary operator failed as well.
sure - here is a minimal example (the attached root file contains two branches: mynum - a scalar that is either 0 or 1 and an array myval with length equal to mynum and filled with a random float (0,1) if mynum=1).
Statement [1] and [2] are fine and add up to a total of 50k entries. Now we bi-sect the events where we have one entry: [3] and [4] add up to the result of [2] - as expected. However the complement set of [3], written using the “!” negation in [5] and more explictely in [6] fails to include the additional 24862 entries where the array is empty from [1].