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
|
||||
@@ -78,14 +78,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...
|
||||
|
||||
@@ -290,7 +297,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
|
||||
|
||||
@@ -845,7 +852,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
|
||||
@@ -866,20 +873,20 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
|
||||
--------------------End of Run------------------------------
|
||||
|
||||
mean Energy in Absorber : 281.112 MeV +- 0 eV
|
||||
mean Energy in Gap : 74.1401 MeV +- 0 eV
|
||||
mean Energy in Absorber : 245.231 MeV +- 0 eV
|
||||
mean Energy in Gap : 64.6941 MeV +- 0 eV
|
||||
|
||||
mean trackLength in Absorber : 69.2721 cm +- 0 fm
|
||||
mean trackLength in Gap : 37.7451 cm +- 0 fm
|
||||
mean trackLength in Absorber : 60.8807 cm +- 0 fm
|
||||
mean trackLength in Gap : 32.6255 cm +- 0 fm
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 281.112 MeV rms = 0 eV
|
||||
EGap: mean = 74.1401 MeV rms = 0 eV
|
||||
LAbs: mean = 69.2721 cm rms = 0 fm
|
||||
LGap: mean = 37.7451 cm rms = 0 fm
|
||||
EAbs: mean = 245.231 MeV rms = 0 eV
|
||||
EGap: mean = 64.6941 MeV rms = 0 eV
|
||||
LAbs: mean = 60.8807 cm rms = 0 fm
|
||||
LGap: mean = 32.6255 cm rms = 0 fm
|
||||
... create file : ./histo/AnaEx01_h1_EAbs.csv - done
|
||||
... create file : ./histo/AnaEx01_h1_EGap.csv - done
|
||||
... create file : ./histo/AnaEx01_h1_LAbs.csv - done
|
||||
@@ -939,20 +946,20 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
--------------------End of Run------------------------------
|
||||
|
||||
mean Energy in Absorber : 190.633 MeV +- 48.8718 MeV
|
||||
mean Energy in Gap : 46.5146 MeV +- 13.3975 MeV
|
||||
mean Energy in Absorber : 186.264 MeV +- 50.8208 MeV
|
||||
mean Energy in Gap : 45.8735 MeV +- 13.843 MeV
|
||||
|
||||
mean trackLength in Absorber : 47.0418 cm +- 12.1398 cm
|
||||
mean trackLength in Gap : 23.5952 cm +- 6.83896 cm
|
||||
mean trackLength in Absorber : 46.0323 cm +- 12.6521 cm
|
||||
mean trackLength in Gap : 23.2729 cm +- 7.04724 cm
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 190.633 MeV rms = 48.8718 MeV
|
||||
EGap: mean = 46.5146 MeV rms = 13.3975 MeV
|
||||
LAbs: mean = 47.0418 cm rms = 12.1398 cm
|
||||
LGap: mean = 23.5952 cm rms = 6.83896 cm
|
||||
EAbs: mean = 186.264 MeV rms = 50.8208 MeV
|
||||
EGap: mean = 45.8735 MeV rms = 13.843 MeV
|
||||
LAbs: mean = 46.0323 cm rms = 12.6521 cm
|
||||
LGap: mean = 23.246 cm rms = 6.99942 cm
|
||||
... create file : ./histo/AnaEx01_h1_EAbs.csv - done
|
||||
... create file : ./histo/AnaEx01_h1_EGap.csv - done
|
||||
... create file : ./histo/AnaEx01_h1_LAbs.csv - done
|
||||
|
||||
@@ -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
|
||||
@@ -78,14 +78,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...
|
||||
|
||||
@@ -290,7 +297,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
|
||||
|
||||
@@ -845,7 +852,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
|
||||
@@ -865,20 +872,20 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
|
||||
--------------------End of Run------------------------------
|
||||
|
||||
mean Energy in Absorber : 281.112 MeV +- 0 eV
|
||||
mean Energy in Gap : 74.1401 MeV +- 0 eV
|
||||
mean Energy in Absorber : 245.231 MeV +- 0 eV
|
||||
mean Energy in Gap : 64.6941 MeV +- 0 eV
|
||||
|
||||
mean trackLength in Absorber : 69.2721 cm +- 0 fm
|
||||
mean trackLength in Gap : 37.7451 cm +- 0 fm
|
||||
mean trackLength in Absorber : 60.8807 cm +- 0 fm
|
||||
mean trackLength in Gap : 32.6255 cm +- 0 fm
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 281.112 MeV rms = 0 eV
|
||||
EGap: mean = 74.1401 MeV rms = 0 eV
|
||||
LAbs: mean = 69.2721 cm rms = 0 fm
|
||||
LGap: mean = 37.7451 cm rms = 0 fm
|
||||
EAbs: mean = 245.231 MeV rms = 0 eV
|
||||
EGap: mean = 64.6941 MeV rms = 0 eV
|
||||
LAbs: mean = 60.8807 cm rms = 0 fm
|
||||
LGap: mean = 32.6255 cm rms = 0 fm
|
||||
... write file : AnaEx01.hdf5 - done
|
||||
... close file : AnaEx01.hdf5 - done
|
||||
|
||||
@@ -923,20 +930,20 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
--------------------End of Run------------------------------
|
||||
|
||||
mean Energy in Absorber : 190.633 MeV +- 48.8718 MeV
|
||||
mean Energy in Gap : 46.5146 MeV +- 13.3975 MeV
|
||||
mean Energy in Absorber : 186.264 MeV +- 50.8208 MeV
|
||||
mean Energy in Gap : 45.8735 MeV +- 13.843 MeV
|
||||
|
||||
mean trackLength in Absorber : 47.0418 cm +- 12.1398 cm
|
||||
mean trackLength in Gap : 23.5952 cm +- 6.83896 cm
|
||||
mean trackLength in Absorber : 46.0323 cm +- 12.6521 cm
|
||||
mean trackLength in Gap : 23.2729 cm +- 7.04724 cm
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 190.633 MeV rms = 48.8718 MeV
|
||||
EGap: mean = 46.5146 MeV rms = 13.3975 MeV
|
||||
LAbs: mean = 47.0418 cm rms = 12.1398 cm
|
||||
LGap: mean = 23.5952 cm rms = 6.83896 cm
|
||||
EAbs: mean = 186.264 MeV rms = 50.8208 MeV
|
||||
EGap: mean = 45.8735 MeV rms = 13.843 MeV
|
||||
LAbs: mean = 46.0323 cm rms = 12.6521 cm
|
||||
LGap: mean = 23.246 cm rms = 6.99942 cm
|
||||
... write file : AnaEx01.hdf5 - done
|
||||
... close file : AnaEx01.hdf5 - done
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -78,14 +78,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...
|
||||
|
||||
@@ -290,7 +297,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
|
||||
|
||||
@@ -845,7 +852,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
|
||||
@@ -867,20 +874,20 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
|
||||
--------------------End of Run------------------------------
|
||||
|
||||
mean Energy in Absorber : 281.112 MeV +- 0 eV
|
||||
mean Energy in Gap : 74.1401 MeV +- 0 eV
|
||||
mean Energy in Absorber : 245.231 MeV +- 0 eV
|
||||
mean Energy in Gap : 64.6941 MeV +- 0 eV
|
||||
|
||||
mean trackLength in Absorber : 69.2721 cm +- 0 fm
|
||||
mean trackLength in Gap : 37.7451 cm +- 0 fm
|
||||
mean trackLength in Absorber : 60.8807 cm +- 0 fm
|
||||
mean trackLength in Gap : 32.6255 cm +- 0 fm
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 281.112 MeV rms = 0 eV
|
||||
EGap: mean = 74.1401 MeV rms = 0 eV
|
||||
LAbs: mean = 69.2721 cm rms = 0 fm
|
||||
LGap: mean = 37.7451 cm rms = 0 fm
|
||||
EAbs: mean = 245.231 MeV rms = 0 eV
|
||||
EGap: mean = 64.6941 MeV rms = 0 eV
|
||||
LAbs: mean = 60.8807 cm rms = 0 fm
|
||||
LGap: mean = 32.6255 cm rms = 0 fm
|
||||
... write file : AnaEx01.root - done
|
||||
... close file : AnaEx01.root - done
|
||||
|
||||
@@ -926,20 +933,20 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
--------------------End of Run------------------------------
|
||||
|
||||
mean Energy in Absorber : 190.633 MeV +- 48.8718 MeV
|
||||
mean Energy in Gap : 46.5146 MeV +- 13.3975 MeV
|
||||
mean Energy in Absorber : 186.264 MeV +- 50.8208 MeV
|
||||
mean Energy in Gap : 45.8735 MeV +- 13.843 MeV
|
||||
|
||||
mean trackLength in Absorber : 47.0418 cm +- 12.1398 cm
|
||||
mean trackLength in Gap : 23.5952 cm +- 6.83896 cm
|
||||
mean trackLength in Absorber : 46.0323 cm +- 12.6521 cm
|
||||
mean trackLength in Gap : 23.2729 cm +- 7.04724 cm
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 190.633 MeV rms = 48.8718 MeV
|
||||
EGap: mean = 46.5146 MeV rms = 13.3975 MeV
|
||||
LAbs: mean = 47.0418 cm rms = 12.1398 cm
|
||||
LGap: mean = 23.5952 cm rms = 6.83896 cm
|
||||
EAbs: mean = 186.264 MeV rms = 50.8208 MeV
|
||||
EGap: mean = 45.8735 MeV rms = 13.843 MeV
|
||||
LAbs: mean = 46.0323 cm rms = 12.6521 cm
|
||||
LGap: mean = 23.246 cm rms = 6.99942 cm
|
||||
... write file : AnaEx01.root - done
|
||||
... close file : AnaEx01.root - done
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -78,14 +78,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...
|
||||
|
||||
@@ -290,7 +297,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
|
||||
|
||||
@@ -845,7 +852,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
|
||||
@@ -867,20 +874,20 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
|
||||
--------------------End of Run------------------------------
|
||||
|
||||
mean Energy in Absorber : 281.112 MeV +- 0 eV
|
||||
mean Energy in Gap : 74.1401 MeV +- 0 eV
|
||||
mean Energy in Absorber : 245.231 MeV +- 0 eV
|
||||
mean Energy in Gap : 64.6941 MeV +- 0 eV
|
||||
|
||||
mean trackLength in Absorber : 69.2721 cm +- 0 fm
|
||||
mean trackLength in Gap : 37.7451 cm +- 0 fm
|
||||
mean trackLength in Absorber : 60.8807 cm +- 0 fm
|
||||
mean trackLength in Gap : 32.6255 cm +- 0 fm
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 281.112 MeV rms = 0 eV
|
||||
EGap: mean = 74.1401 MeV rms = 0 eV
|
||||
LAbs: mean = 69.2721 cm rms = 0 fm
|
||||
LGap: mean = 37.7451 cm rms = 0 fm
|
||||
EAbs: mean = 245.231 MeV rms = 0 eV
|
||||
EGap: mean = 64.6941 MeV rms = 0 eV
|
||||
LAbs: mean = 60.8807 cm rms = 0 fm
|
||||
LGap: mean = 32.6255 cm rms = 0 fm
|
||||
... write file : AnaEx01.xml - done
|
||||
... write file : AnaEx01_nt_Ntuple1.xml - done
|
||||
... write file : AnaEx01_nt_Ntuple2.xml - done
|
||||
@@ -931,20 +938,20 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
--------------------End of Run------------------------------
|
||||
|
||||
mean Energy in Absorber : 190.633 MeV +- 48.8718 MeV
|
||||
mean Energy in Gap : 46.5146 MeV +- 13.3975 MeV
|
||||
mean Energy in Absorber : 186.264 MeV +- 50.8208 MeV
|
||||
mean Energy in Gap : 45.8735 MeV +- 13.843 MeV
|
||||
|
||||
mean trackLength in Absorber : 47.0418 cm +- 12.1398 cm
|
||||
mean trackLength in Gap : 23.5952 cm +- 6.83896 cm
|
||||
mean trackLength in Absorber : 46.0323 cm +- 12.6521 cm
|
||||
mean trackLength in Gap : 23.2729 cm +- 7.04724 cm
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 190.633 MeV rms = 48.8718 MeV
|
||||
EGap: mean = 46.5146 MeV rms = 13.3975 MeV
|
||||
LAbs: mean = 47.0418 cm rms = 12.1398 cm
|
||||
LGap: mean = 23.5952 cm rms = 6.83896 cm
|
||||
EAbs: mean = 186.264 MeV rms = 50.8208 MeV
|
||||
EGap: mean = 45.8735 MeV rms = 13.843 MeV
|
||||
LAbs: mean = 46.0323 cm rms = 12.6521 cm
|
||||
LGap: mean = 23.246 cm rms = 6.99942 cm
|
||||
... write file : AnaEx01.xml - done
|
||||
... write file : AnaEx01_nt_Ntuple1.xml - done
|
||||
... write file : AnaEx01_nt_Ntuple2.xml - done
|
||||
|
||||
@@ -32,25 +32,23 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "ActionInitialization.hh"
|
||||
|
||||
#include "G4RunManagerFactory.hh"
|
||||
|
||||
#include "G4UImanager.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "FTFP_BERT.hh"
|
||||
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "G4RunManagerFactory.hh"
|
||||
#include "G4UIExecutive.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VisExecutive.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
int main(int argc,char** argv)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
// Detect interactive mode (if no arguments) and define UI session
|
||||
//
|
||||
G4UIExecutive* ui = nullptr;
|
||||
if ( argc == 1 ) {
|
||||
if (argc == 1) {
|
||||
ui = new G4UIExecutive(argc, argv);
|
||||
}
|
||||
|
||||
@@ -62,7 +60,7 @@ int main(int argc,char** argv)
|
||||
|
||||
// Set mandatory initialization classes
|
||||
//
|
||||
auto detector = new DetectorConstruction;
|
||||
auto detector = new DetectorConstruction;
|
||||
runManager->SetUserInitialization(detector);
|
||||
runManager->SetUserInitialization(new FTFP_BERT);
|
||||
runManager->SetUserInitialization(new ActionInitialization(detector));
|
||||
@@ -76,13 +74,13 @@ int main(int argc,char** argv)
|
||||
//
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
|
||||
if ( ui == nullptr ) {
|
||||
if (ui == nullptr) {
|
||||
// batch mode
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand("/control/alias defaultFileType root");
|
||||
// define the default value for alias used in AnaEx01.in
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
// define the default value for alias used in AnaEx01.in
|
||||
UImanager->ApplyCommand(command + fileName);
|
||||
}
|
||||
else {
|
||||
// interactive mode
|
||||
|
||||
@@ -43,7 +43,7 @@ class HistoManager
|
||||
{
|
||||
public:
|
||||
HistoManager();
|
||||
~HistoManager() = default;
|
||||
~HistoManager() = default;
|
||||
|
||||
void Book();
|
||||
void Save();
|
||||
@@ -51,8 +51,7 @@ class HistoManager
|
||||
void FillHisto(G4int id, G4double e, G4double weight = 1.0);
|
||||
void Normalize(G4int id, G4double fac);
|
||||
|
||||
void FillNtuple(G4double EnergyAbs, G4double EnergyGap,
|
||||
G4double TrackLAbs, G4double TrackLGap);
|
||||
void FillNtuple(G4double EnergyAbs, G4double EnergyGap, G4double TrackLAbs, G4double TrackLGap);
|
||||
|
||||
void PrintStatistic();
|
||||
|
||||
@@ -63,4 +62,3 @@ class HistoManager
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -51,5 +51,3 @@ class ActionInitialization : public G4VUserActionInitialization
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
#ifndef DetectorConstruction_h
|
||||
#define DetectorConstruction_h 1
|
||||
|
||||
#include "CLHEP/Units/SystemOfUnits.h"
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include "CLHEP/Units/SystemOfUnits.h"
|
||||
|
||||
class G4Box;
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
@@ -48,41 +48,40 @@ class DetectorMessenger;
|
||||
class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
|
||||
DetectorConstruction();
|
||||
~DetectorConstruction() override;
|
||||
DetectorConstruction();
|
||||
~DetectorConstruction() override;
|
||||
|
||||
public:
|
||||
G4VPhysicalVolume* Construct() override;
|
||||
|
||||
void SetAbsorberMaterial (const G4String&);
|
||||
void SetAbsorberMaterial(const G4String&);
|
||||
void SetAbsorberThickness(G4double);
|
||||
|
||||
void SetGapMaterial (const G4String&);
|
||||
void SetGapMaterial(const G4String&);
|
||||
void SetGapThickness(G4double);
|
||||
|
||||
void SetCalorSizeYZ(G4double);
|
||||
void SetNbOfLayers (G4int);
|
||||
void SetNbOfLayers(G4int);
|
||||
|
||||
void PrintCalorParameters();
|
||||
|
||||
G4double GetWorldSizeX() { return fWorldSizeX; }
|
||||
G4double GetWorldSizeX() { return fWorldSizeX; }
|
||||
G4double GetWorldSizeYZ() { return fWorldSizeYZ; }
|
||||
|
||||
G4double GetCalorThickness() { return fCalorThickness; }
|
||||
G4double GetCalorSizeYZ() { return fCalorSizeYZ; }
|
||||
G4double GetCalorSizeYZ() { return fCalorSizeYZ; }
|
||||
|
||||
G4int GetNbOfLayers() { return fNbOfLayers; }
|
||||
|
||||
G4Material* GetAbsorberMaterial() { return fAbsorberMaterial; }
|
||||
G4double GetAbsorberThickness() { return fAbsorberThickness; }
|
||||
G4Material* GetAbsorberMaterial() { return fAbsorberMaterial; }
|
||||
G4double GetAbsorberThickness() { return fAbsorberThickness; }
|
||||
|
||||
G4Material* GetGapMaterial() { return fGapMaterial; }
|
||||
G4double GetGapThickness() { return fGapThickness; }
|
||||
G4Material* GetGapMaterial() { return fGapMaterial; }
|
||||
G4double GetGapThickness() { return fGapThickness; }
|
||||
|
||||
const G4VPhysicalVolume* GetphysiWorld() { return fPhysiWorld; }
|
||||
const G4VPhysicalVolume* GetAbsorber() { return fPhysiAbsorber; }
|
||||
const G4VPhysicalVolume* GetGap() { return fPhysiGap; }
|
||||
const G4VPhysicalVolume* GetAbsorber() { return fPhysiAbsorber; }
|
||||
const G4VPhysicalVolume* GetGap() { return fPhysiGap; }
|
||||
|
||||
private:
|
||||
void DefineMaterials();
|
||||
@@ -93,37 +92,37 @@ class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
G4Material* fGapMaterial = nullptr;
|
||||
G4Material* fDefaultMaterial = nullptr;
|
||||
|
||||
G4int fNbOfLayers = 10;
|
||||
G4double fAbsorberThickness = 10.*CLHEP::mm;
|
||||
G4double fGapThickness = 5.*CLHEP::mm;
|
||||
G4double fCalorSizeYZ = 10.*CLHEP::cm;
|
||||
G4int fNbOfLayers = 10;
|
||||
G4double fAbsorberThickness = 10. * CLHEP::mm;
|
||||
G4double fGapThickness = 5. * CLHEP::mm;
|
||||
G4double fCalorSizeYZ = 10. * CLHEP::cm;
|
||||
|
||||
G4double fCalorThickness = 0.; // will be computed
|
||||
G4double fLayerThickness= 0.; // will be computed
|
||||
G4double fWorldSizeYZ = 0.; // will be computed;
|
||||
G4double fWorldSizeX = 0.; // will be computed;
|
||||
G4double fCalorThickness = 0.; // will be computed
|
||||
G4double fLayerThickness = 0.; // will be computed
|
||||
G4double fWorldSizeYZ = 0.; // will be computed;
|
||||
G4double fWorldSizeX = 0.; // will be computed;
|
||||
|
||||
G4Box* fSolidWorld = nullptr; //pointer to the solid World
|
||||
G4LogicalVolume* fLogicWorld = nullptr; //pointer to the logical World
|
||||
G4VPhysicalVolume* fPhysiWorld = nullptr; //pointer to the physical World
|
||||
G4Box* fSolidWorld = nullptr; // pointer to the solid World
|
||||
G4LogicalVolume* fLogicWorld = nullptr; // pointer to the logical World
|
||||
G4VPhysicalVolume* fPhysiWorld = nullptr; // pointer to the physical World
|
||||
|
||||
G4Box* fSolidCalor = nullptr; //pointer to the solid Calor
|
||||
G4LogicalVolume* fLogicCalor = nullptr; //pointer to the logical Calor
|
||||
G4VPhysicalVolume* fPhysiCalor = nullptr; //pointer to the physical Calor
|
||||
G4Box* fSolidCalor = nullptr; // pointer to the solid Calor
|
||||
G4LogicalVolume* fLogicCalor = nullptr; // pointer to the logical Calor
|
||||
G4VPhysicalVolume* fPhysiCalor = nullptr; // pointer to the physical Calor
|
||||
|
||||
G4Box* fSolidLayer = nullptr; //pointer to the solid Layer
|
||||
G4LogicalVolume* fLogicLayer = nullptr; //pointer to the logical Layer
|
||||
G4VPhysicalVolume* fPhysiLayer = nullptr; //pointer to the physical Layer
|
||||
G4Box* fSolidLayer = nullptr; // pointer to the solid Layer
|
||||
G4LogicalVolume* fLogicLayer = nullptr; // pointer to the logical Layer
|
||||
G4VPhysicalVolume* fPhysiLayer = nullptr; // pointer to the physical Layer
|
||||
|
||||
G4Box* fSolidAbsorber = nullptr; //pointer to the solid Absorber
|
||||
G4LogicalVolume* fLogicAbsorber = nullptr; //pointer to the logical Absorber
|
||||
G4VPhysicalVolume* fPhysiAbsorber = nullptr; //pointer to the physical Absorber
|
||||
G4Box* fSolidAbsorber = nullptr; // pointer to the solid Absorber
|
||||
G4LogicalVolume* fLogicAbsorber = nullptr; // pointer to the logical Absorber
|
||||
G4VPhysicalVolume* fPhysiAbsorber = nullptr; // pointer to the physical Absorber
|
||||
|
||||
G4Box* fSolidGap = nullptr; //pointer to the solid Gap
|
||||
G4LogicalVolume* fLogicGap = nullptr; //pointer to the logical Gap
|
||||
G4VPhysicalVolume* fPhysiGap = nullptr; //pointer to the physical Gap
|
||||
G4Box* fSolidGap = nullptr; // pointer to the solid Gap
|
||||
G4LogicalVolume* fLogicGap = nullptr; // pointer to the logical Gap
|
||||
G4VPhysicalVolume* fPhysiGap = nullptr; // pointer to the physical Gap
|
||||
|
||||
DetectorMessenger* fDetectorMessenger = nullptr; //pointer to the Messenger
|
||||
DetectorMessenger* fDetectorMessenger = nullptr; // pointer to the Messenger
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -131,13 +130,13 @@ class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
inline void DetectorConstruction::ComputeCalorParameters()
|
||||
{
|
||||
// Compute derived parameters of the calorimeter
|
||||
fLayerThickness = fAbsorberThickness + fGapThickness;
|
||||
fCalorThickness = fNbOfLayers*fLayerThickness;
|
||||
fLayerThickness = fAbsorberThickness + fGapThickness;
|
||||
fCalorThickness = fNbOfLayers * fLayerThickness;
|
||||
|
||||
fWorldSizeX = 1.2*fCalorThickness; fWorldSizeYZ = 1.2*fCalorSizeYZ;
|
||||
fWorldSizeX = 1.2 * fCalorThickness;
|
||||
fWorldSizeYZ = 1.2 * fCalorSizeYZ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
#ifndef DetectorMessenger_h
|
||||
#define DetectorMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class DetectorConstruction;
|
||||
class G4UIdirectory;
|
||||
@@ -43,10 +43,10 @@ class G4UIcmdWithADoubleAndUnit;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class DetectorMessenger: public G4UImessenger
|
||||
class DetectorMessenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
DetectorMessenger(DetectorConstruction* );
|
||||
DetectorMessenger(DetectorConstruction*);
|
||||
~DetectorMessenger() override;
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String) override;
|
||||
@@ -54,13 +54,13 @@ class DetectorMessenger: public G4UImessenger
|
||||
private:
|
||||
DetectorConstruction* fDetector = nullptr;
|
||||
|
||||
G4UIdirectory* fDetDir = nullptr;
|
||||
G4UIcmdWithAString* fAbsMaterCmd = nullptr;
|
||||
G4UIcmdWithAString* fGapMaterCmd = nullptr;
|
||||
G4UIdirectory* fDetDir = nullptr;
|
||||
G4UIcmdWithAString* fAbsMaterCmd = nullptr;
|
||||
G4UIcmdWithAString* fGapMaterCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fAbsThickCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fGapThickCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSizeYZCmd = nullptr;
|
||||
G4UIcmdWithAnInteger* fNbLayersCmd = nullptr;
|
||||
G4UIcmdWithAnInteger* fNbLayersCmd = nullptr;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -46,30 +46,36 @@ class HistoManager;
|
||||
|
||||
class EventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
EventAction(RunAction*, HistoManager*);
|
||||
~EventAction() override;
|
||||
public:
|
||||
EventAction(RunAction*, HistoManager*);
|
||||
~EventAction() override;
|
||||
|
||||
void BeginOfEventAction(const G4Event*) override;
|
||||
void EndOfEventAction(const G4Event*) override;
|
||||
void BeginOfEventAction(const G4Event*) override;
|
||||
void EndOfEventAction(const G4Event*) override;
|
||||
|
||||
void AddAbs(G4double de, G4double dl) {fEnergyAbs += de; fTrackLAbs += dl;};
|
||||
void AddGap(G4double de, G4double dl) {fEnergyGap += de; fTrackLGap += dl;};
|
||||
void AddAbs(G4double de, G4double dl)
|
||||
{
|
||||
fEnergyAbs += de;
|
||||
fTrackLAbs += dl;
|
||||
};
|
||||
void AddGap(G4double de, G4double dl)
|
||||
{
|
||||
fEnergyGap += de;
|
||||
fTrackLGap += dl;
|
||||
};
|
||||
|
||||
private:
|
||||
RunAction* fRunAct = nullptr;
|
||||
HistoManager* fHistoManager = nullptr;
|
||||
private:
|
||||
RunAction* fRunAct = nullptr;
|
||||
HistoManager* fHistoManager = nullptr;
|
||||
|
||||
G4double fEnergyAbs = 0.;
|
||||
G4double fEnergyGap = 0;
|
||||
G4double fTrackLAbs = 0;
|
||||
G4double fTrackLGap = 0;
|
||||
G4double fEnergyAbs = 0.;
|
||||
G4double fEnergyGap = 0;
|
||||
G4double fTrackLAbs = 0;
|
||||
G4double fTrackLGap = 0;
|
||||
|
||||
G4int fPrintModulo = 100;
|
||||
G4int fPrintModulo = 100;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -43,19 +43,17 @@ class DetectorConstruction;
|
||||
|
||||
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
PrimaryGeneratorAction(DetectorConstruction*);
|
||||
~PrimaryGeneratorAction() override;
|
||||
public:
|
||||
PrimaryGeneratorAction(DetectorConstruction*);
|
||||
~PrimaryGeneratorAction() override;
|
||||
|
||||
void GeneratePrimaries(G4Event*) override;
|
||||
void GeneratePrimaries(G4Event*) override;
|
||||
|
||||
private:
|
||||
G4ParticleGun* fParticleGun = nullptr; //pointer a to G4 class
|
||||
DetectorConstruction* fDetector = nullptr; //pointer to the geometry
|
||||
private:
|
||||
G4ParticleGun* fParticleGun = nullptr; // pointer a to G4 class
|
||||
DetectorConstruction* fDetector = nullptr; // pointer to the geometry
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
#ifndef RunAction_h
|
||||
#define RunAction_h 1
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "G4Accumulable.hh"
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -47,30 +47,29 @@ class HistoManager;
|
||||
|
||||
class RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
RunAction(HistoManager*);
|
||||
~RunAction() override;
|
||||
public:
|
||||
RunAction(HistoManager*);
|
||||
~RunAction() override;
|
||||
|
||||
void BeginOfRunAction(const G4Run*) override;
|
||||
void EndOfRunAction(const G4Run*) override;
|
||||
void BeginOfRunAction(const G4Run*) override;
|
||||
void EndOfRunAction(const G4Run*) override;
|
||||
|
||||
void FillPerEvent(G4double, G4double, G4double, G4double);
|
||||
void FillPerEvent(G4double, G4double, G4double, G4double);
|
||||
|
||||
private:
|
||||
HistoManager* fHistoManager = nullptr;
|
||||
private:
|
||||
HistoManager* fHistoManager = nullptr;
|
||||
|
||||
G4Accumulable<G4double> fSumEAbs = 0.;
|
||||
G4Accumulable<G4double> fSum2EAbs = 0.;
|
||||
G4Accumulable<G4double> fSumEGap = 0.;
|
||||
G4Accumulable<G4double> fSum2EGap = 0.;
|
||||
G4Accumulable<G4double> fSumEAbs = 0.;
|
||||
G4Accumulable<G4double> fSum2EAbs = 0.;
|
||||
G4Accumulable<G4double> fSumEGap = 0.;
|
||||
G4Accumulable<G4double> fSum2EGap = 0.;
|
||||
|
||||
G4Accumulable<G4double> fSumLAbs = 0.;
|
||||
G4Accumulable<G4double> fSum2LAbs = 0.;
|
||||
G4Accumulable<G4double> fSumLGap = 0.;
|
||||
G4Accumulable<G4double> fSum2LGap = 0.;
|
||||
G4Accumulable<G4double> fSumLAbs = 0.;
|
||||
G4Accumulable<G4double> fSum2LAbs = 0.;
|
||||
G4Accumulable<G4double> fSumLGap = 0.;
|
||||
G4Accumulable<G4double> fSum2LGap = 0.;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -41,15 +41,15 @@ class EventAction;
|
||||
|
||||
class SteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
SteppingAction(DetectorConstruction*, EventAction*);
|
||||
~SteppingAction() override;
|
||||
public:
|
||||
SteppingAction(DetectorConstruction*, EventAction*);
|
||||
~SteppingAction() override;
|
||||
|
||||
void UserSteppingAction(const G4Step*) override;
|
||||
void UserSteppingAction(const G4Step*) override;
|
||||
|
||||
private:
|
||||
DetectorConstruction* fDetector = nullptr;
|
||||
EventAction* fEventAction = nullptr;
|
||||
private:
|
||||
DetectorConstruction* fDetector = nullptr;
|
||||
EventAction* fEventAction = nullptr;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -28,17 +28,16 @@
|
||||
/// \brief Implementation of the ActionInitialization class
|
||||
|
||||
#include "ActionInitialization.hh"
|
||||
|
||||
#include "EventAction.hh"
|
||||
#include "HistoManager.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
#include "RunAction.hh"
|
||||
#include "EventAction.hh"
|
||||
#include "SteppingAction.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ActionInitialization::ActionInitialization(DetectorConstruction* detector)
|
||||
: fDetector(detector)
|
||||
{}
|
||||
ActionInitialization::ActionInitialization(DetectorConstruction* detector) : fDetector(detector) {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -49,7 +48,7 @@ ActionInitialization::~ActionInitialization() = default;
|
||||
void ActionInitialization::BuildForMaster() const
|
||||
{
|
||||
// Histo manager
|
||||
auto histo = new HistoManager();
|
||||
auto histo = new HistoManager();
|
||||
|
||||
// Actions
|
||||
SetUserAction(new RunAction(histo));
|
||||
@@ -60,19 +59,19 @@ void ActionInitialization::BuildForMaster() const
|
||||
void ActionInitialization::Build() const
|
||||
{
|
||||
// Histo manager
|
||||
auto histo = new HistoManager();
|
||||
auto histo = new HistoManager();
|
||||
|
||||
// Actions
|
||||
//
|
||||
SetUserAction(new PrimaryGeneratorAction(fDetector));
|
||||
|
||||
auto runAction = new RunAction(histo);
|
||||
auto runAction = new RunAction(histo);
|
||||
SetUserAction(runAction);
|
||||
|
||||
auto eventAction = new EventAction(runAction, histo);
|
||||
auto eventAction = new EventAction(runAction, histo);
|
||||
SetUserAction(eventAction);
|
||||
|
||||
auto steppingAction = new SteppingAction(fDetector, eventAction);
|
||||
auto steppingAction = new SteppingAction(fDetector, eventAction);
|
||||
SetUserAction(steppingAction);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,26 +30,24 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
#include "DetectorMessenger.hh"
|
||||
|
||||
#include "G4Box.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4GeometryManager.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4NistManager.hh"
|
||||
|
||||
#include "G4Box.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4PVReplica.hh"
|
||||
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4GeometryManager.hh"
|
||||
#include "G4PhysicalVolumeStore.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4SolidStore.hh"
|
||||
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4SolidStore.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -113,114 +111,118 @@ G4VPhysicalVolume* DetectorConstruction::ConstructCalorimeter()
|
||||
//
|
||||
// World
|
||||
//
|
||||
fSolidWorld = new G4Box("World", //its name
|
||||
fWorldSizeX/2,fWorldSizeYZ/2,fWorldSizeYZ/2); //its size
|
||||
fSolidWorld = new G4Box("World", // its name
|
||||
fWorldSizeX / 2, fWorldSizeYZ / 2, fWorldSizeYZ / 2); // its size
|
||||
|
||||
fLogicWorld = new G4LogicalVolume(fSolidWorld, //its solid
|
||||
fDefaultMaterial, //its material
|
||||
"World"); //its name
|
||||
fLogicWorld = new G4LogicalVolume(fSolidWorld, // its solid
|
||||
fDefaultMaterial, // its material
|
||||
"World"); // its name
|
||||
|
||||
fPhysiWorld = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
fLogicWorld, //its logical volume
|
||||
"World", //its name
|
||||
nullptr, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
fPhysiWorld = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
fLogicWorld, // its logical volume
|
||||
"World", // its name
|
||||
nullptr, // its mother volume
|
||||
false, // no boolean operation
|
||||
0); // copy number
|
||||
|
||||
//
|
||||
// Calorimeter
|
||||
//
|
||||
fSolidCalor = nullptr; fLogicCalor = nullptr; fPhysiCalor = nullptr;
|
||||
fSolidLayer = nullptr; fLogicLayer = nullptr; fPhysiLayer = nullptr;
|
||||
fSolidCalor = nullptr;
|
||||
fLogicCalor = nullptr;
|
||||
fPhysiCalor = nullptr;
|
||||
fSolidLayer = nullptr;
|
||||
fLogicLayer = nullptr;
|
||||
fPhysiLayer = nullptr;
|
||||
|
||||
if (fCalorThickness > 0.) {
|
||||
fSolidCalor = new G4Box("Calorimeter", //its name
|
||||
fCalorThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2); //size
|
||||
if (fCalorThickness > 0.) {
|
||||
fSolidCalor = new G4Box("Calorimeter", // its name
|
||||
fCalorThickness / 2, fCalorSizeYZ / 2, fCalorSizeYZ / 2); // size
|
||||
|
||||
fLogicCalor = new G4LogicalVolume(fSolidCalor, //its solid
|
||||
fDefaultMaterial, //its material
|
||||
"Calorimeter"); //its name
|
||||
fLogicCalor = new G4LogicalVolume(fSolidCalor, // its solid
|
||||
fDefaultMaterial, // its material
|
||||
"Calorimeter"); // its name
|
||||
|
||||
fPhysiCalor = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
fLogicCalor, //its logical volume
|
||||
"Calorimeter", //its name
|
||||
fLogicWorld, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
fPhysiCalor = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
fLogicCalor, // its logical volume
|
||||
"Calorimeter", // its name
|
||||
fLogicWorld, // its mother volume
|
||||
false, // no boolean operation
|
||||
0); // copy number
|
||||
|
||||
//
|
||||
// Layer
|
||||
//
|
||||
fSolidLayer = new G4Box("Layer", //its name
|
||||
fLayerThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2); //size
|
||||
fSolidLayer = new G4Box("Layer", // its name
|
||||
fLayerThickness / 2, fCalorSizeYZ / 2, fCalorSizeYZ / 2); // size
|
||||
|
||||
fLogicLayer = new G4LogicalVolume(fSolidLayer, //its solid
|
||||
fDefaultMaterial, //its material
|
||||
"Layer"); //its name
|
||||
fLogicLayer = new G4LogicalVolume(fSolidLayer, // its solid
|
||||
fDefaultMaterial, // its material
|
||||
"Layer"); // its name
|
||||
if (fNbOfLayers > 1) {
|
||||
fPhysiLayer = new G4PVReplica("Layer", //its name
|
||||
fLogicLayer, //its logical volume
|
||||
fLogicCalor, //its mother
|
||||
kXAxis, //axis of replication
|
||||
fNbOfLayers, //number of replica
|
||||
fLayerThickness); //witdth of replica
|
||||
fPhysiLayer = new G4PVReplica("Layer", // its name
|
||||
fLogicLayer, // its logical volume
|
||||
fLogicCalor, // its mother
|
||||
kXAxis, // axis of replication
|
||||
fNbOfLayers, // number of replica
|
||||
fLayerThickness); // witdth of replica
|
||||
}
|
||||
else {
|
||||
fPhysiLayer = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
fLogicLayer, //its logical volume
|
||||
"Layer", //its name
|
||||
fLogicCalor, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
fPhysiLayer = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
fLogicLayer, // its logical volume
|
||||
"Layer", // its name
|
||||
fLogicCalor, // its mother volume
|
||||
false, // no boolean operation
|
||||
0); // copy number
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Absorber
|
||||
//
|
||||
fSolidAbsorber = nullptr; fLogicAbsorber = nullptr; fPhysiAbsorber = nullptr;
|
||||
fSolidAbsorber = nullptr;
|
||||
fLogicAbsorber = nullptr;
|
||||
fPhysiAbsorber = nullptr;
|
||||
|
||||
if (fAbsorberThickness > 0.) {
|
||||
fSolidAbsorber = new G4Box("Absorber", //its name
|
||||
fAbsorberThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2); //size
|
||||
fSolidAbsorber = new G4Box("Absorber", // its name
|
||||
fAbsorberThickness / 2, fCalorSizeYZ / 2, fCalorSizeYZ / 2); // size
|
||||
|
||||
fLogicAbsorber = new G4LogicalVolume(fSolidAbsorber, //its solid
|
||||
fAbsorberMaterial, //its material
|
||||
fAbsorberMaterial->GetName()); //name
|
||||
|
||||
fPhysiAbsorber = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(-fGapThickness/2,0.,0.), //its position
|
||||
fLogicAbsorber, //its logical volume
|
||||
fAbsorberMaterial->GetName(), //its name
|
||||
fLogicLayer, //its mother
|
||||
false, //no boulean operat
|
||||
0); //copy number
|
||||
fLogicAbsorber = new G4LogicalVolume(fSolidAbsorber, // its solid
|
||||
fAbsorberMaterial, // its material
|
||||
fAbsorberMaterial->GetName()); // name
|
||||
|
||||
fPhysiAbsorber = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(-fGapThickness / 2, 0., 0.), // its position
|
||||
fLogicAbsorber, // its logical volume
|
||||
fAbsorberMaterial->GetName(), // its name
|
||||
fLogicLayer, // its mother
|
||||
false, // no boulean operat
|
||||
0); // copy number
|
||||
}
|
||||
|
||||
//
|
||||
// Gap
|
||||
//
|
||||
fSolidGap = nullptr; fLogicGap = nullptr; fPhysiGap = nullptr;
|
||||
fSolidGap = nullptr;
|
||||
fLogicGap = nullptr;
|
||||
fPhysiGap = nullptr;
|
||||
|
||||
if (fGapThickness > 0.) {
|
||||
fSolidGap = new G4Box("Gap",
|
||||
fGapThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2);
|
||||
fSolidGap = new G4Box("Gap", fGapThickness / 2, fCalorSizeYZ / 2, fCalorSizeYZ / 2);
|
||||
|
||||
fLogicGap = new G4LogicalVolume(fSolidGap,
|
||||
fGapMaterial,
|
||||
fGapMaterial->GetName());
|
||||
fLogicGap = new G4LogicalVolume(fSolidGap, fGapMaterial, fGapMaterial->GetName());
|
||||
|
||||
fPhysiGap = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(fAbsorberThickness/2,0.,0.), //its position
|
||||
fLogicGap, //its logical volume
|
||||
fGapMaterial->GetName(), //its name
|
||||
fLogicLayer, //its mother
|
||||
false, //no boulean operat
|
||||
0); //copy number
|
||||
fPhysiGap = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(fAbsorberThickness / 2, 0., 0.), // its position
|
||||
fLogicGap, // its logical volume
|
||||
fGapMaterial->GetName(), // its name
|
||||
fLogicLayer, // its mother
|
||||
false, // no boulean operat
|
||||
0); // copy number
|
||||
}
|
||||
|
||||
PrintCalorParameters();
|
||||
@@ -228,14 +230,14 @@ G4VPhysicalVolume* DetectorConstruction::ConstructCalorimeter()
|
||||
//
|
||||
// Visualization attributes
|
||||
//
|
||||
fLogicWorld->SetVisAttributes (G4VisAttributes::GetInvisible());
|
||||
fLogicWorld->SetVisAttributes(G4VisAttributes::GetInvisible());
|
||||
|
||||
auto simpleBoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
|
||||
auto simpleBoxVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0));
|
||||
simpleBoxVisAtt->SetVisibility(true);
|
||||
fLogicCalor->SetVisAttributes(simpleBoxVisAtt);
|
||||
|
||||
//
|
||||
//always return the physical World
|
||||
// always return the physical World
|
||||
//
|
||||
return fPhysiWorld;
|
||||
}
|
||||
@@ -246,9 +248,8 @@ void DetectorConstruction::PrintCalorParameters()
|
||||
{
|
||||
G4cout << "\n------------------------------------------------------------"
|
||||
<< "\n---> The calorimeter is " << fNbOfLayers << " layers of: [ "
|
||||
<< fAbsorberThickness/mm << "mm of " << fAbsorberMaterial->GetName()
|
||||
<< " + "
|
||||
<< fGapThickness/mm << "mm of " << fGapMaterial->GetName() << " ] "
|
||||
<< fAbsorberThickness / mm << "mm of " << fAbsorberMaterial->GetName() << " + "
|
||||
<< fGapThickness / mm << "mm of " << fGapMaterial->GetName() << " ] "
|
||||
<< "\n------------------------------------------------------------\n";
|
||||
}
|
||||
|
||||
@@ -274,7 +275,7 @@ void DetectorConstruction::SetGapMaterial(const G4String& materialChoice)
|
||||
auto material = G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
|
||||
if (material != nullptr) {
|
||||
fGapMaterial = material;
|
||||
if ( fLogicGap != nullptr) {
|
||||
if (fLogicGap != nullptr) {
|
||||
fLogicGap->SetMaterial(fGapMaterial);
|
||||
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
|
||||
}
|
||||
@@ -287,7 +288,7 @@ void DetectorConstruction::SetAbsorberThickness(G4double value)
|
||||
{
|
||||
// change Absorber thickness and recompute the calorimeter parameters
|
||||
fAbsorberThickness = value;
|
||||
if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
|
||||
if (G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit) {
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
}
|
||||
@@ -298,7 +299,7 @@ void DetectorConstruction::SetGapThickness(G4double value)
|
||||
{
|
||||
// change Gap thickness and recompute the calorimeter parameters
|
||||
fGapThickness = value;
|
||||
if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
|
||||
if (G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit) {
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
}
|
||||
@@ -309,7 +310,7 @@ void DetectorConstruction::SetCalorSizeYZ(G4double value)
|
||||
{
|
||||
// change the transverse size and recompute the calorimeter parameters
|
||||
fCalorSizeYZ = value;
|
||||
if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
|
||||
if (G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit) {
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
}
|
||||
@@ -319,7 +320,7 @@ void DetectorConstruction::SetCalorSizeYZ(G4double value)
|
||||
void DetectorConstruction::SetNbOfLayers(G4int value)
|
||||
{
|
||||
fNbOfLayers = value;
|
||||
if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
|
||||
if (G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit) {
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,57 +32,57 @@
|
||||
#include "DetectorMessenger.hh"
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorMessenger::DetectorMessenger( DetectorConstruction* Det)
|
||||
: fDetector(Det)
|
||||
DetectorMessenger::DetectorMessenger(DetectorConstruction* Det) : fDetector(Det)
|
||||
{
|
||||
G4bool broadcast = false;
|
||||
fDetDir = new G4UIdirectory("/det/",broadcast);
|
||||
fDetDir = new G4UIdirectory("/det/", broadcast);
|
||||
fDetDir->SetGuidance("Detector control");
|
||||
|
||||
fAbsMaterCmd = new G4UIcmdWithAString("/det/setAbsMat",this);
|
||||
fAbsMaterCmd = new G4UIcmdWithAString("/det/setAbsMat", this);
|
||||
fAbsMaterCmd->SetGuidance("Select Material of the Absorber.");
|
||||
fAbsMaterCmd->SetParameterName("AbsMat",false);
|
||||
fAbsMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fAbsMaterCmd->SetParameterName("AbsMat", false);
|
||||
fAbsMaterCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fGapMaterCmd = new G4UIcmdWithAString("/det/setGapMat",this);
|
||||
fGapMaterCmd = new G4UIcmdWithAString("/det/setGapMat", this);
|
||||
fGapMaterCmd->SetGuidance("Select Material of the Gap.");
|
||||
fGapMaterCmd->SetParameterName("GapMat",false);
|
||||
fGapMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fGapMaterCmd->SetParameterName("GapMat", false);
|
||||
fGapMaterCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fAbsThickCmd = new G4UIcmdWithADoubleAndUnit("/det/setAbsThick",this);
|
||||
fAbsThickCmd = new G4UIcmdWithADoubleAndUnit("/det/setAbsThick", this);
|
||||
fAbsThickCmd->SetGuidance("Set Thickness of the Absorber");
|
||||
fAbsThickCmd->SetParameterName("AbsThick",false);
|
||||
fAbsThickCmd->SetParameterName("AbsThick", false);
|
||||
fAbsThickCmd->SetRange("AbsThick>=0.");
|
||||
fAbsThickCmd->SetUnitCategory("Length");
|
||||
fAbsThickCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fAbsThickCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fGapThickCmd = new G4UIcmdWithADoubleAndUnit("/det/setGapThick",this);
|
||||
fGapThickCmd = new G4UIcmdWithADoubleAndUnit("/det/setGapThick", this);
|
||||
fGapThickCmd->SetGuidance("Set Thickness of the Gap");
|
||||
fGapThickCmd->SetParameterName("GapThick",false);
|
||||
fGapThickCmd->SetParameterName("GapThick", false);
|
||||
fGapThickCmd->SetRange("GapThick>=0.");
|
||||
fGapThickCmd->SetUnitCategory("Length");
|
||||
fGapThickCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fGapThickCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fSizeYZCmd = new G4UIcmdWithADoubleAndUnit("/det/setSizeYZ",this);
|
||||
fSizeYZCmd = new G4UIcmdWithADoubleAndUnit("/det/setSizeYZ", this);
|
||||
fSizeYZCmd->SetGuidance("Set tranverse size of the calorimeter");
|
||||
fSizeYZCmd->SetParameterName("SizeYZ",false);
|
||||
fSizeYZCmd->SetParameterName("SizeYZ", false);
|
||||
fSizeYZCmd->SetRange("SizeYZ>0.");
|
||||
fSizeYZCmd->SetUnitCategory("Length");
|
||||
fSizeYZCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fSizeYZCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fNbLayersCmd = new G4UIcmdWithAnInteger("/det/setNbOfLayers",this);
|
||||
fNbLayersCmd = new G4UIcmdWithAnInteger("/det/setNbOfLayers", this);
|
||||
fNbLayersCmd->SetGuidance("Set number of layers.");
|
||||
fNbLayersCmd->SetParameterName("NbLayers",false);
|
||||
fNbLayersCmd->SetParameterName("NbLayers", false);
|
||||
fNbLayersCmd->SetRange("NbLayers>0 && NbLayers<500");
|
||||
fNbLayersCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fNbLayersCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -102,32 +102,32 @@ DetectorMessenger::~DetectorMessenger()
|
||||
|
||||
void DetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
if( command == fAbsMaterCmd ) {
|
||||
if (command == fAbsMaterCmd) {
|
||||
fDetector->SetAbsorberMaterial(newValue);
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fGapMaterCmd ) {
|
||||
if (command == fGapMaterCmd) {
|
||||
fDetector->SetGapMaterial(newValue);
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fAbsThickCmd ) {
|
||||
if (command == fAbsThickCmd) {
|
||||
fDetector->SetAbsorberThickness(fAbsThickCmd->GetNewDoubleValue(newValue));
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fGapThickCmd ) {
|
||||
if (command == fGapThickCmd) {
|
||||
fDetector->SetGapThickness(fGapThickCmd->GetNewDoubleValue(newValue));
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fSizeYZCmd ) {
|
||||
if (command == fSizeYZCmd) {
|
||||
fDetector->SetCalorSizeYZ(fSizeYZCmd->GetNewDoubleValue(newValue));
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fNbLayersCmd ) {
|
||||
if (command == fNbLayersCmd) {
|
||||
fDetector->SetNbOfLayers(fNbLayersCmd->GetNewIntValue(newValue));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -35,15 +35,14 @@
|
||||
|
||||
#include "EventAction.hh"
|
||||
|
||||
#include "RunAction.hh"
|
||||
#include "HistoManager.hh"
|
||||
#include "RunAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EventAction::EventAction(RunAction* run, HistoManager* histo)
|
||||
: fRunAct(run),fHistoManager(histo)
|
||||
EventAction::EventAction(RunAction* run, HistoManager* histo) : fRunAct(run), fHistoManager(histo)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -55,7 +54,7 @@ EventAction::~EventAction() = default;
|
||||
void EventAction::BeginOfEventAction(const G4Event* evt)
|
||||
{
|
||||
G4int evtNb = evt->GetEventID();
|
||||
if (evtNb%fPrintModulo == 0) {
|
||||
if (evtNb % fPrintModulo == 0) {
|
||||
G4cout << "\n---> Begin of event: " << evtNb << G4endl;
|
||||
}
|
||||
|
||||
@@ -68,18 +67,18 @@ void EventAction::BeginOfEventAction(const G4Event* evt)
|
||||
|
||||
void EventAction::EndOfEventAction(const G4Event*)
|
||||
{
|
||||
//accumulates statistic
|
||||
// accumulates statistic
|
||||
//
|
||||
fRunAct->FillPerEvent(fEnergyAbs, fEnergyGap, fTrackLAbs, fTrackLGap);
|
||||
|
||||
//fill histograms
|
||||
// fill histograms
|
||||
//
|
||||
fHistoManager->FillHisto(0, fEnergyAbs);
|
||||
fHistoManager->FillHisto(1, fEnergyGap);
|
||||
fHistoManager->FillHisto(2, fTrackLAbs);
|
||||
fHistoManager->FillHisto(3, fTrackLGap);
|
||||
|
||||
//fill ntuple
|
||||
// fill ntuple
|
||||
//
|
||||
fHistoManager->FillNtuple(fEnergyAbs, fEnergyGap, fTrackLAbs, fTrackLGap);
|
||||
}
|
||||
|
||||
@@ -34,30 +34,28 @@
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* dc)
|
||||
: fDetector(dc)
|
||||
PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* dc) : fDetector(dc)
|
||||
{
|
||||
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="e-");
|
||||
G4ParticleDefinition* particle = particleTable->FindParticle(particleName = "e-");
|
||||
fParticleGun->SetParticleDefinition(particle);
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
|
||||
fParticleGun->SetParticleEnergy(500.*MeV);
|
||||
G4double position = -0.5*(fDetector->GetWorldSizeX());
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm));
|
||||
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(1., 0., 0.));
|
||||
fParticleGun->SetParticleEnergy(500. * MeV);
|
||||
G4double position = -0.5 * (fDetector->GetWorldSizeX());
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(position, 0. * cm, 0. * cm));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -71,10 +69,9 @@ PrimaryGeneratorAction::~PrimaryGeneratorAction()
|
||||
|
||||
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
//this function is called at the begining of event
|
||||
// this function is called at the begining of event
|
||||
//
|
||||
fParticleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -32,17 +32,17 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "RunAction.hh"
|
||||
|
||||
#include "HistoManager.hh"
|
||||
|
||||
#include "G4AccumulableManager.hh"
|
||||
#include "G4Run.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4AccumulableManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
RunAction::RunAction(HistoManager* histo)
|
||||
: fHistoManager(histo)
|
||||
RunAction::RunAction(HistoManager* histo) : fHistoManager(histo)
|
||||
{
|
||||
// Register accumulable to the accumulable manager
|
||||
G4AccumulableManager* accumulableManager = G4AccumulableManager::Instance();
|
||||
@@ -69,23 +69,26 @@ void RunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
// reset accumulables to their initial values
|
||||
G4AccumulableManager::Instance()->Reset();
|
||||
|
||||
//histograms
|
||||
// histograms
|
||||
//
|
||||
fHistoManager->Book();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void RunAction::FillPerEvent(G4double EAbs, G4double EGap,
|
||||
G4double LAbs, G4double LGap)
|
||||
void RunAction::FillPerEvent(G4double EAbs, G4double EGap, G4double LAbs, G4double LGap)
|
||||
{
|
||||
//accumulate statistic
|
||||
// accumulate statistic
|
||||
//
|
||||
fSumEAbs += EAbs; fSum2EAbs += EAbs*EAbs;
|
||||
fSumEGap += EGap; fSum2EGap += EGap*EGap;
|
||||
fSumEAbs += EAbs;
|
||||
fSum2EAbs += EAbs * EAbs;
|
||||
fSumEGap += EGap;
|
||||
fSum2EGap += EGap * EGap;
|
||||
|
||||
fSumLAbs += LAbs; fSum2LAbs += LAbs*LAbs;
|
||||
fSumLGap += LGap; fSum2LGap += LGap*LGap;
|
||||
fSumLAbs += LAbs;
|
||||
fSum2LAbs += LAbs * LAbs;
|
||||
fSumLGap += LGap;
|
||||
fSum2LGap += LGap * LGap;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -102,67 +105,72 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
|
||||
return;
|
||||
}
|
||||
|
||||
//compute statistics: mean and rms
|
||||
// compute statistics: mean and rms
|
||||
//
|
||||
auto sumEAbs = fSumEAbs.GetValue();
|
||||
auto sum2EAbs = fSum2EAbs.GetValue();
|
||||
sumEAbs /= nofEvents; sum2EAbs /= nofEvents;
|
||||
auto rmsEAbs = sum2EAbs - sumEAbs*sumEAbs;
|
||||
if (rmsEAbs >0.) {
|
||||
sumEAbs /= nofEvents;
|
||||
sum2EAbs /= nofEvents;
|
||||
auto rmsEAbs = sum2EAbs - sumEAbs * sumEAbs;
|
||||
if (rmsEAbs > 0.) {
|
||||
rmsEAbs = std::sqrt(rmsEAbs);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
rmsEAbs = 0.;
|
||||
}
|
||||
|
||||
auto sumEGap = fSumEGap.GetValue();
|
||||
auto sum2EGap = fSum2EGap.GetValue();
|
||||
sumEGap /= nofEvents; sum2EGap /= nofEvents;
|
||||
auto rmsEGap = sum2EGap - sumEGap*sumEGap;
|
||||
if (rmsEGap >0.) {
|
||||
sumEGap /= nofEvents;
|
||||
sum2EGap /= nofEvents;
|
||||
auto rmsEGap = sum2EGap - sumEGap * sumEGap;
|
||||
if (rmsEGap > 0.) {
|
||||
rmsEGap = std::sqrt(rmsEGap);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
rmsEGap = 0.;
|
||||
}
|
||||
|
||||
auto sumLAbs = fSumLAbs.GetValue();
|
||||
auto sum2LAbs = fSum2LAbs.GetValue();
|
||||
sumLAbs /= nofEvents; sum2LAbs /= nofEvents;
|
||||
auto rmsLAbs = sum2LAbs - sumLAbs*sumLAbs;
|
||||
if (rmsLAbs >0.) {
|
||||
sumLAbs /= nofEvents;
|
||||
sum2LAbs /= nofEvents;
|
||||
auto rmsLAbs = sum2LAbs - sumLAbs * sumLAbs;
|
||||
if (rmsLAbs > 0.) {
|
||||
rmsLAbs = std::sqrt(rmsLAbs);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
rmsLAbs = 0.;
|
||||
}
|
||||
|
||||
auto sumLGap = fSumLGap.GetValue();
|
||||
auto sum2LGap = fSum2LGap.GetValue();
|
||||
sumLGap /= nofEvents; sum2LGap /= nofEvents;
|
||||
G4double rmsLGap = sum2LGap - sumLGap*sumLGap;
|
||||
if (rmsLGap >0.) {
|
||||
sumLGap /= nofEvents;
|
||||
sum2LGap /= nofEvents;
|
||||
G4double rmsLGap = sum2LGap - sumLGap * sumLGap;
|
||||
if (rmsLGap > 0.) {
|
||||
rmsLGap = std::sqrt(rmsLGap);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
rmsLGap = 0.;
|
||||
}
|
||||
|
||||
//print
|
||||
// print
|
||||
//
|
||||
G4cout
|
||||
<< "\n--------------------End of Run------------------------------\n"
|
||||
<< "\n mean Energy in Absorber : " << G4BestUnit(sumEAbs,"Energy")
|
||||
<< " +- " << G4BestUnit(rmsEAbs,"Energy")
|
||||
<< "\n mean Energy in Gap : " << G4BestUnit(sumEGap,"Energy")
|
||||
<< " +- " << G4BestUnit(rmsEGap,"Energy")
|
||||
<< G4endl;
|
||||
G4cout << "\n--------------------End of Run------------------------------\n"
|
||||
<< "\n mean Energy in Absorber : " << G4BestUnit(sumEAbs, "Energy") << " +- "
|
||||
<< G4BestUnit(rmsEAbs, "Energy")
|
||||
<< "\n mean Energy in Gap : " << G4BestUnit(sumEGap, "Energy") << " +- "
|
||||
<< G4BestUnit(rmsEGap, "Energy") << G4endl;
|
||||
|
||||
G4cout
|
||||
<< "\n mean trackLength in Absorber : " << G4BestUnit(sumLAbs,"Length")
|
||||
<< " +- " << G4BestUnit(rmsLAbs,"Length")
|
||||
<< "\n mean trackLength in Gap : " << G4BestUnit(sumLGap,"Length")
|
||||
<< " +- " << G4BestUnit(rmsLGap,"Length")
|
||||
<< "\n------------------------------------------------------------\n"
|
||||
<< G4endl;
|
||||
G4cout << "\n mean trackLength in Absorber : " << G4BestUnit(sumLAbs, "Length") << " +- "
|
||||
<< G4BestUnit(rmsLAbs, "Length")
|
||||
<< "\n mean trackLength in Gap : " << G4BestUnit(sumLGap, "Length") << " +- "
|
||||
<< G4BestUnit(rmsLGap, "Length")
|
||||
<< "\n------------------------------------------------------------\n"
|
||||
<< G4endl;
|
||||
|
||||
//save histograms
|
||||
// save histograms
|
||||
//
|
||||
fHistoManager->PrintStatistic();
|
||||
fHistoManager->Save();
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
SteppingAction::SteppingAction(DetectorConstruction* det, EventAction* evt)
|
||||
: fDetector(det), fEventAction(evt)
|
||||
: fDetector(det), fEventAction(evt)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -51,8 +51,7 @@ SteppingAction::~SteppingAction() = default;
|
||||
void SteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
{
|
||||
// get volume of the current step
|
||||
G4VPhysicalVolume* volume =
|
||||
aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
|
||||
G4VPhysicalVolume* volume = aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
|
||||
|
||||
// collect energy and track length step by step
|
||||
G4double edep = aStep->GetTotalEnergyDeposit();
|
||||
@@ -62,8 +61,12 @@ void SteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
stepl = aStep->GetStepLength();
|
||||
}
|
||||
|
||||
if (volume == fDetector->GetAbsorber()) { fEventAction->AddAbs(edep,stepl); }
|
||||
if (volume == fDetector->GetGap()) { fEventAction->AddGap(edep,stepl); }
|
||||
if (volume == fDetector->GetAbsorber()) {
|
||||
fEventAction->AddAbs(edep, stepl);
|
||||
}
|
||||
if (volume == fDetector->GetGap()) {
|
||||
fEventAction->AddGap(edep, stepl);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -32,8 +32,9 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "HistoManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -42,7 +43,7 @@ HistoManager::HistoManager()
|
||||
// Create or get analysis manager
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
analysisManager->SetDefaultFileType("root");
|
||||
// the default file type can be overriden in run macro
|
||||
// the default file type can be overriden in run macro
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -52,13 +53,13 @@ void HistoManager::Book()
|
||||
// Create or get analysis manager
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
|
||||
if ( ! fFactoryOn ) {
|
||||
if (!fFactoryOn) {
|
||||
//
|
||||
analysisManager->SetVerboseLevel(1);
|
||||
// Only merge in MT mode to avoid warning when running in Sequential mode
|
||||
#ifdef G4MULTITHREADED
|
||||
#ifdef G4MULTITHREADED
|
||||
analysisManager->SetNtupleMerging(true);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Create directories
|
||||
analysisManager->SetHistoDirectoryName("histo");
|
||||
@@ -68,26 +69,26 @@ void HistoManager::Book()
|
||||
// Open an output file
|
||||
//
|
||||
G4bool fileOpen = analysisManager->OpenFile("AnaEx01");
|
||||
if (! fileOpen) {
|
||||
G4cerr << "\n---> HistoManager::Book(): cannot open "
|
||||
<< analysisManager->GetFileName() << G4endl;
|
||||
if (!fileOpen) {
|
||||
G4cerr << "\n---> HistoManager::Book(): cannot open " << analysisManager->GetFileName()
|
||||
<< G4endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! fFactoryOn ) {
|
||||
if (!fFactoryOn) {
|
||||
// Create histograms.
|
||||
// Histogram ids are generated automatically starting from 0.
|
||||
// The start value can be changed by:
|
||||
// analysisManager->SetFirstHistoId(1);
|
||||
|
||||
// id = 0
|
||||
analysisManager->CreateH1("EAbs","Edep in absorber (MeV)", 100, 0., 800*MeV);
|
||||
analysisManager->CreateH1("EAbs", "Edep in absorber (MeV)", 100, 0., 800 * MeV);
|
||||
// id = 1
|
||||
analysisManager->CreateH1("EGap","Edep in gap (MeV)", 100, 0., 100*MeV);
|
||||
analysisManager->CreateH1("EGap", "Edep in gap (MeV)", 100, 0., 100 * MeV);
|
||||
// id = 2
|
||||
analysisManager->CreateH1("LAbs","trackL in absorber (mm)", 100, 0., 1*m);
|
||||
analysisManager->CreateH1("LAbs", "trackL in absorber (mm)", 100, 0., 1 * m);
|
||||
// id = 3
|
||||
analysisManager->CreateH1("LGap","trackL in gap (mm)", 100, 0., 50*cm);
|
||||
analysisManager->CreateH1("LGap", "trackL in gap (mm)", 100, 0., 50 * cm);
|
||||
|
||||
// Create ntuples.
|
||||
// Ntuples ids are generated automatically starting from 0.
|
||||
@@ -96,22 +97,21 @@ void HistoManager::Book()
|
||||
|
||||
// Create 1st ntuple (id = 0)
|
||||
analysisManager->CreateNtuple("Ntuple1", "Edep");
|
||||
analysisManager->CreateNtupleDColumn("Eabs"); // column Id = 0
|
||||
analysisManager->CreateNtupleDColumn("Egap"); // column Id = 1
|
||||
analysisManager->CreateNtupleDColumn("Eabs"); // column Id = 0
|
||||
analysisManager->CreateNtupleDColumn("Egap"); // column Id = 1
|
||||
analysisManager->FinishNtuple();
|
||||
|
||||
// Create 2nd ntuple (id = 1)
|
||||
//
|
||||
analysisManager->CreateNtuple("Ntuple2", "TrackL");
|
||||
analysisManager->CreateNtupleDColumn("Labs"); // column Id = 0
|
||||
analysisManager->CreateNtupleDColumn("Lgap"); // column Id = 1
|
||||
analysisManager->CreateNtupleDColumn("Labs"); // column Id = 0
|
||||
analysisManager->CreateNtupleDColumn("Lgap"); // column Id = 1
|
||||
analysisManager->FinishNtuple();
|
||||
|
||||
fFactoryOn = true;
|
||||
}
|
||||
|
||||
G4cout << "\n----> Output file is open in "
|
||||
<< analysisManager->GetFileName() << "."
|
||||
G4cout << "\n----> Output file is open in " << analysisManager->GetFileName() << "."
|
||||
<< analysisManager->GetFileType() << G4endl;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,9 @@ void HistoManager::Book()
|
||||
|
||||
void HistoManager::Save()
|
||||
{
|
||||
if (! fFactoryOn) { return; }
|
||||
if (!fFactoryOn) {
|
||||
return;
|
||||
}
|
||||
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
analysisManager->Write();
|
||||
@@ -142,14 +144,15 @@ void HistoManager::Normalize(G4int ih, G4double fac)
|
||||
{
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
auto h1 = analysisManager->GetH1(ih);
|
||||
if (h1 != nullptr) { h1->scale(fac);
|
||||
}
|
||||
if (h1 != nullptr) {
|
||||
h1->scale(fac);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void HistoManager::FillNtuple(G4double energyAbs, G4double energyGap,
|
||||
G4double trackLAbs, G4double trackLGap)
|
||||
void HistoManager::FillNtuple(G4double energyAbs, G4double energyGap, G4double trackLAbs,
|
||||
G4double trackLGap)
|
||||
{
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
// Fill 1st ntuple ( id = 0)
|
||||
@@ -166,25 +169,29 @@ void HistoManager::FillNtuple(G4double energyAbs, G4double energyGap,
|
||||
|
||||
void HistoManager::PrintStatistic()
|
||||
{
|
||||
if (! fFactoryOn) { return; }
|
||||
if (!fFactoryOn) {
|
||||
return;
|
||||
}
|
||||
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
|
||||
G4cout << "\n ----> print histograms statistic \n" << G4endl;
|
||||
for ( G4int i=0; i<analysisManager->GetNofH1s(); ++i ) {
|
||||
for (G4int i = 0; i < analysisManager->GetNofH1s(); ++i) {
|
||||
G4String name = analysisManager->GetH1Name(i);
|
||||
auto h1 = analysisManager->GetH1(i);
|
||||
|
||||
G4String unitCategory;
|
||||
if (name[0U] == 'E' ) { unitCategory = "Energy"; }
|
||||
if (name[0U] == 'L' ) { unitCategory = "Length"; }
|
||||
// we use an explicit unsigned int type for operator [] argument
|
||||
// to avoid problems with windows compiler
|
||||
if (name[0U] == 'E') {
|
||||
unitCategory = "Energy";
|
||||
}
|
||||
if (name[0U] == 'L') {
|
||||
unitCategory = "Length";
|
||||
}
|
||||
// we use an explicit unsigned int type for operator [] argument
|
||||
// to avoid problems with windows compiler
|
||||
|
||||
G4cout << name
|
||||
<< ": mean = " << G4BestUnit(h1->mean(), unitCategory)
|
||||
<< " rms = " << G4BestUnit(h1->rms(), unitCategory )
|
||||
<< G4endl;
|
||||
G4cout << name << ": mean = " << G4BestUnit(h1->mean(), unitCategory)
|
||||
<< " rms = " << G4BestUnit(h1->rms(), unitCategory) << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,27 +34,26 @@
|
||||
|
||||
#include "ActionInitialization.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "EventAction.hh"
|
||||
#include "FTFP_BERT.hh"
|
||||
#include "HistoManager.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
#include "RunAction.hh"
|
||||
#include "EventAction.hh"
|
||||
#include "SteppingAction.hh"
|
||||
#include "HistoManager.hh"
|
||||
|
||||
#include "G4RunManagerFactory.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "FTFP_BERT.hh"
|
||||
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "G4UIExecutive.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VisExecutive.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
int main(int argc,char** argv)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
// Detect interactive mode (if no arguments) and define UI session
|
||||
//
|
||||
G4UIExecutive* ui = nullptr;
|
||||
if ( argc == 1 ) {
|
||||
if (argc == 1) {
|
||||
ui = new G4UIExecutive(argc, argv);
|
||||
}
|
||||
|
||||
@@ -64,7 +63,7 @@ int main(int argc,char** argv)
|
||||
|
||||
// Set mandatory initialization classes
|
||||
//
|
||||
auto detector = new DetectorConstruction;
|
||||
auto detector = new DetectorConstruction;
|
||||
runManager->SetUserInitialization(detector);
|
||||
runManager->SetUserInitialization(new FTFP_BERT);
|
||||
runManager->SetUserInitialization(new ActionInitialization(detector));
|
||||
@@ -82,11 +81,11 @@ int main(int argc,char** argv)
|
||||
//
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
|
||||
if ( ui == nullptr ) {
|
||||
if (ui == nullptr) {
|
||||
// batch mode
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
UImanager->ApplyCommand(command + fileName);
|
||||
}
|
||||
else {
|
||||
// interactive mode
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
**************************************************************
|
||||
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
|
||||
@@ -77,14 +77,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...
|
||||
|
||||
@@ -289,7 +296,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
|
||||
|
||||
@@ -844,7 +851,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
|
||||
@@ -862,20 +869,20 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
|
||||
--------------------End of Run------------------------------
|
||||
|
||||
mean Energy in Absorber : 281.112 MeV +- 0 eV
|
||||
mean Energy in Gap : 74.1401 MeV +- 0 eV
|
||||
mean Energy in Absorber : 245.231 MeV +- 0 eV
|
||||
mean Energy in Gap : 64.6941 MeV +- 0 eV
|
||||
|
||||
mean trackLength in Absorber : 69.2721 cm +- 0 fm
|
||||
mean trackLength in Gap : 37.7451 cm +- 0 fm
|
||||
mean trackLength in Absorber : 60.8807 cm +- 0 fm
|
||||
mean trackLength in Gap : 32.6255 cm +- 0 fm
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 281.112 MeV rms = 0 eV
|
||||
EGap: mean = 74.1401 MeV rms = 0 eV
|
||||
LAbs: mean = 69.2721 cm rms = 0 fm
|
||||
LGap: mean = 37.7451 cm rms = 0 fm
|
||||
EAbs: mean = 245.231 MeV rms = 0 eV
|
||||
EGap: mean = 64.6941 MeV rms = 0 eV
|
||||
LAbs: mean = 60.8807 cm rms = 0 fm
|
||||
LGap: mean = 32.6255 cm rms = 0 fm
|
||||
|
||||
----> Histograms and ntuples are saved
|
||||
|
||||
@@ -909,20 +916,20 @@ LGap: mean = 37.7451 cm rms = 0 fm
|
||||
|
||||
--------------------End of Run------------------------------
|
||||
|
||||
mean Energy in Absorber : 190.633 MeV +- 48.8718 MeV
|
||||
mean Energy in Gap : 46.5146 MeV +- 13.3975 MeV
|
||||
mean Energy in Absorber : 186.264 MeV +- 50.8208 MeV
|
||||
mean Energy in Gap : 45.8735 MeV +- 13.843 MeV
|
||||
|
||||
mean trackLength in Absorber : 47.0418 cm +- 12.1398 cm
|
||||
mean trackLength in Gap : 23.5952 cm +- 6.83896 cm
|
||||
mean trackLength in Absorber : 46.0323 cm +- 12.6521 cm
|
||||
mean trackLength in Gap : 23.2729 cm +- 7.04724 cm
|
||||
------------------------------------------------------------
|
||||
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 190.633 MeV rms = 48.8718 MeV
|
||||
EGap: mean = 46.5146 MeV rms = 13.3975 MeV
|
||||
LAbs: mean = 47.0418 cm rms = 12.1398 cm
|
||||
LGap: mean = 23.5952 cm rms = 6.83896 cm
|
||||
EAbs: mean = 186.264 MeV rms = 50.8208 MeV
|
||||
EGap: mean = 45.8735 MeV rms = 13.843 MeV
|
||||
LAbs: mean = 46.0323 cm rms = 12.6521 cm
|
||||
LGap: mean = 23.246 cm rms = 6.99942 cm
|
||||
|
||||
----> Histograms and ntuples are saved
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ class HistoManager
|
||||
{
|
||||
public:
|
||||
HistoManager() = default;
|
||||
~HistoManager();
|
||||
~HistoManager();
|
||||
|
||||
void Book();
|
||||
void Save();
|
||||
@@ -59,8 +59,7 @@ class HistoManager
|
||||
void FillHisto(G4int id, G4double bin, G4double weight = 1.0);
|
||||
void Normalize(G4int id, G4double fac);
|
||||
|
||||
void FillNtuple(G4double energyAbs, G4double energyGap,
|
||||
G4double trackLAbs, G4double trackLGap);
|
||||
void FillNtuple(G4double energyAbs, G4double energyGap, G4double trackLAbs, G4double trackLGap);
|
||||
|
||||
void PrintStatistic();
|
||||
|
||||
@@ -79,4 +78,3 @@ class HistoManager
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -51,5 +51,3 @@ class ActionInitialization : public G4VUserActionInitialization
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
#ifndef DetectorConstruction_h
|
||||
#define DetectorConstruction_h 1
|
||||
|
||||
#include "CLHEP/Units/SystemOfUnits.h"
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include "CLHEP/Units/SystemOfUnits.h"
|
||||
|
||||
class G4Box;
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
@@ -48,41 +48,40 @@ class DetectorMessenger;
|
||||
class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
|
||||
DetectorConstruction();
|
||||
~DetectorConstruction() override;
|
||||
DetectorConstruction();
|
||||
~DetectorConstruction() override;
|
||||
|
||||
public:
|
||||
G4VPhysicalVolume* Construct() override;
|
||||
|
||||
void SetAbsorberMaterial (const G4String&);
|
||||
void SetAbsorberMaterial(const G4String&);
|
||||
void SetAbsorberThickness(G4double);
|
||||
|
||||
void SetGapMaterial (const G4String&);
|
||||
void SetGapMaterial(const G4String&);
|
||||
void SetGapThickness(G4double);
|
||||
|
||||
void SetCalorSizeYZ(G4double);
|
||||
void SetNbOfLayers (G4int);
|
||||
void SetNbOfLayers(G4int);
|
||||
|
||||
void PrintCalorParameters();
|
||||
|
||||
G4double GetWorldSizeX() { return fWorldSizeX; }
|
||||
G4double GetWorldSizeX() { return fWorldSizeX; }
|
||||
G4double GetWorldSizeYZ() { return fWorldSizeYZ; }
|
||||
|
||||
G4double GetCalorThickness() { return fCalorThickness; }
|
||||
G4double GetCalorSizeYZ() { return fCalorSizeYZ; }
|
||||
G4double GetCalorSizeYZ() { return fCalorSizeYZ; }
|
||||
|
||||
G4int GetNbOfLayers() { return fNbOfLayers; }
|
||||
|
||||
G4Material* GetAbsorberMaterial() { return fAbsorberMaterial; }
|
||||
G4double GetAbsorberThickness() { return fAbsorberThickness; }
|
||||
G4Material* GetAbsorberMaterial() { return fAbsorberMaterial; }
|
||||
G4double GetAbsorberThickness() { return fAbsorberThickness; }
|
||||
|
||||
G4Material* GetGapMaterial() { return fGapMaterial; }
|
||||
G4double GetGapThickness() { return fGapThickness; }
|
||||
G4Material* GetGapMaterial() { return fGapMaterial; }
|
||||
G4double GetGapThickness() { return fGapThickness; }
|
||||
|
||||
const G4VPhysicalVolume* GetphysiWorld() { return fPhysiWorld; }
|
||||
const G4VPhysicalVolume* GetAbsorber() { return fPhysiAbsorber; }
|
||||
const G4VPhysicalVolume* GetGap() { return fPhysiGap; }
|
||||
const G4VPhysicalVolume* GetAbsorber() { return fPhysiAbsorber; }
|
||||
const G4VPhysicalVolume* GetGap() { return fPhysiGap; }
|
||||
|
||||
private:
|
||||
void DefineMaterials();
|
||||
@@ -93,37 +92,37 @@ class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
G4Material* fGapMaterial = nullptr;
|
||||
G4Material* fDefaultMaterial = nullptr;
|
||||
|
||||
G4int fNbOfLayers = 10;
|
||||
G4double fAbsorberThickness = 10.*CLHEP::mm;
|
||||
G4double fGapThickness = 5.*CLHEP::mm;
|
||||
G4double fCalorSizeYZ = 10.*CLHEP::cm;
|
||||
G4int fNbOfLayers = 10;
|
||||
G4double fAbsorberThickness = 10. * CLHEP::mm;
|
||||
G4double fGapThickness = 5. * CLHEP::mm;
|
||||
G4double fCalorSizeYZ = 10. * CLHEP::cm;
|
||||
|
||||
G4double fCalorThickness = 0.; // will be computed
|
||||
G4double fLayerThickness= 0.; // will be computed
|
||||
G4double fWorldSizeYZ = 0.; // will be computed;
|
||||
G4double fWorldSizeX = 0.; // will be computed;
|
||||
G4double fCalorThickness = 0.; // will be computed
|
||||
G4double fLayerThickness = 0.; // will be computed
|
||||
G4double fWorldSizeYZ = 0.; // will be computed;
|
||||
G4double fWorldSizeX = 0.; // will be computed;
|
||||
|
||||
G4Box* fSolidWorld = nullptr; //pointer to the solid World
|
||||
G4LogicalVolume* fLogicWorld = nullptr; //pointer to the logical World
|
||||
G4VPhysicalVolume* fPhysiWorld = nullptr; //pointer to the physical World
|
||||
G4Box* fSolidWorld = nullptr; // pointer to the solid World
|
||||
G4LogicalVolume* fLogicWorld = nullptr; // pointer to the logical World
|
||||
G4VPhysicalVolume* fPhysiWorld = nullptr; // pointer to the physical World
|
||||
|
||||
G4Box* fSolidCalor = nullptr; //pointer to the solid Calor
|
||||
G4LogicalVolume* fLogicCalor = nullptr; //pointer to the logical Calor
|
||||
G4VPhysicalVolume* fPhysiCalor = nullptr; //pointer to the physical Calor
|
||||
G4Box* fSolidCalor = nullptr; // pointer to the solid Calor
|
||||
G4LogicalVolume* fLogicCalor = nullptr; // pointer to the logical Calor
|
||||
G4VPhysicalVolume* fPhysiCalor = nullptr; // pointer to the physical Calor
|
||||
|
||||
G4Box* fSolidLayer = nullptr; //pointer to the solid Layer
|
||||
G4LogicalVolume* fLogicLayer = nullptr; //pointer to the logical Layer
|
||||
G4VPhysicalVolume* fPhysiLayer = nullptr; //pointer to the physical Layer
|
||||
G4Box* fSolidLayer = nullptr; // pointer to the solid Layer
|
||||
G4LogicalVolume* fLogicLayer = nullptr; // pointer to the logical Layer
|
||||
G4VPhysicalVolume* fPhysiLayer = nullptr; // pointer to the physical Layer
|
||||
|
||||
G4Box* fSolidAbsorber = nullptr; //pointer to the solid Absorber
|
||||
G4LogicalVolume* fLogicAbsorber = nullptr; //pointer to the logical Absorber
|
||||
G4VPhysicalVolume* fPhysiAbsorber = nullptr; //pointer to the physical Absorber
|
||||
G4Box* fSolidAbsorber = nullptr; // pointer to the solid Absorber
|
||||
G4LogicalVolume* fLogicAbsorber = nullptr; // pointer to the logical Absorber
|
||||
G4VPhysicalVolume* fPhysiAbsorber = nullptr; // pointer to the physical Absorber
|
||||
|
||||
G4Box* fSolidGap = nullptr; //pointer to the solid Gap
|
||||
G4LogicalVolume* fLogicGap = nullptr; //pointer to the logical Gap
|
||||
G4VPhysicalVolume* fPhysiGap = nullptr; //pointer to the physical Gap
|
||||
G4Box* fSolidGap = nullptr; // pointer to the solid Gap
|
||||
G4LogicalVolume* fLogicGap = nullptr; // pointer to the logical Gap
|
||||
G4VPhysicalVolume* fPhysiGap = nullptr; // pointer to the physical Gap
|
||||
|
||||
DetectorMessenger* fDetectorMessenger = nullptr; //pointer to the Messenger
|
||||
DetectorMessenger* fDetectorMessenger = nullptr; // pointer to the Messenger
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -131,13 +130,13 @@ class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
inline void DetectorConstruction::ComputeCalorParameters()
|
||||
{
|
||||
// Compute derived parameters of the calorimeter
|
||||
fLayerThickness = fAbsorberThickness + fGapThickness;
|
||||
fCalorThickness = fNbOfLayers*fLayerThickness;
|
||||
fLayerThickness = fAbsorberThickness + fGapThickness;
|
||||
fCalorThickness = fNbOfLayers * fLayerThickness;
|
||||
|
||||
fWorldSizeX = 1.2*fCalorThickness; fWorldSizeYZ = 1.2*fCalorSizeYZ;
|
||||
fWorldSizeX = 1.2 * fCalorThickness;
|
||||
fWorldSizeYZ = 1.2 * fCalorSizeYZ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
#ifndef DetectorMessenger_h
|
||||
#define DetectorMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class DetectorConstruction;
|
||||
class G4UIdirectory;
|
||||
@@ -43,10 +43,10 @@ class G4UIcmdWithADoubleAndUnit;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class DetectorMessenger: public G4UImessenger
|
||||
class DetectorMessenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
DetectorMessenger(DetectorConstruction* );
|
||||
DetectorMessenger(DetectorConstruction*);
|
||||
~DetectorMessenger() override;
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String) override;
|
||||
@@ -54,13 +54,13 @@ class DetectorMessenger: public G4UImessenger
|
||||
private:
|
||||
DetectorConstruction* fDetector = nullptr;
|
||||
|
||||
G4UIdirectory* fDetDir = nullptr;
|
||||
G4UIcmdWithAString* fAbsMaterCmd = nullptr;
|
||||
G4UIcmdWithAString* fGapMaterCmd = nullptr;
|
||||
G4UIdirectory* fDetDir = nullptr;
|
||||
G4UIcmdWithAString* fAbsMaterCmd = nullptr;
|
||||
G4UIcmdWithAString* fGapMaterCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fAbsThickCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fGapThickCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSizeYZCmd = nullptr;
|
||||
G4UIcmdWithAnInteger* fNbLayersCmd = nullptr;
|
||||
G4UIcmdWithAnInteger* fNbLayersCmd = nullptr;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -46,30 +46,36 @@ class HistoManager;
|
||||
|
||||
class EventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
EventAction(RunAction*, HistoManager*);
|
||||
~EventAction() override;
|
||||
public:
|
||||
EventAction(RunAction*, HistoManager*);
|
||||
~EventAction() override;
|
||||
|
||||
void BeginOfEventAction(const G4Event*) override;
|
||||
void EndOfEventAction(const G4Event*) override;
|
||||
void BeginOfEventAction(const G4Event*) override;
|
||||
void EndOfEventAction(const G4Event*) override;
|
||||
|
||||
void AddAbs(G4double de, G4double dl) {fEnergyAbs += de; fTrackLAbs += dl;};
|
||||
void AddGap(G4double de, G4double dl) {fEnergyGap += de; fTrackLGap += dl;};
|
||||
void AddAbs(G4double de, G4double dl)
|
||||
{
|
||||
fEnergyAbs += de;
|
||||
fTrackLAbs += dl;
|
||||
};
|
||||
void AddGap(G4double de, G4double dl)
|
||||
{
|
||||
fEnergyGap += de;
|
||||
fTrackLGap += dl;
|
||||
};
|
||||
|
||||
private:
|
||||
RunAction* fRunAct = nullptr;
|
||||
HistoManager* fHistoManager = nullptr;
|
||||
private:
|
||||
RunAction* fRunAct = nullptr;
|
||||
HistoManager* fHistoManager = nullptr;
|
||||
|
||||
G4double fEnergyAbs = 0.;
|
||||
G4double fEnergyGap = 0;
|
||||
G4double fTrackLAbs = 0;
|
||||
G4double fTrackLGap = 0;
|
||||
G4double fEnergyAbs = 0.;
|
||||
G4double fEnergyGap = 0;
|
||||
G4double fTrackLAbs = 0;
|
||||
G4double fTrackLGap = 0;
|
||||
|
||||
G4int fPrintModulo = 100;
|
||||
G4int fPrintModulo = 100;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -43,19 +43,17 @@ class DetectorConstruction;
|
||||
|
||||
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
PrimaryGeneratorAction(DetectorConstruction*);
|
||||
~PrimaryGeneratorAction() override;
|
||||
public:
|
||||
PrimaryGeneratorAction(DetectorConstruction*);
|
||||
~PrimaryGeneratorAction() override;
|
||||
|
||||
void GeneratePrimaries(G4Event*) override;
|
||||
void GeneratePrimaries(G4Event*) override;
|
||||
|
||||
private:
|
||||
G4ParticleGun* fParticleGun = nullptr; //pointer a to G4 class
|
||||
DetectorConstruction* fDetector = nullptr; //pointer to the geometry
|
||||
private:
|
||||
G4ParticleGun* fParticleGun = nullptr; // pointer a to G4 class
|
||||
DetectorConstruction* fDetector = nullptr; // pointer to the geometry
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
#ifndef RunAction_h
|
||||
#define RunAction_h 1
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "G4Accumulable.hh"
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -47,30 +47,29 @@ class HistoManager;
|
||||
|
||||
class RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
RunAction(HistoManager*);
|
||||
~RunAction() override;
|
||||
public:
|
||||
RunAction(HistoManager*);
|
||||
~RunAction() override;
|
||||
|
||||
void BeginOfRunAction(const G4Run*) override;
|
||||
void EndOfRunAction(const G4Run*) override;
|
||||
void BeginOfRunAction(const G4Run*) override;
|
||||
void EndOfRunAction(const G4Run*) override;
|
||||
|
||||
void FillPerEvent(G4double, G4double, G4double, G4double);
|
||||
void FillPerEvent(G4double, G4double, G4double, G4double);
|
||||
|
||||
private:
|
||||
HistoManager* fHistoManager = nullptr;
|
||||
private:
|
||||
HistoManager* fHistoManager = nullptr;
|
||||
|
||||
G4Accumulable<G4double> fSumEAbs = 0.;
|
||||
G4Accumulable<G4double> fSum2EAbs = 0.;
|
||||
G4Accumulable<G4double> fSumEGap = 0.;
|
||||
G4Accumulable<G4double> fSum2EGap = 0.;
|
||||
G4Accumulable<G4double> fSumEAbs = 0.;
|
||||
G4Accumulable<G4double> fSum2EAbs = 0.;
|
||||
G4Accumulable<G4double> fSumEGap = 0.;
|
||||
G4Accumulable<G4double> fSum2EGap = 0.;
|
||||
|
||||
G4Accumulable<G4double> fSumLAbs = 0.;
|
||||
G4Accumulable<G4double> fSum2LAbs = 0.;
|
||||
G4Accumulable<G4double> fSumLGap = 0.;
|
||||
G4Accumulable<G4double> fSum2LGap = 0.;
|
||||
G4Accumulable<G4double> fSumLAbs = 0.;
|
||||
G4Accumulable<G4double> fSum2LAbs = 0.;
|
||||
G4Accumulable<G4double> fSumLGap = 0.;
|
||||
G4Accumulable<G4double> fSum2LGap = 0.;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -41,15 +41,15 @@ class EventAction;
|
||||
|
||||
class SteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
SteppingAction(DetectorConstruction*, EventAction*);
|
||||
~SteppingAction() override;
|
||||
public:
|
||||
SteppingAction(DetectorConstruction*, EventAction*);
|
||||
~SteppingAction() override;
|
||||
|
||||
void UserSteppingAction(const G4Step*) override;
|
||||
void UserSteppingAction(const G4Step*) override;
|
||||
|
||||
private:
|
||||
DetectorConstruction* fDetector = nullptr;
|
||||
EventAction* fEventAction = nullptr;
|
||||
private:
|
||||
DetectorConstruction* fDetector = nullptr;
|
||||
EventAction* fEventAction = nullptr;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -28,17 +28,16 @@
|
||||
/// \brief Implementation of the ActionInitialization class
|
||||
|
||||
#include "ActionInitialization.hh"
|
||||
|
||||
#include "EventAction.hh"
|
||||
#include "HistoManager.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
#include "RunAction.hh"
|
||||
#include "EventAction.hh"
|
||||
#include "SteppingAction.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ActionInitialization::ActionInitialization(DetectorConstruction* detector)
|
||||
: fDetector(detector)
|
||||
{}
|
||||
ActionInitialization::ActionInitialization(DetectorConstruction* detector) : fDetector(detector) {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -49,7 +48,7 @@ ActionInitialization::~ActionInitialization() = default;
|
||||
void ActionInitialization::BuildForMaster() const
|
||||
{
|
||||
// Histo manager
|
||||
auto histo = new HistoManager();
|
||||
auto histo = new HistoManager();
|
||||
|
||||
// Actions
|
||||
SetUserAction(new RunAction(histo));
|
||||
@@ -60,19 +59,19 @@ void ActionInitialization::BuildForMaster() const
|
||||
void ActionInitialization::Build() const
|
||||
{
|
||||
// Histo manager
|
||||
auto histo = new HistoManager();
|
||||
auto histo = new HistoManager();
|
||||
|
||||
// Actions
|
||||
//
|
||||
SetUserAction(new PrimaryGeneratorAction(fDetector));
|
||||
|
||||
auto runAction = new RunAction(histo);
|
||||
auto runAction = new RunAction(histo);
|
||||
SetUserAction(runAction);
|
||||
|
||||
auto eventAction = new EventAction(runAction, histo);
|
||||
auto eventAction = new EventAction(runAction, histo);
|
||||
SetUserAction(eventAction);
|
||||
|
||||
auto steppingAction = new SteppingAction(fDetector, eventAction);
|
||||
auto steppingAction = new SteppingAction(fDetector, eventAction);
|
||||
SetUserAction(steppingAction);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,26 +30,24 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
#include "DetectorMessenger.hh"
|
||||
|
||||
#include "G4Box.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4GeometryManager.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4NistManager.hh"
|
||||
|
||||
#include "G4Box.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4PVReplica.hh"
|
||||
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4GeometryManager.hh"
|
||||
#include "G4PhysicalVolumeStore.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4SolidStore.hh"
|
||||
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4SolidStore.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -113,114 +111,118 @@ G4VPhysicalVolume* DetectorConstruction::ConstructCalorimeter()
|
||||
//
|
||||
// World
|
||||
//
|
||||
fSolidWorld = new G4Box("World", //its name
|
||||
fWorldSizeX/2,fWorldSizeYZ/2,fWorldSizeYZ/2); //its size
|
||||
fSolidWorld = new G4Box("World", // its name
|
||||
fWorldSizeX / 2, fWorldSizeYZ / 2, fWorldSizeYZ / 2); // its size
|
||||
|
||||
fLogicWorld = new G4LogicalVolume(fSolidWorld, //its solid
|
||||
fDefaultMaterial, //its material
|
||||
"World"); //its name
|
||||
fLogicWorld = new G4LogicalVolume(fSolidWorld, // its solid
|
||||
fDefaultMaterial, // its material
|
||||
"World"); // its name
|
||||
|
||||
fPhysiWorld = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
fLogicWorld, //its logical volume
|
||||
"World", //its name
|
||||
nullptr, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
fPhysiWorld = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
fLogicWorld, // its logical volume
|
||||
"World", // its name
|
||||
nullptr, // its mother volume
|
||||
false, // no boolean operation
|
||||
0); // copy number
|
||||
|
||||
//
|
||||
// Calorimeter
|
||||
//
|
||||
fSolidCalor = nullptr; fLogicCalor = nullptr; fPhysiCalor = nullptr;
|
||||
fSolidLayer = nullptr; fLogicLayer = nullptr; fPhysiLayer = nullptr;
|
||||
fSolidCalor = nullptr;
|
||||
fLogicCalor = nullptr;
|
||||
fPhysiCalor = nullptr;
|
||||
fSolidLayer = nullptr;
|
||||
fLogicLayer = nullptr;
|
||||
fPhysiLayer = nullptr;
|
||||
|
||||
if (fCalorThickness > 0.) {
|
||||
fSolidCalor = new G4Box("Calorimeter", //its name
|
||||
fCalorThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2); //size
|
||||
if (fCalorThickness > 0.) {
|
||||
fSolidCalor = new G4Box("Calorimeter", // its name
|
||||
fCalorThickness / 2, fCalorSizeYZ / 2, fCalorSizeYZ / 2); // size
|
||||
|
||||
fLogicCalor = new G4LogicalVolume(fSolidCalor, //its solid
|
||||
fDefaultMaterial, //its material
|
||||
"Calorimeter"); //its name
|
||||
fLogicCalor = new G4LogicalVolume(fSolidCalor, // its solid
|
||||
fDefaultMaterial, // its material
|
||||
"Calorimeter"); // its name
|
||||
|
||||
fPhysiCalor = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
fLogicCalor, //its logical volume
|
||||
"Calorimeter", //its name
|
||||
fLogicWorld, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
fPhysiCalor = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
fLogicCalor, // its logical volume
|
||||
"Calorimeter", // its name
|
||||
fLogicWorld, // its mother volume
|
||||
false, // no boolean operation
|
||||
0); // copy number
|
||||
|
||||
//
|
||||
// Layer
|
||||
//
|
||||
fSolidLayer = new G4Box("Layer", //its name
|
||||
fLayerThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2); //size
|
||||
fSolidLayer = new G4Box("Layer", // its name
|
||||
fLayerThickness / 2, fCalorSizeYZ / 2, fCalorSizeYZ / 2); // size
|
||||
|
||||
fLogicLayer = new G4LogicalVolume(fSolidLayer, //its solid
|
||||
fDefaultMaterial, //its material
|
||||
"Layer"); //its name
|
||||
fLogicLayer = new G4LogicalVolume(fSolidLayer, // its solid
|
||||
fDefaultMaterial, // its material
|
||||
"Layer"); // its name
|
||||
if (fNbOfLayers > 1) {
|
||||
fPhysiLayer = new G4PVReplica("Layer", //its name
|
||||
fLogicLayer, //its logical volume
|
||||
fLogicCalor, //its mother
|
||||
kXAxis, //axis of replication
|
||||
fNbOfLayers, //number of replica
|
||||
fLayerThickness); //witdth of replica
|
||||
fPhysiLayer = new G4PVReplica("Layer", // its name
|
||||
fLogicLayer, // its logical volume
|
||||
fLogicCalor, // its mother
|
||||
kXAxis, // axis of replication
|
||||
fNbOfLayers, // number of replica
|
||||
fLayerThickness); // witdth of replica
|
||||
}
|
||||
else {
|
||||
fPhysiLayer = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
fLogicLayer, //its logical volume
|
||||
"Layer", //its name
|
||||
fLogicCalor, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
fPhysiLayer = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
fLogicLayer, // its logical volume
|
||||
"Layer", // its name
|
||||
fLogicCalor, // its mother volume
|
||||
false, // no boolean operation
|
||||
0); // copy number
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Absorber
|
||||
//
|
||||
fSolidAbsorber = nullptr; fLogicAbsorber = nullptr; fPhysiAbsorber = nullptr;
|
||||
fSolidAbsorber = nullptr;
|
||||
fLogicAbsorber = nullptr;
|
||||
fPhysiAbsorber = nullptr;
|
||||
|
||||
if (fAbsorberThickness > 0.) {
|
||||
fSolidAbsorber = new G4Box("Absorber", //its name
|
||||
fAbsorberThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2); //size
|
||||
fSolidAbsorber = new G4Box("Absorber", // its name
|
||||
fAbsorberThickness / 2, fCalorSizeYZ / 2, fCalorSizeYZ / 2); // size
|
||||
|
||||
fLogicAbsorber = new G4LogicalVolume(fSolidAbsorber, //its solid
|
||||
fAbsorberMaterial, //its material
|
||||
fAbsorberMaterial->GetName()); //name
|
||||
|
||||
fPhysiAbsorber = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(-fGapThickness/2,0.,0.), //its position
|
||||
fLogicAbsorber, //its logical volume
|
||||
fAbsorberMaterial->GetName(), //its name
|
||||
fLogicLayer, //its mother
|
||||
false, //no boulean operat
|
||||
0); //copy number
|
||||
fLogicAbsorber = new G4LogicalVolume(fSolidAbsorber, // its solid
|
||||
fAbsorberMaterial, // its material
|
||||
fAbsorberMaterial->GetName()); // name
|
||||
|
||||
fPhysiAbsorber = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(-fGapThickness / 2, 0., 0.), // its position
|
||||
fLogicAbsorber, // its logical volume
|
||||
fAbsorberMaterial->GetName(), // its name
|
||||
fLogicLayer, // its mother
|
||||
false, // no boulean operat
|
||||
0); // copy number
|
||||
}
|
||||
|
||||
//
|
||||
// Gap
|
||||
//
|
||||
fSolidGap = nullptr; fLogicGap = nullptr; fPhysiGap = nullptr;
|
||||
fSolidGap = nullptr;
|
||||
fLogicGap = nullptr;
|
||||
fPhysiGap = nullptr;
|
||||
|
||||
if (fGapThickness > 0.) {
|
||||
fSolidGap = new G4Box("Gap",
|
||||
fGapThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2);
|
||||
fSolidGap = new G4Box("Gap", fGapThickness / 2, fCalorSizeYZ / 2, fCalorSizeYZ / 2);
|
||||
|
||||
fLogicGap = new G4LogicalVolume(fSolidGap,
|
||||
fGapMaterial,
|
||||
fGapMaterial->GetName());
|
||||
fLogicGap = new G4LogicalVolume(fSolidGap, fGapMaterial, fGapMaterial->GetName());
|
||||
|
||||
fPhysiGap = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(fAbsorberThickness/2,0.,0.), //its position
|
||||
fLogicGap, //its logical volume
|
||||
fGapMaterial->GetName(), //its name
|
||||
fLogicLayer, //its mother
|
||||
false, //no boulean operat
|
||||
0); //copy number
|
||||
fPhysiGap = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(fAbsorberThickness / 2, 0., 0.), // its position
|
||||
fLogicGap, // its logical volume
|
||||
fGapMaterial->GetName(), // its name
|
||||
fLogicLayer, // its mother
|
||||
false, // no boulean operat
|
||||
0); // copy number
|
||||
}
|
||||
|
||||
PrintCalorParameters();
|
||||
@@ -228,14 +230,14 @@ G4VPhysicalVolume* DetectorConstruction::ConstructCalorimeter()
|
||||
//
|
||||
// Visualization attributes
|
||||
//
|
||||
fLogicWorld->SetVisAttributes (G4VisAttributes::GetInvisible());
|
||||
fLogicWorld->SetVisAttributes(G4VisAttributes::GetInvisible());
|
||||
|
||||
auto simpleBoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
|
||||
auto simpleBoxVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0));
|
||||
simpleBoxVisAtt->SetVisibility(true);
|
||||
fLogicCalor->SetVisAttributes(simpleBoxVisAtt);
|
||||
|
||||
//
|
||||
//always return the physical World
|
||||
// always return the physical World
|
||||
//
|
||||
return fPhysiWorld;
|
||||
}
|
||||
@@ -246,9 +248,8 @@ void DetectorConstruction::PrintCalorParameters()
|
||||
{
|
||||
G4cout << "\n------------------------------------------------------------"
|
||||
<< "\n---> The calorimeter is " << fNbOfLayers << " layers of: [ "
|
||||
<< fAbsorberThickness/mm << "mm of " << fAbsorberMaterial->GetName()
|
||||
<< " + "
|
||||
<< fGapThickness/mm << "mm of " << fGapMaterial->GetName() << " ] "
|
||||
<< fAbsorberThickness / mm << "mm of " << fAbsorberMaterial->GetName() << " + "
|
||||
<< fGapThickness / mm << "mm of " << fGapMaterial->GetName() << " ] "
|
||||
<< "\n------------------------------------------------------------\n";
|
||||
}
|
||||
|
||||
@@ -274,7 +275,7 @@ void DetectorConstruction::SetGapMaterial(const G4String& materialChoice)
|
||||
auto material = G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
|
||||
if (material != nullptr) {
|
||||
fGapMaterial = material;
|
||||
if ( fLogicGap != nullptr) {
|
||||
if (fLogicGap != nullptr) {
|
||||
fLogicGap->SetMaterial(fGapMaterial);
|
||||
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
|
||||
}
|
||||
@@ -287,7 +288,7 @@ void DetectorConstruction::SetAbsorberThickness(G4double value)
|
||||
{
|
||||
// change Absorber thickness and recompute the calorimeter parameters
|
||||
fAbsorberThickness = value;
|
||||
if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
|
||||
if (G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit) {
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
}
|
||||
@@ -298,7 +299,7 @@ void DetectorConstruction::SetGapThickness(G4double value)
|
||||
{
|
||||
// change Gap thickness and recompute the calorimeter parameters
|
||||
fGapThickness = value;
|
||||
if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
|
||||
if (G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit) {
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
}
|
||||
@@ -309,7 +310,7 @@ void DetectorConstruction::SetCalorSizeYZ(G4double value)
|
||||
{
|
||||
// change the transverse size and recompute the calorimeter parameters
|
||||
fCalorSizeYZ = value;
|
||||
if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
|
||||
if (G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit) {
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
}
|
||||
@@ -319,7 +320,7 @@ void DetectorConstruction::SetCalorSizeYZ(G4double value)
|
||||
void DetectorConstruction::SetNbOfLayers(G4int value)
|
||||
{
|
||||
fNbOfLayers = value;
|
||||
if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
|
||||
if (G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit) {
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,57 +32,57 @@
|
||||
#include "DetectorMessenger.hh"
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorMessenger::DetectorMessenger( DetectorConstruction* Det)
|
||||
: fDetector(Det)
|
||||
DetectorMessenger::DetectorMessenger(DetectorConstruction* Det) : fDetector(Det)
|
||||
{
|
||||
G4bool broadcast = false;
|
||||
fDetDir = new G4UIdirectory("/det/",broadcast);
|
||||
fDetDir = new G4UIdirectory("/det/", broadcast);
|
||||
fDetDir->SetGuidance("Detector control");
|
||||
|
||||
fAbsMaterCmd = new G4UIcmdWithAString("/det/setAbsMat",this);
|
||||
fAbsMaterCmd = new G4UIcmdWithAString("/det/setAbsMat", this);
|
||||
fAbsMaterCmd->SetGuidance("Select Material of the Absorber.");
|
||||
fAbsMaterCmd->SetParameterName("AbsMat",false);
|
||||
fAbsMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fAbsMaterCmd->SetParameterName("AbsMat", false);
|
||||
fAbsMaterCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fGapMaterCmd = new G4UIcmdWithAString("/det/setGapMat",this);
|
||||
fGapMaterCmd = new G4UIcmdWithAString("/det/setGapMat", this);
|
||||
fGapMaterCmd->SetGuidance("Select Material of the Gap.");
|
||||
fGapMaterCmd->SetParameterName("GapMat",false);
|
||||
fGapMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fGapMaterCmd->SetParameterName("GapMat", false);
|
||||
fGapMaterCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fAbsThickCmd = new G4UIcmdWithADoubleAndUnit("/det/setAbsThick",this);
|
||||
fAbsThickCmd = new G4UIcmdWithADoubleAndUnit("/det/setAbsThick", this);
|
||||
fAbsThickCmd->SetGuidance("Set Thickness of the Absorber");
|
||||
fAbsThickCmd->SetParameterName("AbsThick",false);
|
||||
fAbsThickCmd->SetParameterName("AbsThick", false);
|
||||
fAbsThickCmd->SetRange("AbsThick>=0.");
|
||||
fAbsThickCmd->SetUnitCategory("Length");
|
||||
fAbsThickCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fAbsThickCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fGapThickCmd = new G4UIcmdWithADoubleAndUnit("/det/setGapThick",this);
|
||||
fGapThickCmd = new G4UIcmdWithADoubleAndUnit("/det/setGapThick", this);
|
||||
fGapThickCmd->SetGuidance("Set Thickness of the Gap");
|
||||
fGapThickCmd->SetParameterName("GapThick",false);
|
||||
fGapThickCmd->SetParameterName("GapThick", false);
|
||||
fGapThickCmd->SetRange("GapThick>=0.");
|
||||
fGapThickCmd->SetUnitCategory("Length");
|
||||
fGapThickCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fGapThickCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fSizeYZCmd = new G4UIcmdWithADoubleAndUnit("/det/setSizeYZ",this);
|
||||
fSizeYZCmd = new G4UIcmdWithADoubleAndUnit("/det/setSizeYZ", this);
|
||||
fSizeYZCmd->SetGuidance("Set tranverse size of the calorimeter");
|
||||
fSizeYZCmd->SetParameterName("SizeYZ",false);
|
||||
fSizeYZCmd->SetParameterName("SizeYZ", false);
|
||||
fSizeYZCmd->SetRange("SizeYZ>0.");
|
||||
fSizeYZCmd->SetUnitCategory("Length");
|
||||
fSizeYZCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fSizeYZCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fNbLayersCmd = new G4UIcmdWithAnInteger("/det/setNbOfLayers",this);
|
||||
fNbLayersCmd = new G4UIcmdWithAnInteger("/det/setNbOfLayers", this);
|
||||
fNbLayersCmd->SetGuidance("Set number of layers.");
|
||||
fNbLayersCmd->SetParameterName("NbLayers",false);
|
||||
fNbLayersCmd->SetParameterName("NbLayers", false);
|
||||
fNbLayersCmd->SetRange("NbLayers>0 && NbLayers<500");
|
||||
fNbLayersCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fNbLayersCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -102,32 +102,32 @@ DetectorMessenger::~DetectorMessenger()
|
||||
|
||||
void DetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
if( command == fAbsMaterCmd ) {
|
||||
if (command == fAbsMaterCmd) {
|
||||
fDetector->SetAbsorberMaterial(newValue);
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fGapMaterCmd ) {
|
||||
if (command == fGapMaterCmd) {
|
||||
fDetector->SetGapMaterial(newValue);
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fAbsThickCmd ) {
|
||||
if (command == fAbsThickCmd) {
|
||||
fDetector->SetAbsorberThickness(fAbsThickCmd->GetNewDoubleValue(newValue));
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fGapThickCmd ) {
|
||||
if (command == fGapThickCmd) {
|
||||
fDetector->SetGapThickness(fGapThickCmd->GetNewDoubleValue(newValue));
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fSizeYZCmd ) {
|
||||
if (command == fSizeYZCmd) {
|
||||
fDetector->SetCalorSizeYZ(fSizeYZCmd->GetNewDoubleValue(newValue));
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fNbLayersCmd ) {
|
||||
if (command == fNbLayersCmd) {
|
||||
fDetector->SetNbOfLayers(fNbLayersCmd->GetNewIntValue(newValue));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -35,15 +35,14 @@
|
||||
|
||||
#include "EventAction.hh"
|
||||
|
||||
#include "RunAction.hh"
|
||||
#include "HistoManager.hh"
|
||||
#include "RunAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EventAction::EventAction(RunAction* run, HistoManager* histo)
|
||||
: fRunAct(run),fHistoManager(histo)
|
||||
EventAction::EventAction(RunAction* run, HistoManager* histo) : fRunAct(run), fHistoManager(histo)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -55,7 +54,7 @@ EventAction::~EventAction() = default;
|
||||
void EventAction::BeginOfEventAction(const G4Event* evt)
|
||||
{
|
||||
G4int evtNb = evt->GetEventID();
|
||||
if (evtNb%fPrintModulo == 0) {
|
||||
if (evtNb % fPrintModulo == 0) {
|
||||
G4cout << "\n---> Begin of event: " << evtNb << G4endl;
|
||||
}
|
||||
|
||||
@@ -68,18 +67,18 @@ void EventAction::BeginOfEventAction(const G4Event* evt)
|
||||
|
||||
void EventAction::EndOfEventAction(const G4Event*)
|
||||
{
|
||||
//accumulates statistic
|
||||
// accumulates statistic
|
||||
//
|
||||
fRunAct->FillPerEvent(fEnergyAbs, fEnergyGap, fTrackLAbs, fTrackLGap);
|
||||
|
||||
//fill histograms
|
||||
// fill histograms
|
||||
//
|
||||
fHistoManager->FillHisto(0, fEnergyAbs);
|
||||
fHistoManager->FillHisto(1, fEnergyGap);
|
||||
fHistoManager->FillHisto(2, fTrackLAbs);
|
||||
fHistoManager->FillHisto(3, fTrackLGap);
|
||||
|
||||
//fill ntuple
|
||||
// fill ntuple
|
||||
//
|
||||
fHistoManager->FillNtuple(fEnergyAbs, fEnergyGap, fTrackLAbs, fTrackLGap);
|
||||
}
|
||||
|
||||
@@ -34,30 +34,28 @@
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* dc)
|
||||
: fDetector(dc)
|
||||
PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* dc) : fDetector(dc)
|
||||
{
|
||||
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="e-");
|
||||
G4ParticleDefinition* particle = particleTable->FindParticle(particleName = "e-");
|
||||
fParticleGun->SetParticleDefinition(particle);
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
|
||||
fParticleGun->SetParticleEnergy(500.*MeV);
|
||||
G4double position = -0.5*(fDetector->GetWorldSizeX());
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm));
|
||||
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(1., 0., 0.));
|
||||
fParticleGun->SetParticleEnergy(500. * MeV);
|
||||
G4double position = -0.5 * (fDetector->GetWorldSizeX());
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(position, 0. * cm, 0. * cm));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -71,10 +69,9 @@ PrimaryGeneratorAction::~PrimaryGeneratorAction()
|
||||
|
||||
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
//this function is called at the begining of event
|
||||
// this function is called at the begining of event
|
||||
//
|
||||
fParticleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -32,17 +32,17 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "RunAction.hh"
|
||||
|
||||
#include "HistoManager.hh"
|
||||
|
||||
#include "G4AccumulableManager.hh"
|
||||
#include "G4Run.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4AccumulableManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
RunAction::RunAction(HistoManager* histo)
|
||||
: fHistoManager(histo)
|
||||
RunAction::RunAction(HistoManager* histo) : fHistoManager(histo)
|
||||
{
|
||||
// Register accumulable to the accumulable manager
|
||||
G4AccumulableManager* accumulableManager = G4AccumulableManager::Instance();
|
||||
@@ -69,23 +69,26 @@ void RunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
// reset accumulables to their initial values
|
||||
G4AccumulableManager::Instance()->Reset();
|
||||
|
||||
//histograms
|
||||
// histograms
|
||||
//
|
||||
fHistoManager->Book();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void RunAction::FillPerEvent(G4double EAbs, G4double EGap,
|
||||
G4double LAbs, G4double LGap)
|
||||
void RunAction::FillPerEvent(G4double EAbs, G4double EGap, G4double LAbs, G4double LGap)
|
||||
{
|
||||
//accumulate statistic
|
||||
// accumulate statistic
|
||||
//
|
||||
fSumEAbs += EAbs; fSum2EAbs += EAbs*EAbs;
|
||||
fSumEGap += EGap; fSum2EGap += EGap*EGap;
|
||||
fSumEAbs += EAbs;
|
||||
fSum2EAbs += EAbs * EAbs;
|
||||
fSumEGap += EGap;
|
||||
fSum2EGap += EGap * EGap;
|
||||
|
||||
fSumLAbs += LAbs; fSum2LAbs += LAbs*LAbs;
|
||||
fSumLGap += LGap; fSum2LGap += LGap*LGap;
|
||||
fSumLAbs += LAbs;
|
||||
fSum2LAbs += LAbs * LAbs;
|
||||
fSumLGap += LGap;
|
||||
fSum2LGap += LGap * LGap;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -102,67 +105,72 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
|
||||
return;
|
||||
}
|
||||
|
||||
//compute statistics: mean and rms
|
||||
// compute statistics: mean and rms
|
||||
//
|
||||
auto sumEAbs = fSumEAbs.GetValue();
|
||||
auto sum2EAbs = fSum2EAbs.GetValue();
|
||||
sumEAbs /= nofEvents; sum2EAbs /= nofEvents;
|
||||
auto rmsEAbs = sum2EAbs - sumEAbs*sumEAbs;
|
||||
if (rmsEAbs >0.) {
|
||||
sumEAbs /= nofEvents;
|
||||
sum2EAbs /= nofEvents;
|
||||
auto rmsEAbs = sum2EAbs - sumEAbs * sumEAbs;
|
||||
if (rmsEAbs > 0.) {
|
||||
rmsEAbs = std::sqrt(rmsEAbs);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
rmsEAbs = 0.;
|
||||
}
|
||||
|
||||
auto sumEGap = fSumEGap.GetValue();
|
||||
auto sum2EGap = fSum2EGap.GetValue();
|
||||
sumEGap /= nofEvents; sum2EGap /= nofEvents;
|
||||
auto rmsEGap = sum2EGap - sumEGap*sumEGap;
|
||||
if (rmsEGap >0.) {
|
||||
sumEGap /= nofEvents;
|
||||
sum2EGap /= nofEvents;
|
||||
auto rmsEGap = sum2EGap - sumEGap * sumEGap;
|
||||
if (rmsEGap > 0.) {
|
||||
rmsEGap = std::sqrt(rmsEGap);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
rmsEGap = 0.;
|
||||
}
|
||||
|
||||
auto sumLAbs = fSumLAbs.GetValue();
|
||||
auto sum2LAbs = fSum2LAbs.GetValue();
|
||||
sumLAbs /= nofEvents; sum2LAbs /= nofEvents;
|
||||
auto rmsLAbs = sum2LAbs - sumLAbs*sumLAbs;
|
||||
if (rmsLAbs >0.) {
|
||||
sumLAbs /= nofEvents;
|
||||
sum2LAbs /= nofEvents;
|
||||
auto rmsLAbs = sum2LAbs - sumLAbs * sumLAbs;
|
||||
if (rmsLAbs > 0.) {
|
||||
rmsLAbs = std::sqrt(rmsLAbs);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
rmsLAbs = 0.;
|
||||
}
|
||||
|
||||
auto sumLGap = fSumLGap.GetValue();
|
||||
auto sum2LGap = fSum2LGap.GetValue();
|
||||
sumLGap /= nofEvents; sum2LGap /= nofEvents;
|
||||
G4double rmsLGap = sum2LGap - sumLGap*sumLGap;
|
||||
if (rmsLGap >0.) {
|
||||
sumLGap /= nofEvents;
|
||||
sum2LGap /= nofEvents;
|
||||
G4double rmsLGap = sum2LGap - sumLGap * sumLGap;
|
||||
if (rmsLGap > 0.) {
|
||||
rmsLGap = std::sqrt(rmsLGap);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
rmsLGap = 0.;
|
||||
}
|
||||
|
||||
//print
|
||||
// print
|
||||
//
|
||||
G4cout
|
||||
<< "\n--------------------End of Run------------------------------\n"
|
||||
<< "\n mean Energy in Absorber : " << G4BestUnit(sumEAbs,"Energy")
|
||||
<< " +- " << G4BestUnit(rmsEAbs,"Energy")
|
||||
<< "\n mean Energy in Gap : " << G4BestUnit(sumEGap,"Energy")
|
||||
<< " +- " << G4BestUnit(rmsEGap,"Energy")
|
||||
<< G4endl;
|
||||
G4cout << "\n--------------------End of Run------------------------------\n"
|
||||
<< "\n mean Energy in Absorber : " << G4BestUnit(sumEAbs, "Energy") << " +- "
|
||||
<< G4BestUnit(rmsEAbs, "Energy")
|
||||
<< "\n mean Energy in Gap : " << G4BestUnit(sumEGap, "Energy") << " +- "
|
||||
<< G4BestUnit(rmsEGap, "Energy") << G4endl;
|
||||
|
||||
G4cout
|
||||
<< "\n mean trackLength in Absorber : " << G4BestUnit(sumLAbs,"Length")
|
||||
<< " +- " << G4BestUnit(rmsLAbs,"Length")
|
||||
<< "\n mean trackLength in Gap : " << G4BestUnit(sumLGap,"Length")
|
||||
<< " +- " << G4BestUnit(rmsLGap,"Length")
|
||||
<< "\n------------------------------------------------------------\n"
|
||||
<< G4endl;
|
||||
G4cout << "\n mean trackLength in Absorber : " << G4BestUnit(sumLAbs, "Length") << " +- "
|
||||
<< G4BestUnit(rmsLAbs, "Length")
|
||||
<< "\n mean trackLength in Gap : " << G4BestUnit(sumLGap, "Length") << " +- "
|
||||
<< G4BestUnit(rmsLGap, "Length")
|
||||
<< "\n------------------------------------------------------------\n"
|
||||
<< G4endl;
|
||||
|
||||
//save histograms
|
||||
// save histograms
|
||||
//
|
||||
fHistoManager->PrintStatistic();
|
||||
fHistoManager->Save();
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
SteppingAction::SteppingAction(DetectorConstruction* det, EventAction* evt)
|
||||
: fDetector(det), fEventAction(evt)
|
||||
: fDetector(det), fEventAction(evt)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -51,8 +51,7 @@ SteppingAction::~SteppingAction() = default;
|
||||
void SteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
{
|
||||
// get volume of the current step
|
||||
G4VPhysicalVolume* volume =
|
||||
aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
|
||||
G4VPhysicalVolume* volume = aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
|
||||
|
||||
// collect energy and track length step by step
|
||||
G4double edep = aStep->GetTotalEnergyDeposit();
|
||||
@@ -62,8 +61,12 @@ void SteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
stepl = aStep->GetStepLength();
|
||||
}
|
||||
|
||||
if (volume == fDetector->GetAbsorber()) { fEventAction->AddAbs(edep,stepl); }
|
||||
if (volume == fDetector->GetGap()) { fEventAction->AddGap(edep,stepl); }
|
||||
if (volume == fDetector->GetAbsorber()) {
|
||||
fEventAction->AddAbs(edep, stepl);
|
||||
}
|
||||
if (volume == fDetector->GetGap()) {
|
||||
fEventAction->AddGap(edep, stepl);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -30,14 +30,15 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include <TH1D.h>
|
||||
#include <TFile.h>
|
||||
#include <TTree.h>
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
#include "HistoManager.hh"
|
||||
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
#include <TFile.h>
|
||||
#include <TH1D.h>
|
||||
#include <TTree.h>
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
HistoManager::~HistoManager()
|
||||
@@ -53,24 +54,23 @@ void HistoManager::Book()
|
||||
// This tree is associated to an output file.
|
||||
//
|
||||
G4String fileName = "AnaEx02.root";
|
||||
fRootFile = new TFile(fileName,"RECREATE");
|
||||
fRootFile = new TFile(fileName, "RECREATE");
|
||||
if (fRootFile == nullptr) {
|
||||
G4cout << " HistoManager::Book :"
|
||||
<< " problem creating the ROOT TFile "
|
||||
<< G4endl;
|
||||
<< " problem creating the ROOT TFile " << G4endl;
|
||||
return;
|
||||
}
|
||||
|
||||
// id = 0
|
||||
fHisto[0] = new TH1D("EAbs", "Edep in absorber (MeV)", 100, 0., 800*CLHEP::MeV);
|
||||
fHisto[0] = new TH1D("EAbs", "Edep in absorber (MeV)", 100, 0., 800 * CLHEP::MeV);
|
||||
// id = 1
|
||||
fHisto[1] = new TH1D("EGap", "Edep in gap (MeV)", 100, 0., 100*CLHEP::MeV);
|
||||
fHisto[1] = new TH1D("EGap", "Edep in gap (MeV)", 100, 0., 100 * CLHEP::MeV);
|
||||
// id = 2
|
||||
fHisto[2] = new TH1D("LAbs", "trackL in absorber (mm)", 100, 0., 1*CLHEP::m);
|
||||
fHisto[2] = new TH1D("LAbs", "trackL in absorber (mm)", 100, 0., 1 * CLHEP::m);
|
||||
// id = 3
|
||||
fHisto[3] = new TH1D("LGap", "trackL in gap (mm)", 100, 0., 50*CLHEP::cm);
|
||||
fHisto[3] = new TH1D("LGap", "trackL in gap (mm)", 100, 0., 50 * CLHEP::cm);
|
||||
|
||||
for ( G4int i=0; i<kMaxHisto; ++i ) {
|
||||
for (G4int i = 0; i < kMaxHisto; ++i) {
|
||||
if (fHisto[i] == nullptr) {
|
||||
G4cout << "\n can't create histo " << i << G4endl;
|
||||
}
|
||||
@@ -93,11 +93,12 @@ void HistoManager::Book()
|
||||
|
||||
void HistoManager::Save()
|
||||
{
|
||||
if (fRootFile == nullptr) { return;
|
||||
}
|
||||
if (fRootFile == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
fRootFile->Write(); // Writing the histograms to the file
|
||||
fRootFile->Close(); // and closing the tree (and the file)
|
||||
fRootFile->Write(); // Writing the histograms to the file
|
||||
fRootFile->Close(); // and closing the tree (and the file)
|
||||
|
||||
G4cout << "\n----> Histograms and ntuples are saved\n" << G4endl;
|
||||
}
|
||||
@@ -108,11 +109,12 @@ void HistoManager::FillHisto(G4int ih, G4double xbin, G4double weight)
|
||||
{
|
||||
if (ih >= kMaxHisto) {
|
||||
G4cerr << "---> warning from HistoManager::FillHisto() : histo " << ih
|
||||
<< " does not exist. (xbin=" << xbin << " weight=" << weight << ")"
|
||||
<< G4endl;
|
||||
<< " does not exist. (xbin=" << xbin << " weight=" << weight << ")" << G4endl;
|
||||
return;
|
||||
}
|
||||
if (fHisto[ih] != nullptr) { fHisto[ih]->Fill(xbin, weight); }
|
||||
if (fHisto[ih] != nullptr) {
|
||||
fHisto[ih]->Fill(xbin, weight);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -131,16 +133,20 @@ void HistoManager::Normalize(G4int ih, G4double fac)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void HistoManager::FillNtuple(G4double energyAbs, G4double energyGap,
|
||||
G4double trackLAbs , G4double trackLGap )
|
||||
void HistoManager::FillNtuple(G4double energyAbs, G4double energyGap, G4double trackLAbs,
|
||||
G4double trackLGap)
|
||||
{
|
||||
fEabs = energyAbs;
|
||||
fEgap = energyGap;
|
||||
fLabs = trackLAbs;
|
||||
fLgap = trackLGap;
|
||||
|
||||
if (fNtuple1 != nullptr) { fNtuple1->Fill(); }
|
||||
if (fNtuple2 != nullptr) { fNtuple2->Fill(); }
|
||||
if (fNtuple1 != nullptr) {
|
||||
fNtuple1->Fill();
|
||||
}
|
||||
if (fNtuple2 != nullptr) {
|
||||
fNtuple2->Fill();
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -152,13 +158,15 @@ void HistoManager::PrintStatistic()
|
||||
const G4String name = h1->GetName();
|
||||
|
||||
G4String unitCategory;
|
||||
if (name[0] == 'E' ) { unitCategory = "Energy"; }
|
||||
if (name[0] == 'L' ) { unitCategory = "Length"; }
|
||||
if (name[0] == 'E') {
|
||||
unitCategory = "Energy";
|
||||
}
|
||||
if (name[0] == 'L') {
|
||||
unitCategory = "Length";
|
||||
}
|
||||
|
||||
G4cout << name
|
||||
<< ": mean = " << G4BestUnit(h1->GetMean(), unitCategory)
|
||||
<< " rms = " << G4BestUnit(h1->GetRMS(), unitCategory )
|
||||
<< G4endl;
|
||||
G4cout << name << ": mean = " << G4BestUnit(h1->GetMean(), unitCategory)
|
||||
<< " rms = " << G4BestUnit(h1->GetRMS(), unitCategory) << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -78,14 +78,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...
|
||||
|
||||
@@ -276,7 +283,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
|
||||
|
||||
@@ -831,7 +838,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
|
||||
@@ -861,10 +868,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 86.7754 MeV rms = 6.06128 MeV
|
||||
EGap: mean = 6.22737 MeV rms = 4.05788 MeV
|
||||
LAbs: mean = 6.36212 cm rms = 5.45277 mm
|
||||
LGap: mean = 3.22513 cm rms = 2.15538 cm
|
||||
EAbs: mean = 92.3063 MeV rms = 4.14219 MeV
|
||||
EGap: mean = 4.85878 MeV rms = 2.0183 MeV
|
||||
LAbs: mean = 6.63777 cm rms = 2.92186 mm
|
||||
LGap: mean = 2.3872 cm rms = 9.61394 mm
|
||||
### Run 1 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
@@ -889,8 +896,8 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 182.084 MeV rms = 6.77419 MeV
|
||||
LAbs: mean = 13.0969 cm rms = 5.39518 mm
|
||||
EAbs: mean = 181.847 MeV rms = 4.68046 MeV
|
||||
LAbs: mean = 13.1175 cm rms = 4.04973 mm
|
||||
### Run 2 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
@@ -923,10 +930,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 271.702 MeV rms = 14.4701 MeV
|
||||
EGap2: mean = 13.0056 MeV rms = 4.70044 MeV
|
||||
LAbs: mean = 19.609 cm rms = 1.07761 cm
|
||||
LGap2: mean = 6.42871 cm rms = 2.46679 cm
|
||||
EAbs: mean = 274.942 MeV rms = 8.96651 MeV
|
||||
EGap2: mean = 13.9939 MeV rms = 6.14487 MeV
|
||||
LAbs: mean = 19.7961 cm rms = 7.49951 mm
|
||||
LGap2: mean = 6.91332 cm rms = 3.1357 cm
|
||||
... close file : ./histo/e-_h1_EAbs.csv - done
|
||||
... close file : ./histo/e-_h1_EAbs_v1.csv - done
|
||||
... close file : ./histo/e-_h1_EAbs_v2.csv - done
|
||||
@@ -966,10 +973,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 197.13 MeV rms = 59.1173 MeV
|
||||
EGap2: mean = 20.0031 MeV rms = 11.0171 MeV
|
||||
LAbs: mean = 8.42208 cm rms = 2.68317 cm
|
||||
LGap2: mean = 4.32901 cm rms = 1.4735 cm
|
||||
EAbs: mean = 220.52 MeV rms = 42.6585 MeV
|
||||
EGap2: mean = 21.0932 MeV rms = 14.424 MeV
|
||||
LAbs: mean = 8.44493 cm rms = 2.11558 cm
|
||||
LGap2: mean = 4.29837 cm rms = 1.2912 cm
|
||||
### Run 4 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
@@ -998,10 +1005,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 201.326 MeV rms = 52.7717 MeV
|
||||
EGap2: mean = 19.8641 MeV rms = 13.0272 MeV
|
||||
LAbs: mean = 9.43807 cm rms = 2.2901 cm
|
||||
LGap2: mean = 4.98845 cm rms = 1.36532 cm
|
||||
EAbs: mean = 183.744 MeV rms = 43.5113 MeV
|
||||
EGap2: mean = 15.4705 MeV rms = 6.10516 MeV
|
||||
LAbs: mean = 9.21143 cm rms = 2.16642 cm
|
||||
LGap2: mean = 4.86717 cm rms = 1.60599 cm
|
||||
... close file : ./histo/proton_h1_EAbs.csv - done
|
||||
... close file : ./histo/proton_h1_EAbs_v1.csv - done
|
||||
... close file : ./histo/proton_h1_EGap2.csv - done
|
||||
|
||||
@@ -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
|
||||
@@ -78,14 +78,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...
|
||||
|
||||
@@ -275,7 +282,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
|
||||
|
||||
@@ -830,7 +837,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
|
||||
@@ -851,10 +858,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 86.7754 MeV rms = 6.06128 MeV
|
||||
EGap: mean = 6.22737 MeV rms = 4.05788 MeV
|
||||
LAbs: mean = 6.36212 cm rms = 5.45277 mm
|
||||
LGap: mean = 3.22513 cm rms = 2.15538 cm
|
||||
EAbs: mean = 92.3063 MeV rms = 4.14219 MeV
|
||||
EGap: mean = 4.85878 MeV rms = 2.0183 MeV
|
||||
LAbs: mean = 6.63777 cm rms = 2.92186 mm
|
||||
LGap: mean = 2.3872 cm rms = 9.61394 mm
|
||||
### Run 1 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
@@ -866,8 +873,8 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 182.084 MeV rms = 6.77419 MeV
|
||||
LAbs: mean = 13.0969 cm rms = 5.39518 mm
|
||||
EAbs: mean = 181.847 MeV rms = 4.68046 MeV
|
||||
LAbs: mean = 13.1175 cm rms = 4.04973 mm
|
||||
### Run 2 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
@@ -879,10 +886,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 271.702 MeV rms = 14.4701 MeV
|
||||
EGap2: mean = 13.0056 MeV rms = 4.70044 MeV
|
||||
LAbs: mean = 19.609 cm rms = 1.07761 cm
|
||||
LGap2: mean = 6.42871 cm rms = 2.46679 cm
|
||||
EAbs: mean = 274.942 MeV rms = 8.96651 MeV
|
||||
EGap2: mean = 13.9939 MeV rms = 6.14487 MeV
|
||||
LAbs: mean = 19.7961 cm rms = 7.49951 mm
|
||||
LGap2: mean = 6.91332 cm rms = 3.1357 cm
|
||||
... close file : e-.hdf5 - done
|
||||
... create file : proton.hdf5 - done
|
||||
... open analysis file : proton.hdf5 - done
|
||||
@@ -897,10 +904,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 197.13 MeV rms = 59.1173 MeV
|
||||
EGap2: mean = 20.0031 MeV rms = 11.0171 MeV
|
||||
LAbs: mean = 8.42208 cm rms = 2.68317 cm
|
||||
LGap2: mean = 4.32901 cm rms = 1.4735 cm
|
||||
EAbs: mean = 220.52 MeV rms = 42.6585 MeV
|
||||
EGap2: mean = 21.0932 MeV rms = 14.424 MeV
|
||||
LAbs: mean = 8.44493 cm rms = 2.11558 cm
|
||||
LGap2: mean = 4.29837 cm rms = 1.2912 cm
|
||||
### Run 4 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
@@ -912,10 +919,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 201.326 MeV rms = 52.7717 MeV
|
||||
EGap2: mean = 19.8641 MeV rms = 13.0272 MeV
|
||||
LAbs: mean = 9.43807 cm rms = 2.2901 cm
|
||||
LGap2: mean = 4.98845 cm rms = 1.36532 cm
|
||||
EAbs: mean = 183.744 MeV rms = 43.5113 MeV
|
||||
EGap2: mean = 15.4705 MeV rms = 6.10516 MeV
|
||||
LAbs: mean = 9.21143 cm rms = 2.16642 cm
|
||||
LGap2: mean = 4.86717 cm rms = 1.60599 cm
|
||||
... close file : proton.hdf5 - done
|
||||
Graphics systems deleted.
|
||||
Visualization Manager deleting...
|
||||
|
||||
@@ -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
|
||||
@@ -78,14 +78,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...
|
||||
|
||||
@@ -277,7 +284,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
|
||||
|
||||
@@ -832,7 +839,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
|
||||
@@ -853,10 +860,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 86.7754 MeV rms = 6.06128 MeV
|
||||
EGap: mean = 6.22737 MeV rms = 4.05788 MeV
|
||||
LAbs: mean = 6.36212 cm rms = 5.45277 mm
|
||||
LGap: mean = 3.22513 cm rms = 2.15538 cm
|
||||
EAbs: mean = 92.3063 MeV rms = 4.14219 MeV
|
||||
EGap: mean = 4.85878 MeV rms = 2.0183 MeV
|
||||
LAbs: mean = 6.63777 cm rms = 2.92186 mm
|
||||
LGap: mean = 2.3872 cm rms = 9.61394 mm
|
||||
### Run 1 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
@@ -868,8 +875,8 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 182.084 MeV rms = 6.77419 MeV
|
||||
LAbs: mean = 13.0969 cm rms = 5.39518 mm
|
||||
EAbs: mean = 181.847 MeV rms = 4.68046 MeV
|
||||
LAbs: mean = 13.1175 cm rms = 4.04973 mm
|
||||
### Run 2 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
@@ -881,10 +888,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 271.702 MeV rms = 14.4701 MeV
|
||||
EGap2: mean = 13.0056 MeV rms = 4.70044 MeV
|
||||
LAbs: mean = 19.609 cm rms = 1.07761 cm
|
||||
LGap2: mean = 6.42871 cm rms = 2.46679 cm
|
||||
EAbs: mean = 274.942 MeV rms = 8.96651 MeV
|
||||
EGap2: mean = 13.9939 MeV rms = 6.14487 MeV
|
||||
LAbs: mean = 19.7961 cm rms = 7.49951 mm
|
||||
LGap2: mean = 6.91332 cm rms = 3.1357 cm
|
||||
... close file : e-.root - done
|
||||
... create file : proton.root - done
|
||||
... open analysis file : proton.root - done
|
||||
@@ -900,10 +907,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 197.13 MeV rms = 59.1173 MeV
|
||||
EGap2: mean = 20.0031 MeV rms = 11.0171 MeV
|
||||
LAbs: mean = 8.42208 cm rms = 2.68317 cm
|
||||
LGap2: mean = 4.32901 cm rms = 1.4735 cm
|
||||
EAbs: mean = 220.52 MeV rms = 42.6585 MeV
|
||||
EGap2: mean = 21.0932 MeV rms = 14.424 MeV
|
||||
LAbs: mean = 8.44493 cm rms = 2.11558 cm
|
||||
LGap2: mean = 4.29837 cm rms = 1.2912 cm
|
||||
### Run 4 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
@@ -915,10 +922,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 201.326 MeV rms = 52.7717 MeV
|
||||
EGap2: mean = 19.8641 MeV rms = 13.0272 MeV
|
||||
LAbs: mean = 9.43807 cm rms = 2.2901 cm
|
||||
LGap2: mean = 4.98845 cm rms = 1.36532 cm
|
||||
EAbs: mean = 183.744 MeV rms = 43.5113 MeV
|
||||
EGap2: mean = 15.4705 MeV rms = 6.10516 MeV
|
||||
LAbs: mean = 9.21143 cm rms = 2.16642 cm
|
||||
LGap2: mean = 4.86717 cm rms = 1.60599 cm
|
||||
... close file : proton.root - done
|
||||
Graphics systems deleted.
|
||||
Visualization Manager deleting...
|
||||
|
||||
@@ -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
|
||||
@@ -78,14 +78,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...
|
||||
|
||||
@@ -277,7 +284,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
|
||||
|
||||
@@ -832,7 +839,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
|
||||
@@ -855,10 +862,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 86.7754 MeV rms = 6.06128 MeV
|
||||
EGap: mean = 6.22737 MeV rms = 4.05788 MeV
|
||||
LAbs: mean = 6.36212 cm rms = 5.45277 mm
|
||||
LGap: mean = 3.22513 cm rms = 2.15538 cm
|
||||
EAbs: mean = 92.3063 MeV rms = 4.14219 MeV
|
||||
EGap: mean = 4.85878 MeV rms = 2.0183 MeV
|
||||
LAbs: mean = 6.63777 cm rms = 2.92186 mm
|
||||
LGap: mean = 2.3872 cm rms = 9.61394 mm
|
||||
### Run 1 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
@@ -872,8 +879,8 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 182.084 MeV rms = 6.77419 MeV
|
||||
LAbs: mean = 13.0969 cm rms = 5.39518 mm
|
||||
EAbs: mean = 181.847 MeV rms = 4.68046 MeV
|
||||
LAbs: mean = 13.1175 cm rms = 4.04973 mm
|
||||
### Run 2 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
@@ -887,10 +894,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 271.702 MeV rms = 14.4701 MeV
|
||||
EGap2: mean = 13.0056 MeV rms = 4.70044 MeV
|
||||
LAbs: mean = 19.609 cm rms = 1.07761 cm
|
||||
LGap2: mean = 6.42871 cm rms = 2.46679 cm
|
||||
EAbs: mean = 274.942 MeV rms = 8.96651 MeV
|
||||
EGap2: mean = 13.9939 MeV rms = 6.14487 MeV
|
||||
LAbs: mean = 19.7961 cm rms = 7.49951 mm
|
||||
LGap2: mean = 6.91332 cm rms = 3.1357 cm
|
||||
... close file : e-.xml - done
|
||||
... close file : e-_nt_Ntuple1.xml - done
|
||||
... close file : e-_nt_Ntuple2.xml - done
|
||||
@@ -911,10 +918,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 197.13 MeV rms = 59.1173 MeV
|
||||
EGap2: mean = 20.0031 MeV rms = 11.0171 MeV
|
||||
LAbs: mean = 8.42208 cm rms = 2.68317 cm
|
||||
LGap2: mean = 4.32901 cm rms = 1.4735 cm
|
||||
EAbs: mean = 220.52 MeV rms = 42.6585 MeV
|
||||
EGap2: mean = 21.0932 MeV rms = 14.424 MeV
|
||||
LAbs: mean = 8.44493 cm rms = 2.11558 cm
|
||||
LGap2: mean = 4.29837 cm rms = 1.2912 cm
|
||||
### Run 4 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
@@ -928,10 +935,10 @@ There are histograms that can be viewed with visualization:
|
||||
|
||||
----> print histograms statistic
|
||||
|
||||
EAbs: mean = 201.326 MeV rms = 52.7717 MeV
|
||||
EGap2: mean = 19.8641 MeV rms = 13.0272 MeV
|
||||
LAbs: mean = 9.43807 cm rms = 2.2901 cm
|
||||
LGap2: mean = 4.98845 cm rms = 1.36532 cm
|
||||
EAbs: mean = 183.744 MeV rms = 43.5113 MeV
|
||||
EGap2: mean = 15.4705 MeV rms = 6.10516 MeV
|
||||
LAbs: mean = 9.21143 cm rms = 2.16642 cm
|
||||
LGap2: mean = 4.86717 cm rms = 1.60599 cm
|
||||
... close file : proton.xml - done
|
||||
... close file : proton_nt_Ntuple1.xml - done
|
||||
... close file : proton_nt_Ntuple2.xml - done
|
||||
|
||||
@@ -32,25 +32,23 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "ActionInitialization.hh"
|
||||
|
||||
#include "G4RunManagerFactory.hh"
|
||||
|
||||
#include "G4UImanager.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "FTFP_BERT.hh"
|
||||
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "G4RunManagerFactory.hh"
|
||||
#include "G4UIExecutive.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VisExecutive.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
int main(int argc,char** argv)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
// Detect interactive mode (if no arguments) and define UI session
|
||||
//
|
||||
G4UIExecutive* ui = nullptr;
|
||||
if ( argc == 1 ) {
|
||||
if (argc == 1) {
|
||||
ui = new G4UIExecutive(argc, argv);
|
||||
}
|
||||
|
||||
@@ -62,7 +60,7 @@ int main(int argc,char** argv)
|
||||
|
||||
// Set mandatory initialization classes
|
||||
//
|
||||
auto detector = new DetectorConstruction;
|
||||
auto detector = new DetectorConstruction;
|
||||
runManager->SetUserInitialization(detector);
|
||||
runManager->SetUserInitialization(new FTFP_BERT);
|
||||
runManager->SetUserInitialization(new ActionInitialization(detector));
|
||||
@@ -76,13 +74,13 @@ int main(int argc,char** argv)
|
||||
//
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
|
||||
if ( ui == nullptr ) {
|
||||
if (ui == nullptr) {
|
||||
// batch mode
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand("/control/alias defaultFileType root");
|
||||
// define the default value for alias used in AnaEx03.in
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
// define the default value for alias used in AnaEx03.in
|
||||
UImanager->ApplyCommand(command + fileName);
|
||||
}
|
||||
else {
|
||||
// interactive mode
|
||||
|
||||
@@ -51,5 +51,3 @@ class ActionInitialization : public G4VUserActionInitialization
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -46,27 +46,33 @@ class HistoManager;
|
||||
|
||||
class EventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
EventAction();
|
||||
~EventAction() override;
|
||||
public:
|
||||
EventAction();
|
||||
~EventAction() override;
|
||||
|
||||
void BeginOfEventAction(const G4Event*) override;
|
||||
void EndOfEventAction(const G4Event*) override;
|
||||
void BeginOfEventAction(const G4Event*) override;
|
||||
void EndOfEventAction(const G4Event*) override;
|
||||
|
||||
void AddAbs(G4double de, G4double dl) {fEnergyAbs += de; fTrackLAbs += dl;};
|
||||
void AddGap(G4double de, G4double dl) {fEnergyGap += de; fTrackLGap += dl;};
|
||||
void AddAbs(G4double de, G4double dl)
|
||||
{
|
||||
fEnergyAbs += de;
|
||||
fTrackLAbs += dl;
|
||||
};
|
||||
void AddGap(G4double de, G4double dl)
|
||||
{
|
||||
fEnergyGap += de;
|
||||
fTrackLGap += dl;
|
||||
};
|
||||
|
||||
private:
|
||||
G4double fEnergyAbs = 0;
|
||||
G4double fEnergyGap = 0;
|
||||
G4double fTrackLAbs = 0;
|
||||
G4double fTrackLGap = 0;
|
||||
private:
|
||||
G4double fEnergyAbs = 0;
|
||||
G4double fEnergyGap = 0;
|
||||
G4double fTrackLAbs = 0;
|
||||
G4double fTrackLGap = 0;
|
||||
|
||||
G4int fPrintModulo = 100;
|
||||
G4int fPrintModulo = 100;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -46,19 +46,19 @@ class G4Run;
|
||||
|
||||
class RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
RunAction();
|
||||
~RunAction() override;
|
||||
public:
|
||||
RunAction();
|
||||
~RunAction() override;
|
||||
|
||||
void BeginOfRunAction(const G4Run*) override;
|
||||
void EndOfRunAction(const G4Run*) override;
|
||||
void BeginOfRunAction(const G4Run*) override;
|
||||
void EndOfRunAction(const G4Run*) override;
|
||||
|
||||
void PrintStatistic();
|
||||
void PrintStatistic();
|
||||
|
||||
private:
|
||||
void DefineCommands();
|
||||
private:
|
||||
void DefineCommands();
|
||||
|
||||
G4GenericMessenger* fMessenger = nullptr;
|
||||
G4GenericMessenger* fMessenger = nullptr;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
#ifndef DetectorConstruction_h
|
||||
#define DetectorConstruction_h 1
|
||||
|
||||
#include "CLHEP/Units/SystemOfUnits.h"
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include "CLHEP/Units/SystemOfUnits.h"
|
||||
|
||||
class G4Box;
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
@@ -48,41 +48,40 @@ class DetectorMessenger;
|
||||
class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
|
||||
DetectorConstruction();
|
||||
~DetectorConstruction() override;
|
||||
DetectorConstruction();
|
||||
~DetectorConstruction() override;
|
||||
|
||||
public:
|
||||
G4VPhysicalVolume* Construct() override;
|
||||
|
||||
void SetAbsorberMaterial (const G4String&);
|
||||
void SetAbsorberMaterial(const G4String&);
|
||||
void SetAbsorberThickness(G4double);
|
||||
|
||||
void SetGapMaterial (const G4String&);
|
||||
void SetGapMaterial(const G4String&);
|
||||
void SetGapThickness(G4double);
|
||||
|
||||
void SetCalorSizeYZ(G4double);
|
||||
void SetNbOfLayers (G4int);
|
||||
void SetNbOfLayers(G4int);
|
||||
|
||||
void PrintCalorParameters();
|
||||
|
||||
G4double GetWorldSizeX() { return fWorldSizeX; }
|
||||
G4double GetWorldSizeX() { return fWorldSizeX; }
|
||||
G4double GetWorldSizeYZ() { return fWorldSizeYZ; }
|
||||
|
||||
G4double GetCalorThickness() { return fCalorThickness; }
|
||||
G4double GetCalorSizeYZ() { return fCalorSizeYZ; }
|
||||
G4double GetCalorSizeYZ() { return fCalorSizeYZ; }
|
||||
|
||||
G4int GetNbOfLayers() { return fNbOfLayers; }
|
||||
|
||||
G4Material* GetAbsorberMaterial() { return fAbsorberMaterial; }
|
||||
G4double GetAbsorberThickness() { return fAbsorberThickness; }
|
||||
G4Material* GetAbsorberMaterial() { return fAbsorberMaterial; }
|
||||
G4double GetAbsorberThickness() { return fAbsorberThickness; }
|
||||
|
||||
G4Material* GetGapMaterial() { return fGapMaterial; }
|
||||
G4double GetGapThickness() { return fGapThickness; }
|
||||
G4Material* GetGapMaterial() { return fGapMaterial; }
|
||||
G4double GetGapThickness() { return fGapThickness; }
|
||||
|
||||
const G4VPhysicalVolume* GetphysiWorld() { return fPhysiWorld; }
|
||||
const G4VPhysicalVolume* GetAbsorber() { return fPhysiAbsorber; }
|
||||
const G4VPhysicalVolume* GetGap() { return fPhysiGap; }
|
||||
const G4VPhysicalVolume* GetAbsorber() { return fPhysiAbsorber; }
|
||||
const G4VPhysicalVolume* GetGap() { return fPhysiGap; }
|
||||
|
||||
private:
|
||||
void DefineMaterials();
|
||||
@@ -93,37 +92,37 @@ class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
G4Material* fGapMaterial = nullptr;
|
||||
G4Material* fDefaultMaterial = nullptr;
|
||||
|
||||
G4int fNbOfLayers = 10;
|
||||
G4double fAbsorberThickness = 10.*CLHEP::mm;
|
||||
G4double fGapThickness = 5.*CLHEP::mm;
|
||||
G4double fCalorSizeYZ = 10.*CLHEP::cm;
|
||||
G4int fNbOfLayers = 10;
|
||||
G4double fAbsorberThickness = 10. * CLHEP::mm;
|
||||
G4double fGapThickness = 5. * CLHEP::mm;
|
||||
G4double fCalorSizeYZ = 10. * CLHEP::cm;
|
||||
|
||||
G4double fCalorThickness = 0.; // will be computed
|
||||
G4double fLayerThickness= 0.; // will be computed
|
||||
G4double fWorldSizeYZ = 0.; // will be computed;
|
||||
G4double fWorldSizeX = 0.; // will be computed;
|
||||
G4double fCalorThickness = 0.; // will be computed
|
||||
G4double fLayerThickness = 0.; // will be computed
|
||||
G4double fWorldSizeYZ = 0.; // will be computed;
|
||||
G4double fWorldSizeX = 0.; // will be computed;
|
||||
|
||||
G4Box* fSolidWorld = nullptr; //pointer to the solid World
|
||||
G4LogicalVolume* fLogicWorld = nullptr; //pointer to the logical World
|
||||
G4VPhysicalVolume* fPhysiWorld = nullptr; //pointer to the physical World
|
||||
G4Box* fSolidWorld = nullptr; // pointer to the solid World
|
||||
G4LogicalVolume* fLogicWorld = nullptr; // pointer to the logical World
|
||||
G4VPhysicalVolume* fPhysiWorld = nullptr; // pointer to the physical World
|
||||
|
||||
G4Box* fSolidCalor = nullptr; //pointer to the solid Calor
|
||||
G4LogicalVolume* fLogicCalor = nullptr; //pointer to the logical Calor
|
||||
G4VPhysicalVolume* fPhysiCalor = nullptr; //pointer to the physical Calor
|
||||
G4Box* fSolidCalor = nullptr; // pointer to the solid Calor
|
||||
G4LogicalVolume* fLogicCalor = nullptr; // pointer to the logical Calor
|
||||
G4VPhysicalVolume* fPhysiCalor = nullptr; // pointer to the physical Calor
|
||||
|
||||
G4Box* fSolidLayer = nullptr; //pointer to the solid Layer
|
||||
G4LogicalVolume* fLogicLayer = nullptr; //pointer to the logical Layer
|
||||
G4VPhysicalVolume* fPhysiLayer = nullptr; //pointer to the physical Layer
|
||||
G4Box* fSolidLayer = nullptr; // pointer to the solid Layer
|
||||
G4LogicalVolume* fLogicLayer = nullptr; // pointer to the logical Layer
|
||||
G4VPhysicalVolume* fPhysiLayer = nullptr; // pointer to the physical Layer
|
||||
|
||||
G4Box* fSolidAbsorber = nullptr; //pointer to the solid Absorber
|
||||
G4LogicalVolume* fLogicAbsorber = nullptr; //pointer to the logical Absorber
|
||||
G4VPhysicalVolume* fPhysiAbsorber = nullptr; //pointer to the physical Absorber
|
||||
G4Box* fSolidAbsorber = nullptr; // pointer to the solid Absorber
|
||||
G4LogicalVolume* fLogicAbsorber = nullptr; // pointer to the logical Absorber
|
||||
G4VPhysicalVolume* fPhysiAbsorber = nullptr; // pointer to the physical Absorber
|
||||
|
||||
G4Box* fSolidGap = nullptr; //pointer to the solid Gap
|
||||
G4LogicalVolume* fLogicGap = nullptr; //pointer to the logical Gap
|
||||
G4VPhysicalVolume* fPhysiGap = nullptr; //pointer to the physical Gap
|
||||
G4Box* fSolidGap = nullptr; // pointer to the solid Gap
|
||||
G4LogicalVolume* fLogicGap = nullptr; // pointer to the logical Gap
|
||||
G4VPhysicalVolume* fPhysiGap = nullptr; // pointer to the physical Gap
|
||||
|
||||
DetectorMessenger* fDetectorMessenger = nullptr; //pointer to the Messenger
|
||||
DetectorMessenger* fDetectorMessenger = nullptr; // pointer to the Messenger
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -131,13 +130,13 @@ class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
inline void DetectorConstruction::ComputeCalorParameters()
|
||||
{
|
||||
// Compute derived parameters of the calorimeter
|
||||
fLayerThickness = fAbsorberThickness + fGapThickness;
|
||||
fCalorThickness = fNbOfLayers*fLayerThickness;
|
||||
fLayerThickness = fAbsorberThickness + fGapThickness;
|
||||
fCalorThickness = fNbOfLayers * fLayerThickness;
|
||||
|
||||
fWorldSizeX = 1.2*fCalorThickness; fWorldSizeYZ = 1.2*fCalorSizeYZ;
|
||||
fWorldSizeX = 1.2 * fCalorThickness;
|
||||
fWorldSizeYZ = 1.2 * fCalorSizeYZ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
#ifndef DetectorMessenger_h
|
||||
#define DetectorMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class DetectorConstruction;
|
||||
class G4UIdirectory;
|
||||
@@ -43,10 +43,10 @@ class G4UIcmdWithADoubleAndUnit;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class DetectorMessenger: public G4UImessenger
|
||||
class DetectorMessenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
DetectorMessenger(DetectorConstruction* );
|
||||
DetectorMessenger(DetectorConstruction*);
|
||||
~DetectorMessenger() override;
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String) override;
|
||||
@@ -54,13 +54,13 @@ class DetectorMessenger: public G4UImessenger
|
||||
private:
|
||||
DetectorConstruction* fDetector = nullptr;
|
||||
|
||||
G4UIdirectory* fDetDir = nullptr;
|
||||
G4UIcmdWithAString* fAbsMaterCmd = nullptr;
|
||||
G4UIcmdWithAString* fGapMaterCmd = nullptr;
|
||||
G4UIdirectory* fDetDir = nullptr;
|
||||
G4UIcmdWithAString* fAbsMaterCmd = nullptr;
|
||||
G4UIcmdWithAString* fGapMaterCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fAbsThickCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fGapThickCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSizeYZCmd = nullptr;
|
||||
G4UIcmdWithAnInteger* fNbLayersCmd = nullptr;
|
||||
G4UIcmdWithAnInteger* fNbLayersCmd = nullptr;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -43,19 +43,17 @@ class DetectorConstruction;
|
||||
|
||||
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
PrimaryGeneratorAction(DetectorConstruction*);
|
||||
~PrimaryGeneratorAction() override;
|
||||
public:
|
||||
PrimaryGeneratorAction(DetectorConstruction*);
|
||||
~PrimaryGeneratorAction() override;
|
||||
|
||||
void GeneratePrimaries(G4Event*) override;
|
||||
void GeneratePrimaries(G4Event*) override;
|
||||
|
||||
private:
|
||||
G4ParticleGun* fParticleGun = nullptr; //pointer a to G4 class
|
||||
DetectorConstruction* fDetector = nullptr; //pointer to the geometry
|
||||
private:
|
||||
G4ParticleGun* fParticleGun = nullptr; // pointer a to G4 class
|
||||
DetectorConstruction* fDetector = nullptr; // pointer to the geometry
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -41,15 +41,15 @@ class EventAction;
|
||||
|
||||
class SteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
SteppingAction(DetectorConstruction*, EventAction*);
|
||||
~SteppingAction() override;
|
||||
public:
|
||||
SteppingAction(DetectorConstruction*, EventAction*);
|
||||
~SteppingAction() override;
|
||||
|
||||
void UserSteppingAction(const G4Step*) override;
|
||||
void UserSteppingAction(const G4Step*) override;
|
||||
|
||||
private:
|
||||
DetectorConstruction* fDetector = nullptr;
|
||||
EventAction* fEventAction = nullptr;
|
||||
private:
|
||||
DetectorConstruction* fDetector = nullptr;
|
||||
EventAction* fEventAction = nullptr;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -30,26 +30,24 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
#include "DetectorMessenger.hh"
|
||||
|
||||
#include "G4Box.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4GeometryManager.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4NistManager.hh"
|
||||
|
||||
#include "G4Box.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4PVReplica.hh"
|
||||
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4GeometryManager.hh"
|
||||
#include "G4PhysicalVolumeStore.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4SolidStore.hh"
|
||||
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4SolidStore.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -113,114 +111,118 @@ G4VPhysicalVolume* DetectorConstruction::ConstructCalorimeter()
|
||||
//
|
||||
// World
|
||||
//
|
||||
fSolidWorld = new G4Box("World", //its name
|
||||
fWorldSizeX/2,fWorldSizeYZ/2,fWorldSizeYZ/2); //its size
|
||||
fSolidWorld = new G4Box("World", // its name
|
||||
fWorldSizeX / 2, fWorldSizeYZ / 2, fWorldSizeYZ / 2); // its size
|
||||
|
||||
fLogicWorld = new G4LogicalVolume(fSolidWorld, //its solid
|
||||
fDefaultMaterial, //its material
|
||||
"World"); //its name
|
||||
fLogicWorld = new G4LogicalVolume(fSolidWorld, // its solid
|
||||
fDefaultMaterial, // its material
|
||||
"World"); // its name
|
||||
|
||||
fPhysiWorld = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
fLogicWorld, //its logical volume
|
||||
"World", //its name
|
||||
nullptr, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
fPhysiWorld = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
fLogicWorld, // its logical volume
|
||||
"World", // its name
|
||||
nullptr, // its mother volume
|
||||
false, // no boolean operation
|
||||
0); // copy number
|
||||
|
||||
//
|
||||
// Calorimeter
|
||||
//
|
||||
fSolidCalor = nullptr; fLogicCalor = nullptr; fPhysiCalor = nullptr;
|
||||
fSolidLayer = nullptr; fLogicLayer = nullptr; fPhysiLayer = nullptr;
|
||||
fSolidCalor = nullptr;
|
||||
fLogicCalor = nullptr;
|
||||
fPhysiCalor = nullptr;
|
||||
fSolidLayer = nullptr;
|
||||
fLogicLayer = nullptr;
|
||||
fPhysiLayer = nullptr;
|
||||
|
||||
if (fCalorThickness > 0.) {
|
||||
fSolidCalor = new G4Box("Calorimeter", //its name
|
||||
fCalorThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2); //size
|
||||
if (fCalorThickness > 0.) {
|
||||
fSolidCalor = new G4Box("Calorimeter", // its name
|
||||
fCalorThickness / 2, fCalorSizeYZ / 2, fCalorSizeYZ / 2); // size
|
||||
|
||||
fLogicCalor = new G4LogicalVolume(fSolidCalor, //its solid
|
||||
fDefaultMaterial, //its material
|
||||
"Calorimeter"); //its name
|
||||
fLogicCalor = new G4LogicalVolume(fSolidCalor, // its solid
|
||||
fDefaultMaterial, // its material
|
||||
"Calorimeter"); // its name
|
||||
|
||||
fPhysiCalor = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
fLogicCalor, //its logical volume
|
||||
"Calorimeter", //its name
|
||||
fLogicWorld, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
fPhysiCalor = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
fLogicCalor, // its logical volume
|
||||
"Calorimeter", // its name
|
||||
fLogicWorld, // its mother volume
|
||||
false, // no boolean operation
|
||||
0); // copy number
|
||||
|
||||
//
|
||||
// Layer
|
||||
//
|
||||
fSolidLayer = new G4Box("Layer", //its name
|
||||
fLayerThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2); //size
|
||||
fSolidLayer = new G4Box("Layer", // its name
|
||||
fLayerThickness / 2, fCalorSizeYZ / 2, fCalorSizeYZ / 2); // size
|
||||
|
||||
fLogicLayer = new G4LogicalVolume(fSolidLayer, //its solid
|
||||
fDefaultMaterial, //its material
|
||||
"Layer"); //its name
|
||||
fLogicLayer = new G4LogicalVolume(fSolidLayer, // its solid
|
||||
fDefaultMaterial, // its material
|
||||
"Layer"); // its name
|
||||
if (fNbOfLayers > 1) {
|
||||
fPhysiLayer = new G4PVReplica("Layer", //its name
|
||||
fLogicLayer, //its logical volume
|
||||
fLogicCalor, //its mother
|
||||
kXAxis, //axis of replication
|
||||
fNbOfLayers, //number of replica
|
||||
fLayerThickness); //witdth of replica
|
||||
fPhysiLayer = new G4PVReplica("Layer", // its name
|
||||
fLogicLayer, // its logical volume
|
||||
fLogicCalor, // its mother
|
||||
kXAxis, // axis of replication
|
||||
fNbOfLayers, // number of replica
|
||||
fLayerThickness); // witdth of replica
|
||||
}
|
||||
else {
|
||||
fPhysiLayer = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
fLogicLayer, //its logical volume
|
||||
"Layer", //its name
|
||||
fLogicCalor, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
fPhysiLayer = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
fLogicLayer, // its logical volume
|
||||
"Layer", // its name
|
||||
fLogicCalor, // its mother volume
|
||||
false, // no boolean operation
|
||||
0); // copy number
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Absorber
|
||||
//
|
||||
fSolidAbsorber = nullptr; fLogicAbsorber = nullptr; fPhysiAbsorber = nullptr;
|
||||
fSolidAbsorber = nullptr;
|
||||
fLogicAbsorber = nullptr;
|
||||
fPhysiAbsorber = nullptr;
|
||||
|
||||
if (fAbsorberThickness > 0.) {
|
||||
fSolidAbsorber = new G4Box("Absorber", //its name
|
||||
fAbsorberThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2); //size
|
||||
fSolidAbsorber = new G4Box("Absorber", // its name
|
||||
fAbsorberThickness / 2, fCalorSizeYZ / 2, fCalorSizeYZ / 2); // size
|
||||
|
||||
fLogicAbsorber = new G4LogicalVolume(fSolidAbsorber, //its solid
|
||||
fAbsorberMaterial, //its material
|
||||
fAbsorberMaterial->GetName()); //name
|
||||
|
||||
fPhysiAbsorber = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(-fGapThickness/2,0.,0.), //its position
|
||||
fLogicAbsorber, //its logical volume
|
||||
fAbsorberMaterial->GetName(), //its name
|
||||
fLogicLayer, //its mother
|
||||
false, //no boulean operat
|
||||
0); //copy number
|
||||
fLogicAbsorber = new G4LogicalVolume(fSolidAbsorber, // its solid
|
||||
fAbsorberMaterial, // its material
|
||||
fAbsorberMaterial->GetName()); // name
|
||||
|
||||
fPhysiAbsorber = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(-fGapThickness / 2, 0., 0.), // its position
|
||||
fLogicAbsorber, // its logical volume
|
||||
fAbsorberMaterial->GetName(), // its name
|
||||
fLogicLayer, // its mother
|
||||
false, // no boulean operat
|
||||
0); // copy number
|
||||
}
|
||||
|
||||
//
|
||||
// Gap
|
||||
//
|
||||
fSolidGap = nullptr; fLogicGap = nullptr; fPhysiGap = nullptr;
|
||||
fSolidGap = nullptr;
|
||||
fLogicGap = nullptr;
|
||||
fPhysiGap = nullptr;
|
||||
|
||||
if (fGapThickness > 0.) {
|
||||
fSolidGap = new G4Box("Gap",
|
||||
fGapThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2);
|
||||
fSolidGap = new G4Box("Gap", fGapThickness / 2, fCalorSizeYZ / 2, fCalorSizeYZ / 2);
|
||||
|
||||
fLogicGap = new G4LogicalVolume(fSolidGap,
|
||||
fGapMaterial,
|
||||
fGapMaterial->GetName());
|
||||
fLogicGap = new G4LogicalVolume(fSolidGap, fGapMaterial, fGapMaterial->GetName());
|
||||
|
||||
fPhysiGap = new G4PVPlacement(nullptr, //no rotation
|
||||
G4ThreeVector(fAbsorberThickness/2,0.,0.), //its position
|
||||
fLogicGap, //its logical volume
|
||||
fGapMaterial->GetName(), //its name
|
||||
fLogicLayer, //its mother
|
||||
false, //no boulean operat
|
||||
0); //copy number
|
||||
fPhysiGap = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(fAbsorberThickness / 2, 0., 0.), // its position
|
||||
fLogicGap, // its logical volume
|
||||
fGapMaterial->GetName(), // its name
|
||||
fLogicLayer, // its mother
|
||||
false, // no boulean operat
|
||||
0); // copy number
|
||||
}
|
||||
|
||||
PrintCalorParameters();
|
||||
@@ -228,14 +230,14 @@ G4VPhysicalVolume* DetectorConstruction::ConstructCalorimeter()
|
||||
//
|
||||
// Visualization attributes
|
||||
//
|
||||
fLogicWorld->SetVisAttributes (G4VisAttributes::GetInvisible());
|
||||
fLogicWorld->SetVisAttributes(G4VisAttributes::GetInvisible());
|
||||
|
||||
auto simpleBoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
|
||||
auto simpleBoxVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0));
|
||||
simpleBoxVisAtt->SetVisibility(true);
|
||||
fLogicCalor->SetVisAttributes(simpleBoxVisAtt);
|
||||
|
||||
//
|
||||
//always return the physical World
|
||||
// always return the physical World
|
||||
//
|
||||
return fPhysiWorld;
|
||||
}
|
||||
@@ -246,9 +248,8 @@ void DetectorConstruction::PrintCalorParameters()
|
||||
{
|
||||
G4cout << "\n------------------------------------------------------------"
|
||||
<< "\n---> The calorimeter is " << fNbOfLayers << " layers of: [ "
|
||||
<< fAbsorberThickness/mm << "mm of " << fAbsorberMaterial->GetName()
|
||||
<< " + "
|
||||
<< fGapThickness/mm << "mm of " << fGapMaterial->GetName() << " ] "
|
||||
<< fAbsorberThickness / mm << "mm of " << fAbsorberMaterial->GetName() << " + "
|
||||
<< fGapThickness / mm << "mm of " << fGapMaterial->GetName() << " ] "
|
||||
<< "\n------------------------------------------------------------\n";
|
||||
}
|
||||
|
||||
@@ -274,7 +275,7 @@ void DetectorConstruction::SetGapMaterial(const G4String& materialChoice)
|
||||
auto material = G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
|
||||
if (material != nullptr) {
|
||||
fGapMaterial = material;
|
||||
if ( fLogicGap != nullptr) {
|
||||
if (fLogicGap != nullptr) {
|
||||
fLogicGap->SetMaterial(fGapMaterial);
|
||||
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
|
||||
}
|
||||
@@ -287,7 +288,7 @@ void DetectorConstruction::SetAbsorberThickness(G4double value)
|
||||
{
|
||||
// change Absorber thickness and recompute the calorimeter parameters
|
||||
fAbsorberThickness = value;
|
||||
if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
|
||||
if (G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit) {
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
}
|
||||
@@ -298,7 +299,7 @@ void DetectorConstruction::SetGapThickness(G4double value)
|
||||
{
|
||||
// change Gap thickness and recompute the calorimeter parameters
|
||||
fGapThickness = value;
|
||||
if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
|
||||
if (G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit) {
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
}
|
||||
@@ -309,7 +310,7 @@ void DetectorConstruction::SetCalorSizeYZ(G4double value)
|
||||
{
|
||||
// change the transverse size and recompute the calorimeter parameters
|
||||
fCalorSizeYZ = value;
|
||||
if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
|
||||
if (G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit) {
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
}
|
||||
@@ -319,7 +320,7 @@ void DetectorConstruction::SetCalorSizeYZ(G4double value)
|
||||
void DetectorConstruction::SetNbOfLayers(G4int value)
|
||||
{
|
||||
fNbOfLayers = value;
|
||||
if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
|
||||
if (G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit) {
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,57 +32,57 @@
|
||||
#include "DetectorMessenger.hh"
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorMessenger::DetectorMessenger( DetectorConstruction* Det)
|
||||
: fDetector(Det)
|
||||
DetectorMessenger::DetectorMessenger(DetectorConstruction* Det) : fDetector(Det)
|
||||
{
|
||||
G4bool broadcast = false;
|
||||
fDetDir = new G4UIdirectory("/det/",broadcast);
|
||||
fDetDir = new G4UIdirectory("/det/", broadcast);
|
||||
fDetDir->SetGuidance("Detector control");
|
||||
|
||||
fAbsMaterCmd = new G4UIcmdWithAString("/det/setAbsMat",this);
|
||||
fAbsMaterCmd = new G4UIcmdWithAString("/det/setAbsMat", this);
|
||||
fAbsMaterCmd->SetGuidance("Select Material of the Absorber.");
|
||||
fAbsMaterCmd->SetParameterName("AbsMat",false);
|
||||
fAbsMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fAbsMaterCmd->SetParameterName("AbsMat", false);
|
||||
fAbsMaterCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fGapMaterCmd = new G4UIcmdWithAString("/det/setGapMat",this);
|
||||
fGapMaterCmd = new G4UIcmdWithAString("/det/setGapMat", this);
|
||||
fGapMaterCmd->SetGuidance("Select Material of the Gap.");
|
||||
fGapMaterCmd->SetParameterName("GapMat",false);
|
||||
fGapMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fGapMaterCmd->SetParameterName("GapMat", false);
|
||||
fGapMaterCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fAbsThickCmd = new G4UIcmdWithADoubleAndUnit("/det/setAbsThick",this);
|
||||
fAbsThickCmd = new G4UIcmdWithADoubleAndUnit("/det/setAbsThick", this);
|
||||
fAbsThickCmd->SetGuidance("Set Thickness of the Absorber");
|
||||
fAbsThickCmd->SetParameterName("AbsThick",false);
|
||||
fAbsThickCmd->SetParameterName("AbsThick", false);
|
||||
fAbsThickCmd->SetRange("AbsThick>=0.");
|
||||
fAbsThickCmd->SetUnitCategory("Length");
|
||||
fAbsThickCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fAbsThickCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fGapThickCmd = new G4UIcmdWithADoubleAndUnit("/det/setGapThick",this);
|
||||
fGapThickCmd = new G4UIcmdWithADoubleAndUnit("/det/setGapThick", this);
|
||||
fGapThickCmd->SetGuidance("Set Thickness of the Gap");
|
||||
fGapThickCmd->SetParameterName("GapThick",false);
|
||||
fGapThickCmd->SetParameterName("GapThick", false);
|
||||
fGapThickCmd->SetRange("GapThick>=0.");
|
||||
fGapThickCmd->SetUnitCategory("Length");
|
||||
fGapThickCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fGapThickCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fSizeYZCmd = new G4UIcmdWithADoubleAndUnit("/det/setSizeYZ",this);
|
||||
fSizeYZCmd = new G4UIcmdWithADoubleAndUnit("/det/setSizeYZ", this);
|
||||
fSizeYZCmd->SetGuidance("Set tranverse size of the calorimeter");
|
||||
fSizeYZCmd->SetParameterName("SizeYZ",false);
|
||||
fSizeYZCmd->SetParameterName("SizeYZ", false);
|
||||
fSizeYZCmd->SetRange("SizeYZ>0.");
|
||||
fSizeYZCmd->SetUnitCategory("Length");
|
||||
fSizeYZCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fSizeYZCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fNbLayersCmd = new G4UIcmdWithAnInteger("/det/setNbOfLayers",this);
|
||||
fNbLayersCmd = new G4UIcmdWithAnInteger("/det/setNbOfLayers", this);
|
||||
fNbLayersCmd->SetGuidance("Set number of layers.");
|
||||
fNbLayersCmd->SetParameterName("NbLayers",false);
|
||||
fNbLayersCmd->SetParameterName("NbLayers", false);
|
||||
fNbLayersCmd->SetRange("NbLayers>0 && NbLayers<500");
|
||||
fNbLayersCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fNbLayersCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -102,32 +102,32 @@ DetectorMessenger::~DetectorMessenger()
|
||||
|
||||
void DetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
if( command == fAbsMaterCmd ) {
|
||||
if (command == fAbsMaterCmd) {
|
||||
fDetector->SetAbsorberMaterial(newValue);
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fGapMaterCmd ) {
|
||||
if (command == fGapMaterCmd) {
|
||||
fDetector->SetGapMaterial(newValue);
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fAbsThickCmd ) {
|
||||
if (command == fAbsThickCmd) {
|
||||
fDetector->SetAbsorberThickness(fAbsThickCmd->GetNewDoubleValue(newValue));
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fGapThickCmd ) {
|
||||
if (command == fGapThickCmd) {
|
||||
fDetector->SetGapThickness(fGapThickCmd->GetNewDoubleValue(newValue));
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fSizeYZCmd ) {
|
||||
if (command == fSizeYZCmd) {
|
||||
fDetector->SetCalorSizeYZ(fSizeYZCmd->GetNewDoubleValue(newValue));
|
||||
return;
|
||||
}
|
||||
|
||||
if( command == fNbLayersCmd ) {
|
||||
if (command == fNbLayersCmd) {
|
||||
fDetector->SetNbOfLayers(fNbLayersCmd->GetNewIntValue(newValue));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -34,30 +34,28 @@
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* dc)
|
||||
: fDetector(dc)
|
||||
PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* dc) : fDetector(dc)
|
||||
{
|
||||
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="e-");
|
||||
G4ParticleDefinition* particle = particleTable->FindParticle(particleName = "e-");
|
||||
fParticleGun->SetParticleDefinition(particle);
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
|
||||
fParticleGun->SetParticleEnergy(500.*MeV);
|
||||
G4double position = -0.5*(fDetector->GetWorldSizeX());
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm));
|
||||
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(1., 0., 0.));
|
||||
fParticleGun->SetParticleEnergy(500. * MeV);
|
||||
G4double position = -0.5 * (fDetector->GetWorldSizeX());
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(position, 0. * cm, 0. * cm));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -71,10 +69,9 @@ PrimaryGeneratorAction::~PrimaryGeneratorAction()
|
||||
|
||||
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
//this function is called at the begining of event
|
||||
// this function is called at the begining of event
|
||||
//
|
||||
fParticleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
SteppingAction::SteppingAction(DetectorConstruction* det, EventAction* evt)
|
||||
: fDetector(det), fEventAction(evt)
|
||||
: fDetector(det), fEventAction(evt)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -51,8 +51,7 @@ SteppingAction::~SteppingAction() = default;
|
||||
void SteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
{
|
||||
// get volume of the current step
|
||||
G4VPhysicalVolume* volume =
|
||||
aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
|
||||
G4VPhysicalVolume* volume = aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
|
||||
|
||||
// collect energy and track length step by step
|
||||
G4double edep = aStep->GetTotalEnergyDeposit();
|
||||
@@ -62,8 +61,12 @@ void SteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
stepl = aStep->GetStepLength();
|
||||
}
|
||||
|
||||
if (volume == fDetector->GetAbsorber()) { fEventAction->AddAbs(edep,stepl); }
|
||||
if (volume == fDetector->GetGap()) { fEventAction->AddGap(edep,stepl); }
|
||||
if (volume == fDetector->GetAbsorber()) {
|
||||
fEventAction->AddAbs(edep, stepl);
|
||||
}
|
||||
if (volume == fDetector->GetGap()) {
|
||||
fEventAction->AddGap(edep, stepl);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -28,16 +28,15 @@
|
||||
/// \brief Implementation of the ActionInitialization class
|
||||
|
||||
#include "ActionInitialization.hh"
|
||||
|
||||
#include "EventAction.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
#include "RunAction.hh"
|
||||
#include "EventAction.hh"
|
||||
#include "SteppingAction.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ActionInitialization::ActionInitialization(DetectorConstruction* detector)
|
||||
: fDetector(detector)
|
||||
{}
|
||||
ActionInitialization::ActionInitialization(DetectorConstruction* detector) : fDetector(detector) {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -61,10 +60,10 @@ void ActionInitialization::Build() const
|
||||
|
||||
SetUserAction(new RunAction());
|
||||
|
||||
auto eventAction = new EventAction();
|
||||
auto eventAction = new EventAction();
|
||||
SetUserAction(eventAction);
|
||||
|
||||
auto steppingAction = new SteppingAction(fDetector, eventAction);
|
||||
auto steppingAction = new SteppingAction(fDetector, eventAction);
|
||||
SetUserAction(steppingAction);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "EventAction.hh"
|
||||
|
||||
#include "RunAction.hh"
|
||||
|
||||
#include "G4AnalysisManager.hh"
|
||||
@@ -52,7 +53,7 @@ EventAction::~EventAction() = default;
|
||||
void EventAction::BeginOfEventAction(const G4Event* evt)
|
||||
{
|
||||
G4int evtNb = evt->GetEventID();
|
||||
if (evtNb%fPrintModulo == 0) {
|
||||
if (evtNb % fPrintModulo == 0) {
|
||||
G4cout << "\n---> Begin of event: " << evtNb << G4endl;
|
||||
}
|
||||
|
||||
@@ -78,9 +79,9 @@ void EventAction::EndOfEventAction(const G4Event*)
|
||||
analysisManager->FillH1(3, fTrackLGap);
|
||||
}
|
||||
|
||||
//fill ntuple
|
||||
// fill ntuple
|
||||
//
|
||||
// Fill 1st ntuple ( id = 0)
|
||||
// Fill 1st ntuple ( id = 0)
|
||||
analysisManager->FillNtupleDColumn(0, 0, fEnergyAbs);
|
||||
analysisManager->FillNtupleDColumn(0, 1, fEnergyGap);
|
||||
analysisManager->AddNtupleRow(0);
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
#include "G4GenericMessenger.hh"
|
||||
#include "G4Run.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -50,10 +50,10 @@ RunAction::RunAction()
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
analysisManager->SetDefaultFileType("root");
|
||||
analysisManager->SetVerboseLevel(1);
|
||||
// Only merge in MT mode to avoid warning when running in Sequential mode
|
||||
#ifdef G4MULTITHREADED
|
||||
analysisManager->SetNtupleMerging(true);
|
||||
#endif
|
||||
// Only merge in MT mode to avoid warning when running in Sequential mode
|
||||
#ifdef G4MULTITHREADED
|
||||
analysisManager->SetNtupleMerging(true);
|
||||
#endif
|
||||
|
||||
// Create directories
|
||||
analysisManager->SetHistoDirectoryName("histo");
|
||||
@@ -65,13 +65,13 @@ RunAction::RunAction()
|
||||
// analysisManager->SetFirstHistoId(1);
|
||||
|
||||
// id = 0
|
||||
analysisManager->CreateH1("EAbs","Edep in absorber (MeV)", 100, 0., 800*MeV);
|
||||
analysisManager->CreateH1("EAbs", "Edep in absorber (MeV)", 100, 0., 800 * MeV);
|
||||
// id = 1
|
||||
analysisManager->CreateH1("EGap","Edep in gap (MeV)", 100, 0., 100*MeV);
|
||||
analysisManager->CreateH1("EGap", "Edep in gap (MeV)", 100, 0., 100 * MeV);
|
||||
// id = 2
|
||||
analysisManager->CreateH1("LAbs","trackL in absorber (mm)", 100, 0., 1*m);
|
||||
analysisManager->CreateH1("LAbs", "trackL in absorber (mm)", 100, 0., 1 * m);
|
||||
// id = 3
|
||||
analysisManager->CreateH1("LGap","trackL in gap (mm)", 100, 0., 50*cm);
|
||||
analysisManager->CreateH1("LGap", "trackL in gap (mm)", 100, 0., 50 * cm);
|
||||
|
||||
// Create ntuples.
|
||||
// Ntuples ids are generated automatically starting from 0.
|
||||
@@ -80,15 +80,15 @@ RunAction::RunAction()
|
||||
|
||||
// Create 1st ntuple (id = 0)
|
||||
analysisManager->CreateNtuple("Ntuple1", "Edep");
|
||||
analysisManager->CreateNtupleDColumn("Eabs"); // column Id = 0
|
||||
analysisManager->CreateNtupleDColumn("Egap"); // column Id = 1
|
||||
analysisManager->CreateNtupleDColumn("Eabs"); // column Id = 0
|
||||
analysisManager->CreateNtupleDColumn("Egap"); // column Id = 1
|
||||
analysisManager->FinishNtuple();
|
||||
|
||||
// Create 2nd ntuple (id = 1)
|
||||
//
|
||||
analysisManager->CreateNtuple("Ntuple2", "TrackL");
|
||||
analysisManager->CreateNtupleDColumn("Labs"); // column Id = 0
|
||||
analysisManager->CreateNtupleDColumn("Lgap"); // column Id = 1
|
||||
analysisManager->CreateNtupleDColumn("Labs"); // column Id = 0
|
||||
analysisManager->CreateNtupleDColumn("Lgap"); // column Id = 1
|
||||
analysisManager->FinishNtuple();
|
||||
|
||||
DefineCommands();
|
||||
@@ -107,8 +107,7 @@ void RunAction::BeginOfRunAction(const G4Run* run)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void RunAction::EndOfRunAction(const G4Run* /*run*/)
|
||||
{}
|
||||
void RunAction::EndOfRunAction(const G4Run* /*run*/) {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -117,22 +116,24 @@ void RunAction::PrintStatistic()
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
|
||||
G4cout << "\n ----> print histograms statistic \n" << G4endl;
|
||||
for ( G4int i=0; i<analysisManager->GetNofH1s(); ++i ) {
|
||||
for (G4int i = 0; i < analysisManager->GetNofH1s(); ++i) {
|
||||
auto h1 = analysisManager->GetH1(i);
|
||||
// skip if histogram was deleted
|
||||
if (h1 == nullptr) continue;
|
||||
|
||||
G4String name = analysisManager->GetH1Name(i);
|
||||
G4String unitCategory;
|
||||
if (name[0U] == 'E' ) { unitCategory = "Energy"; }
|
||||
if (name[0U] == 'L' ) { unitCategory = "Length"; }
|
||||
// we use an explicit unsigned int type for operator [] argument
|
||||
// to avoid problems with windows compiler
|
||||
if (name[0U] == 'E') {
|
||||
unitCategory = "Energy";
|
||||
}
|
||||
if (name[0U] == 'L') {
|
||||
unitCategory = "Length";
|
||||
}
|
||||
// we use an explicit unsigned int type for operator [] argument
|
||||
// to avoid problems with windows compiler
|
||||
|
||||
G4cout << name
|
||||
<< ": mean = " << G4BestUnit(h1->mean(), unitCategory)
|
||||
<< " rms = " << G4BestUnit(h1->rms(), unitCategory )
|
||||
<< G4endl;
|
||||
G4cout << name << ": mean = " << G4BestUnit(h1->mean(), unitCategory)
|
||||
<< " rms = " << G4BestUnit(h1->rms(), unitCategory) << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,18 +142,12 @@ void RunAction::PrintStatistic()
|
||||
void RunAction::DefineCommands()
|
||||
{
|
||||
// Define /AnaEx03/runAction command directory using generic messenger class
|
||||
fMessenger
|
||||
= new G4GenericMessenger(this,
|
||||
"/AnaEx03/runAction/",
|
||||
"Run action commands");
|
||||
fMessenger = new G4GenericMessenger(this, "/AnaEx03/runAction/", "Run action commands");
|
||||
|
||||
// printStatistic command
|
||||
auto& printStatisticCmd
|
||||
= fMessenger->DeclareMethod("printStatistic",
|
||||
&RunAction::PrintStatistic,
|
||||
"Print statistic at the end of Run.");
|
||||
auto& printStatisticCmd = fMessenger->DeclareMethod("printStatistic", &RunAction::PrintStatistic,
|
||||
"Print statistic at the end of Run.");
|
||||
printStatisticCmd.SetToBeBroadcasted(false);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -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