Unwanted error message

From: Tom Roberts <tjrob_at_fnal.gov>
Date: Mon, 15 Dec 2008 22:27:55 -0500


To check an expression for validity with a given TNtuple, I construct a temporary TTreeFormula and check whether it succeeded. For invalid expressions I get the error message: Error in <TTreeFormula::Compile>: Bad numerical expression : "in_Px"

This looks bad to my users (there can be dozens in a row). It is legitimate for these expressions to be invalid for the TNtuple that is currently selected -- that's why I am checking them before trying to use them. So I don't want the error message. Zeroing stderr and stdout do not suppress it. How can I suppress it? Alternatively, is there some other way to check whether a given expression is valid for a given TNtuple?

At present I'm printing a notice to ignore the errors -- this workable, but looks silly....

Tom Roberts Received on Tue Dec 16 2008 - 04:28:00 CET

This archive was generated by hypermail 2.2.0 : Tue Dec 16 2008 - 05:50:04 CET