Import Geant4 11.3.0.beta source tree
This commit is contained in:
@@ -27,40 +27,39 @@
|
||||
/// \file exampleB2b.cc
|
||||
/// \brief Main program of the B2b example
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "ActionInitialization.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "FTFP_BERT.hh"
|
||||
|
||||
#include "G4RunManagerFactory.hh"
|
||||
#include "G4SteppingVerbose.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "FTFP_BERT.hh"
|
||||
#include "G4StepLimiterPhysics.hh"
|
||||
|
||||
#include "Randomize.hh"
|
||||
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "G4SteppingVerbose.hh"
|
||||
#include "G4UIExecutive.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VisExecutive.hh"
|
||||
// #include "Randomize.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 ) { ui = new G4UIExecutive(argc, argv); }
|
||||
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);
|
||||
|
||||
// Set mandatory initialization classes
|
||||
//
|
||||
@@ -87,11 +86,11 @@ int main(int argc,char** argv)
|
||||
|
||||
// Process macro or start UI session
|
||||
//
|
||||
if ( ! ui ) {
|
||||
if (!ui) {
|
||||
// barch mode
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
UImanager->ApplyCommand(command + fileName);
|
||||
}
|
||||
else {
|
||||
// interactive mode
|
||||
|
||||
@@ -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
|
||||
@@ -44,14 +44,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...
|
||||
|
||||
@@ -300,7 +307,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
|
||||
|
||||
@@ -855,7 +862,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
|
||||
@@ -884,13 +891,13 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
>>> Event: 7
|
||||
0 hits stored in this event
|
||||
>>> Event: 8
|
||||
0 hits stored in this event
|
||||
28 hits stored in this event
|
||||
>>> Event: 9
|
||||
0 hits stored in this event
|
||||
>>> Event: 10
|
||||
16 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 11
|
||||
70 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 12
|
||||
0 hits stored in this event
|
||||
>>> Event: 13
|
||||
@@ -902,13 +909,13 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
>>> Event: 16
|
||||
0 hits stored in this event
|
||||
>>> Event: 17
|
||||
39 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 18
|
||||
43 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 19
|
||||
0 hits stored in this event
|
||||
>>> Event: 20
|
||||
0 hits stored in this event
|
||||
9 hits stored in this event
|
||||
>>> Event: 21
|
||||
0 hits stored in this event
|
||||
>>> Event: 22
|
||||
@@ -926,29 +933,29 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
>>> Event: 28
|
||||
0 hits stored in this event
|
||||
>>> Event: 29
|
||||
43 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 30
|
||||
0 hits stored in this event
|
||||
>>> Event: 31
|
||||
99 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 32
|
||||
0 hits stored in this event
|
||||
>>> Event: 33
|
||||
0 hits stored in this event
|
||||
22 hits stored in this event
|
||||
>>> Event: 34
|
||||
0 hits stored in this event
|
||||
79 hits stored in this event
|
||||
>>> Event: 35
|
||||
0 hits stored in this event
|
||||
>>> Event: 36
|
||||
0 hits stored in this event
|
||||
>>> Event: 37
|
||||
51 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 38
|
||||
120 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 39
|
||||
0 hits stored in this event
|
||||
>>> Event: 40
|
||||
76 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 41
|
||||
0 hits stored in this event
|
||||
>>> Event: 42
|
||||
@@ -956,7 +963,7 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
>>> Event: 43
|
||||
0 hits stored in this event
|
||||
>>> Event: 44
|
||||
0 hits stored in this event
|
||||
99 hits stored in this event
|
||||
>>> Event: 45
|
||||
0 hits stored in this event
|
||||
>>> Event: 46
|
||||
@@ -972,17 +979,17 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
>>> Event: 51
|
||||
0 hits stored in this event
|
||||
>>> Event: 52
|
||||
0 hits stored in this event
|
||||
112 hits stored in this event
|
||||
>>> Event: 53
|
||||
0 hits stored in this event
|
||||
>>> Event: 54
|
||||
0 hits stored in this event
|
||||
56 hits stored in this event
|
||||
>>> Event: 55
|
||||
0 hits stored in this event
|
||||
>>> Event: 56
|
||||
0 hits stored in this event
|
||||
>>> Event: 57
|
||||
0 hits stored in this event
|
||||
21 hits stored in this event
|
||||
>>> Event: 58
|
||||
0 hits stored in this event
|
||||
>>> Event: 59
|
||||
@@ -990,21 +997,21 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
>>> Event: 60
|
||||
0 hits stored in this event
|
||||
>>> Event: 61
|
||||
0 hits stored in this event
|
||||
63 hits stored in this event
|
||||
>>> Event: 62
|
||||
101 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 63
|
||||
0 hits stored in this event
|
||||
>>> Event: 64
|
||||
76 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 65
|
||||
0 hits stored in this event
|
||||
>>> Event: 66
|
||||
0 hits stored in this event
|
||||
>>> Event: 67
|
||||
103 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 68
|
||||
149 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 69
|
||||
0 hits stored in this event
|
||||
>>> Event: 70
|
||||
@@ -1016,11 +1023,11 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
>>> Event: 73
|
||||
0 hits stored in this event
|
||||
>>> Event: 74
|
||||
48 hits stored in this event
|
||||
>>> Event: 75
|
||||
0 hits stored in this event
|
||||
>>> Event: 75
|
||||
49 hits stored in this event
|
||||
>>> Event: 76
|
||||
3 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 77
|
||||
0 hits stored in this event
|
||||
>>> Event: 78
|
||||
@@ -1032,7 +1039,7 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
>>> Event: 81
|
||||
0 hits stored in this event
|
||||
>>> Event: 82
|
||||
179 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 83
|
||||
0 hits stored in this event
|
||||
>>> Event: 84
|
||||
@@ -1046,23 +1053,23 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
>>> Event: 88
|
||||
0 hits stored in this event
|
||||
>>> Event: 89
|
||||
0 hits stored in this event
|
||||
331 hits stored in this event
|
||||
>>> Event: 90
|
||||
0 hits stored in this event
|
||||
>>> Event: 91
|
||||
31 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 92
|
||||
31 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 93
|
||||
0 hits stored in this event
|
||||
>>> Event: 94
|
||||
1 hits stored in this event
|
||||
0 hits stored in this event
|
||||
>>> Event: 95
|
||||
0 hits stored in this event
|
||||
>>> Event: 96
|
||||
0 hits stored in this event
|
||||
>>> Event: 97
|
||||
0 hits stored in this event
|
||||
46 hits stored in this event
|
||||
>>> Event: 98
|
||||
0 hits stored in this event
|
||||
>>> Event: 99
|
||||
@@ -1070,205 +1077,205 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
### Run 1 starts.
|
||||
--> Event 0 starts.
|
||||
>>> Event: 0
|
||||
68 hits stored in this event
|
||||
>>> Event: 1
|
||||
408 hits stored in this event
|
||||
>>> Event: 2
|
||||
103 hits stored in this event
|
||||
>>> Event: 3
|
||||
107 hits stored in this event
|
||||
>>> Event: 4
|
||||
73 hits stored in this event
|
||||
>>> Event: 5
|
||||
80 hits stored in this event
|
||||
>>> Event: 6
|
||||
181 hits stored in this event
|
||||
>>> Event: 7
|
||||
77 hits stored in this event
|
||||
>>> Event: 8
|
||||
98 hits stored in this event
|
||||
>>> Event: 9
|
||||
2258 hits stored in this event
|
||||
>>> Event: 10
|
||||
161 hits stored in this event
|
||||
>>> Event: 11
|
||||
83 hits stored in this event
|
||||
>>> Event: 12
|
||||
124 hits stored in this event
|
||||
>>> Event: 13
|
||||
93 hits stored in this event
|
||||
>>> Event: 14
|
||||
379 hits stored in this event
|
||||
>>> Event: 15
|
||||
79 hits stored in this event
|
||||
>>> Event: 16
|
||||
309 hits stored in this event
|
||||
>>> Event: 17
|
||||
77 hits stored in this event
|
||||
>>> Event: 18
|
||||
63 hits stored in this event
|
||||
>>> Event: 19
|
||||
58 hits stored in this event
|
||||
>>> Event: 20
|
||||
62 hits stored in this event
|
||||
>>> Event: 21
|
||||
107 hits stored in this event
|
||||
>>> Event: 22
|
||||
214 hits stored in this event
|
||||
>>> Event: 23
|
||||
79 hits stored in this event
|
||||
>>> Event: 24
|
||||
361 hits stored in this event
|
||||
>>> Event: 25
|
||||
63 hits stored in this event
|
||||
>>> Event: 26
|
||||
64 hits stored in this event
|
||||
>>> Event: 27
|
||||
436 hits stored in this event
|
||||
>>> Event: 28
|
||||
102 hits stored in this event
|
||||
>>> Event: 29
|
||||
93 hits stored in this event
|
||||
>>> Event: 30
|
||||
109 hits stored in this event
|
||||
>>> Event: 31
|
||||
4239 hits stored in this event
|
||||
>>> Event: 32
|
||||
83 hits stored in this event
|
||||
>>> Event: 33
|
||||
73 hits stored in this event
|
||||
>>> Event: 34
|
||||
90 hits stored in this event
|
||||
>>> Event: 35
|
||||
94 hits stored in this event
|
||||
>>> Event: 36
|
||||
351 hits stored in this event
|
||||
>>> Event: 37
|
||||
55 hits stored in this event
|
||||
>>> Event: 38
|
||||
112 hits stored in this event
|
||||
>>> Event: 39
|
||||
465 hits stored in this event
|
||||
>>> Event: 40
|
||||
65 hits stored in this event
|
||||
>>> Event: 41
|
||||
1413 hits stored in this event
|
||||
>>> Event: 42
|
||||
93 hits stored in this event
|
||||
>>> Event: 43
|
||||
85 hits stored in this event
|
||||
>>> Event: 44
|
||||
212 hits stored in this event
|
||||
>>> Event: 45
|
||||
100 hits stored in this event
|
||||
>>> Event: 46
|
||||
155 hits stored in this event
|
||||
>>> Event: 47
|
||||
400 hits stored in this event
|
||||
>>> Event: 48
|
||||
285 hits stored in this event
|
||||
>>> Event: 49
|
||||
369 hits stored in this event
|
||||
>>> Event: 50
|
||||
76 hits stored in this event
|
||||
>>> Event: 51
|
||||
104 hits stored in this event
|
||||
>>> Event: 52
|
||||
71 hits stored in this event
|
||||
>>> Event: 53
|
||||
648 hits stored in this event
|
||||
>>> Event: 54
|
||||
127 hits stored in this event
|
||||
>>> Event: 55
|
||||
95 hits stored in this event
|
||||
>>> Event: 56
|
||||
59 hits stored in this event
|
||||
>>> Event: 57
|
||||
94 hits stored in this event
|
||||
>>> Event: 58
|
||||
108 hits stored in this event
|
||||
>>> Event: 59
|
||||
93 hits stored in this event
|
||||
>>> Event: 60
|
||||
92 hits stored in this event
|
||||
>>> Event: 61
|
||||
>>> Event: 1
|
||||
86 hits stored in this event
|
||||
>>> Event: 2
|
||||
328 hits stored in this event
|
||||
>>> Event: 3
|
||||
87 hits stored in this event
|
||||
>>> Event: 4
|
||||
120 hits stored in this event
|
||||
>>> Event: 5
|
||||
86 hits stored in this event
|
||||
>>> Event: 6
|
||||
105 hits stored in this event
|
||||
>>> Event: 7
|
||||
60 hits stored in this event
|
||||
>>> Event: 8
|
||||
121 hits stored in this event
|
||||
>>> Event: 9
|
||||
86 hits stored in this event
|
||||
>>> Event: 10
|
||||
361 hits stored in this event
|
||||
>>> Event: 11
|
||||
185 hits stored in this event
|
||||
>>> Event: 12
|
||||
80 hits stored in this event
|
||||
>>> Event: 62
|
||||
97 hits stored in this event
|
||||
>>> Event: 63
|
||||
66 hits stored in this event
|
||||
>>> Event: 64
|
||||
248 hits stored in this event
|
||||
>>> Event: 65
|
||||
83 hits stored in this event
|
||||
>>> Event: 66
|
||||
69 hits stored in this event
|
||||
>>> Event: 67
|
||||
211 hits stored in this event
|
||||
>>> Event: 68
|
||||
605 hits stored in this event
|
||||
>>> Event: 69
|
||||
193 hits stored in this event
|
||||
>>> Event: 70
|
||||
1023 hits stored in this event
|
||||
>>> Event: 71
|
||||
51 hits stored in this event
|
||||
>>> Event: 72
|
||||
48 hits stored in this event
|
||||
>>> Event: 73
|
||||
164 hits stored in this event
|
||||
>>> Event: 74
|
||||
71 hits stored in this event
|
||||
>>> Event: 75
|
||||
147 hits stored in this event
|
||||
>>> Event: 76
|
||||
92 hits stored in this event
|
||||
>>> Event: 77
|
||||
>>> Event: 13
|
||||
67 hits stored in this event
|
||||
>>> Event: 14
|
||||
93 hits stored in this event
|
||||
>>> Event: 15
|
||||
76 hits stored in this event
|
||||
>>> Event: 16
|
||||
65 hits stored in this event
|
||||
>>> Event: 17
|
||||
81 hits stored in this event
|
||||
>>> Event: 78
|
||||
84 hits stored in this event
|
||||
>>> Event: 79
|
||||
>>> Event: 18
|
||||
124 hits stored in this event
|
||||
>>> Event: 19
|
||||
121 hits stored in this event
|
||||
>>> Event: 20
|
||||
606 hits stored in this event
|
||||
>>> Event: 21
|
||||
66 hits stored in this event
|
||||
>>> Event: 22
|
||||
207 hits stored in this event
|
||||
>>> Event: 23
|
||||
289 hits stored in this event
|
||||
>>> Event: 24
|
||||
126 hits stored in this event
|
||||
>>> Event: 25
|
||||
79 hits stored in this event
|
||||
>>> Event: 26
|
||||
81 hits stored in this event
|
||||
>>> Event: 27
|
||||
170 hits stored in this event
|
||||
>>> Event: 28
|
||||
219 hits stored in this event
|
||||
>>> Event: 29
|
||||
186 hits stored in this event
|
||||
>>> Event: 30
|
||||
61 hits stored in this event
|
||||
>>> Event: 31
|
||||
111 hits stored in this event
|
||||
>>> Event: 32
|
||||
52 hits stored in this event
|
||||
>>> Event: 33
|
||||
105 hits stored in this event
|
||||
>>> Event: 34
|
||||
72 hits stored in this event
|
||||
>>> Event: 35
|
||||
64 hits stored in this event
|
||||
>>> Event: 80
|
||||
242 hits stored in this event
|
||||
>>> Event: 81
|
||||
103 hits stored in this event
|
||||
>>> Event: 82
|
||||
497 hits stored in this event
|
||||
>>> Event: 83
|
||||
195 hits stored in this event
|
||||
>>> Event: 84
|
||||
83 hits stored in this event
|
||||
>>> Event: 85
|
||||
505 hits stored in this event
|
||||
>>> Event: 86
|
||||
151 hits stored in this event
|
||||
>>> Event: 87
|
||||
55 hits stored in this event
|
||||
>>> Event: 88
|
||||
140 hits stored in this event
|
||||
>>> Event: 89
|
||||
67 hits stored in this event
|
||||
>>> Event: 90
|
||||
90 hits stored in this event
|
||||
>>> Event: 91
|
||||
67 hits stored in this event
|
||||
>>> Event: 92
|
||||
88 hits stored in this event
|
||||
>>> Event: 93
|
||||
391 hits stored in this event
|
||||
>>> Event: 94
|
||||
169 hits stored in this event
|
||||
>>> Event: 95
|
||||
46 hits stored in this event
|
||||
>>> Event: 96
|
||||
163 hits stored in this event
|
||||
>>> Event: 97
|
||||
183 hits stored in this event
|
||||
>>> Event: 98
|
||||
180 hits stored in this event
|
||||
>>> Event: 99
|
||||
>>> Event: 36
|
||||
107 hits stored in this event
|
||||
>>> Event: 37
|
||||
114 hits stored in this event
|
||||
>>> Event: 38
|
||||
119 hits stored in this event
|
||||
>>> Event: 39
|
||||
76 hits stored in this event
|
||||
>>> Event: 40
|
||||
79 hits stored in this event
|
||||
>>> Event: 41
|
||||
105 hits stored in this event
|
||||
>>> Event: 42
|
||||
547 hits stored in this event
|
||||
>>> Event: 43
|
||||
71 hits stored in this event
|
||||
>>> Event: 44
|
||||
157 hits stored in this event
|
||||
>>> Event: 45
|
||||
104 hits stored in this event
|
||||
>>> Event: 46
|
||||
167 hits stored in this event
|
||||
>>> Event: 47
|
||||
134 hits stored in this event
|
||||
>>> Event: 48
|
||||
441 hits stored in this event
|
||||
>>> Event: 49
|
||||
79 hits stored in this event
|
||||
>>> Event: 50
|
||||
65 hits stored in this event
|
||||
>>> Event: 51
|
||||
260 hits stored in this event
|
||||
>>> Event: 52
|
||||
75 hits stored in this event
|
||||
>>> Event: 53
|
||||
274 hits stored in this event
|
||||
>>> Event: 54
|
||||
118 hits stored in this event
|
||||
>>> Event: 55
|
||||
93 hits stored in this event
|
||||
>>> Event: 56
|
||||
231 hits stored in this event
|
||||
>>> Event: 57
|
||||
92 hits stored in this event
|
||||
>>> Event: 58
|
||||
79 hits stored in this event
|
||||
>>> Event: 59
|
||||
85 hits stored in this event
|
||||
>>> Event: 60
|
||||
150 hits stored in this event
|
||||
>>> Event: 61
|
||||
598 hits stored in this event
|
||||
>>> Event: 62
|
||||
133 hits stored in this event
|
||||
>>> Event: 63
|
||||
74 hits stored in this event
|
||||
>>> Event: 64
|
||||
177 hits stored in this event
|
||||
>>> Event: 65
|
||||
73 hits stored in this event
|
||||
>>> Event: 66
|
||||
68 hits stored in this event
|
||||
>>> Event: 67
|
||||
65 hits stored in this event
|
||||
>>> Event: 68
|
||||
922 hits stored in this event
|
||||
>>> Event: 69
|
||||
50 hits stored in this event
|
||||
>>> Event: 70
|
||||
128 hits stored in this event
|
||||
>>> Event: 71
|
||||
33582 hits stored in this event
|
||||
>>> Event: 72
|
||||
110 hits stored in this event
|
||||
>>> Event: 73
|
||||
119 hits stored in this event
|
||||
>>> Event: 74
|
||||
119 hits stored in this event
|
||||
>>> Event: 75
|
||||
122 hits stored in this event
|
||||
>>> Event: 76
|
||||
86 hits stored in this event
|
||||
>>> Event: 77
|
||||
929 hits stored in this event
|
||||
>>> Event: 78
|
||||
78 hits stored in this event
|
||||
>>> Event: 79
|
||||
66 hits stored in this event
|
||||
>>> Event: 80
|
||||
119 hits stored in this event
|
||||
>>> Event: 81
|
||||
225 hits stored in this event
|
||||
>>> Event: 82
|
||||
99 hits stored in this event
|
||||
>>> Event: 83
|
||||
75 hits stored in this event
|
||||
>>> Event: 84
|
||||
89 hits stored in this event
|
||||
>>> Event: 85
|
||||
108 hits stored in this event
|
||||
>>> Event: 86
|
||||
93 hits stored in this event
|
||||
>>> Event: 87
|
||||
100 hits stored in this event
|
||||
>>> Event: 88
|
||||
129 hits stored in this event
|
||||
>>> Event: 89
|
||||
87 hits stored in this event
|
||||
>>> Event: 90
|
||||
2147 hits stored in this event
|
||||
>>> Event: 91
|
||||
164 hits stored in this event
|
||||
>>> Event: 92
|
||||
47 hits stored in this event
|
||||
>>> Event: 93
|
||||
60 hits stored in this event
|
||||
>>> Event: 94
|
||||
184 hits stored in this event
|
||||
>>> Event: 95
|
||||
87 hits stored in this event
|
||||
>>> Event: 96
|
||||
262 hits stored in this event
|
||||
>>> Event: 97
|
||||
134 hits stored in this event
|
||||
>>> Event: 98
|
||||
68 hits stored in this event
|
||||
>>> Event: 99
|
||||
107 hits stored in this event
|
||||
### Run 2 starts.
|
||||
--> Event 0 starts.
|
||||
|
||||
|
||||
@@ -47,8 +47,6 @@ class ActionInitialization : public G4VUserActionInitialization
|
||||
void Build() const override;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B2
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
#ifndef B2bChamberParameterisation_h
|
||||
#define B2bChamberParameterisation_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VPVParameterisation.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
class G4Box;
|
||||
@@ -61,56 +61,39 @@ namespace B2b
|
||||
class ChamberParameterisation : public G4VPVParameterisation
|
||||
{
|
||||
public:
|
||||
ChamberParameterisation(G4int noChambers,
|
||||
G4double startZ,
|
||||
G4double spacing,
|
||||
G4double widthChamber,
|
||||
G4double lengthInitial,
|
||||
G4double lengthFinal );
|
||||
ChamberParameterisation(G4int noChambers, G4double startZ, G4double spacing,
|
||||
G4double widthChamber, G4double lengthInitial, G4double lengthFinal);
|
||||
|
||||
~ChamberParameterisation() override = default;
|
||||
|
||||
void ComputeTransformation (const G4int copyNo,
|
||||
G4VPhysicalVolume* physVol) const override;
|
||||
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume* physVol) const override;
|
||||
|
||||
void ComputeDimensions (G4Tubs & trackerLayer, const G4int copyNo,
|
||||
const G4VPhysicalVolume* physVol) const override;
|
||||
void ComputeDimensions(G4Tubs& trackerLayer, const G4int copyNo,
|
||||
const G4VPhysicalVolume* physVol) const override;
|
||||
|
||||
private: // Dummy declarations to get rid of warnings ...
|
||||
void ComputeDimensions (G4Box&,const G4int,
|
||||
const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions (G4Trd&,const G4int,
|
||||
const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions (G4Trap&,const G4int,
|
||||
const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions (G4Cons&,const G4int,
|
||||
const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions (G4Sphere&,const G4int,
|
||||
const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions (G4Orb&,const G4int,
|
||||
const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions (G4Ellipsoid&,const G4int,
|
||||
const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions (G4Torus&,const G4int,
|
||||
const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions (G4Para&,const G4int,
|
||||
const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions (G4Hype&,const G4int,
|
||||
const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions (G4Polycone&,const G4int,
|
||||
const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions (G4Polyhedra&,const G4int,
|
||||
const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions(G4Box&, const G4int, const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions(G4Trd&, const G4int, const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions(G4Trap&, const G4int, const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions(G4Cons&, const G4int, const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions(G4Sphere&, const G4int, const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions(G4Orb&, const G4int, const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions(G4Ellipsoid&, const G4int, const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions(G4Torus&, const G4int, const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions(G4Para&, const G4int, const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions(G4Hype&, const G4int, const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions(G4Polycone&, const G4int, const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions(G4Polyhedra&, const G4int, const G4VPhysicalVolume*) const override {}
|
||||
|
||||
private:
|
||||
G4int fNoChambers;
|
||||
G4int fNoChambers;
|
||||
G4double fStartZ;
|
||||
G4double fHalfWidth; // The half-width of each tracker chamber
|
||||
G4double fSpacing; // The distance between the chambers' center
|
||||
G4double fRmaxFirst; // The first half-length
|
||||
G4double fRmaxIncr; // The Increment for the half-length
|
||||
G4double fHalfWidth; // The half-width of each tracker chamber
|
||||
G4double fSpacing; // The distance between the chambers' center
|
||||
G4double fRmaxFirst; // The first half-length
|
||||
G4double fRmaxIncr; // The Increment for the half-length
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B2b
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,9 +30,10 @@
|
||||
#ifndef B2bDetectorConstruction_h
|
||||
#define B2bDetectorConstruction_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "tls.hh"
|
||||
|
||||
#include "G4Threading.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
class G4LogicalVolume;
|
||||
@@ -59,10 +60,10 @@ class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
void ConstructSDandField() override;
|
||||
|
||||
// Set methods
|
||||
void SetTargetMaterial (G4String );
|
||||
void SetChamberMaterial(G4String );
|
||||
void SetMaxStep (G4double );
|
||||
void SetCheckOverlaps(G4bool );
|
||||
void SetTargetMaterial(G4String);
|
||||
void SetChamberMaterial(G4String);
|
||||
void SetMaxStep(G4double);
|
||||
void SetCheckOverlaps(G4bool);
|
||||
|
||||
private:
|
||||
// methods
|
||||
@@ -70,22 +71,22 @@ class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
G4VPhysicalVolume* DefineVolumes();
|
||||
|
||||
// static data members
|
||||
static G4ThreadLocal G4GlobalMagFieldMessenger* fMagFieldMessenger;
|
||||
// magnetic field messenger
|
||||
static G4ThreadLocal G4GlobalMagFieldMessenger* fMagFieldMessenger;
|
||||
// magnetic field messenger
|
||||
// data members
|
||||
G4LogicalVolume* fLogicTarget = nullptr; // pointer to the logical Target
|
||||
G4LogicalVolume* fLogicChamber = nullptr; // pointer to the logical Chamber
|
||||
G4LogicalVolume* fLogicTarget = nullptr; // pointer to the logical Target
|
||||
G4LogicalVolume* fLogicChamber = nullptr; // pointer to the logical Chamber
|
||||
|
||||
G4Material* fTargetMaterial = nullptr; // pointer to the target material
|
||||
G4Material* fChamberMaterial = nullptr; // pointer to the chamber material
|
||||
G4Material* fTargetMaterial = nullptr; // pointer to the target material
|
||||
G4Material* fChamberMaterial = nullptr; // pointer to the chamber material
|
||||
|
||||
G4UserLimits* fStepLimit = nullptr; // pointer to user step limits
|
||||
G4UserLimits* fStepLimit = nullptr; // pointer to user step limits
|
||||
|
||||
DetectorMessenger* fMessenger = nullptr; // messenger
|
||||
DetectorMessenger* fMessenger = nullptr; // messenger
|
||||
|
||||
G4bool fCheckOverlaps = true; // option to activate checking of volumes overlaps
|
||||
G4bool fCheckOverlaps = true; // option to activate checking of volumes overlaps
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B2b
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,12 +30,13 @@
|
||||
#ifndef B2bDetectorMessenger_h
|
||||
#define B2bDetectorMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcommand;
|
||||
|
||||
namespace B2b
|
||||
{
|
||||
@@ -49,26 +50,26 @@ class DetectorConstruction;
|
||||
/// - /B2/det/setChamberMaterial name
|
||||
/// - /B2/det/stepMax value unit
|
||||
|
||||
class DetectorMessenger: public G4UImessenger
|
||||
class DetectorMessenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
DetectorMessenger(DetectorConstruction* );
|
||||
DetectorMessenger(DetectorConstruction*);
|
||||
~DetectorMessenger() override;
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String) override;
|
||||
|
||||
private:
|
||||
DetectorConstruction* fDetectorConstruction = nullptr;
|
||||
DetectorConstruction* fDetectorConstruction = nullptr;
|
||||
|
||||
G4UIdirectory* fDirectory = nullptr;
|
||||
G4UIdirectory* fDetDirectory = nullptr;
|
||||
G4UIdirectory* fDirectory = nullptr;
|
||||
G4UIdirectory* fDetDirectory = nullptr;
|
||||
|
||||
G4UIcmdWithAString* fTargMatCmd = nullptr;
|
||||
G4UIcmdWithAString* fChamMatCmd = nullptr;
|
||||
G4UIcmdWithAString* fTargMatCmd = nullptr;
|
||||
G4UIcmdWithAString* fChamMatCmd = nullptr;
|
||||
|
||||
G4UIcmdWithADoubleAndUnit* fStepMaxCmd = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B2b
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "G4UserEventAction.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
class G4Event;
|
||||
|
||||
namespace B2
|
||||
{
|
||||
@@ -45,10 +45,10 @@ class EventAction : public G4UserEventAction
|
||||
EventAction() = default;
|
||||
~EventAction() override = default;
|
||||
|
||||
void BeginOfEventAction(const G4Event* ) override;
|
||||
void EndOfEventAction(const G4Event* ) override;
|
||||
void BeginOfEventAction(const G4Event*) override;
|
||||
void EndOfEventAction(const G4Event*) override;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B2
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#define B2PrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
class G4Event;
|
||||
@@ -52,14 +51,14 @@ class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
PrimaryGeneratorAction();
|
||||
~PrimaryGeneratorAction() override;
|
||||
|
||||
void GeneratePrimaries(G4Event* ) override;
|
||||
void GeneratePrimaries(G4Event*) override;
|
||||
|
||||
G4ParticleGun* GetParticleGun() {return fParticleGun;}
|
||||
G4ParticleGun* GetParticleGun() { return fParticleGun; }
|
||||
|
||||
private:
|
||||
G4ParticleGun* fParticleGun = nullptr; // G4 particle gun
|
||||
G4ParticleGun* fParticleGun = nullptr; // G4 particle gun
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B2
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#define B2RunAction_h 1
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Run;
|
||||
|
||||
@@ -47,9 +46,9 @@ class RunAction : public G4UserRunAction
|
||||
~RunAction() override = default;
|
||||
|
||||
void BeginOfRunAction(const G4Run* run) override;
|
||||
void EndOfRunAction(const G4Run* run) override;
|
||||
void EndOfRunAction(const G4Run* run) override;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B2
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,10 +31,12 @@
|
||||
#define B2TrackerHit_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Threading.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "tls.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
namespace B2
|
||||
{
|
||||
@@ -57,28 +59,28 @@ class TrackerHit : public G4VHit
|
||||
G4bool operator==(const TrackerHit&) const;
|
||||
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void*);
|
||||
inline void operator delete(void*);
|
||||
|
||||
// methods from base class
|
||||
void Draw() override;
|
||||
void Print() override;
|
||||
|
||||
// Set methods
|
||||
void SetTrackID (G4int track) { fTrackID = track; };
|
||||
void SetChamberNb(G4int chamb) { fChamberNb = chamb; };
|
||||
void SetEdep (G4double de) { fEdep = de; };
|
||||
void SetPos (G4ThreeVector xyz){ fPos = xyz; };
|
||||
void SetTrackID(G4int track) { fTrackID = track; };
|
||||
void SetChamberNb(G4int chamb) { fChamberNb = chamb; };
|
||||
void SetEdep(G4double de) { fEdep = de; };
|
||||
void SetPos(G4ThreeVector xyz) { fPos = xyz; };
|
||||
|
||||
// Get methods
|
||||
G4int GetTrackID() const { return fTrackID; };
|
||||
G4int GetChamberNb() const { return fChamberNb; };
|
||||
G4double GetEdep() const { return fEdep; };
|
||||
G4int GetTrackID() const { return fTrackID; };
|
||||
G4int GetChamberNb() const { return fChamberNb; };
|
||||
G4double GetEdep() const { return fEdep; };
|
||||
G4ThreeVector GetPos() const { return fPos; };
|
||||
|
||||
private:
|
||||
G4int fTrackID = -1;
|
||||
G4int fChamberNb = -1;
|
||||
G4double fEdep = 0.;
|
||||
G4int fTrackID = -1;
|
||||
G4int fChamberNb = -1;
|
||||
G4double fEdep = 0.;
|
||||
G4ThreeVector fPos;
|
||||
};
|
||||
|
||||
@@ -92,20 +94,19 @@ extern G4ThreadLocal G4Allocator<TrackerHit>* TrackerHitAllocator;
|
||||
|
||||
inline void* TrackerHit::operator new(size_t)
|
||||
{
|
||||
if(!TrackerHitAllocator)
|
||||
TrackerHitAllocator = new G4Allocator<TrackerHit>;
|
||||
return (void *) TrackerHitAllocator->MallocSingle();
|
||||
if (!TrackerHitAllocator) TrackerHitAllocator = new G4Allocator<TrackerHit>;
|
||||
return (void*)TrackerHitAllocator->MallocSingle();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void TrackerHit::operator delete(void *hit)
|
||||
inline void TrackerHit::operator delete(void* hit)
|
||||
{
|
||||
TrackerHitAllocator->FreeSingle((TrackerHit*) hit);
|
||||
TrackerHitAllocator->FreeSingle((TrackerHit*)hit);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
} // namespace B2
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,10 +34,11 @@
|
||||
|
||||
#include "TrackerHit.hh"
|
||||
|
||||
#include <vector>
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Step;
|
||||
class G4HCofThisEvent;
|
||||
class G4TouchableHistory;
|
||||
|
||||
namespace B2
|
||||
{
|
||||
@@ -51,19 +52,18 @@ namespace B2
|
||||
class TrackerSD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
TrackerSD(const G4String& name,
|
||||
const G4String& hitsCollectionName);
|
||||
TrackerSD(const G4String& name, const G4String& hitsCollectionName);
|
||||
~TrackerSD() override = default;
|
||||
|
||||
// methods from base class
|
||||
void Initialize(G4HCofThisEvent* hitCollection) override;
|
||||
void Initialize(G4HCofThisEvent* hitCollection) override;
|
||||
G4bool ProcessHits(G4Step* step, G4TouchableHistory* history) override;
|
||||
void EndOfEvent(G4HCofThisEvent* hitCollection) override;
|
||||
void EndOfEvent(G4HCofThisEvent* hitCollection) override;
|
||||
|
||||
private:
|
||||
TrackerHitsCollection* fHitsCollection = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B2
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,9 +28,10 @@
|
||||
/// \brief Implementation of the B2::ActionInitialization class
|
||||
|
||||
#include "ActionInitialization.hh"
|
||||
|
||||
#include "EventAction.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
#include "RunAction.hh"
|
||||
#include "EventAction.hh"
|
||||
|
||||
namespace B2
|
||||
{
|
||||
@@ -53,5 +54,4 @@ void ActionInitialization::Build() const
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
|
||||
} // namespace B2
|
||||
|
||||
@@ -29,65 +29,62 @@
|
||||
|
||||
#include "ChamberParameterisation.hh"
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
|
||||
namespace B2b
|
||||
{
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ChamberParameterisation::ChamberParameterisation(
|
||||
G4int noChambers,
|
||||
G4double startZ, // Z of center of first
|
||||
G4double spacingZ, // Z spacing of centers
|
||||
G4double widthChamber,
|
||||
G4double lengthInitial,
|
||||
G4double lengthFinal )
|
||||
ChamberParameterisation::ChamberParameterisation(G4int noChambers,
|
||||
G4double startZ, // Z of center of first
|
||||
G4double spacingZ, // Z spacing of centers
|
||||
G4double widthChamber, G4double lengthInitial,
|
||||
G4double lengthFinal)
|
||||
{
|
||||
fNoChambers = noChambers;
|
||||
fStartZ = startZ;
|
||||
fHalfWidth = 0.5*widthChamber;
|
||||
fSpacing = spacingZ;
|
||||
fRmaxFirst = 0.5 * lengthInitial;
|
||||
if( noChambers > 0 ){
|
||||
fRmaxIncr = 0.5 * (lengthFinal-lengthInitial)/(noChambers-1);
|
||||
if (spacingZ < widthChamber) {
|
||||
G4Exception("ChamberParameterisation::ChamberParameterisation()",
|
||||
"InvalidSetup", FatalException,
|
||||
"Width>Spacing");
|
||||
}
|
||||
}
|
||||
fNoChambers = noChambers;
|
||||
fStartZ = startZ;
|
||||
fHalfWidth = 0.5 * widthChamber;
|
||||
fSpacing = spacingZ;
|
||||
fRmaxFirst = 0.5 * lengthInitial;
|
||||
if (noChambers > 0) {
|
||||
fRmaxIncr = 0.5 * (lengthFinal - lengthInitial) / (noChambers - 1);
|
||||
if (spacingZ < widthChamber) {
|
||||
G4Exception("ChamberParameterisation::ChamberParameterisation()", "InvalidSetup",
|
||||
FatalException, "Width>Spacing");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ChamberParameterisation::ComputeTransformation
|
||||
(const G4int copyNo, G4VPhysicalVolume* physVol) const
|
||||
void ChamberParameterisation::ComputeTransformation(const G4int copyNo,
|
||||
G4VPhysicalVolume* physVol) const
|
||||
{
|
||||
// Note: copyNo will start with zero!
|
||||
G4double Zposition = fStartZ + copyNo * fSpacing;
|
||||
G4ThreeVector origin(0,0,Zposition);
|
||||
G4ThreeVector origin(0, 0, Zposition);
|
||||
physVol->SetTranslation(origin);
|
||||
physVol->SetRotation(nullptr);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ChamberParameterisation::ComputeDimensions
|
||||
(G4Tubs& trackerChamber, const G4int copyNo, const G4VPhysicalVolume*) const
|
||||
void ChamberParameterisation::ComputeDimensions(G4Tubs& trackerChamber, const G4int copyNo,
|
||||
const G4VPhysicalVolume*) const
|
||||
{
|
||||
// Note: copyNo will start with zero!
|
||||
G4double rmax = fRmaxFirst + copyNo * fRmaxIncr;
|
||||
trackerChamber.SetInnerRadius(0);
|
||||
trackerChamber.SetOuterRadius(rmax);
|
||||
trackerChamber.SetZHalfLength(fHalfWidth);
|
||||
trackerChamber.SetStartPhiAngle(0.*deg);
|
||||
trackerChamber.SetDeltaPhiAngle(360.*deg);
|
||||
trackerChamber.SetStartPhiAngle(0. * deg);
|
||||
trackerChamber.SetDeltaPhiAngle(360. * deg);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
} // namespace B2b
|
||||
|
||||
@@ -28,31 +28,28 @@
|
||||
/// \brief Implementation of the B2b::DetectorConstruction class
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "DetectorMessenger.hh"
|
||||
|
||||
#include "ChamberParameterisation.hh"
|
||||
#include "DetectorMessenger.hh"
|
||||
#include "TrackerSD.hh"
|
||||
|
||||
#include "G4AutoDelete.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4GeometryManager.hh"
|
||||
#include "G4GeometryTolerance.hh"
|
||||
#include "G4GlobalMagFieldMessenger.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4SDManager.hh"
|
||||
|
||||
#include "G4Box.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4PVParameterised.hh"
|
||||
#include "G4GlobalMagFieldMessenger.hh"
|
||||
#include "G4AutoDelete.hh"
|
||||
|
||||
#include "G4GeometryTolerance.hh"
|
||||
#include "G4GeometryManager.hh"
|
||||
|
||||
#include "G4UserLimits.hh"
|
||||
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Colour.hh"
|
||||
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4UserLimits.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
using namespace B2;
|
||||
|
||||
@@ -61,8 +58,7 @@ namespace B2b
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ThreadLocal
|
||||
G4GlobalMagFieldMessenger* DetectorConstruction::fMagFieldMessenger = nullptr;
|
||||
G4ThreadLocal G4GlobalMagFieldMessenger* DetectorConstruction::fMagFieldMessenger = nullptr;
|
||||
|
||||
DetectorConstruction::DetectorConstruction()
|
||||
{
|
||||
@@ -100,7 +96,7 @@ void DetectorConstruction::DefineMaterials()
|
||||
nistManager->FindOrBuildMaterial("G4_AIR");
|
||||
|
||||
// Lead defined using NIST Manager
|
||||
fTargetMaterial = nistManager->FindOrBuildMaterial("G4_Pb");
|
||||
fTargetMaterial = nistManager->FindOrBuildMaterial("G4_Pb");
|
||||
|
||||
// Xenon gas defined using NIST Manager
|
||||
fChamberMaterial = nistManager->FindOrBuildMaterial("G4_Xe");
|
||||
@@ -113,23 +109,23 @@ void DetectorConstruction::DefineMaterials()
|
||||
|
||||
G4VPhysicalVolume* DetectorConstruction::DefineVolumes()
|
||||
{
|
||||
G4Material* air = G4Material::GetMaterial("G4_AIR");
|
||||
G4Material* air = G4Material::GetMaterial("G4_AIR");
|
||||
|
||||
// Sizes of the principal geometrical components (solids)
|
||||
|
||||
G4int NbOfChambers = 5;
|
||||
G4double chamberSpacing = 80*cm; // from chamber center to center!
|
||||
G4double chamberSpacing = 80 * cm; // from chamber center to center!
|
||||
|
||||
G4double chamberWidth = 20.0*cm; // width of the chambers
|
||||
G4double targetLength = 5.0*cm; // full length of Target
|
||||
G4double chamberWidth = 20.0 * cm; // width of the chambers
|
||||
G4double targetLength = 5.0 * cm; // full length of Target
|
||||
|
||||
G4double trackerLength = (NbOfChambers+1)*chamberSpacing;
|
||||
G4double trackerLength = (NbOfChambers + 1) * chamberSpacing;
|
||||
|
||||
G4double worldLength = 1.2 * (2*targetLength + trackerLength);
|
||||
G4double worldLength = 1.2 * (2 * targetLength + trackerLength);
|
||||
|
||||
G4double targetRadius = 0.5*targetLength; // Radius of Target
|
||||
targetLength = 0.5*targetLength; // Half length of the Target
|
||||
G4double trackerSize = 0.5*trackerLength; // Half length of the Tracker
|
||||
G4double targetRadius = 0.5 * targetLength; // Radius of Target
|
||||
targetLength = 0.5 * targetLength; // Half length of the Target
|
||||
G4double trackerSize = 0.5 * trackerLength; // Half length of the Tracker
|
||||
|
||||
// Definitions of Solids, Logical Volumes, Physical Volumes
|
||||
|
||||
@@ -138,58 +134,57 @@ G4VPhysicalVolume* DetectorConstruction::DefineVolumes()
|
||||
G4GeometryManager::GetInstance()->SetWorldMaximumExtent(worldLength);
|
||||
|
||||
G4cout << "Computed tolerance = "
|
||||
<< G4GeometryTolerance::GetInstance()->GetSurfaceTolerance()/mm
|
||||
<< " mm" << G4endl;
|
||||
<< G4GeometryTolerance::GetInstance()->GetSurfaceTolerance() / mm << " mm" << G4endl;
|
||||
|
||||
auto worldS = new G4Box("world", // its name
|
||||
worldLength / 2, worldLength / 2, worldLength / 2); // its size
|
||||
auto worldLV = new G4LogicalVolume(worldS, // its solid
|
||||
air, // its material
|
||||
"World"); // its name
|
||||
auto worldS = new G4Box("world", // its name
|
||||
worldLength / 2, worldLength / 2, worldLength / 2); // its size
|
||||
auto worldLV = new G4LogicalVolume(worldS, // its solid
|
||||
air, // its material
|
||||
"World"); // its name
|
||||
|
||||
// Must place the World Physical volume unrotated at (0,0,0).
|
||||
//
|
||||
auto worldPV = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
worldLV, // its logical volume
|
||||
"World", // its name
|
||||
nullptr, // its mother volume
|
||||
false, // no boolean operations
|
||||
0, // copy number
|
||||
fCheckOverlaps); // checking overlaps
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
worldLV, // its logical volume
|
||||
"World", // its name
|
||||
nullptr, // its mother volume
|
||||
false, // no boolean operations
|
||||
0, // copy number
|
||||
fCheckOverlaps); // checking overlaps
|
||||
|
||||
// Target
|
||||
|
||||
G4ThreeVector positionTarget = G4ThreeVector(0,0,-(targetLength+trackerSize));
|
||||
G4ThreeVector positionTarget = G4ThreeVector(0, 0, -(targetLength + trackerSize));
|
||||
|
||||
auto targetS = new G4Tubs("target", 0., targetRadius, targetLength, 0. * deg, 360. * deg);
|
||||
fLogicTarget = new G4LogicalVolume(targetS, fTargetMaterial, "Target", nullptr, nullptr, nullptr);
|
||||
new G4PVPlacement(nullptr, // no rotation
|
||||
positionTarget, // at (x,y,z)
|
||||
fLogicTarget, // its logical volume
|
||||
"Target", // its name
|
||||
worldLV, // its mother volume
|
||||
false, // no boolean operations
|
||||
0, // copy number
|
||||
fCheckOverlaps); // checking overlaps
|
||||
positionTarget, // at (x,y,z)
|
||||
fLogicTarget, // its logical volume
|
||||
"Target", // its name
|
||||
worldLV, // its mother volume
|
||||
false, // no boolean operations
|
||||
0, // copy number
|
||||
fCheckOverlaps); // checking overlaps
|
||||
|
||||
G4cout << "Target is " << 2*targetLength/cm << " cm of "
|
||||
<< fTargetMaterial->GetName() << G4endl;
|
||||
G4cout << "Target is " << 2 * targetLength / cm << " cm of " << fTargetMaterial->GetName()
|
||||
<< G4endl;
|
||||
|
||||
// Tracker
|
||||
|
||||
G4ThreeVector positionTracker = G4ThreeVector(0,0,0);
|
||||
G4ThreeVector positionTracker = G4ThreeVector(0, 0, 0);
|
||||
|
||||
auto trackerS = new G4Tubs("tracker", 0, trackerSize, trackerSize, 0. * deg, 360. * deg);
|
||||
auto trackerLV = new G4LogicalVolume(trackerS, air, "Tracker", nullptr, nullptr, nullptr);
|
||||
new G4PVPlacement(nullptr, // no rotation
|
||||
positionTracker, // at (x,y,z)
|
||||
trackerLV, // its logical volume
|
||||
"Tracker", // its name
|
||||
worldLV, // its mother volume
|
||||
false, // no boolean operations
|
||||
0, // copy number
|
||||
fCheckOverlaps); // checking overlaps
|
||||
positionTracker, // at (x,y,z)
|
||||
trackerLV, // its logical volume
|
||||
"Tracker", // its name
|
||||
worldLV, // its mother volume
|
||||
false, // no boolean operations
|
||||
0, // copy number
|
||||
fCheckOverlaps); // checking overlaps
|
||||
|
||||
// Tracker segments
|
||||
|
||||
@@ -201,42 +196,38 @@ G4VPhysicalVolume* DetectorConstruction::DefineVolumes()
|
||||
new G4LogicalVolume(chamberS, fChamberMaterial, "Chamber", nullptr, nullptr, nullptr);
|
||||
|
||||
G4double firstPosition = -trackerSize + chamberSpacing;
|
||||
G4double firstLength = trackerLength/10;
|
||||
G4double lastLength = trackerLength;
|
||||
G4double firstLength = trackerLength / 10;
|
||||
G4double lastLength = trackerLength;
|
||||
|
||||
G4VPVParameterisation* chamberParam =
|
||||
new ChamberParameterisation(
|
||||
NbOfChambers, // NoChambers
|
||||
firstPosition, // Z of center of first
|
||||
chamberSpacing, // Z spacing of centers
|
||||
chamberWidth, // chamber width
|
||||
firstLength, // initial length
|
||||
lastLength); // final length
|
||||
new ChamberParameterisation(NbOfChambers, // NoChambers
|
||||
firstPosition, // Z of center of first
|
||||
chamberSpacing, // Z spacing of centers
|
||||
chamberWidth, // chamber width
|
||||
firstLength, // initial length
|
||||
lastLength); // final length
|
||||
|
||||
// dummy value : kZAxis -- modified by parameterised volume
|
||||
|
||||
new G4PVParameterised("Chamber", // their name
|
||||
fLogicChamber, // their logical volume
|
||||
trackerLV, // Mother logical volume
|
||||
kZAxis, // Are placed along this axis
|
||||
NbOfChambers, // Number of chambers
|
||||
chamberParam, // The parametrisation
|
||||
fCheckOverlaps); // checking overlaps
|
||||
new G4PVParameterised("Chamber", // their name
|
||||
fLogicChamber, // their logical volume
|
||||
trackerLV, // Mother logical volume
|
||||
kZAxis, // Are placed along this axis
|
||||
NbOfChambers, // Number of chambers
|
||||
chamberParam, // The parametrisation
|
||||
fCheckOverlaps); // checking overlaps
|
||||
|
||||
G4cout << "There are " << NbOfChambers << " chambers in the tracker region. "
|
||||
<< G4endl
|
||||
<< "The chambers are " << chamberWidth/cm << " cm of "
|
||||
<< fChamberMaterial->GetName() << G4endl
|
||||
<< "The distance between chamber is " << chamberSpacing/cm << " cm"
|
||||
<< G4endl;
|
||||
G4cout << "There are " << NbOfChambers << " chambers in the tracker region. " << G4endl
|
||||
<< "The chambers are " << chamberWidth / cm << " cm of " << fChamberMaterial->GetName()
|
||||
<< G4endl << "The distance between chamber is " << chamberSpacing / cm << " cm" << G4endl;
|
||||
|
||||
// Visualization attributes
|
||||
|
||||
G4VisAttributes boxVisAtt(G4Colour::White());
|
||||
|
||||
worldLV ->SetVisAttributes(boxVisAtt);
|
||||
fLogicTarget ->SetVisAttributes(boxVisAtt);
|
||||
trackerLV ->SetVisAttributes(boxVisAtt);
|
||||
worldLV->SetVisAttributes(boxVisAtt);
|
||||
fLogicTarget->SetVisAttributes(boxVisAtt);
|
||||
trackerLV->SetVisAttributes(boxVisAtt);
|
||||
|
||||
G4VisAttributes chamberVisAtt(G4Colour::Yellow());
|
||||
fLogicChamber->SetVisAttributes(chamberVisAtt);
|
||||
@@ -248,7 +239,7 @@ G4VPhysicalVolume* DetectorConstruction::DefineVolumes()
|
||||
//
|
||||
// Sets a max step length in the tracker region, with G4StepLimiter
|
||||
|
||||
G4double maxStep = 0.5*chamberWidth;
|
||||
G4double maxStep = 0.5 * chamberWidth;
|
||||
fStepLimit = new G4UserLimits(maxStep);
|
||||
trackerLV->SetUserLimits(fStepLimit);
|
||||
|
||||
@@ -272,9 +263,9 @@ void DetectorConstruction::ConstructSDandField()
|
||||
// Sensitive detectors
|
||||
|
||||
G4String trackerChamberSDname = "B2/TrackerChamberSD";
|
||||
auto aTrackerSD = new TrackerSD(trackerChamberSDname, "TrackerHitsCollection");
|
||||
G4SDManager::GetSDMpointer()->AddNewDetector(aTrackerSD);
|
||||
SetSensitiveDetector( fLogicChamber, aTrackerSD );
|
||||
auto trackerSD = new TrackerSD(trackerChamberSDname, "TrackerHitsCollection");
|
||||
G4SDManager::GetSDMpointer()->AddNewDetector(trackerSD);
|
||||
SetSensitiveDetector(fLogicChamber, trackerSD);
|
||||
|
||||
// Create global magnetic field messenger.
|
||||
// Uniform magnetic field is then created automatically if
|
||||
@@ -293,22 +284,18 @@ void DetectorConstruction::SetTargetMaterial(G4String materialName)
|
||||
{
|
||||
G4NistManager* nistManager = G4NistManager::Instance();
|
||||
|
||||
G4Material* pttoMaterial =
|
||||
nistManager->FindOrBuildMaterial(materialName);
|
||||
G4Material* pttoMaterial = nistManager->FindOrBuildMaterial(materialName);
|
||||
|
||||
if (fTargetMaterial != pttoMaterial) {
|
||||
if ( pttoMaterial ) {
|
||||
fTargetMaterial = pttoMaterial;
|
||||
if (fLogicTarget) fLogicTarget->SetMaterial(fTargetMaterial);
|
||||
G4cout
|
||||
<< G4endl
|
||||
<< "----> The target is made of " << materialName << G4endl;
|
||||
} else {
|
||||
G4cout
|
||||
<< G4endl
|
||||
<< "--> WARNING from SetTargetMaterial : "
|
||||
<< materialName << " not found" << G4endl;
|
||||
}
|
||||
if (pttoMaterial) {
|
||||
fTargetMaterial = pttoMaterial;
|
||||
if (fLogicTarget) fLogicTarget->SetMaterial(fTargetMaterial);
|
||||
G4cout << G4endl << "----> The target is made of " << materialName << G4endl;
|
||||
}
|
||||
else {
|
||||
G4cout << G4endl << "--> WARNING from SetTargetMaterial : " << materialName << " not found"
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,22 +305,18 @@ void DetectorConstruction::SetChamberMaterial(G4String materialName)
|
||||
{
|
||||
G4NistManager* nistManager = G4NistManager::Instance();
|
||||
|
||||
G4Material* pttoMaterial =
|
||||
nistManager->FindOrBuildMaterial(materialName);
|
||||
G4Material* pttoMaterial = nistManager->FindOrBuildMaterial(materialName);
|
||||
|
||||
if (fChamberMaterial != pttoMaterial) {
|
||||
if ( pttoMaterial ) {
|
||||
fChamberMaterial = pttoMaterial;
|
||||
if (fLogicChamber) fLogicChamber->SetMaterial(fChamberMaterial);
|
||||
G4cout
|
||||
<< G4endl
|
||||
<< "----> The chambers are made of " << materialName << G4endl;
|
||||
} else {
|
||||
G4cout
|
||||
<< G4endl
|
||||
<< "--> WARNING from SetChamberMaterial : "
|
||||
<< materialName << " not found" << G4endl;
|
||||
}
|
||||
if (pttoMaterial) {
|
||||
fChamberMaterial = pttoMaterial;
|
||||
if (fLogicChamber) fLogicChamber->SetMaterial(fChamberMaterial);
|
||||
G4cout << G4endl << "----> The chambers are made of " << materialName << G4endl;
|
||||
}
|
||||
else {
|
||||
G4cout << G4endl << "--> WARNING from SetChamberMaterial : " << materialName << " not found"
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,9 +324,9 @@ void DetectorConstruction::SetChamberMaterial(G4String materialName)
|
||||
|
||||
void DetectorConstruction::SetMaxStep(G4double maxStep)
|
||||
{
|
||||
if ((fStepLimit)&&(maxStep>0.)) fStepLimit->SetMaxAllowedStep(maxStep);
|
||||
if ((fStepLimit) && (maxStep > 0.)) fStepLimit->SetMaxAllowedStep(maxStep);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
} // namespace B2b
|
||||
|
||||
@@ -28,19 +28,19 @@
|
||||
/// \brief Implementation of the B2b::DetectorMessenger class
|
||||
|
||||
#include "DetectorMessenger.hh"
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
|
||||
namespace B2b
|
||||
{
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorMessenger::DetectorMessenger(DetectorConstruction* Det)
|
||||
: fDetectorConstruction(Det)
|
||||
DetectorMessenger::DetectorMessenger(DetectorConstruction* Det) : fDetectorConstruction(Det)
|
||||
{
|
||||
fDirectory = new G4UIdirectory("/B2/");
|
||||
fDirectory->SetGuidance("UI commands specific to this example.");
|
||||
@@ -48,19 +48,19 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction* Det)
|
||||
fDetDirectory = new G4UIdirectory("/B2/det/");
|
||||
fDetDirectory->SetGuidance("Detector construction control");
|
||||
|
||||
fTargMatCmd = new G4UIcmdWithAString("/B2/det/setTargetMaterial",this);
|
||||
fTargMatCmd = new G4UIcmdWithAString("/B2/det/setTargetMaterial", this);
|
||||
fTargMatCmd->SetGuidance("Select Material of the Target.");
|
||||
fTargMatCmd->SetParameterName("choice",false);
|
||||
fTargMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fTargMatCmd->SetParameterName("choice", false);
|
||||
fTargMatCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fChamMatCmd = new G4UIcmdWithAString("/B2/det/setChamberMaterial",this);
|
||||
fChamMatCmd = new G4UIcmdWithAString("/B2/det/setChamberMaterial", this);
|
||||
fChamMatCmd->SetGuidance("Select Material of the Chamber.");
|
||||
fChamMatCmd->SetParameterName("choice",false);
|
||||
fChamMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fChamMatCmd->SetParameterName("choice", false);
|
||||
fChamMatCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fStepMaxCmd = new G4UIcmdWithADoubleAndUnit("/B2/det/stepMax",this);
|
||||
fStepMaxCmd = new G4UIcmdWithADoubleAndUnit("/B2/det/stepMax", this);
|
||||
fStepMaxCmd->SetGuidance("Define a step max");
|
||||
fStepMaxCmd->SetParameterName("stepMax",false);
|
||||
fStepMaxCmd->SetParameterName("stepMax", false);
|
||||
fStepMaxCmd->SetUnitCategory("Length");
|
||||
fStepMaxCmd->AvailableForStates(G4State_Idle);
|
||||
}
|
||||
@@ -78,20 +78,21 @@ DetectorMessenger::~DetectorMessenger()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
void DetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
if( command == fTargMatCmd )
|
||||
{ fDetectorConstruction->SetTargetMaterial(newValue);}
|
||||
if (command == fTargMatCmd) {
|
||||
fDetectorConstruction->SetTargetMaterial(newValue);
|
||||
}
|
||||
|
||||
if( command == fChamMatCmd )
|
||||
{ fDetectorConstruction->SetChamberMaterial(newValue);}
|
||||
if (command == fChamMatCmd) {
|
||||
fDetectorConstruction->SetChamberMaterial(newValue);
|
||||
}
|
||||
|
||||
if( command == fStepMaxCmd ) {
|
||||
fDetectorConstruction
|
||||
->SetMaxStep(fStepMaxCmd->GetNewDoubleValue(newValue));
|
||||
if (command == fStepMaxCmd) {
|
||||
fDetectorConstruction->SetMaxStep(fStepMaxCmd->GetNewDoubleValue(newValue));
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
} // namespace B2b
|
||||
|
||||
@@ -30,18 +30,15 @@
|
||||
#include "EventAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
#include "G4Trajectory.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
namespace B2
|
||||
{
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void EventAction::BeginOfEventAction(const G4Event*)
|
||||
{}
|
||||
void EventAction::BeginOfEventAction(const G4Event*) {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -56,19 +53,16 @@ void EventAction::EndOfEventAction(const G4Event* event)
|
||||
// periodic printing
|
||||
|
||||
G4int eventID = event->GetEventID();
|
||||
if ( eventID < 100 || eventID % 100 == 0) {
|
||||
G4cout << ">>> Event: " << eventID << G4endl;
|
||||
if ( trajectoryContainer ) {
|
||||
G4cout << " " << n_trajectories
|
||||
<< " trajectories stored in this event." << G4endl;
|
||||
if (eventID < 100 || eventID % 100 == 0) {
|
||||
G4cout << ">>> Event: " << eventID << G4endl;
|
||||
if (trajectoryContainer) {
|
||||
G4cout << " " << n_trajectories << " trajectories stored in this event." << G4endl;
|
||||
}
|
||||
G4VHitsCollection* hc = event->GetHCofThisEvent()->GetHC(0);
|
||||
G4cout << " "
|
||||
<< hc->GetSize() << " hits stored in this event" << G4endl;
|
||||
G4cout << " " << hc->GetSize() << " hits stored in this event" << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
|
||||
} // namespace B2
|
||||
|
||||
@@ -29,15 +29,13 @@
|
||||
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
namespace B2
|
||||
{
|
||||
@@ -51,12 +49,12 @@ PrimaryGeneratorAction::PrimaryGeneratorAction()
|
||||
|
||||
// default particle kinematic
|
||||
|
||||
G4ParticleDefinition* particleDefinition
|
||||
= G4ParticleTable::GetParticleTable()->FindParticle("proton");
|
||||
G4ParticleDefinition* particleDefinition =
|
||||
G4ParticleTable::GetParticleTable()->FindParticle("proton");
|
||||
|
||||
fParticleGun->SetParticleDefinition(particleDefinition);
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
|
||||
fParticleGun->SetParticleEnergy(3.0*GeV);
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0., 0., 1.));
|
||||
fParticleGun->SetParticleEnergy(3.0 * GeV);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -68,7 +66,7 @@ PrimaryGeneratorAction::~PrimaryGeneratorAction()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* event)
|
||||
{
|
||||
// This function is called at the begining of event
|
||||
|
||||
@@ -77,12 +75,12 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
// from G4LogicalVolumeStore.
|
||||
|
||||
G4double worldZHalfLength = 0;
|
||||
G4LogicalVolume* worldLV
|
||||
= G4LogicalVolumeStore::GetInstance()->GetVolume("World");
|
||||
G4LogicalVolume* worldLV = G4LogicalVolumeStore::GetInstance()->GetVolume("World");
|
||||
G4Box* worldBox = nullptr;
|
||||
if ( worldLV ) worldBox = dynamic_cast<G4Box*>(worldLV->GetSolid());
|
||||
if ( worldBox ) worldZHalfLength = worldBox->GetZHalfLength();
|
||||
else {
|
||||
if (worldLV) worldBox = dynamic_cast<G4Box*>(worldLV->GetSolid());
|
||||
if (worldBox)
|
||||
worldZHalfLength = worldBox->GetZHalfLength();
|
||||
else {
|
||||
G4cerr << "World volume of box not found." << G4endl;
|
||||
G4cerr << "Perhaps you have changed geometry." << G4endl;
|
||||
G4cerr << "The gun will be place in the center." << G4endl;
|
||||
@@ -90,12 +88,11 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
|
||||
// Starting a primary particle close to the world boundary.
|
||||
//
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(0., 0., -worldZHalfLength+1*um));
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(0., 0., -worldZHalfLength + 1 * um));
|
||||
|
||||
fParticleGun->GeneratePrimaryVertex(anEvent);
|
||||
fParticleGun->GeneratePrimaryVertex(event);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
|
||||
} // namespace B2
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include "RunAction.hh"
|
||||
|
||||
#include "G4Run.hh"
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
namespace B2
|
||||
@@ -47,16 +46,14 @@ RunAction::RunAction()
|
||||
|
||||
void RunAction::BeginOfRunAction(const G4Run*)
|
||||
{
|
||||
//inform the runManager to save random number seed
|
||||
// inform the runManager to save random number seed
|
||||
G4RunManager::GetRunManager()->SetRandomNumberStore(false);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void RunAction::EndOfRunAction(const G4Run* )
|
||||
{}
|
||||
void RunAction::EndOfRunAction(const G4Run*) {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
|
||||
} // namespace B2
|
||||
|
||||
@@ -28,10 +28,11 @@
|
||||
/// \brief Implementation of the B2::TrackerHit class
|
||||
|
||||
#include "TrackerHit.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
|
||||
#include "G4Circle.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
#include <iomanip>
|
||||
@@ -45,7 +46,7 @@ G4ThreadLocal G4Allocator<TrackerHit>* TrackerHitAllocator = nullptr;
|
||||
|
||||
G4bool TrackerHit::operator==(const TrackerHit& right) const
|
||||
{
|
||||
return ( this == &right ) ? true : false;
|
||||
return (this == &right) ? true : false;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -53,8 +54,7 @@ G4bool TrackerHit::operator==(const TrackerHit& right) const
|
||||
void TrackerHit::Draw()
|
||||
{
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if(pVVisManager)
|
||||
{
|
||||
if (pVVisManager) {
|
||||
G4Circle circle(fPos);
|
||||
circle.SetScreenSize(4.);
|
||||
circle.SetFillStyle(G4Circle::filled);
|
||||
@@ -68,15 +68,11 @@ void TrackerHit::Draw()
|
||||
|
||||
void TrackerHit::Print()
|
||||
{
|
||||
G4cout
|
||||
<< " trackID: " << fTrackID << " chamberNb: " << fChamberNb
|
||||
<< "Edep: "
|
||||
<< std::setw(7) << G4BestUnit(fEdep,"Energy")
|
||||
<< " Position: "
|
||||
<< std::setw(7) << G4BestUnit( fPos,"Length")
|
||||
<< G4endl;
|
||||
G4cout << " trackID: " << fTrackID << " chamberNb: " << fChamberNb << "Edep: " << std::setw(7)
|
||||
<< G4BestUnit(fEdep, "Energy") << " Position: " << std::setw(7)
|
||||
<< G4BestUnit(fPos, "Length") << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
} // namespace B2
|
||||
|
||||
@@ -28,20 +28,18 @@
|
||||
/// \brief Implementation of the B2::TrackerSD class
|
||||
|
||||
#include "TrackerSD.hh"
|
||||
|
||||
#include "G4HCofThisEvent.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4Step.hh"
|
||||
|
||||
namespace B2
|
||||
{
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
TrackerSD::TrackerSD(const G4String& name,
|
||||
const G4String& hitsCollectionName)
|
||||
: G4VSensitiveDetector(name)
|
||||
TrackerSD::TrackerSD(const G4String& name, const G4String& hitsCollectionName)
|
||||
: G4VSensitiveDetector(name)
|
||||
{
|
||||
collectionName.insert(hitsCollectionName);
|
||||
}
|
||||
@@ -52,37 +50,33 @@ void TrackerSD::Initialize(G4HCofThisEvent* hce)
|
||||
{
|
||||
// Create hits collection
|
||||
|
||||
fHitsCollection
|
||||
= new TrackerHitsCollection(SensitiveDetectorName, collectionName[0]);
|
||||
fHitsCollection = new TrackerHitsCollection(SensitiveDetectorName, collectionName[0]);
|
||||
|
||||
// Add this collection in hce
|
||||
|
||||
G4int hcID
|
||||
= G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
|
||||
hce->AddHitsCollection( hcID, fHitsCollection );
|
||||
G4int hcID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
|
||||
hce->AddHitsCollection(hcID, fHitsCollection);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool TrackerSD::ProcessHits(G4Step* aStep,
|
||||
G4TouchableHistory*)
|
||||
G4bool TrackerSD::ProcessHits(G4Step* step, G4TouchableHistory*)
|
||||
{
|
||||
// energy deposit
|
||||
G4double edep = aStep->GetTotalEnergyDeposit();
|
||||
G4double edep = step->GetTotalEnergyDeposit();
|
||||
|
||||
if (edep==0.) return false;
|
||||
if (edep == 0.) return false;
|
||||
|
||||
auto newHit = new TrackerHit();
|
||||
|
||||
newHit->SetTrackID (aStep->GetTrack()->GetTrackID());
|
||||
newHit->SetChamberNb(aStep->GetPreStepPoint()->GetTouchableHandle()
|
||||
->GetCopyNumber());
|
||||
newHit->SetTrackID(step->GetTrack()->GetTrackID());
|
||||
newHit->SetChamberNb(step->GetPreStepPoint()->GetTouchableHandle()->GetCopyNumber());
|
||||
newHit->SetEdep(edep);
|
||||
newHit->SetPos (aStep->GetPostStepPoint()->GetPosition());
|
||||
newHit->SetPos(step->GetPostStepPoint()->GetPosition());
|
||||
|
||||
fHitsCollection->insert( newHit );
|
||||
fHitsCollection->insert(newHit);
|
||||
|
||||
//newHit->Print();
|
||||
// newHit->Print();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -91,16 +85,15 @@ G4bool TrackerSD::ProcessHits(G4Step* aStep,
|
||||
|
||||
void TrackerSD::EndOfEvent(G4HCofThisEvent*)
|
||||
{
|
||||
if ( verboseLevel>1 ) {
|
||||
std::size_t nofHits = fHitsCollection->entries();
|
||||
G4cout << G4endl
|
||||
<< "-------->Hits Collection: in this event they are " << nofHits
|
||||
<< " hits in the tracker chambers: " << G4endl;
|
||||
for ( std::size_t i=0; i<nofHits; i++ ) (*fHitsCollection)[i]->Print();
|
||||
if (verboseLevel > 1) {
|
||||
std::size_t nofHits = fHitsCollection->entries();
|
||||
G4cout << G4endl << "-------->Hits Collection: in this event they are " << nofHits
|
||||
<< " hits in the tracker chambers: " << G4endl;
|
||||
for (std::size_t i = 0; i < nofHits; i++)
|
||||
(*fHitsCollection)[i]->Print();
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
|
||||
} // namespace B2
|
||||
|
||||
Reference in New Issue
Block a user