So I have a simple code here that creates two histograms and I am applying them to the same plot axis. Essentially merging both plots in one. I want to be able to create a third histogram that would be defined as a merge of these histograms together. Any ideas on how to do this ? I know how to add two plots but I am not trying to add them and get a new plot but just create a new plot that merges two other histograms together. Hope this makes sense what I am saying.
#include "TH1D.h"
using namespace std;
int hi(){
TH1D *histo1 = new TH1D("myhisto1", "myhisto1",10,0,10);
TH1D *histo2 = new TH1D("myhisto2","myhisto2",10,0,10);
histo1->Fill(7);
histo2->Fill(5);
histo2->SetLineColor(2);
histo1->Draw();
histo2->Draw("same");
return 0;
}
No I know how to add (+) two histograms but like my example above it merges two plots that even if like if both histograms had a value of 7 so ```
histo1->Fill(7);
histo2->Fill(7);
The bin height does not increase but the two histograms same value just overlap and that’s all does that make sense ?