When we use GetEntries()


I would like to know how much input there is for a charge_tree > 1000, but I have no idea where to start.
Currently I am using the GetEntry function to know the entry number for the entire histogram.


try something like

printf("Sum of contents of bins with charge > 1000 is %f\n", charge_tree->Integral(charge_tree->FindFixBin(1000), charge_tree->GetNbinsX()+1)); // includes the overflow bin

What is the purpose of this order?
Because my charge_tree is a double.

Right. What’s the name of the histogram then? Suppose it’s hist, then

hist->Integral(hist->FindFixBin(1000), hist->GetNbinsX()+1)

gives you the the sum of contents of bins with charge > 1000.


Thank you so much.
I made the change it works, but I would like to save this value.
So I would like to know in the command where exactly this value is.

Sorry, I can just write:

value = hist->Integral(hist->FindFixBin(1000), hist->GetNbinsX()+1);