Hello guys:
I want to know why one histogram can’t be initialized after adding a histogram, like below hQ2Q2Q2Q2_HFmHFmHFpHFp, even through I initial the histogram. Second times or more, though get the same histograms in files, I found the entries and mean of hQ2Q2Q2Q2_HFmHFmHFpHFp changed.
Thanks.
I am afraid I did not understand the question: can you provide the simplest possible recipe for me to reproduce the problem and state what is the result you expect and what is the result you get instead?
Hi @eguiraud
Thanks for your kind reminder.
I mean like below,
for(int pT=0; pT<npT; pT++){
TH1D* a = (TH1D*) file1->("a");
TH1D* b = (TH1D*) file1->("b");
a->Sumw2();
a->Add(b);
}
The “a” object in file1 in first pT has a right entries.
But Added “b” object. “a” object don’t has a right entires, mean value.
I think the value may be covered?
Now, I try to:
Your original loop creates many histograms with the same name. I don’t think that’s what you want?
Maybe you want to get the histogram from the file outside of the loop?
I can try to debug if you can produce a small reproducer that includes a check for the expected output.
Cheers,
Enrico