Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
examples
advanced
human_phantom
macro.C
Go to the documentation of this file.
1
{
2
TFile
f
(
"g4humanphantom.root"
);
3
4
TDirectory*
dir
= (TDirectory*)
f
.Get(
"ntuple"
);
5
TTree*
ntuple
= (TTree*)dir->Get(
"ntuple1"
);
6
ntuple ->
Print
();
7
8
Double_t
organ_id
;
9
Double_t
edep
;
10
11
ntuple->GetBranch(
"ID"
)->SetAddress(&organ_id);
12
ntuple->GetBranch(
"Edep"
)->SetAddress(&edep);
13
14
// Print the content of the ntuple
15
Int_t
nevent
= ntuple->GetEntries();
16
17
for
(
Int_t
i=0; i<
nevent
; i++ ) {
18
ntuple->GetEvent(i);
19
cout <<
"organ id, edep (MeV): "
20
<< organ_id <<
", "
<< edep << endl;
21
}
22
}
Generated on Sat May 25 2013 14:32:05 for Geant4 by
1.8.4