Geant4_10
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
source
examples
advanced
human_phantom
macro.C
Go to the documentation of this file.
1
{
2
gROOT ->
Reset
();
3
TFile
f
(
"human_phantom.root"
);
4
5
TDirectory*
dir
= (TDirectory*)
f
.Get(
"human_phantom_ntuple"
);
6
TTree*
ntuple
= (TTree*)dir->Get(
"1"
);
7
ntuple ->
Print
();
8
9
// Print the content of the ntuple
10
Int_t
nevent
=
Int_t
(ntuple->GetEntries());
11
12
Double_t
xx
;
13
Double_t
edep
;
14
ntuple->GetBranch(
"organID"
)->SetAddress(&xx);
15
ntuple->GetBranch(
"edep"
)->SetAddress(&edep);
16
17
for
(
Int_t
i=0; i<
nevent
; i++ ) {
18
ntuple->GetEvent(i);
19
cout <<
"organ ID, edep (MeV): "
20
<< xx <<
", "
<< edep << endl;
21
}
22
23
24
}
xx
Double_t xx
Definition:
macro.C:10
ntuple
TTree * ntuple
Definition:
macro.C:6
edep
Double_t edep
Definition:
macro.C:13
f
TFile f
Definition:
plotHisto.C:6
G4INCL::Int_t
G4int Int_t
Definition:
G4INCLEventInfo.hh:59
Reset
ntupleExperimental Reset()
G4INCL::Double_t
G4double Double_t
Definition:
G4INCLEventInfo.hh:62
dir
TDirectory * dir
Definition:
macro.C:5
nevent
Int_t nevent
Definition:
macro.C:10
pyG4Element::Print
void Print(G4Element &ele)
Definition:
pyG4Element.cc:56
Generated on Sat Dec 14 2013 14:32:54 for Geant4_10 by
1.8.5