Add No of histories in histogram

Dear All,
I created one histogram where no of entries are 705. These are events with counts greater than zero. Now there are more 191 events whose counts are zero. I want to add these 191 events into the histogram.

How do I can do that ?


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

root [1] auto h = new TH1F("h","h", 10, 0,1)
(TH1F *) 0x7fb9a7d4d5d0
root [2] h->Fill(0.5,0);
root [3] h->GetEntries()
(double) 1.0000000
root [4] h->Draw()
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
root [5] 

Thanks . Now i want to add more entries into the histogram. suppose i want to add 3 more entries so that entries will be 4.

Call Fill as many times as ou need.

I do not want to fill. Here there is 1 entry . Suppose this entry has 1 count.

Now i have 4 more entry with 0 counts. I want to add those entries directly into the histogram so that the updated histogram will show no of entries 5. ( among which 1 entry with 1 count and 4 entries with 0 counts.)

is there any such command ?

Sorry, I thought you wanted to have entries with 0 weight.
Use SetBinContent in that case.

Thank you but seeing this i can not understand how to do it . is there any example of how to implement it ?
Thank you

Dear Couet,
The program with 0 weight is working . But if i have to fill 100 events manually that is a problem. How do I can fill the histogram 100 times with 0 weight. What will be command in that case ?

Thank you

h->SetEntries(h->GetEntries() + 100); // safe, unless it uses "automatic bins"

Thank you. It works.

SetBinContent was working also.