File indexing completed on 2025-12-16 09:29:38
0001 {
0002 gROOT -> Reset();
0003 TFile f("human_phantom.root");
0004
0005 TDirectory* dir = (TDirectory*)f.Get("human_phantom_ntuple");
0006 TTree* ntuple = (TTree*)dir->Get("1");
0007 ntuple -> Print();
0008
0009
0010 Int_t nevent = Int_t(ntuple->GetEntries());
0011
0012 Double_t xx;
0013 Double_t edep;
0014 ntuple->GetBranch("organID")->SetAddress(&xx);
0015 ntuple->GetBranch("edep")->SetAddress(&edep);
0016
0017 for ( Int_t i=0; i<nevent; i++ ) {
0018 ntuple->GetEvent(i);
0019 cout << "organ ID, edep (MeV): "
0020 << xx << ", " << edep << endl;
0021 }
0022
0023
0024 }