ROOT Version: tested on 6.32.08 and 6.32.10
Platform: tested on Linux Mint 22.1
ROOT developers,
Not sure, but this might be a bug (or unexpected feature for me) in TTree::Draw. When the tree branch/leaf only contains entries with negative and zero values (exactly equal to zero), and no positives, doing Draw does not show the entries at zero; this seems to happen for float and double, but not for int (see below).
I noticed this with v6.32.08, and the one just released (6.32.10) shows the same. Here is an example (note that x is filled with -999 and zero, y with -999 and 1, z with -999 and -1):
{
gStyle->SetOptStat(111111);
auto c = new TCanvas("c", "c", 1800, 500);
c->Divide(3,1);
//int x, y, z;
//float x, y, z;
double x, y, z;
auto T = new TTree("T","Tree");
/*
T->Branch("x",&x,"x/I");
T->Branch("y",&y,"y/I");
T->Branch("z",&z,"z/I");
T->Branch("x",&x,"x/F");
T->Branch("y",&y,"y/F");
T->Branch("z",&z,"z/F");
*/
T->Branch("x",&x,"x/D");
T->Branch("y",&y,"y/D");
T->Branch("z",&z,"z/D");
for (int i=0; i<50; ++i) {
x = -999;
y = -999;
z = -999;
T->Fill();
}
for (int i=0; i<20; ++i) {
x = 0;
y = 1;
z = -1;
T->Fill();
}
c->cd(1);
T->Draw("x");
c->cd(2);
T->Draw("y");
c->cd(3);
T->Draw("z");
}
Float and double produce the same results:
While int results in:
In this example the negatives (-999) are relatively far from 0, but I also tested down to -1 and the same still happens.
Note also that although the reported number of entries is always correct, the mean value (of x) is affected in the case of double and float, as the entries are sent to the overflow.
Edit:
I should also mention that the same thing happens with 2D plots (e.g. change the last line above to T->Draw("x:z","","colz");
to see it)