Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
extended/radioactivedecay/rdecay02/src/HistoManager.cc
이 파일의 문서화 페이지로 가기
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
28 //
29 // $Id: HistoManager.cc 83882 2014-09-22 11:09:30Z maire $
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "HistoManager.hh"
35 #include "G4UnitsTable.hh"
36 
37 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
38 
40  : fFileName("rdecay02")
41 {
42  Book();
43 }
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
48 {
49  delete G4AnalysisManager::Instance();
50 }
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 
54 void HistoManager::Book()
55 {
56  // Create or get analysis manager
57  // The choice of analysis technology is done via selection of a namespace
58  // in HistoManager.hh
59  //
60  G4AnalysisManager* analysis = G4AnalysisManager::Instance();
61 
62  analysis->SetFileName(fFileName);
63  analysis->SetVerboseLevel(1);
64  analysis->SetActivation(true); //enable inactivation of histos, nTuples
65 
66  // Default values (to be reset via /analysis/h1/set command)
67  G4int nbins = 100;
68  G4double vmin = 0.;
69  G4double vmax = 100.;
70 
71  // Create all histograms as inactivated
72  // as we have not yet set nbins, vmin, vmax
73  //
76 
77  G4int id = analysis->CreateH1("H10","Energy deposit (MeV) in the target",
78  nbins, vmin, vmax);
79  analysis->SetH1Activation(id, false);
80 
81  id = analysis->CreateH1("H11","Energy deposit (MeV) in the detector",
82  nbins, vmin, vmax);
83  analysis->SetH1Activation(id, false);
84 
85  id = analysis->CreateH1("H12","Total energy (MeV) in target and detector",
86  nbins, vmin, vmax);
87  analysis->SetH1Activation(id, false);
88 
89  id = analysis->CreateH1("H13",
90  "Coincidence spectrum (MeV) between the target and detector",
91  nbins, vmin, vmax);
92  analysis->SetH1Activation(id, false);
93 
94  id = analysis->CreateH1("H14",
95  "Anti-coincidence spectrum (MeV) in the traget",
96  nbins, vmin, vmax);
97  analysis->SetH1Activation(id, false);
98 
99  id = analysis->CreateH1("H15",
100  "Anti-coincidence spectrum (MeV) in the detector",
101  nbins, vmin, vmax);
102  analysis->SetH1Activation(id, false);
103 
104  id = analysis->CreateH1("H16","Decay emission spectrum (0 - 10 MeV)",
105  nbins, vmin, vmax);
106  analysis->SetH1Activation(id, false);
107 
108  id = analysis->CreateH1("H17","Decay emission spectrum (0 - 1 MeV)",
109  nbins, vmin, vmax);
110  analysis->SetH1Activation(id, false);
111 
112  id = analysis->CreateH1("H18","Decay emission spectrum (0 - 0.1 MeV)",
113  nbins, vmin, vmax);
114  analysis->SetH1Activation(id, false);
115 
116  // nTuples
117  //
120  //
121  analysis->CreateNtuple("T1", "Emitted Particles");
122  analysis->CreateNtupleDColumn("PID"); //column 0
123  analysis->CreateNtupleDColumn("Energy"); //column 1
124  analysis->CreateNtupleDColumn("Time"); //column 2
125  analysis->CreateNtupleDColumn("Weight"); //column 3
126  analysis->FinishNtuple();
127 
128  analysis->CreateNtuple("T2", "RadioIsotopes");
129  analysis->CreateNtupleDColumn("PID"); //column 0
130  analysis->CreateNtupleDColumn("Time"); //column 1
131  analysis->CreateNtupleDColumn("Weight"); //column 2
132  analysis->FinishNtuple();
133 
134  analysis->CreateNtuple("T3", "Energy depositions");
135  analysis->CreateNtupleDColumn("Energy"); //column 0
136  analysis->CreateNtupleDColumn("Time"); //column 1
137  analysis->CreateNtupleDColumn("Weight"); //column 2
138  analysis->FinishNtuple();
139 
140  analysis->CreateNtuple("RDecayProducts", "All Products of RDecay");
141  analysis->CreateNtupleDColumn("PID"); //column 0
142  analysis->CreateNtupleDColumn("Z"); //column 1
143  analysis->CreateNtupleDColumn("A"); //column 2
144  analysis->CreateNtupleDColumn("Energy"); //column 3
145  analysis->CreateNtupleDColumn("Time"); //column 4
146  analysis->CreateNtupleDColumn("Weight"); //column 5
147  analysis->FinishNtuple();
148 
149  analysis->SetNtupleActivation(false);
150 }
151 
152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
double G4double
Definition: G4Types.hh:76
G4CsvAnalysisManager G4AnalysisManager
Definition: g4csv_defs.hh:77
int G4int
Definition: G4Types.hh:78