Hi, I am trying to create a TChain of 10 files and then create a plot of them. I am getting an error that says: Error in TChain::LoadTree: Cannot find tree with name Uranium in file… for each of the ten files. I believe I am missing a step in creating the TChain but I am not sure what it is. Here is the code:
#include <iostream>
#include <fstream>
#include <map>
#include <vector>
#include "TFile.h"
#include "TTree.h"
void mergedData(){
TChain *chain = new TChain("Uranium");
chain->Add("U/merged_data_0.root");
chain->Add("U/merged_data_1.root");
chain->Add("U/merged_data_2.root");
chain->Add("U/merged_data_3.root");
chain->Add("U/merged_data_4.root");
chain->Add("U/merged_data_5.root");
chain->Add("U/merged_data_6.root");
chain->Add("U/merged_data_7.root");
chain->Add("U/merged_data_8.root");
chain->Add("U/merged_data_9.root");
TCanvas *c1 = new TCanvas("c1");
chain->Draw("fluka_Z:fluka_A-fluka_Z","fluka_lifetime<1e-3");
c1->Print("Uranium.pdf");
}