Adding two TH2F histograms

Hi I’m currently trying to add (subtract) two TH2F histograms.
I’ve plotted positive charge against momentum in os, and negative charge against momentum in ss. I wish to plot the different of positive to negative charges against momentum. I tried the following:


But what I get out is nonsense (covers the whole plot with entries). I have been working with TH1F only, so I wasn’t sure if the Add command was the right one. Can someone lend me a hand please? Thank you

Could you send the shortest possible RUNNING script reproducing/explaining your problem?
Do you have the same binning in your histograms?
Note that you can simply do

os.Add(ss,-1); This will substract ss from os. You can save the original os before the operation if necessary.


This is very vague,

os = new TH2F("os","TLpt:OS",120,0,120,120,0,120);    
ss = new TH2F("ss","TLpt:SS",120,0,120,120,0,120);
oss = new TH2F("oss","TLpt:OS-SS",120,0,120,120,0,120);


They have the same number of bins, and the variables are filled from ntuples. Thank you for helping