Efficient way to get/compare distributions of each run?

Hi, Charles,

Thanks a lot for your reply again.

To be simple, we want to make 3D plots (X: run number, Y: some Variable, Z: Entries), or just a 2D histogram, or 2D scatter plot.

The problem is that we don’t want to mix different run, so for X, the total bins should be (max run number-min run number) while using TTree::Draw to do the loop, and there are many empty bins (95%) here. To see a consecutive 3D distribution, we want to only keep the non-empty bin (run) and remove the empty bins of X. I hope that you got what I want to do now.

Yes, I will try to do this. Currently I can also try to do the map things by hand, i.e., add a new branch to store the position of the run number of some entry in the run number set. Then I can just use
tree->Draw (“position:other”), to get what we want. Yes, I agree this is ugly and not efficient. :slight_smile:

I thought that it is a simple use case, and ROOT may have already supported it. Then it would be more efficient to use the function provided by ROOT. But it seems not…Maybe I should make a feature request?

Thanks, Jibo