Nan problem with histogram

I’ve a really strange problem. I plot this variable from a TChain, I’ve some events with 0 value:


I want to zoom into these event so require ph_TraversedMaterial<2



where are they? Ok, maybe they are NaN, in fact if I remove NaN I’m removing these events:


so, let see how much they are:


they seems to be disappeared! Try the inverse:

Another strange thing is that if I try to Scan the TChain I don’t see any NaN. ROOT 5.34/00

When you plot with this selection, x=0 in no more in range. So its normal they disappeared …

I’ve solved: I was using a TChain and in some files the variable was not present. Is it possibile to add a warning?

[quote=“couet”][quote]
I want to zoom into these event so require ph_TraversedMaterial<2
where are they?
[/quote]

When you plot with this selection, x=0 in no more in range. So its normal they disappeared …[/quote]

I don’t understand: 0 < 2, so yes, I should see them.

May be. I let the TTree expert answering you.

Yes, you are right, I had not noticed you did the cut on the same variable you are plotting.
I agree that in that case the axis value is in range. I will tell our TTree expert to have a look.

Hi,

This is somewhat intended. When you do not make any selection on a possibly missing data field, TTreeFormula is not (allowed to) skip any rows and thus insert zero where there is missing data.

When a selection is involved, its value is set to false whenever the data field is missing (and thus in your example they are skipped).

Cheers,
Philippe.

[quote=“pcanal”]Hi,

This is somewhat intended. When you do not make any selection on a possibly missing data field, TTreeFormula is not (allowed to) skip any rows and thus insert zero where there is missing data.

When a selection is involved, its value is set to false whenever the data field is missing (and thus in your example they are skipped).

Cheers,
Philippe.[/quote]

I see, but this is really dangerous. Can you add at least a warning?

[quote]I see, but this is really dangerous. Can you add at least a warning?[/quote]I’ll have to think through the side effects.

Philippe.