I have 3 root files but, and am trying to plot them together but the graph is shown but no histograms are seen.
Root files contains a 2 TTree, but I want the one with fEvent
Here is the files FConvo.C (2.3 KB) All.root (395 Bytes) AmOnly.root (407 Bytes) NoReflector.root (107.3 KB)
Your help will mean a lot
void FConvo() {
gStyle->SetOptStat(0);
TFile *file1 = new TFile("All.root");
TFile *file2 = new TFile("Am.root");
TTree *tree1 = dynamic_cast<TTree*>(file1->Get("Hits"));
TTree *tree2 = dynamic_cast<TTree*>(file2->Get("Hits"));
tree1->SetLineColor(kRed); // Set color to red
tree1->SetLineWidth(4); // Set line width to 2
tree1->Draw("fEvent");
tree2->SetLineColor(kBlue); // Set color to blue
tree2->SetLineWidth(4); // Set line width to 2
tree2->Draw("fEvent","","SAME");
}