Import Geant4 11.3.0.beta source tree
This commit is contained in:
@@ -11,7 +11,7 @@ Environment variable "G4FORCE_RUN_MANAGER_TYPE" enabled with value == Serial. Fo
|
||||
|
||||
|
||||
**************************************************************
|
||||
Geant4 version Name: geant4-11-02-patch-02 (21-June-2024)
|
||||
Geant4 version Name: geant4-11-02-ref-06 (28-June-2024)
|
||||
Copyright : Geant4 Collaboration
|
||||
References : NIM A 506 (2003), 250-303
|
||||
: IEEE-TNS 53 (2006), 270-278
|
||||
@@ -43,14 +43,21 @@ Registered graphics systems are:
|
||||
RayTracerX (RayTracerX)
|
||||
Qt3D (Qt3D)
|
||||
TOOLSSG_X11_GLES (TSG_X11_GLES, TSGX11, TSG_XT_GLES_FALLBACK)
|
||||
TOOLSSG_X11_ZB (TSG_X11_ZB, TSGX11ZB)
|
||||
TOOLSSG_XT_GLES (TSG_XT_GLES, TSGXt, TSG_QT_GLES_FALLBACK)
|
||||
TOOLSSG_XT_ZB (TSG_XT_ZB, TSGXtZB)
|
||||
TOOLSSG_QT_GLES (TSG_QT_GLES, TSGQt, TSG)
|
||||
TOOLSSG_QT_ZB (TSG_QT_ZB, TSGQtZB)
|
||||
Default graphics system is: TSG_OFFSCREEN (based on batch session).
|
||||
Default window size hint is: 600x600-0+0 (based on G4VisManager initialisation).
|
||||
Note: Parameters specified on the command line will override these defaults.
|
||||
Use "vis/open" without parameters to get these defaults.
|
||||
You may choose a graphics system (driver) with a parameter of
|
||||
the command "/vis/open" or "/vis/sceneHandler/create",
|
||||
or you may omit the driver parameter and choose at run time:
|
||||
- by argument in the construction of G4VisExecutive
|
||||
- by environment variable "G4VIS_DEFAULT_DRIVER"
|
||||
- by entry in "~/.g4session"
|
||||
- by build flags.
|
||||
- Note: This feature is not allowed in batch mode.
|
||||
For further information see "examples/basic/B1/exampleB1.cc"
|
||||
and "vis.mac".
|
||||
|
||||
Registering model factories...
|
||||
|
||||
@@ -233,7 +240,7 @@ eBrem: for e+ XStype:4 SubType=3
|
||||
eBremSB : Emin= 0 eV Emax= 1 GeV ModifiedTsai
|
||||
eBremLPM : Emin= 1 GeV Emax= 100 TeV ModifiedTsai
|
||||
|
||||
annihil: for e+ XStype:2 SubType=5 BuildTable=0
|
||||
annihil: for e+ XStype:2 SubType=5 AtRestModel:Simple BuildTable=0
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
eplus2gg : Emin= 0 eV Emax= 100 TeV
|
||||
|
||||
@@ -794,7 +801,7 @@ Min energy per nucleon for multifragmentation 200 GeV
|
||||
Limit excitation energy for Fermi BreakUp 20 MeV
|
||||
Level density (1/MeV) 0.075
|
||||
Use simple level density model 1
|
||||
Use discrete excitation energy of the residual 1
|
||||
Use discrete excitation energy of the residual 0
|
||||
Time limit for long lived isomeres 1 ns
|
||||
Isomer production flag 1
|
||||
Internal e- conversion flag 1
|
||||
@@ -806,24 +813,24 @@ G4VisManager: Using G4TrajectoryDrawByCharge as fallback trajectory model.
|
||||
See commands in /vis/modeling/trajectories/ for other options.
|
||||
|
||||
G4ConvergenceTester Output Result of DOSE_TALLY
|
||||
EFFICIENCY = 0.17
|
||||
MEAN = 4.24413e-14
|
||||
VAR = 1.51296e-26
|
||||
SD = 1.23003e-13
|
||||
R = 0.0916485
|
||||
SHIFT = 1.833e-13
|
||||
VOV = 0.00965561
|
||||
FOM = 3968.52
|
||||
THE LARGEST SCORE = 5.55155e-13 and it happened at 893th event
|
||||
Affected Mean = 4.29535e-14 and its ratio to original is 1.01207
|
||||
Affected VAR = 1.53771e-26 and its ratio to original is 1.01636
|
||||
Affected R = 0.0912476 and its ratio to original is 0.995626
|
||||
Affected SHIFT = 1.83781e-13 and its ratio to original is 1.00262
|
||||
Affected FOM = 3968.52 and its ratio to original is 1
|
||||
EFFICIENCY = 0.198
|
||||
MEAN = 4.55475e-14
|
||||
VAR = 1.54263e-26
|
||||
SD = 1.24203e-13
|
||||
R = 0.0862315
|
||||
SHIFT = 1.72861e-13
|
||||
VOV = 0.00854466
|
||||
FOM = 4482.77
|
||||
THE LARGEST SCORE = 5.54337e-13 and it happened at 366th event
|
||||
Affected Mean = 4.60558e-14 and its ratio to original is 1.01116
|
||||
Affected VAR = 1.56695e-26 and its ratio to original is 1.01576
|
||||
Affected R = 0.0859065 and its ratio to original is 0.99623
|
||||
Affected SHIFT = 1.73445e-13 and its ratio to original is 1.00338
|
||||
Affected FOM = 4482.77 and its ratio to original is 1
|
||||
MEAN distribution is not RANDOM
|
||||
r follows 1/std::sqrt(N)
|
||||
r is monotonically decrease
|
||||
r is less than 0.1. r = 0.0916485
|
||||
r is less than 0.1. r = 0.0862315
|
||||
VOV follows 1/std::sqrt(N)
|
||||
VOV is monotonically decrease
|
||||
FOM distribution is not RANDOM
|
||||
@@ -833,48 +840,48 @@ This result passes 5 / 8 Convergence Test.
|
||||
|
||||
G4ConvergenceTester Output History of DOSE_TALLY
|
||||
i/16 till_ith mean var sd r vov fom shift e r2eff r2int
|
||||
1 62 4.15089e-14 1.47669e-26 1.21519e-13 0.368836 0.150664 245.026 1.75351e-13 0.174603 0.0750361 0.0588445
|
||||
2 124 3.93009e-14 1.4082e-26 1.18668e-13 0.270069 0.082913 457.014 1.81552e-13 0.176 0.0374545 0.0348991
|
||||
3 187 3.87499e-14 1.31699e-26 1.1476e-13 0.215994 0.0578571 714.488 1.78683e-13 0.18617 0.0232523 0.023153
|
||||
4 249 4.09837e-14 1.41212e-26 1.18833e-13 0.183381 0.041065 991.219 1.80656e-13 0.188 0.0172766 0.0162175
|
||||
5 312 4.32645e-14 1.52396e-26 1.23449e-13 0.161281 0.0306769 1281.48 1.82098e-13 0.188498 0.0137543 0.0121741
|
||||
6 374 4.11182e-14 1.42378e-26 1.19322e-13 0.149855 0.0274276 1484.35 1.81735e-13 0.186667 0.011619 0.0107776
|
||||
7 437 4.21075e-14 1.46511e-26 1.21042e-13 0.137353 0.0225127 1766.86 1.80916e-13 0.182648 0.0102169 0.00860589
|
||||
8 499 4.12978e-14 1.4143e-26 1.18924e-13 0.128783 0.0199466 2009.83 1.78628e-13 0.186 0.00875269 0.00779928
|
||||
9 562 4.00473e-14 1.37636e-26 1.17319e-13 0.123464 0.0179062 2186.76 1.77608e-13 0.174067 0.00842788 0.00678832
|
||||
10 624 3.94354e-14 1.35768e-26 1.16519e-13 0.118188 0.0164103 2386.35 1.78155e-13 0.1696 0.00783396 0.00611202
|
||||
11 687 4.14442e-14 1.41886e-26 1.19116e-13 0.109575 0.014024 2776.22 1.76413e-13 0.174419 0.00687984 0.00510943
|
||||
12 749 4.06709e-14 1.39931e-26 1.18292e-13 0.106204 0.0132954 2955.25 1.78255e-13 0.170667 0.00647917 0.00478516
|
||||
13 812 4.08157e-14 1.40276e-26 1.18438e-13 0.10177 0.0121591 3218.4 1.77843e-13 0.169742 0.00601636 0.00432802
|
||||
14 874 4.12957e-14 1.44e-26 1.2e-13 0.0982365 0.0112995 3454.09 1.80358e-13 0.170286 0.00556855 0.00407083
|
||||
15 937 4.37242e-14 1.55491e-26 1.24696e-13 0.0931171 0.00983397 3844.32 1.81499e-13 0.173774 0.00506887 0.00359268
|
||||
16 999 4.24413e-14 1.51296e-26 1.23003e-13 0.0916485 0.00965561 3968.52 1.833e-13 0.17 0.00488235 0.00350869
|
||||
1 62 3.17379e-14 1.29473e-26 1.13786e-13 0.451691 0.226367 163.379 2.0412e-13 0.142857 0.0952381 0.105548
|
||||
2 124 3.30804e-14 1.06384e-26 1.03143e-13 0.278877 0.105732 428.601 1.73258e-13 0.168 0.039619 0.0375311
|
||||
3 187 3.94836e-14 1.26526e-26 1.12484e-13 0.207776 0.0559014 772.128 1.69917e-13 0.191489 0.0224586 0.0204825
|
||||
4 249 3.97276e-14 1.30204e-26 1.14107e-13 0.181656 0.0405982 1010.14 1.71002e-13 0.184 0.0177391 0.0151277
|
||||
5 312 3.82407e-14 1.22829e-26 1.10828e-13 0.163814 0.0339478 1242.15 1.69776e-13 0.185304 0.0140465 0.0127029
|
||||
6 374 3.89136e-14 1.2719e-26 1.12778e-13 0.149661 0.0287795 1488.2 1.742e-13 0.184 0.0118261 0.0105126
|
||||
7 437 3.80559e-14 1.25301e-26 1.11938e-13 0.140546 0.0252541 1687.5 1.75552e-13 0.191781 0.00962166 0.0100864
|
||||
8 499 4.16767e-14 1.38768e-26 1.178e-13 0.126406 0.019678 2086.14 1.74791e-13 0.202 0.00790099 0.00804549
|
||||
9 562 4.17944e-14 1.4095e-26 1.18722e-13 0.119718 0.0172617 2325.73 1.75728e-13 0.198934 0.00715237 0.00715461
|
||||
10 624 4.33469e-14 1.47176e-26 1.21316e-13 0.111949 0.0146904 2659.74 1.74757e-13 0.1968 0.00653008 0.00598243
|
||||
11 687 4.40834e-14 1.50155e-26 1.22538e-13 0.105974 0.0130273 2968.1 1.74616e-13 0.196221 0.00595392 0.00526027
|
||||
12 749 4.57566e-14 1.56694e-26 1.25178e-13 0.0998947 0.0112546 3340.36 1.73389e-13 0.198667 0.00537808 0.00458757
|
||||
13 812 4.50245e-14 1.54897e-26 1.24458e-13 0.0969456 0.0105987 3546.68 1.74374e-13 0.195572 0.0050593 0.0043276
|
||||
14 874 4.57357e-14 1.56286e-26 1.25015e-13 0.0924063 0.00966482 3903.69 1.7349e-13 0.2 0.00457143 0.00395773
|
||||
15 937 4.56765e-14 1.55286e-26 1.24614e-13 0.0890783 0.0090895 4200.83 1.73294e-13 0.198294 0.00431025 0.00361624
|
||||
16 999 4.55475e-14 1.54263e-26 1.24203e-13 0.0862315 0.00854466 4482.77 1.72861e-13 0.198 0.00405051 0.00337794
|
||||
|
||||
--------------------End of Global Run-----------------------
|
||||
The run consists of 1000 gamma of 6 MeV
|
||||
Cumulated dose per run, in scoring volume : 42.4413 picoGy rms = 3.88774 picoGy
|
||||
Cumulated dose per run, in scoring volume : 45.5475 picoGy rms = 3.92567 picoGy
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
G4ConvergenceTester Output Result of DOSE_TALLY
|
||||
EFFICIENCY = 0.638
|
||||
MEAN = 5.05669e-12
|
||||
VAR = 2.16333e-23
|
||||
SD = 4.65116e-12
|
||||
R = 0.0290868
|
||||
SHIFT = 2.0878e-15
|
||||
VOV = 0.000156804
|
||||
FOM = 4727.91
|
||||
THE LARGEST SCORE = 1.0851e-11 and it happened at 802th event
|
||||
Affected Mean = 5.06247e-12 and its ratio to original is 1.00114
|
||||
Affected VAR = 2.16452e-23 and its ratio to original is 1.00055
|
||||
Affected R = 0.029047 and its ratio to original is 0.998632
|
||||
Affected SHIFT = -2.10021e-15 and its ratio to original is -1.00595
|
||||
Affected FOM = 4727.91 and its ratio to original is 1
|
||||
EFFICIENCY = 0.612
|
||||
MEAN = 4.70767e-12
|
||||
VAR = 2.09414e-23
|
||||
SD = 4.57618e-12
|
||||
R = 0.0307395
|
||||
SHIFT = 3.36726e-13
|
||||
VOV = 0.000199175
|
||||
FOM = 4601.27
|
||||
THE LARGEST SCORE = 1.07575e-11 and it happened at 607th event
|
||||
Affected Mean = 4.71372e-12 and its ratio to original is 1.00128
|
||||
Affected VAR = 2.09571e-23 and its ratio to original is 1.00075
|
||||
Affected R = 0.0306962 and its ratio to original is 0.998591
|
||||
Affected SHIFT = 3.3236e-13 and its ratio to original is 0.987033
|
||||
Affected FOM = 4601.27 and its ratio to original is 1
|
||||
MEAN distribution is RANDOM
|
||||
r follows 1/std::sqrt(N)
|
||||
r is monotonically decrease
|
||||
r is less than 0.1. r = 0.0290868
|
||||
r is less than 0.1. r = 0.0307395
|
||||
VOV follows 1/std::sqrt(N)
|
||||
VOV is monotonically decrease
|
||||
FOM distribution is not RANDOM
|
||||
@@ -884,26 +891,26 @@ This result passes 6 / 8 Convergence Test.
|
||||
|
||||
G4ConvergenceTester Output History of DOSE_TALLY
|
||||
i/16 till_ith mean var sd r vov fom shift e r2eff r2int
|
||||
1 62 5.51905e-12 2.10641e-23 4.58956e-12 0.10477 0.00349254 379.591 -6.31268e-13 0.619048 0.00976801 0.00103449
|
||||
2 124 5.24443e-12 2.19131e-23 4.68114e-12 0.079836 0.00119948 627.571 -2.32561e-13 0.632 0.00465823 0.00166456
|
||||
3 187 5.19533e-12 2.17828e-23 4.6672e-12 0.0655187 0.000810324 931.816 -1.46253e-13 0.638298 0.00301418 0.00125568
|
||||
4 249 5.24762e-12 2.17577e-23 4.66451e-12 0.0562178 0.000628242 1265.64 -1.88828e-13 0.64 0.00225 0.000897804
|
||||
5 312 5.05818e-12 2.13264e-23 4.61805e-12 0.0516051 0.000543135 1502.01 -1.61673e-14 0.632588 0.00185562 0.000798965
|
||||
6 374 4.94544e-12 2.13069e-23 4.61595e-12 0.0481992 0.000456237 1721.79 8.7396e-14 0.626667 0.00158865 0.000728316
|
||||
7 437 5.00127e-12 2.121e-23 4.60543e-12 0.044 0.000391269 2066.11 4.18245e-14 0.636986 0.00130112 0.000630458
|
||||
8 499 5.08953e-12 2.13598e-23 4.62167e-12 0.0406103 0.000326214 2425.43 -4.35334e-14 0.646 0.00109598 0.000549919
|
||||
9 562 5.16829e-12 2.14152e-23 4.62765e-12 0.0377363 0.000291332 2808.93 -1.0866e-13 0.653641 0.000941192 0.000480309
|
||||
10 624 5.18124e-12 2.14591e-23 4.63239e-12 0.0357628 0.000258743 3127.5 -1.18512e-13 0.6544 0.000844988 0.000431944
|
||||
11 687 5.17908e-12 2.13659e-23 4.62233e-12 0.0340262 0.000239275 3454.87 -1.19679e-13 0.655523 0.000763807 0.000392296
|
||||
12 749 5.17742e-12 2.13375e-23 4.61926e-12 0.0325783 0.00022047 3768.8 -1.13831e-13 0.658667 0.000690958 0.000368972
|
||||
13 812 5.18358e-12 2.12092e-23 4.60534e-12 0.0311592 0.000212735 4119.89 -1.23029e-13 0.661747 0.000628724 0.000340981
|
||||
14 874 5.13529e-12 2.13621e-23 4.62192e-12 0.0304266 0.000190414 4320.69 -7.65616e-14 0.651429 0.000611529 0.00031319
|
||||
15 937 5.10108e-12 2.15153e-23 4.63846e-12 0.02969 0.000170897 4537.73 -4.15281e-14 0.646055 0.000584067 0.000296492
|
||||
16 999 5.05669e-12 2.16333e-23 4.65116e-12 0.0290868 0.000156804 4727.91 2.0878e-15 0.638 0.000567398 0.000277796
|
||||
1 62 5.19299e-12 2.1284e-23 4.61346e-12 0.111928 0.00320878 347.051 -2.2379e-14 0.666667 0.00793651 0.00439255
|
||||
2 124 5.36134e-12 2.12529e-23 4.61009e-12 0.0769096 0.001509 735.041 -2.4295e-13 0.656 0.00419512 0.00167264
|
||||
3 187 5.1933e-12 2.16596e-23 4.65399e-12 0.0653586 0.000877776 1017.81 -8.33545e-14 0.632979 0.00308421 0.00116482
|
||||
4 249 4.95489e-12 2.15601e-23 4.64329e-12 0.0592682 0.000688672 1237.74 1.1844e-13 0.612 0.00253595 0.000962715
|
||||
5 312 4.91856e-12 2.14292e-23 4.62917e-12 0.0531977 0.000567319 1536.34 1.6347e-13 0.616613 0.00198646 0.000834496
|
||||
6 374 4.90622e-12 2.0871e-23 4.56847e-12 0.0480849 0.000528341 1880.42 1.48974e-13 0.624 0.00160684 0.000699154
|
||||
7 437 4.77642e-12 2.08916e-23 4.57073e-12 0.0457243 0.000449474 2079.59 2.55796e-13 0.609589 0.00146221 0.000623722
|
||||
8 499 4.77164e-12 2.09932e-23 4.58183e-12 0.0429424 0.000382828 2357.76 2.67344e-13 0.612 0.00126797 0.00057239
|
||||
9 562 4.71852e-12 2.09737e-23 4.5797e-12 0.0409051 0.000346315 2598.47 3.11738e-13 0.605684 0.00115635 0.0005139
|
||||
10 624 4.70478e-12 2.10471e-23 4.58771e-12 0.0390047 0.00030795 2857.84 3.22915e-13 0.6016 0.00105957 0.00045936
|
||||
11 687 4.72405e-12 2.09644e-23 4.5787e-12 0.0369516 0.000283309 3184.24 3.08893e-13 0.607558 0.000938856 0.000424579
|
||||
12 749 4.72705e-12 2.11366e-23 4.59746e-12 0.0355138 0.000252487 3447.29 3.11107e-13 0.602667 0.000879056 0.000380491
|
||||
13 812 4.76222e-12 2.10716e-23 4.59039e-12 0.0338061 0.000231611 3804.37 2.76281e-13 0.608856 0.00079019 0.000351255
|
||||
14 874 4.76977e-12 2.10183e-23 4.58457e-12 0.0324935 0.000216617 4117.92 2.72184e-13 0.612571 0.000722814 0.000331808
|
||||
15 937 4.70589e-12 2.09145e-23 4.57323e-12 0.0317308 0.000213362 4318.29 3.35765e-13 0.610874 0.000679103 0.000326665
|
||||
16 999 4.70767e-12 2.09414e-23 4.57618e-12 0.0307395 0.000199175 4601.27 3.36726e-13 0.612 0.000633987 0.000309986
|
||||
|
||||
--------------------End of Global Run-----------------------
|
||||
The run consists of 1000 proton of 210 MeV
|
||||
Cumulated dose per run, in scoring volume : 5.05669 nanoGy rms = 147.009 picoGy
|
||||
Cumulated dose per run, in scoring volume : 4.70767 nanoGy rms = 144.639 picoGy
|
||||
------------------------------------------------------------
|
||||
|
||||
Graphics systems deleted.
|
||||
|
||||
@@ -27,42 +27,39 @@
|
||||
/// \file exampleB1.cc
|
||||
/// \brief Main program of the B1 example
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "ActionInitialization.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "QBBC.hh"
|
||||
|
||||
#include "G4RunManagerFactory.hh"
|
||||
#include "G4SteppingVerbose.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "QBBC.hh"
|
||||
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "G4UIExecutive.hh"
|
||||
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
using namespace B1;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
int main(int argc,char** argv)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
// Instantiate G4UIExecutive if there are no arguments (interactive mode)
|
||||
G4UIExecutive* ui = nullptr;
|
||||
if ( argc == 1 ) {
|
||||
if (argc == 1) {
|
||||
ui = new G4UIExecutive(argc, argv);
|
||||
}
|
||||
|
||||
// Optionally: choose a different Random engine...
|
||||
// G4Random::setTheEngine(new CLHEP::MTwistEngine);
|
||||
|
||||
//use G4SteppingVerboseWithUnits
|
||||
// use G4SteppingVerboseWithUnits
|
||||
G4int precision = 4;
|
||||
G4SteppingVerbose::UseBestUnit(precision);
|
||||
|
||||
// Construct the default run manager
|
||||
//
|
||||
auto* runManager =
|
||||
G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default);
|
||||
auto* runManager = G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default);
|
||||
runManager->SetNumberOfThreads(8);
|
||||
|
||||
// Set mandatory initialization classes
|
||||
@@ -91,7 +88,7 @@ int main(int argc,char** argv)
|
||||
// batch mode
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
UImanager->ApplyCommand(command + fileName);
|
||||
}
|
||||
else {
|
||||
// interactive mode : define UI session
|
||||
|
||||
@@ -47,7 +47,7 @@ class ActionInitialization : public G4VUserActionInitialization
|
||||
void Build() const override;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B1Con
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
G4LogicalVolume* fScoringVolume = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B1
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -56,13 +56,11 @@ class EventAction : public G4UserEventAction
|
||||
|
||||
private:
|
||||
B1Con::RunAction* fRunAction = nullptr;
|
||||
G4double fEdep = 0.;
|
||||
G4double fEdep = 0.;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B1
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
#ifndef B1PrimaryGeneratorAction_h
|
||||
#define B1PrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
@@ -59,11 +59,11 @@ class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
const G4ParticleGun* GetParticleGun() const { return fParticleGun; }
|
||||
|
||||
private:
|
||||
G4ParticleGun* fParticleGun = nullptr; // pointer a to G4 gun class
|
||||
G4ParticleGun* fParticleGun = nullptr; // pointer a to G4 gun class
|
||||
G4Box* fEnvelopeBox = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B1
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -32,15 +32,14 @@
|
||||
|
||||
#include "VectorAccummulable.hh"
|
||||
|
||||
#include "G4Accumulable.hh"
|
||||
#include "G4ConvergenceTester.hh"
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "G4Accumulable.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4ConvergenceTester;
|
||||
class G4Run;
|
||||
|
||||
|
||||
namespace B1Con
|
||||
{
|
||||
|
||||
@@ -56,19 +55,18 @@ class RunAction : public G4UserRunAction
|
||||
RunAction();
|
||||
~RunAction() override = default;
|
||||
|
||||
void BeginOfRunAction(const G4Run*) override;
|
||||
void EndOfRunAction(const G4Run*) override;
|
||||
void BeginOfRunAction(const G4Run*) override;
|
||||
void EndOfRunAction(const G4Run*) override;
|
||||
|
||||
void AddEdep (G4double edep);
|
||||
void AddEdep(G4double edep);
|
||||
|
||||
private:
|
||||
G4Accumulable<G4double> fEdep = 0.;
|
||||
G4Accumulable<G4double> fEdep2 = 0.;
|
||||
VectorAccumulable<G4double> fEdepPerEvent;
|
||||
VectorAccumulable<G4double> fEdepPerEvent;
|
||||
G4ConvergenceTester* fDoseTally = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B1Con
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class SteppingAction : public G4UserSteppingAction
|
||||
G4LogicalVolume* fScoringVolume = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B1
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -35,9 +35,10 @@
|
||||
|
||||
#include "G4VAccumulable.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <vector>
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
class VectorAccumulable : public G4VAccumulable
|
||||
{
|
||||
public:
|
||||
@@ -56,26 +57,29 @@ class VectorAccumulable : public G4VAccumulable
|
||||
|
||||
// inline functions
|
||||
|
||||
template <typename T>
|
||||
inline void VectorAccumulable<T>::AddValue(T value) {
|
||||
fTVector.push_back(value);
|
||||
template<typename T>
|
||||
inline void VectorAccumulable<T>::AddValue(T value)
|
||||
{
|
||||
fTVector.push_back(value);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template<typename T>
|
||||
inline const std::vector<T>& VectorAccumulable<T>::GetVector() const
|
||||
{
|
||||
return fTVector;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void VectorAccumulable<T>::Merge(const G4VAccumulable& other) {
|
||||
for (const auto& value : static_cast<const VectorAccumulable<T>&>(other).fTVector ) {
|
||||
template<typename T>
|
||||
inline void VectorAccumulable<T>::Merge(const G4VAccumulable& other)
|
||||
{
|
||||
for (const auto& value : static_cast<const VectorAccumulable<T>&>(other).fTVector) {
|
||||
fTVector.push_back(value);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void VectorAccumulable<T>::Reset() {
|
||||
template<typename T>
|
||||
inline void VectorAccumulable<T>::Reset()
|
||||
{
|
||||
fTVector.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,9 +28,10 @@
|
||||
/// \brief Implementation of the B1::ActionInitialization class
|
||||
|
||||
#include "ActionInitialization.hh"
|
||||
|
||||
#include "EventAction.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
#include "RunAction.hh"
|
||||
#include "EventAction.hh"
|
||||
#include "SteppingAction.hh"
|
||||
|
||||
namespace B1Con
|
||||
@@ -61,4 +62,4 @@ void ActionInitialization::Build() const
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
} // namespace B1Con
|
||||
|
||||
@@ -29,16 +29,16 @@
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4Cons.hh"
|
||||
#include "G4Orb.hh"
|
||||
#include "G4Sphere.hh"
|
||||
#include "G4Trd.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4Orb.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4Sphere.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4Trd.hh"
|
||||
|
||||
namespace B1
|
||||
{
|
||||
@@ -52,7 +52,7 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
|
||||
// Envelope parameters
|
||||
//
|
||||
G4double env_sizeXY = 20*cm, env_sizeZ = 30*cm;
|
||||
G4double env_sizeXY = 20 * cm, env_sizeZ = 30 * cm;
|
||||
G4Material* env_mat = nist->FindOrBuildMaterial("G4_WATER");
|
||||
|
||||
// Option to switch on/off checking of volumes overlaps
|
||||
@@ -62,109 +62,111 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
//
|
||||
// World
|
||||
//
|
||||
G4double world_sizeXY = 1.2*env_sizeXY;
|
||||
G4double world_sizeZ = 1.2*env_sizeZ;
|
||||
G4double world_sizeXY = 1.2 * env_sizeXY;
|
||||
G4double world_sizeZ = 1.2 * env_sizeZ;
|
||||
G4Material* world_mat = nist->FindOrBuildMaterial("G4_AIR");
|
||||
|
||||
auto solidWorld = new G4Box("World", // its name
|
||||
0.5 * world_sizeXY, 0.5 * world_sizeXY, 0.5 * world_sizeZ); // its size
|
||||
auto solidWorld =
|
||||
new G4Box("World", // its name
|
||||
0.5 * world_sizeXY, 0.5 * world_sizeXY, 0.5 * world_sizeZ); // its size
|
||||
|
||||
auto logicWorld = new G4LogicalVolume(solidWorld, // its solid
|
||||
world_mat, // its material
|
||||
"World"); // its name
|
||||
world_mat, // its material
|
||||
"World"); // its name
|
||||
|
||||
auto physWorld = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
logicWorld, // its logical volume
|
||||
"World", // its name
|
||||
nullptr, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
logicWorld, // its logical volume
|
||||
"World", // its name
|
||||
nullptr, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
|
||||
//
|
||||
// Envelope
|
||||
//
|
||||
auto solidEnv = new G4Box("Envelope", // its name
|
||||
0.5 * env_sizeXY, 0.5 * env_sizeXY, 0.5 * env_sizeZ); // its size
|
||||
auto solidEnv = new G4Box("Envelope", // its name
|
||||
0.5 * env_sizeXY, 0.5 * env_sizeXY, 0.5 * env_sizeZ); // its size
|
||||
|
||||
auto logicEnv = new G4LogicalVolume(solidEnv, // its solid
|
||||
env_mat, // its material
|
||||
"Envelope"); // its name
|
||||
env_mat, // its material
|
||||
"Envelope"); // its name
|
||||
|
||||
new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
logicEnv, // its logical volume
|
||||
"Envelope", // its name
|
||||
logicWorld, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
logicEnv, // its logical volume
|
||||
"Envelope", // its name
|
||||
logicWorld, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
|
||||
//
|
||||
// Shape 1
|
||||
//
|
||||
G4Material* shape1_mat = nist->FindOrBuildMaterial("G4_A-150_TISSUE");
|
||||
G4ThreeVector pos1 = G4ThreeVector(0, 2*cm, -7*cm);
|
||||
G4ThreeVector pos1 = G4ThreeVector(0, 2 * cm, -7 * cm);
|
||||
|
||||
// Conical section shape
|
||||
G4double shape1_rmina = 0.*cm, shape1_rmaxa = 2.*cm;
|
||||
G4double shape1_rminb = 0.*cm, shape1_rmaxb = 4.*cm;
|
||||
G4double shape1_hz = 3.*cm;
|
||||
G4double shape1_phimin = 0.*deg, shape1_phimax = 360.*deg;
|
||||
G4double shape1_rmina = 0. * cm, shape1_rmaxa = 2. * cm;
|
||||
G4double shape1_rminb = 0. * cm, shape1_rmaxb = 4. * cm;
|
||||
G4double shape1_hz = 3. * cm;
|
||||
G4double shape1_phimin = 0. * deg, shape1_phimax = 360. * deg;
|
||||
auto solidShape1 = new G4Cons("Shape1", shape1_rmina, shape1_rmaxa, shape1_rminb, shape1_rmaxb,
|
||||
shape1_hz, shape1_phimin, shape1_phimax);
|
||||
shape1_hz, shape1_phimin, shape1_phimax);
|
||||
|
||||
auto logicShape1 = new G4LogicalVolume(solidShape1, // its solid
|
||||
shape1_mat, // its material
|
||||
"Shape1"); // its name
|
||||
shape1_mat, // its material
|
||||
"Shape1"); // its name
|
||||
|
||||
new G4PVPlacement(nullptr, // no rotation
|
||||
pos1, // at position
|
||||
logicShape1, // its logical volume
|
||||
"Shape1", // its name
|
||||
logicEnv, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
pos1, // at position
|
||||
logicShape1, // its logical volume
|
||||
"Shape1", // its name
|
||||
logicEnv, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
|
||||
//
|
||||
// Shape 2
|
||||
//
|
||||
G4Material* shape2_mat = nist->FindOrBuildMaterial("G4_BONE_COMPACT_ICRU");
|
||||
G4ThreeVector pos2 = G4ThreeVector(0, -1*cm, 7*cm);
|
||||
G4ThreeVector pos2 = G4ThreeVector(0, -1 * cm, 7 * cm);
|
||||
|
||||
// Trapezoid shape
|
||||
G4double shape2_dxa = 12*cm, shape2_dxb = 12*cm;
|
||||
G4double shape2_dya = 10*cm, shape2_dyb = 16*cm;
|
||||
G4double shape2_dz = 6*cm;
|
||||
auto solidShape2 = new G4Trd("Shape2", // its name
|
||||
0.5 * shape2_dxa, 0.5 * shape2_dxb, 0.5 * shape2_dya, 0.5 * shape2_dyb,
|
||||
0.5 * shape2_dz); // its size
|
||||
G4double shape2_dxa = 12 * cm, shape2_dxb = 12 * cm;
|
||||
G4double shape2_dya = 10 * cm, shape2_dyb = 16 * cm;
|
||||
G4double shape2_dz = 6 * cm;
|
||||
auto solidShape2 =
|
||||
new G4Trd("Shape2", // its name
|
||||
0.5 * shape2_dxa, 0.5 * shape2_dxb, 0.5 * shape2_dya, 0.5 * shape2_dyb,
|
||||
0.5 * shape2_dz); // its size
|
||||
|
||||
auto logicShape2 = new G4LogicalVolume(solidShape2, // its solid
|
||||
shape2_mat, // its material
|
||||
"Shape2"); // its name
|
||||
shape2_mat, // its material
|
||||
"Shape2"); // its name
|
||||
|
||||
new G4PVPlacement(nullptr, // no rotation
|
||||
pos2, // at position
|
||||
logicShape2, // its logical volume
|
||||
"Shape2", // its name
|
||||
logicEnv, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
pos2, // at position
|
||||
logicShape2, // its logical volume
|
||||
"Shape2", // its name
|
||||
logicEnv, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
|
||||
// Set Shape2 as scoring volume
|
||||
//
|
||||
fScoringVolume = logicShape2;
|
||||
|
||||
//
|
||||
//always return the physical World
|
||||
// always return the physical World
|
||||
//
|
||||
return physWorld;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
} // namespace B1
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
/// \brief Implementation of the B1::EventAction class
|
||||
|
||||
#include "EventAction.hh"
|
||||
|
||||
#include "RunAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
@@ -38,9 +39,7 @@ namespace B1
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EventAction::EventAction(B1Con::RunAction* runAction)
|
||||
: fRunAction(runAction)
|
||||
{}
|
||||
EventAction::EventAction(B1Con::RunAction* runAction) : fRunAction(runAction) {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -59,4 +58,4 @@ void EventAction::EndOfEventAction(const G4Event*)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
} // namespace B1
|
||||
|
||||
@@ -29,13 +29,13 @@
|
||||
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
@@ -47,16 +47,15 @@ namespace B1
|
||||
PrimaryGeneratorAction::PrimaryGeneratorAction()
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
fParticleGun = new G4ParticleGun(n_particle);
|
||||
fParticleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
// default particle kinematic
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
G4String particleName;
|
||||
G4ParticleDefinition* particle
|
||||
= particleTable->FindParticle(particleName="gamma");
|
||||
G4ParticleDefinition* particle = particleTable->FindParticle(particleName = "gamma");
|
||||
fParticleGun->SetParticleDefinition(particle);
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
|
||||
fParticleGun->SetParticleEnergy(6.*MeV);
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0., 0., 1.));
|
||||
fParticleGun->SetParticleEnergy(6. * MeV);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -70,7 +69,7 @@ PrimaryGeneratorAction::~PrimaryGeneratorAction()
|
||||
|
||||
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
//this function is called at the begining of ecah event
|
||||
// this function is called at the begining of ecah event
|
||||
//
|
||||
|
||||
// In order to avoid dependence of PrimaryGeneratorAction
|
||||
@@ -80,38 +79,33 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
G4double envSizeXY = 0;
|
||||
G4double envSizeZ = 0;
|
||||
|
||||
if (!fEnvelopeBox)
|
||||
{
|
||||
G4LogicalVolume* envLV
|
||||
= G4LogicalVolumeStore::GetInstance()->GetVolume("Envelope");
|
||||
if ( envLV ) fEnvelopeBox = dynamic_cast<G4Box*>(envLV->GetSolid());
|
||||
if (!fEnvelopeBox) {
|
||||
G4LogicalVolume* envLV = G4LogicalVolumeStore::GetInstance()->GetVolume("Envelope");
|
||||
if (envLV) fEnvelopeBox = dynamic_cast<G4Box*>(envLV->GetSolid());
|
||||
}
|
||||
|
||||
if ( fEnvelopeBox ) {
|
||||
envSizeXY = fEnvelopeBox->GetXHalfLength()*2.;
|
||||
envSizeZ = fEnvelopeBox->GetZHalfLength()*2.;
|
||||
if (fEnvelopeBox) {
|
||||
envSizeXY = fEnvelopeBox->GetXHalfLength() * 2.;
|
||||
envSizeZ = fEnvelopeBox->GetZHalfLength() * 2.;
|
||||
}
|
||||
else {
|
||||
else {
|
||||
G4ExceptionDescription msg;
|
||||
msg << "Envelope volume of box shape not found.\n";
|
||||
msg << "Perhaps you have changed geometry.\n";
|
||||
msg << "The gun will be place at the center.";
|
||||
G4Exception("PrimaryGeneratorAction::GeneratePrimaries()",
|
||||
"MyCode0002",JustWarning,msg);
|
||||
G4Exception("PrimaryGeneratorAction::GeneratePrimaries()", "MyCode0002", JustWarning, msg);
|
||||
}
|
||||
|
||||
G4double size = 0.8;
|
||||
G4double x0 = size * envSizeXY * (G4UniformRand()-0.5);
|
||||
G4double y0 = size * envSizeXY * (G4UniformRand()-0.5);
|
||||
G4double x0 = size * envSizeXY * (G4UniformRand() - 0.5);
|
||||
G4double y0 = size * envSizeXY * (G4UniformRand() - 0.5);
|
||||
G4double z0 = -0.5 * envSizeZ;
|
||||
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(x0, y0, z0));
|
||||
|
||||
fParticleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
|
||||
|
||||
} // namespace B1
|
||||
|
||||
@@ -28,16 +28,17 @@
|
||||
/// \brief Implementation of the B1::RunAction class
|
||||
|
||||
#include "RunAction.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4Run.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "G4AccumulableManager.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4Run.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
namespace B1Con
|
||||
{
|
||||
@@ -48,15 +49,15 @@ RunAction::RunAction()
|
||||
{
|
||||
// add new units for dose
|
||||
//
|
||||
const G4double milligray = 1.e-3*gray;
|
||||
const G4double microgray = 1.e-6*gray;
|
||||
const G4double nanogray = 1.e-9*gray;
|
||||
const G4double picogray = 1.e-12*gray;
|
||||
const G4double milligray = 1.e-3 * gray;
|
||||
const G4double microgray = 1.e-6 * gray;
|
||||
const G4double nanogray = 1.e-9 * gray;
|
||||
const G4double picogray = 1.e-12 * gray;
|
||||
|
||||
new G4UnitDefinition("milligray", "milliGy" , "Dose", milligray);
|
||||
new G4UnitDefinition("microgray", "microGy" , "Dose", microgray);
|
||||
new G4UnitDefinition("nanogray" , "nanoGy" , "Dose", nanogray);
|
||||
new G4UnitDefinition("picogray" , "picoGy" , "Dose", picogray);
|
||||
new G4UnitDefinition("milligray", "milliGy", "Dose", milligray);
|
||||
new G4UnitDefinition("microgray", "microGy", "Dose", microgray);
|
||||
new G4UnitDefinition("nanogray", "nanoGy", "Dose", nanogray);
|
||||
new G4UnitDefinition("picogray", "picoGy", "Dose", picogray);
|
||||
|
||||
// Register accumulable to the accumulable manager
|
||||
G4AccumulableManager* accumulableManager = G4AccumulableManager::Instance();
|
||||
@@ -77,8 +78,8 @@ void RunAction::BeginOfRunAction(const G4Run*)
|
||||
accumulableManager->Reset();
|
||||
|
||||
if (IsMaster()) {
|
||||
fDoseTally = new G4ConvergenceTester("DOSE_TALLY");
|
||||
//fDoseTally = new G4ConvergenceTester();
|
||||
fDoseTally = new G4ConvergenceTester("DOSE_TALLY");
|
||||
// fDoseTally = new G4ConvergenceTester();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,17 +96,20 @@ void RunAction::EndOfRunAction(const G4Run* run)
|
||||
|
||||
// Compute dose = total energy deposit in a run and its variance
|
||||
//
|
||||
G4double edep = fEdep.GetValue();
|
||||
G4double edep = fEdep.GetValue();
|
||||
G4double edep2 = fEdep2.GetValue();
|
||||
|
||||
G4double rms = edep2 - edep*edep/nofEvents;
|
||||
if (rms > 0.) rms = std::sqrt(rms); else rms = 0.;
|
||||
G4double rms = edep2 - edep * edep / nofEvents;
|
||||
if (rms > 0.)
|
||||
rms = std::sqrt(rms);
|
||||
else
|
||||
rms = 0.;
|
||||
|
||||
const auto detConstruction = static_cast<const B1::DetectorConstruction*>(
|
||||
G4RunManager::GetRunManager()->GetUserDetectorConstruction());
|
||||
G4double mass = detConstruction->GetScoringVolume()->GetMass();
|
||||
G4double dose = edep/mass;
|
||||
G4double rmsDose = rms/mass;
|
||||
G4double dose = edep / mass;
|
||||
G4double rmsDose = rms / mass;
|
||||
|
||||
// Run conditions
|
||||
// note: There is no primary generator action object for "master"
|
||||
@@ -113,59 +117,48 @@ void RunAction::EndOfRunAction(const G4Run* run)
|
||||
const auto generatorAction = static_cast<const B1::PrimaryGeneratorAction*>(
|
||||
G4RunManager::GetRunManager()->GetUserPrimaryGeneratorAction());
|
||||
G4String runCondition;
|
||||
if (generatorAction)
|
||||
{
|
||||
if (generatorAction) {
|
||||
const G4ParticleGun* particleGun = generatorAction->GetParticleGun();
|
||||
runCondition += particleGun->GetParticleDefinition()->GetParticleName();
|
||||
runCondition += " of ";
|
||||
G4double particleEnergy = particleGun->GetParticleEnergy();
|
||||
runCondition += G4BestUnit(particleEnergy,"Energy");
|
||||
runCondition += G4BestUnit(particleEnergy, "Energy");
|
||||
}
|
||||
|
||||
// Print
|
||||
//
|
||||
if (IsMaster()) {
|
||||
for (auto edepPerEvent : fEdepPerEvent.GetVector()) {
|
||||
G4double dosePerEvent = edepPerEvent/mass/gray;
|
||||
fDoseTally->AddScore(dosePerEvent);
|
||||
}
|
||||
for (auto edepPerEvent : fEdepPerEvent.GetVector()) {
|
||||
G4double dosePerEvent = edepPerEvent / mass / gray;
|
||||
fDoseTally->AddScore(dosePerEvent);
|
||||
}
|
||||
|
||||
fDoseTally->ShowResult();
|
||||
fDoseTally->ShowHistory();
|
||||
delete fDoseTally;
|
||||
fDoseTally = nullptr;
|
||||
fDoseTally->ShowResult();
|
||||
fDoseTally->ShowHistory();
|
||||
delete fDoseTally;
|
||||
fDoseTally = nullptr;
|
||||
|
||||
G4cout
|
||||
<< G4endl
|
||||
<< "--------------------End of Global Run-----------------------";
|
||||
G4cout << G4endl << "--------------------End of Global Run-----------------------";
|
||||
}
|
||||
else {
|
||||
G4cout
|
||||
<< G4endl
|
||||
<< "--------------------End of Local Run------------------------";
|
||||
G4cout << G4endl << "--------------------End of Local Run------------------------";
|
||||
}
|
||||
|
||||
G4cout
|
||||
<< G4endl
|
||||
<< " The run consists of " << nofEvents << " "<< runCondition
|
||||
<< G4endl
|
||||
<< " Cumulated dose per run, in scoring volume : "
|
||||
<< G4BestUnit(dose,"Dose") << " rms = " << G4BestUnit(rmsDose,"Dose")
|
||||
<< G4endl
|
||||
<< "------------------------------------------------------------"
|
||||
<< G4endl
|
||||
<< G4endl;
|
||||
G4cout << G4endl << " The run consists of " << nofEvents << " " << runCondition << G4endl
|
||||
<< " Cumulated dose per run, in scoring volume : " << G4BestUnit(dose, "Dose")
|
||||
<< " rms = " << G4BestUnit(rmsDose, "Dose") << G4endl
|
||||
<< "------------------------------------------------------------" << G4endl << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void RunAction::AddEdep(G4double edep)
|
||||
{
|
||||
fEdep += edep;
|
||||
fEdep2 += edep*edep;
|
||||
fEdep += edep;
|
||||
fEdep2 += edep * edep;
|
||||
fEdepPerEvent.AddValue(edep);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
} // namespace B1Con
|
||||
|
||||
@@ -28,22 +28,21 @@
|
||||
/// \brief Implementation of the B1::SteppingAction class
|
||||
|
||||
#include "SteppingAction.hh"
|
||||
#include "EventAction.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
#include "G4Step.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "EventAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4Step.hh"
|
||||
|
||||
namespace B1
|
||||
{
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
SteppingAction::SteppingAction(EventAction* eventAction)
|
||||
: fEventAction(eventAction)
|
||||
{}
|
||||
SteppingAction::SteppingAction(EventAction* eventAction) : fEventAction(eventAction) {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -56,9 +55,8 @@ void SteppingAction::UserSteppingAction(const G4Step* step)
|
||||
}
|
||||
|
||||
// get volume of the current step
|
||||
G4LogicalVolume* volume
|
||||
= step->GetPreStepPoint()->GetTouchableHandle()
|
||||
->GetVolume()->GetLogicalVolume();
|
||||
G4LogicalVolume* volume =
|
||||
step->GetPreStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume();
|
||||
|
||||
// check if we are in scoring volume
|
||||
if (volume != fScoringVolume) return;
|
||||
@@ -70,4 +68,4 @@ void SteppingAction::UserSteppingAction(const G4Step* step)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
} // namespace B1
|
||||
|
||||
Reference in New Issue
Block a user