#include "TTree.h" #include "TFile.h" void try27() { // open ROOT file TFile *ftree = new TFile("tree_nucnet27.root", "recreate"); // creation of the first TTree TTree *expo = new TTree("exposure", ""); // creation and filling of branches to hold the variables expo->ReadFile("/home/mohammed/nucnet-tools-code/examples/analysis/exposure.txt","sequence/F:Exposure"); // Write, Scan and Print the Tree expo->Write(); expo->Scan(); expo->Print(); // creation of the secound TTree TTree *fe = new TTree("fe", ""); // creation and filling of branches to hold the variables fe->ReadFile("/home/mohammed/nucnet-tools-code/examples/analysis/fe.txt","sequence/F:fe56:fe57:fe58"); // Write, Scan and Print the Tree fe->Write(); fe->Scan(); fe->Print(); expo->AddFriend(fe); expo->Draw("fe56:Exposure ", "" , "line"); expo->Draw("fe57:Exposure", "" , "SAME line "); expo->Draw("fe58:Exposure", "","SAME line"); }