Loop over entries of a histogram

I need to loop over the entries of a histogram I created,
to perform an operation only on certain events.

I tried with:

 Long64_t num_event = h->GetEntries();
 Long64_t event = 0.;
 for(int k=0; k<num_event; k++){
   event = h->GetEntry(k);
   //calculation with variable "event"...

The compiler is telling me that
"‘class TH1F’ has no member named ‘GetEntry’",
so how can I do?

Thank you very much!
I hope there is somebody that is not on holidays
so he/she can answer :wink: !!!

A histogram no longer has the individual entries; it only has the information in the bins. You need a tree to do what you want.

Good luck,