Draw and Scan inconcistency

I need to compute the efficiency of late conversion with 1 track. This is when “convRadius>0 && @ph_convFlag->size()==2 && ph_convFlag[0] == 1 && ph_convFlag[1]==1 && IsConv” over the time I have a real late conversion: “cvradius>800”.

If I scan my chain with:

chain.Scan(“cvradius:IsConv:convRadius:ph_convFlag[0]”, “convRadius>0 && @ph_convFlag.size()==2 && ph_convFlag[0] == 1 && ph_convFlag[1]==1 && IsConv==1 && cvradius>800”)

I got 675 entries over chain.GetEntries() = 120000, so 675/120000 = small

but if I do

chain.Draw(“convRadius>0 && @ph_convFlag->size()==2 && ph_convFlag[0] == 1 && ph_convFlag[1]==1 && IsConv”, “cvradius>800”)

I got an histogram with two bins, the one at 0 has 2 entry, the one at 1 675 entries, so the mean is 0.997.

Hi,

The result seems consistent to me. The result of scan says that there is exactly 675 elements in the arrays in all the entries of the TTree that match both the expression “convRadius>0 && @ph_convFlag.size()==2 && ph_convFlag[0] == 1 && ph_convFlag[1]==1 && IsConv==1” and the expression “cvradius>800”.
The result of Draw says that there is exactly 677 elements in the arrays in all the entries of the TTree that match ‘just’ the expression “cvradius>800”. Of this 677 elements, only 675 match the expression (so the same result as Scan).
Constrast with the histogram produced bychain.Draw("convRadius>0 && @ph_convFlag->size()==2 && ph_convFlag[0] == 1 && ph_convFlag[1]==1 && IsConv && cvradius>800");andchain.Draw("convRadius>0 && @ph_convFlag->size()==2 && ph_convFlag[0] == 1 && ph_convFlag[1]==1 && IsConv && cvradius>800","convRadius>0 && @ph_convFlag->size()==2 && ph_convFlag[0] == 1 && ph_convFlag[1]==1 && IsConv && cvradius>800");

Cheers,
Philippe.