Import Geant4 10.4.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2017-06-30 11:12:01 +02:00
parent 1a1316fea4
commit 2cce0e189d
238 changed files with 0 additions and 62655 deletions
@@ -1,2 +0,0 @@
/run/verbose 2
/tracking/storeTrajectory 1
@@ -1,24 +0,0 @@
NumberOfStep 22
# Thickness Relative_Weight
Step1 0 .14445
Stept2 .8 .05665
Step3 1.6 .05049
Step4 2.4 .04239
Step5 3.2 .04313
Step6 4.0 .03879
Step7 4.8 .04182
Step8 5.6 .03422
Step9 6.4 .03469
Step10 7.2 .03589
Step11 8.0 .03633
Step12 8.8 .03842
Step13 9.6 .03688
Step14 10.4 .03705
Step15 11.2 .03773
Step16 12.0 .03968
Step17 12.8 .04058
Step18 13.6 .03903
Step19 14.4 .04370
Step20 15.2 .03981
Step21 16.0 .05226
Step22 16.8 .03603
@@ -1,64 +0,0 @@
DATA 4
Depth Ionization Err1 Err2
2.22967614442 1.50466086821 0.0374267067098 0.0182144389407
4.24434780348 1.54545809119 0.0374267067098 0.0182144389407
5.21448444427 1.54748625141 0.0374267067098 0.0182144389407
6.25901946254 1.58625531417 0.0374267067098 0.0182144389407
7.22938362131 1.55169858419 0.0374267067098 0.0182144389407
8.27437367552 1.51729786653 0.0374267067098 0.0182144389407
9.24451031631 1.51932602676 0.0374267067098 0.0182144389407
10.2148744751 1.48476929677 0.0374267067098 0.0182144389407
11.2594094933 1.52353835953 0.0374267067098 0.0182144389407
12.3043995476 1.48913764187 0.0374267067098 0.0182144389407
13.2745361884 1.4911658021 0.0374267067098 0.0182144389407
14.3192987246 1.49334997465 0.0374267067098 0.0182144389407
15.214581952 1.53180701275 0.0374267067098 0.0182144389407
16.2593444882 1.5339911853 0.0374267067098 0.0182144389407
17.3041070245 1.53617535785 0.0374267067098 0.0182144389407
18.2740161473 1.57478840828 0.0374267067098 0.0182144389407
19.2441527881 1.57681656851 0.0374267067098 0.0182144389407
20.3633137018 1.61574164359 0.0374267067098 0.0182144389407
21.3329953066 1.69093958423 0.0374267067098 0.0182144389407
22.3029044294 1.72955263466 0.0374267067098 0.0182144389407
22.7502047662 1.80365848902 0.0374267067098 0.0182144389407
23.3469844118 1.84149147783 0.0374267067098 0.0182144389407
23.7945122665 1.87901244198 0.0374267067098 0.0182144389407
24.2418126032 1.95311829635 0.0374267067098 0.0182144389407
24.8381372128 2.06412106556 0.0374267067098 0.0182144389407
25.2108116541 2.1380709076 0.0374267067098 0.0182144389407
25.5088602 2.21186473731 0.0374267067098 0.0182144389407
25.7322828503 2.2855025547 0.0374267067098 0.0182144389407
26.0303313962 2.35929638441 0.0374267067098 0.0182144389407
26.2542090825 2.35976442139 0.0374267067098 0.0182144389407
26.476949179 2.5431569094 0.0374267067098 0.0182144389407
26.625518416 2.65322360466 0.0374267067098 0.0182144389407
26.7743151709 2.72670540973 0.0374267067098 0.0182144389407
26.9226568899 2.8733569952 0.0374267067098 0.0182144389407
26.9963727134 3.01985256835 0.0374267067098 0.0182144389407
27.1442593965 3.23967393424 0.0374267067098 0.0182144389407
27.2170651481 3.53250906822 0.0374267067098 0.0182144389407
27.2900984178 3.78875931199 0.0374267067098 0.0182144389407
27.3635867234 3.97183977534 0.0374267067098 0.0182144389407
27.3626766515 4.11817933617 0.0374267067098 0.0182144389407
27.3615390616 4.3011037872 0.0374267067098 0.0182144389407
27.4345723312 4.55735403097 0.0374267067098 0.0182144389407
27.4318421155 4.99637271344 0.0374267067098 0.0182144389407
27.5055579391 5.14286828659 0.0374267067098 0.0182144389407
27.5046478672 5.28920784742 0.0374267067098 0.0182144389407
27.5820039783 4.85034517727 0.0374267067098 0.0182144389407
27.584961712 4.37474160459 0.0374267067098 0.0182144389407
27.5883744816 3.82596825149 0.0374267067098 0.0182144389407
27.6639104489 3.67978470299 0.0374267067098 0.0182144389407
27.6677782545 3.05784156948 0.0374267067098 0.0182144389407
27.672101096 2.36272865556 0.0374267067098 0.0182144389407
27.750139761 1.81411131479 0.0374267067098 0.0182144389407
27.7528699767 1.37509263232 0.0374267067098 0.0182144389407
27.7546901205 1.08241351067 0.0374267067098 0.0182144389407
27.7558277104 0.899489059636 0.0374267067098 0.0182144389407
27.8315911957 0.716720620929 0.0374267067098 0.0182144389407
28.2049481909 0.680915792348 0.0374267067098 0.0182144389407
29.2499382451 0.646515074691 0.0374267067098 0.0182144389407
30.2949282993 0.612114357034 0.0374267067098 0.0182144389407
31.2655199761 0.540972736846 0.0374267067098 0.0182144389407
32.2358841348 0.506416006865 0.0374267067098 0.0182144389407
33.2808741891 0.472015289208 0.0374267067098 0.0182144389407
@@ -1,7 +0,0 @@
DATA 2
Angle Amount
-0.0505050505051 15.3995891115
0.984848484848 11.2248330765
2.0202020202 4.25346687211
3.96464646465 0.277478171546
5.93434343434 0.064072932717
@@ -1,8 +0,0 @@
DATA 2
Angle Amount
-0.751879699248 3.99776392654
-0.0501253132832 4.47151335588
0.952380952381 3.59120850453
1.97994987469 1.93759491666
3.90977443609 0.35564748302
5.9649122807 0.0521377793927
@@ -1,7 +0,0 @@
DATA 2
Angle Amount
-0.0253164556962 20.8513706094
0.987341772152 20.0499622768
2 17.7253751362
3.94936708861 12.6793528376
5.94936708861 8.16279654623
@@ -1,7 +0,0 @@
DATA 2
Angle Amount
-0.0501056147762 41.1232827365
0.936942247548 36.7107137594
1.91997838581 25.9756676655
3.96628514352 10.9551178137
5.96715298587 4.32283735324
@@ -1,6 +0,0 @@
DATA 2
Angle Amount
1.00250626566 5.65751749616
2.00501253133 3.49418529022
3.90977443609 0.932643026251
0 6.55441371595
@@ -1,7 +0,0 @@
DATA 2
Angle Amount
-1.0 0.34
0.00 0.49
1.0 0.35
5.0 0.013
10.0 0.005
@@ -1,12 +0,0 @@
DATA 2
Angle Amount
-0.977443609023 16.1755485893
0.0250626566416 30.3448275862
0.551378446115 23.6990595611
1.07769423559 16.3009404389
1.07769423559 13.9184952978
1.55388471178 7.77429467085
2.03007518797 3.26018808777
3.03258145363 0.877742946708
4.06015037594 0.376175548589
5.98997493734 0.376175548589
@@ -1,12 +0,0 @@
DATA 2
Angle Amount
-1.00486941124 3.5192563081
-0.00354138999557 4.28552456839
0.494614136048 4.16570754021
0.988047808765 3.09915891988
1.01534602331 3.57245093699
1.4833997344 2.41722000885
2.00354139 1.70562195662
3.02198612956 0.903792238454
3.99173675668 0.338792976243
6.03541389996 0.0960602036299
@@ -1,14 +0,0 @@
DATA 2
Angle Amount
-1.0101010101 18.1981981982
0 21.7117117117
0.479797979798 20.9009009009
1.0101010101 20.1801801802
1.0101010101 18.018018018
1.51515151515 15.8558558559
2.0202020202 14.6846846847
3.00505050505 12.8828828829
3.9898989899 10.2702702703
5.98484848485 6.30630630631
8.00505050505 3.87387387387
10 2.61261261261
@@ -1,14 +0,0 @@
DATA 2
Angle Amount
-1.03274559194 35.3286351758
-0.0251889168766 38.7139501316
0.453400503778 37.9362069453
0.95717884131 32.5127595543
1.51133501259 27.3859187351
2.01511335013 21.6628458759
2.99748110831 13.9635279578
4.03022670025 7.75931848414
6.0201511335 2.69625185143
8.03526448363 0.927555920339
10 0.360380758309
1.00755667506 34.0078679988
@@ -1,10 +0,0 @@
DATA 2
Angle Amount
-1.0182272731 7.25324553305
0.00400330068056 8.36101602137
1.01079257183 5.6453075597
1.43890064461 4.40207844835
3.04569481777 1.68440918635
3.9982352797 0.668224413598
5.99964051994 0.106128318042
7.99982025997 0.0342323058195
@@ -1,7 +0,0 @@
DATA 2
Angle Amount
-0.0505050505051 15.3995891115
0.984848484848 11.2248330765
2.0202020202 4.25346687211
3.96464646465 0.277478171546
5.93434343434 0.064072932717
@@ -1,8 +0,0 @@
DATA 2
Angle Amount
-0.751879699248 3.99776392654
-0.0501253132832 4.47151335588
0.952380952381 3.59120850453
1.97994987469 1.93759491666
3.90977443609 0.35564748302
5.9649122807 0.0521377793927
@@ -1,7 +0,0 @@
DATA 2
Angle Amount
-0.0253164556962 20.8513706094
0.987341772152 20.0499622768
2 17.7253751362
3.94936708861 12.6793528376
5.94936708861 8.16279654623
@@ -1,7 +0,0 @@
DATA 2
Angle Amount
-0.0501056147762 41.1232827365
0.936942247548 36.7107137594
1.91997838581 25.9756676655
3.96628514352 10.9551178137
5.96715298587 4.32283735324
@@ -1,6 +0,0 @@
DATA 2
Angle Amount
1.00250626566 5.65751749616
2.00501253133 3.49418529022
3.90977443609 0.932643026251
0 6.55441371595
@@ -1,10 +0,0 @@
DATA 2
Angle Amount
-0.980980980981 4.23423423423
-0.00591500591501 6.17117117117
0.987237237237 4.52702702703
2.01167076167 1.68918918919
3.00288925289 0.427927927928
3.98944398944 0.0900900900901
5.05016380016 0.0675675675676
8.08069433069 0.0225225225225
@@ -1,10 +0,0 @@
DATA 2
Angle Amount
-1 2.08502595156
0 2.73589100346
0.975 2.16192041522
2.025 1.09982698962
3 0.46357266436
4.05 0.180025951557
5.025 0.0731833910035
8.075 -0.00897923875433
@@ -1,10 +0,0 @@
DATA 2
Angle Amount
-0.962025316456 19.1792054773
0 19.864978903
1.03797468354 19.2924130244
2.05063291139 17.0847862431
3.01265822785 14.6259055808
4.0253164557 12.0409203089
5.06329113924 9.83313430459
8.05063291139 5.28604410477
@@ -1,10 +0,0 @@
DATA 2
Angle Amount
-1.01012619386 26.2219036477
0.0105481185992 30.1798454221
1.01664684899 26.9410935522
2.03904721721 19.2512753634
3.01350159181 12.8881228185
4.01672356258 8.22897088719
5.02301407694 5.08491235472
8.05339265851 1.3343370028
@@ -1,8 +0,0 @@
DATA 2
Angle Amount
-1.07345562228 4.33855541514
-0.0216859721672 5.17596296933
0.986487395963 4.42416265975
1.97275045428 2.90454433286
3.00859213173 1.54555175843
@@ -1,8 +0,0 @@
DATA 2
Angle Amount
-0.941731970676 0.612726156513
0.0482106099455 0.913446607201
1.05007041999 0.68728106605
2.04687443574 0.260400491134
2.99835686685 0.034253006392
4.03037087862 0.00520927377126
@@ -1,8 +0,0 @@
DATA 2
Angle Amount
-0.998231453532 1.07370716594
0.0109038203263 1.43911812029
1.02775155246 1.11302740582
2.03834953393 0.536946664362
3.03086313046 0.237490525644
4.0019680066 0.0816855710543
@@ -1,9 +0,0 @@
DATA 2
Angle Amount
-1.00961721215 17.5375375375
-0.0237199224541 18.6786786787
0.989926635496 17.8978978979
2.03025810621 16.036036036
3.04610940054 13.5135135135
3.98555517543 11.3513513514
8.01893032273 4.98498498498
@@ -1,9 +0,0 @@
DATA 2
Angle Amount
-1.01565137061 26.4059585354
-0.0246051626428 30.795714971
0.984917124127 27.0796247935
2.01664623639 19.6786228215
2.99854323225 13.2265629164
4.00699959139 8.24734850504
8.07680008527 0.960933752598
@@ -1,6 +0,0 @@
DATA 2
Angle Amount
0.0497043808819 3.91744531257
2.06857690723 2.12950051723
3.91327384507 0.543131796506
8.09542231903 0.0140282415078
@@ -1,10 +0,0 @@
DATA 2
Angle Amount
-1.00973737107 9.1640030316
-0.0127689722213 25.1968893136
0.00617853494579 37.4913500511
0.513559824694 27.8025834514
1.0253896596 9.26121198141
1.5307114377 3.67087356246
1.98405114179 1.52486242462
4.04504563878 0.145813424721
@@ -1,11 +0,0 @@
DATA 2
Angle Amount
-1.00883858878 2.71915716162
-0.00191822460935 4.60669017721
0.00014755573918 5.02087913709
0.519986424872 4.24857239822
1.01341281669 3.18056395804
1.47895117381 1.52100455947
2.00070826755 1.13330185478
4.01543433032 0.085877440203
6.01009281256 0.0149031296572
@@ -1,7 +0,0 @@
DATA 2
Angle Amount
-0.0253164556962 20.8513706094
0.987341772152 20.0499622768
2 17.7253751362
3.94936708861 12.6793528376
5.94936708861 8.16279654623
@@ -1,12 +0,0 @@
DATA 2
Angle Amount
-1.03535353535 17.802804161
-0.0505050505051 23.6779737675
0.429292929293 21.6010854817
0.959595959596 18.7164179104
1.46464646465 15.2057892356
1.99494949495 11.2464947987
3.9898989899 3.29443690638
5.98484848485 0.984170058797
8.00505050505 0.195386702849
10 0.0343735866124
@@ -1,11 +0,0 @@
DATA 2
Angle Amount
-1 4.27543604651
0.025 8.05024916944
0.025 6.34759136213
0.475 5.80585548173
1.025 5.26370431894
1.55 3.18511212625
2.05 2.02024501661
8 0.0437084717608
6.025 0.093438538206
@@ -1,17 +0,0 @@
DATA 6
Energy He B H Li Be
50 0.03 0.04 0.02 0.00 0.01
100 0.06 0.12 0.03 0.01 0.02
120 0.08 0.15 0.04 0.02 0.03
170 0.15 0.08 0.07 0.03 0.02
220 0.20 0.01 0.08 0.04 0.02
260 0.23 0.00 0.10 0.03 0.01
280 0.19 0.00 0.08 0.02 0.00
320 0.11 0.00 0.07 0.01 0.00
350 0.03 0.00 0.04 0.00 0.00
400 0.01 0.00 0.02 0.00 0.00
460 0.00 0.00 0.01 0.00 0.00
@@ -1,9 +0,0 @@
DATA 2
depth NperN0
5.81477867471 0.0334111372306
15.944735208 0.051621684556
25.9130222656 0.0660771311984
28.1304887785 0.05338474674
28.8337177326 0.037208373991
31.3352701144 0.0189745409385
34.8939945001 0.00225039918389
@@ -1,9 +0,0 @@
DATA 2
depth NperN0
5.71400606832 0.0134449936381
15.7502202212 0.0220483018499
25.9215033767 0.0290909758246
27.9935401781 0.0252586375648
29.0280904375 0.0231963883723
31.3448174611 0.0137107272193
34.748947832 0.0074216991289
@@ -1,8 +0,0 @@
DATA 2
depth NperN0
5.72667614569 0.273285573663
15.7943782128 0.55909438915
25.7748003937 0.761582631521
27.9446571147 0.763458383463
31.1556381932 0.723515257574
34.7406759269 0.68351744504
@@ -1,8 +0,0 @@
DATA 2
depth NperN0
5.74927466832 0.198788766514
15.7797667671 0.42075716177
25.7891327005 0.558220895186
27.892876257 0.573195121264
28.8572857103 0.530832934284
34.6118419199 0.44905777302
@@ -1,9 +0,0 @@
DATA 2
depth NperN0
5.68165039212 0.0291750825335
16.0198637674 0.0469868642828
26.0229283038 0.0576013038209
28.0267171851 0.0543609745226
29.0455362242 0.0486341918678
31.2662107008 0.0438794244244
34.8855674268 0.0345604479795
@@ -1,227 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Hadrontherapy advanced example for Geant4
// See more at: https://twiki.cern.ch/twiki/bin/view/Geant4/AdvancedExamplesHadrontherapy
#ifndef HADRONTHERAPYANALYSISMANAGER_HH
#define HADRONTHERAPYANALYSISMANAGER_HH 1
#include "globals.hh"
#ifdef G4ANALYSIS_USE_ROOT ///< If analysis is done directly with ROOT
#include "TROOT.h"
#include "TFile.h"
#include "TNtuple.h"
#include "TH1F.h"
#endif
/**
* Messenger class for analysis-settings for HadronTherapyAnalysisManager
*/
class HadrontherapyAnalysisFileMessenger;
/**
* A class for connecting the simulation to an analysis package.
*/
class HadrontherapyAnalysisManager
{
private:
/**
* Analysis manager is a singleton object (there is only one instance).
* The pointer to this object is available through the use of the method GetInstance();
*
* @see GetInstance
*/
HadrontherapyAnalysisManager();
public:
~HadrontherapyAnalysisManager();
/**
* Get the pointer to the analysis manager.
*/
static HadrontherapyAnalysisManager* GetInstance();
#ifdef G4ANALYSIS_USE_ROOT
/**
* Clear analysis manager heap.
*/
void Clear();
/**
* Check if TFile is there!
*/
G4bool IsTheTFile();
/**
* Book the histograms and ntuples in an AIDA or ROOT file.
*/
void book();
/**
* Set name for the analysis file .root (used by macro)
*/
void SetAnalysisFileName(G4String);
/**
* Fill the ntuple with the energy deposit in the phantom
*/
void FillEnergyDeposit(G4int voxelXId, G4int voxelYId, G4int voxelZId,
G4double energyDeposit);
void BraggPeak(G4int, G4double); ///< Fill 1D histogram with the Bragg peak in the phantom
void SecondaryProtonEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary protons
void SecondaryNeutronEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary neutrons
void SecondaryAlphaEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary alpha particles
void SecondaryGammaEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary gamma
void SecondaryElectronEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary electrons
void SecondaryTritonEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary tritons
void SecondaryDeuteronEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary deuterons
void SecondaryPionEnergyDeposit(G4int slice, G4double energy);
///< Fill 1D histogram with the energy deposit of secondary pions
void electronEnergyDistribution(G4double secondaryParticleKineticEnergy);
///< Energy distribution of secondary electrons originated in the phantom
void gammaEnergyDistribution(G4double secondaryParticleKineticEnergy);
///< Energy distribution of secondary gamma originated in the phantom
void deuteronEnergyDistribution(G4double secondaryParticleKineticEnergy);
///< Energy distribution of secondary deuterons originated in the phantom
void tritonEnergyDistribution(G4double secondaryParticleKineticEnergy);
///< Energy distribution of secondary tritons originated in the phantom
void alphaEnergyDistribution(G4double secondaryParticleKineticEnergy);
///< Energy distribution of secondary alpha originated in the phantom
void heliumEnergy(G4double secondaryParticleKineticEnergy);
///< Energy distribution of the helium (He3 and alpha) particles after the phantom
void hydrogenEnergy(G4double secondaryParticleKineticEnergy);
///< Energy distribution of the hydrogen (proton, d, t) particles after the phantom
//Kinetic energy by voxel, mass number A and atomic number Z.
void FillKineticFragmentTuple(G4int i, G4int j, G4int k, G4int A, G4double Z, G4double kinEnergy);
//Kinetic energy by voxel, mass number A and atomic number Z of only primary particles
void FillKineticEnergyPrimaryNTuple(G4int i, G4int j, G4int k, G4double kinEnergy);
///< Energy by voxel, mass number A and atomic number Z.
void FillVoxelFragmentTuple(G4int i, G4int j, G4int k, G4int A, G4double Z, G4double energy, G4double fluence);
void FillFragmentTuple(G4int A, G4double Z, G4double energy, G4double posX, G4double posY, G4double posZ);
///< Energy ntuple
// void FillLetFragmentTuple(G4int i, G4int j, G4int k, G4int A, G4double Z, G4double letT, G4double letD);
///< let ntuple
void FillLetFragmentTuple(G4int i, G4int j, G4int k, G4int A, G4double Z, G4double letD);
void genericIonInformation(G4int, G4double, G4int, G4double);
void ThintargetBeamDisp(G4double,G4double);
void startNewEvent();
///< Tell the analysis manager that a new event is starting
void setGeometryMetaData(G4double, G4double, G4double);
///< from the detector construction information about the geometry can be written as metadata
void setBeamMetaData(G4double, G4double);
///< metadata about the beam can be written this way
void flush();
///< Close the .hbk file with the histograms and the ntuples
private:
TH1F *createHistogram1D(const TString name, const TString title, int bins, double xmin, double xmax) {
TH1F *histo = new TH1F(name, title, bins, xmin, xmax);
histo->SetLineWidth(2);
return histo;
}
private:
#endif
static HadrontherapyAnalysisManager* instance;
HadrontherapyAnalysisFileMessenger* fMess;
#ifdef G4ANALYSIS_USE_ROOT
G4String analysisFileName;
TFile *theTFile;
TH1F *histo1;
TH1F *histo2;
TH1F *histo3;
TH1F *histo4;
TH1F *histo5;
TH1F *histo6;
TH1F *histo7;
TH1F *histo8;
TH1F *histo9;
TH1F *histo10;
TH1F *histo11;
TH1F *histo12;
TH1F *histo13;
TH1F *histo14;
TH1F *histo15;
TH1F *histo16;
TNtuple *kinFragNtuple;
TNtuple *kineticEnergyPrimaryNtuple;
// ntuple containing the fluence of all the particle in any voxel
TNtuple *doseFragNtuple;
// ntuple containing the fluence of all the particle in any voxel
TNtuple *fluenceFragNtuple;
// ntuple containing the fluence of all the particle in any voxel
TNtuple *letFragNtuple;
TNtuple *theROOTNtuple;
TNtuple *theROOTIonTuple;
TNtuple *fragmentNtuple; // fragments
TNtuple *metaData;
G4long eventCounter; // Simulation metadata
G4double detectorDistance;
G4double phantomDepth;
G4double beamEnergy;
G4double energyError;
G4double phantomCenterDistance;
#endif
};
#endif
@@ -1,53 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Hadrontherapy advanced example for Geant4
// See more at: https://twiki.cern.ch/twiki/bin/view/Geant4/AdvancedExamplesHadrontherapy
#ifndef LOCALIONINELASTICPHYSIC_H
#define LOCALIONIONINELASTICPHYSIC_H 1
#include "G4VPhysicsConstructor.hh"
#include "globals.hh"
class LocalIonIonInelasticPhysic: public G4VPhysicsConstructor
{
public:
LocalIonIonInelasticPhysic (const G4String& name = "local_ion_ion_inelastic");
virtual ~LocalIonIonInelasticPhysic();
protected:
void ConstructParticle(){};
void ConstructProcess();
};
#endif
@@ -1,402 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Hadrontherapy advanced example for Geant4
// See more at: https://twiki.cern.ch/twiki/bin/view/Geant4/AdvancedExamplesHadrontherapy
#include "HadrontherapyAnalysisManager.hh"
#include "HadrontherapyMatrix.hh"
#include "HadrontherapyAnalysisFileMessenger.hh"
#include "G4SystemOfUnits.hh"
#include <time.h>
HadrontherapyAnalysisManager* HadrontherapyAnalysisManager::instance = 0;
HadrontherapyAnalysisManager::HadrontherapyAnalysisManager()
#ifdef G4ANALYSIS_USE_ROOT
:
analysisFileName("DoseDistribution.root"),theTFile(0), histo1(0), histo2(0), histo3(0),
histo4(0), histo5(0), histo6(0), histo7(0), histo8(0), histo9(0), histo10(0), histo11(0), histo12(0), histo13(0), histo14(0), histo15(0), histo16(0),
kinFragNtuple(0),
kineticEnergyPrimaryNtuple(0),
doseFragNtuple(0),
fluenceFragNtuple(0),
letFragNtuple(0),
theROOTNtuple(0),
theROOTIonTuple(0),
fragmentNtuple(0),
metaData(0),
eventCounter(0)
#endif
{
fMess = new HadrontherapyAnalysisFileMessenger(this);
}
/////////////////////////////////////////////////////////////////////////////
HadrontherapyAnalysisManager::~HadrontherapyAnalysisManager()
{
delete fMess;
#ifdef G4ANALYSIS_USE_ROOT
Clear();
#endif
}
HadrontherapyAnalysisManager* HadrontherapyAnalysisManager::GetInstance()
{
if (instance == 0) instance = new HadrontherapyAnalysisManager;
return instance;
}
#ifdef G4ANALYSIS_USE_ROOT
void HadrontherapyAnalysisManager::Clear()
{
if (theTFile)
{
delete metaData;
metaData = 0;
delete fragmentNtuple;
fragmentNtuple = 0;
delete theROOTIonTuple;
theROOTIonTuple = 0;
delete theROOTNtuple;
theROOTNtuple = 0;
delete histo16;
histo16 = 0;
delete histo15;
histo15 = 0;
delete histo14;
histo14 = 0;
delete histo13;
histo13 = 0;
delete histo12;
histo12 = 0;
delete histo11;
histo11 = 0;
delete histo10;
histo10 = 0;
delete histo9;
histo9 = 0;
delete histo8;
histo8 = 0;
delete histo7;
histo7 = 0;
delete histo6;
histo6 = 0;
delete histo5;
histo5 = 0;
delete histo4;
histo4 = 0;
delete histo3;
histo3 = 0;
delete histo2;
histo2 = 0;
delete histo1;
histo1 = 0;
}
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::SetAnalysisFileName(G4String aFileName)
{
this->analysisFileName = aFileName;
}
/////////////////////////////////////////////////////////////////////////////
G4bool HadrontherapyAnalysisManager::IsTheTFile()
{
return (theTFile) ? true:false;
}
void HadrontherapyAnalysisManager::book()
{
delete theTFile; // this is similar to theTFile->Close() => delete all associated variables created via new, moreover it delete itself.
theTFile = new TFile(analysisFileName, "RECREATE");
// Create the histograms with the energy deposit along the X axis
histo1 = createHistogram1D("braggPeak","slice, energy", 400, 0., 80); //<different waterthicknesses are accoutned for in ROOT-analysis stage
histo2 = createHistogram1D("h20","Secondary protons - slice, energy", 400, 0., 400.);
histo3 = createHistogram1D("h30","Secondary neutrons - slice, energy", 400, 0., 400.);
histo4 = createHistogram1D("h40","Secondary alpha - slice, energy", 400, 0., 400.);
histo5 = createHistogram1D("h50","Secondary gamma - slice, energy", 400, 0., 400.);
histo6 = createHistogram1D("h60","Secondary electron - slice, energy", 400, 0., 400.);
histo7 = createHistogram1D("h70","Secondary triton - slice, energy", 400, 0., 400.);
histo8 = createHistogram1D("h80","Secondary deuteron - slice, energy", 400, 0., 400.);
histo9 = createHistogram1D("h90","Secondary pion - slice, energy", 400, 0., 400.);
histo10 = createHistogram1D("h100","Energy distribution of secondary electrons", 70, 0., 70.);
histo11 = createHistogram1D("h110","Energy distribution of secondary photons", 70, 0., 70.);
histo12 = createHistogram1D("h120","Energy distribution of secondary deuterons", 70, 0., 70.);
histo13 = createHistogram1D("h130","Energy distribution of secondary tritons", 70, 0., 70.);
histo14 = createHistogram1D("h140","Energy distribution of secondary alpha particles", 70, 0., 70.);
histo15 = createHistogram1D("heliumEnergyAfterPhantom","Energy distribution of secondary helium fragments after the phantom",
70, 0., 500.);
histo16 = createHistogram1D("hydrogenEnergyAfterPhantom","Energy distribution of secondary helium fragments after the phantom",
70, 0., 500.);
kinFragNtuple = new TNtuple("kinFragNtuple",
"Kinetic energy by voxel & fragment",
"i:j:k:A:Z:kineticEnergy");
kineticEnergyPrimaryNtuple= new TNtuple("kineticEnergyPrimaryNtuple",
"Kinetic energy by voxel of primary",
"i:j:k:kineticEnergy");
doseFragNtuple = new TNtuple("doseFragNtuple",
"Energy deposit by voxel & fragment",
"i:j:k:A:Z:energy");
fluenceFragNtuple = new TNtuple("fluenceFragNtuple",
"Fluence by voxel & fragment",
"i:j:k:A:Z:fluence");
letFragNtuple = new TNtuple("letFragNtuple",
"Let by voxel & fragment",
"i:j:k:A:Z:letT:letD");
theROOTNtuple = new TNtuple("theROOTNtuple",
"Energy deposit by slice",
"i:j:k:energy");
theROOTIonTuple = new TNtuple("theROOTIonTuple",
"Generic ion information",
"a:z:occupancy:energy");
fragmentNtuple = new TNtuple("fragmentNtuple",
"Fragments",
"A:Z:energy:posX:posY:posZ");
metaData = new TNtuple("metaData",
"Metadata",
"events:detectorDistance:waterThickness:beamEnergy:energyError:phantomCenterDistance");
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::FillEnergyDeposit(G4int i,
G4int j,
G4int k,
G4double energy)
{
if (theROOTNtuple)
{
theROOTNtuple->Fill(i, j, k, energy);
}
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::BraggPeak(G4int slice, G4double energy)
{
histo1->SetBinContent(slice, energy); //This uses setbincontent instead of fill to get labels correct
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::SecondaryProtonEnergyDeposit(G4int slice, G4double energy)
{
histo2->Fill(slice, energy);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::SecondaryNeutronEnergyDeposit(G4int slice, G4double energy)
{
histo3->Fill(slice, energy);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::SecondaryAlphaEnergyDeposit(G4int slice, G4double energy)
{
histo4->Fill(slice, energy);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::SecondaryGammaEnergyDeposit(G4int slice, G4double energy)
{
histo5->Fill(slice, energy);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::SecondaryElectronEnergyDeposit(G4int slice, G4double energy)
{
histo6->Fill(slice, energy);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::SecondaryTritonEnergyDeposit(G4int slice, G4double energy)
{
histo7->Fill(slice, energy);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::SecondaryDeuteronEnergyDeposit(G4int slice, G4double energy)
{
histo8->Fill(slice, energy);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::SecondaryPionEnergyDeposit(G4int slice, G4double energy)
{
histo9->Fill(slice, energy);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::electronEnergyDistribution(G4double energy)
{
histo10->Fill(energy);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::gammaEnergyDistribution(G4double energy)
{
histo11->Fill(energy);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::deuteronEnergyDistribution(G4double energy)
{
histo12->Fill(energy);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::tritonEnergyDistribution(G4double energy)
{
histo13->Fill(energy);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::alphaEnergyDistribution(G4double energy)
{
histo14->Fill(energy);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::heliumEnergy(G4double secondaryParticleKineticEnergy)
{
histo15->Fill(secondaryParticleKineticEnergy);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::hydrogenEnergy(G4double secondaryParticleKineticEnergy)
{
histo16->Fill(secondaryParticleKineticEnergy);
}
/////////////////////////////////////////////////////////////////////////////
// FillKineticFragmentTuple create an ntuple where the voxel indexs, the atomic number and mass and the kinetic
// energy of all the particles interacting with the phantom, are stored
void HadrontherapyAnalysisManager::FillKineticFragmentTuple(G4int i, G4int j, G4int k, G4int A, G4double Z, G4double kinEnergy)
{
kinFragNtuple -> Fill(i, j, k, A, Z, kinEnergy);
}
/////////////////////////////////////////////////////////////////////////////
// FillKineticEnergyPrimaryNTuple creates a ntuple where the voxel indexs and the kinetic
// energies of ONLY primary particles interacting with the phantom, are stored
void HadrontherapyAnalysisManager::FillKineticEnergyPrimaryNTuple(G4int i, G4int j, G4int k, G4double kinEnergy)
{
kineticEnergyPrimaryNtuple -> Fill(i, j, k, kinEnergy);
}
/////////////////////////////////////////////////////////////////////////////
// This function is called only if ROOT is activated.
// It is called by the HadrontherapyMatric.cc class file and it is used to create two ntuples containing
// the total energy deposited and the fluence values, in each voxel and per any particle (primary
// and secondary particles beam)
void HadrontherapyAnalysisManager::FillVoxelFragmentTuple(G4int i, G4int j, G4int k, G4int A, G4double Z, G4double energy, G4double fluence)
{
// Fill the ntuple containing the voxel, mass and atomic number and the energy deposited
doseFragNtuple -> Fill( i, j, k, A, Z, energy );
// Fill the ntuple containing the voxel, mass and atomic number and the fluence
if (i==1 && Z==1) {
fluenceFragNtuple -> Fill( i, j, k, A, Z, fluence );
}
}
void HadrontherapyAnalysisManager::FillLetFragmentTuple(G4int i, G4int j, G4int k, G4int A, G4double Z, G4double letD)
{
letFragNtuple -> Fill( i, j, k, A, Z, letD/MeV);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::FillFragmentTuple(G4int A, G4double Z, G4double energy, G4double posX, G4double posY, G4double posZ)
{
fragmentNtuple->Fill(A, Z, energy, posX, posY, posZ);
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::genericIonInformation(G4int a,
G4double z,
G4int electronOccupancy,
G4double energy)
{
if (theROOTIonTuple) {
theROOTIonTuple->Fill(a, z, electronOccupancy, energy);
}
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::startNewEvent()
{
eventCounter++;
}
/////////////////////////////////////////////////////////////////////////////
void HadrontherapyAnalysisManager::setGeometryMetaData(G4double endDetectorPosition, G4double waterThickness, G4double phantomCenter)
{
this->detectorDistance = endDetectorPosition;
this->phantomDepth = waterThickness;
this->phantomCenterDistance = phantomCenter;
}
void HadrontherapyAnalysisManager::setBeamMetaData(G4double meanKineticEnergy,G4double sigmaEnergy)
{
this->beamEnergy = meanKineticEnergy;
this->energyError = sigmaEnergy;
}
/////////////////////////////////////////////////////////////////////////////
// Flush data & close the file
void HadrontherapyAnalysisManager::flush()
{
if (theTFile)
{
theTFile -> Write();
theTFile -> Close();
}
theTFile = 0;
eventCounter = 0;
}
#endif
@@ -1,170 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Hadrontherapy advanced example for Geant4
// See more at: https://twiki.cern.ch/twiki/bin/view/Geant4/AdvancedExamplesHadrontherapy
//
//
// In this class the models for ion-ion interactions at intermediate energies (0 - 1 GeV per nucleon)
// can be activate. This class can be used alternatively to the "binary_ion" physics list
//
// The usefullness of this class is that you can explicitally see the total inelastic sections
// activated and the models called. Moreover you can choose to activate for ions (from deuteron
// to heavier nucleus) three different and exclusive models: the Binary Light Ion cascade, the QMD
// and The Wilson.
// For hadrotherapy pouposes, where distributions of produced fragments is importante we strongly
// suggest to use Binary or QMD. The Binary model is the default and at moment, you can swith beetween models decommenting
// the line of code and recompiling
#include "LocalIonIonInelasticPhysic.hh"
#include "G4SystemOfUnits.hh"
#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
// Total cross section for inelastic processes
#include "G4TripathiCrossSection.hh"
#include "G4TripathiLightCrossSection.hh"
#include "G4IonsShenCrossSection.hh"
#include "G4DeuteronInelasticProcess.hh"
#include "G4TritonInelasticProcess.hh"
#include "G4AlphaInelasticProcess.hh"
#include "G4BinaryLightIonReaction.hh"
#include "G4QMDReaction.hh"
#include "G4WilsonAbrasionModel.hh"
#include "G4IonInelasticProcess.hh"
#include "G4GeneralSpaceNNCrossSection.hh"
/////////////////////////////////////////////////////////////////////////////
LocalIonIonInelasticPhysic::LocalIonIonInelasticPhysic(const G4String& name):
G4VPhysicsConstructor(name)
{
G4cout << G4endl
<< "A local inelastic model is activated for all ions"
<< G4endl;
}
/////////////////////////////////////////////////////////////////////////////
LocalIonIonInelasticPhysic::~LocalIonIonInelasticPhysic()
{}
/////////////////////////////////////////////////////////////////////////////
void LocalIonIonInelasticPhysic::ConstructProcess()
{
G4ParticleDefinition* particle = 0;
G4ProcessManager* processManager = 0;
// ****************************************************************
// *** Ion-Ion models definition ***
// ****************************************************************
G4QMDReaction* JQMDmodel = new G4QMDReaction();
JQMDmodel -> SetMinEnergy(0*MeV);
JQMDmodel -> SetMaxEnergy(10*GeV);
G4BinaryLightIonReaction* ligthBinary = new G4BinaryLightIonReaction();
ligthBinary -> SetMinEnergy(0*MeV);
ligthBinary -> SetMaxEnergy(10*GeV);
G4WilsonAbrasionModel* WilsonModel = new G4WilsonAbrasionModel();
WilsonModel -> SetUseAblation(true);
WilsonModel -> SetMinEnergy(0*MeV);
WilsonModel -> SetMaxEnergy(10 *GeV);
G4TripathiCrossSection* TripatiCrossSections = new G4TripathiCrossSection;
G4TripathiLightCrossSection* TripatiLightCrossSections = new G4TripathiLightCrossSection;
G4IonsShenCrossSection* ShenCrossSections = new G4IonsShenCrossSection;
// ****************
// *** Deuteron ***
// ****************
G4DeuteronInelasticProcess* deuteronInelasticProcess = new G4DeuteronInelasticProcess;
deuteronInelasticProcess -> AddDataSet(ShenCrossSections);
deuteronInelasticProcess -> AddDataSet(TripatiCrossSections);
deuteronInelasticProcess -> AddDataSet(TripatiLightCrossSections);
deuteronInelasticProcess -> RegisterMe(ligthBinary);
//deuteronInelasticProcess -> RegisterMe(JQMDmodel);
//deuteronInelasticProcess -> RegisterMe(WilsonModel);
particle = G4Deuteron::Deuteron();
processManager = particle -> GetProcessManager();
processManager -> AddDiscreteProcess(deuteronInelasticProcess);
// **************
// *** Triton ***
// **************
G4TritonInelasticProcess* tritonInelasticProcess = new G4TritonInelasticProcess;
tritonInelasticProcess -> AddDataSet(ShenCrossSections);
tritonInelasticProcess -> AddDataSet(TripatiCrossSections);
tritonInelasticProcess -> AddDataSet(TripatiLightCrossSections);
tritonInelasticProcess -> RegisterMe(ligthBinary);
//tritonInelasticProcess -> RegisterMe(JQMDmodel);
//tritonInelasticProcess -> RegisterMe(WilsonModel);
particle = G4Triton::Triton();
processManager = particle -> GetProcessManager();
processManager -> AddDiscreteProcess(tritonInelasticProcess);
// *************
// *** Alpha ***
// *************
G4AlphaInelasticProcess* alphaInelasticProcess = new G4AlphaInelasticProcess;
alphaInelasticProcess -> AddDataSet(ShenCrossSections);
alphaInelasticProcess -> AddDataSet(TripatiCrossSections);
alphaInelasticProcess -> AddDataSet(TripatiLightCrossSections);
alphaInelasticProcess -> RegisterMe(ligthBinary);
//alphaInelasticProcess -> RegisterMe(JQMDmodel);
//alphaIonInelasticProcess -> RegisterMe(WilsonModel);
particle = G4Alpha::Alpha();
processManager = particle -> GetProcessManager();
processManager -> AddDiscreteProcess(alphaInelasticProcess);
// *******************
// *** Generic Ion ***
// *******************
G4IonInelasticProcess* genericIonInelasticProcess = new G4IonInelasticProcess();
genericIonInelasticProcess -> AddDataSet(ShenCrossSections);
genericIonInelasticProcess -> AddDataSet(TripatiCrossSections);
genericIonInelasticProcess -> AddDataSet(TripatiLightCrossSections);
genericIonInelasticProcess -> RegisterMe(ligthBinary);
//genericIonInelasticProcess -> RegisterMe(JQMDmodel);
//genericIonInelasticProcess -> RegisterMe(WilsonModel);
particle = G4GenericIon::GenericIon();
processManager = particle -> GetProcessManager();
processManager -> AddDiscreteProcess(genericIonInelasticProcess);
}