SHAIMA
1
please i need your help how can i make this programme run for many events
TFile f2 (“ht.root”,“recreate”);
TTree* mytree = new TTree (“mytree”,“Test Tree”);
TBranch b2 = mytree->Branch(“b2”,val, “a/D:b:c:d:e”);
Double_t val[5] = {0,0,0,0,0};
For (int i=0; i<8;i++) {
val[0] = 1; val[3] = -3.14; val[2] = i1.;
mytree->Fill () ;
f2.Write() ;
}
ROOT User’s Guide - Chapter 12. Trees
ROOT Tutorials: Trees I/O, Queries, Graphics
ROOT HowTo’s - Trees
{
TFile f2("ht.root", "recreate");
TTree *mytree = new TTree("mytree", "Test Tree");
Double_t val[5] = {0, 0, 0, 0, 0};
TBranch *b2 = mytree->Branch("b2", val, "a/D:b:c:d:e");
for (int i=0; i<8; i++) {
val[0] = 1; val[3] = -3.14; val[2] = i*1.;
mytree->Fill();
}
mytree->Write();
mytree->Print();
mytree->Scan();
}