Histogram subtraction problem

Hello…

I have a simple piece of code where I am trying to subtract one histogram from another. They are from two different root files and they are attached to this post. However when I view the resultant histogram it just shows me a copy of the original histogram and not the substraced result. Can anyone see what I am doing wrong?

Thanks in advance.
Donya
single_top.root (218 KB)
background.root (471 KB)
Histogram_subtraction.C (1.04 KB)

Hi!

For me it worked fine. I changed the function name “test” to “Histogram_subtraction” and ran “root -l Histogram_subtraction.C”. Please find attached “NewFile.root” which contains the correctly subtracted histogram.

Best,

Sebastian

NewFile.root (3.61 KB)

Hi Sebastian,

Yes, you are right, I changed the name of the function and it worked !
Thank you so much.

Best,
Donya