#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("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("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", "fe56 > 0", "L"); expo->Draw("fe57:Exposure", "fe57 > 0", "L SAME"); expo->Draw("fe58:Exposure", "fe58 > 0", "L SAME"); }