Handling events where a leaf's data is unavailable


In my ntuple I have cases in which no value can be calculated for a leaf. This isn’t too uncommon, I expect, and from experience people either set the value to some special number, e.g., -9999 or pair every such leaf with a second “isvalid” leaf. The latter case is a little laborious and results in more typing in Draw(). Is there perhaps a better way to handle these cases? Something that would result in TTree::Draw() not drawing cases in which the leaf’s data isn’t valid? I noticed that TLeaf’s child classes define fMaximum and fMinimum and have functions IsRange(), etc., which made me think that the functionality might exist… though I cannot see it as I root through the code. Any suggestions here?

Mike Kordosky


The best way to handle this is to store the value in an array and/or collection that would have 0 or 1 value.