Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
human_phantom/macro.C
이 파일의 문서화 페이지로 가기
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 
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 }
G4double Double_t
Double_t xx
TTree * ntuple
G4int Int_t
ntupleExperimental Reset()
void Print(G4Element &ele)
Definition: pyG4Element.cc:56
Double_t edep
Int_t nevent
TDirectory * dir