Merge normalized histogram

Dear Experts:

I am trying to merge two normalized histogram, say they are normalized to 1. If I simply use the “hadd” command, the merged histogram must be not normalized to 1, right?

How could I make sure the merged histogram is normalized to 1? Is there any simple tool to use?

Thanks for your advice.

Hi,

[quote=“lawrenceju”]
I am trying to merge two normalized histogram, say they are normalized to 1. If I simply use the “hadd” command, the merged histogram must be not normalized to 1, right?

How could I make sure the merged histogram is normalized to 1? Is there any simple tool to use?[/quote]

Two comments:

  1. You’ll probably do better in general posting in the right forum (e.g., Root discussions) instead of here.

  2. I don’t think there is a tool because your problem isn’t quite posed well. What do you want to happen if you are adding three histograms together? Do you want the first two added and then renormalized and then add the third? Or all three added and then renormalized?

Good luck,
Charles

Moved.

Please wait for a few days, Rene might have a suggestion when he’s back.

Cheers, Axel.

If your histograms are already normalized to 1, after addition the integral will be 2.
So you should re normalize with a call like

myhist->Scale(0.5);
Rene