Error in TTreeFormula::Compile: Bad numerical expression : “(0.00837315/*StokesHybridPlusCDF.WAISHPol),(0.31277/*StokesHybridPlusCDF.WAISVPol),(0.107212/*StokesHybridPlusCDF.HiCal2A),(0.105385/*StokesHybridPlusCDF.HiCal2B),(1/*StokesHybridPlusCDF.iceMC)”
As far as I can tell, this has to do with line 115 in the macro. I think it may have to do with how the Max$() function behaves within TTree::Draw(). It seems like Max$() gets confused when arguments within it aren’t simple statements of variables within a TTree? Here I’m attempting to multiply such variables by constants.
But perhaps line 115 just needs to be modified. Any suggestions?
You might have misunderstood the semantic of Max$, it actually takes a single argument that is expected to be a name or expression including names that refer to a collection within the TTree and Max$ will return the maximum value of the expression when iterating over the element of the collection(s) for a given entry.
Thank you for your response. I now think you are right about the semantic of Max$(). When I used a cut such as on line 84 in the macro, I was under the false impression that the maximum among a list of variables enclosed in Max$() would be selected. However, your comment led me rearrange the variables inside of line 84 and found I got different results after using it in the function TTree::GetEntries().
So then is there a way to set a cut like line 84 in TTree:GetEntries()? I have also tried using something like
but that didn’t seem to work. Outside of nesting instances of TMath::Max(), is there a function that can be used to get the desired behavior that I want? Maybe I am missing something in the call to TMath::MaxElement() above?
There has been no upgrade to TTree::Draw itself since that post … However we also released RDataFrame as a successor to TTree::Draw which support more C++ construct and allow for run the queries using multiple cores.