Hi, I’m trying to Draw two histograms containing the same variable from two different ttrees on the same histogram. I set the drawing option to same but for some reason only the first plot is being drawn. Have you any idea why? Here is my code
TFile *fileIn= new TFile("tree_signal_background.root");
TTree *Signal=(TTree*)fileIn->Get("ts;1");
TTree *Cosmics=(TTree*)fileIn->Get("tb;1");
TCanvas *c6 = new TCanvas("c6","c6",750, 500);
gStyle->SetOptStat(0);
Signal->Draw("ntracks>>hntracks");
chntracks->SetLineColor(kRed);
Cosmics->Draw("ntracks>>chntracks","","same");
ROOT Version: 6.12