I am trying to analyze some data and am using a TNtuple to hold the data. I create cuts to examine subsets and the draw the ntuple in order to get the mean from it. The mean should always be greater than zero, since each instance of the variable I’m look at for the mean calculation (it is descriptively called “val”) is between ~150 and ~400. When running the code, it is outputting to screen the value of the mean of the histogram produced by draw. Zero is bad. It implies that the cut applied resulted in zero entries into the histogram. The “dcut” cut seems to be the only cut that is producing the empty set (but it shouldn’t, try n->Draw(“d:val”) in the .root file produced).The behavior I’m seeing I can’t explain, and I bet it is something simple.
Attached is some code to illustrate the problem. Some more odd behavior:
After running it and still in CINT, I can do n->Scan() and see that all of the entries are the same. If I do n->Scan() somewhere around line 200 (before the nested for loops) then I see that the entries are (nearly) all unique.