ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
G4SteppingManager.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4SteppingManager.hh
1
//
2
// ********************************************************************
3
// * License and Disclaimer *
4
// * *
5
// * The Geant4 software is copyright of the Copyright Holders of *
6
// * the Geant4 Collaboration. It is provided under the terms and *
7
// * conditions of the Geant4 Software License, included in the file *
8
// * LICENSE and available at http://cern.ch/geant4/license . These *
9
// * include a list of copyright holders. *
10
// * *
11
// * Neither the authors of this software system, nor their employing *
12
// * institutes,nor the agencies providing financial support for this *
13
// * work make any representation or warranty, express or implied, *
14
// * regarding this software system or assume any liability for its *
15
// * use. Please see the license in the file LICENSE and URL above *
16
// * for the full disclaimer and the limitation of liability. *
17
// * *
18
// * This code implementation is the result of the scientific and *
19
// * technical work of the GEANT4 collaboration. *
20
// * By using, copying, modifying or distributing the software (or *
21
// * any work based on the software) you agree to acknowledge its *
22
// * use in resulting scientific publications, and indicate your *
23
// * acceptance of all terms of the Geant4 Software license. *
24
// ********************************************************************
25
//
26
//
27
//
28
//---------------------------------------------------------------
29
//
30
// G4SteppingManager.hh
31
//
32
// class description:
33
// This is the class which plays an essential role in tracking
34
// the particle. It takes cares all message passing between
35
// objects in the different categories (for example,
36
// geometry(including transportation), interactions in
37
// matter, etc). It's public method 'stepping' steers to step
38
// the particle.
39
// Geant4 kernel use only
40
//
41
// Contact:
42
// Questions and comments to this code should be sent to
43
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
44
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
45
//
46
//---------------------------------------------------------------
47
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
48
49
50
class
G4SteppingManager
;
51
52
#ifndef G4SteppingManager_h
53
#define G4SteppingManager_h 1
54
55
class
G4VSensitiveDetector
;
56
57
#include "
G4ios.hh
"
// Include from 'system'
58
#include <iomanip>
// Include from 'system'
59
#include <vector>
// Include from 'system'
60
#include "
globals.hh
"
// Include from 'global'
61
#include "
Randomize.hh
"
// Include from 'global'
62
63
#include "
G4Navigator.hh
"
// Include from 'geometry'
64
#include "
G4LogicalVolume.hh
"
// Include from 'geometry'
65
#include "
G4VPhysicalVolume.hh
"
// Include from 'geometry'
66
#include "
G4ProcessManager.hh
"
// Include from 'piim'
67
68
#include "
G4Track.hh
"
// Include from 'tracking'
69
#include "
G4TrackVector.hh
"
// Include from 'tracking'
70
#include "
G4TrackStatus.hh
"
// Include from 'tracking'
71
#include "
G4StepStatus.hh
"
// Include from 'tracking'
72
#include "
G4UserSteppingAction.hh
"
// Include from 'tracking'
73
#include "
G4Step.hh
"
// Include from 'tracking'
74
#include "
G4StepPoint.hh
"
// Include from 'tracking'
75
#include "
G4VSteppingVerbose.hh
"
// Include from 'tracking'
76
#include "
G4TouchableHandle.hh
"
// Include from 'geometry'
77
#include "
G4TouchableHistoryHandle.hh
"
// Include from 'geometry'
78
79
//
80
typedef
std::vector<G4int>
81
G4SelectedAtRestDoItVector
;
82
typedef
std::vector<G4int>
83
G4SelectedAlongStepDoItVector
;
84
typedef
std::vector<G4int>
85
G4SelectedPostStepDoItVector
;
86
87
static
const
size_t
SizeOfSelectedDoItVector
=100;
88
// In global scope for porting on WIN-VC compiler...
89
91
class
G4SteppingManager
93
{
94
95
//--------
96
public
:
//without description
97
//--------
98
99
// Constructor/Destructor
100
101
G4SteppingManager
();
102
// SteppingManger should be dynamically persistent, therefore
103
// you need to invoke new() when you call this constructor.
104
// "Secodary track vector" will be dynamically created by this
105
// cosntructor. "G4UserSteppingAction" will be also constructed
106
// in this constructor, and "this" pointer will be passed to
107
// "G4UserSteppingAction".
108
109
~G4SteppingManager
();
110
111
// Get/Set functions
112
113
const
G4TrackVector
*
GetSecondary
()
const
;
114
void
SetUserAction
(
G4UserSteppingAction
* apAction);
115
G4Track
*
GetTrack
()
const
;
116
void
SetVerboseLevel
(
G4int
vLevel);
117
void
SetVerbose
(
G4VSteppingVerbose
*);
118
G4Step
*
GetStep
()
const
;
119
void
SetNavigator
(
G4Navigator
*
value
);
120
121
122
// Other member functions
123
124
G4StepStatus
Stepping
();
125
// Steers to move the give particle from the TrackingManger
126
// by one Step.
127
128
void
SetInitialStep
(
G4Track
* valueTrack);
129
// Sets up initial track information (enegry, position, etc) to
130
// the PreStepPoint of the G4Step. This funciton has to be called
131
// just once before the stepping loop in the "TrackingManager".
132
133
void
GetProcessNumber
();
134
135
// Get methods
136
G4double
GetPhysicalStep
();
137
G4double
GetGeometricalStep
();
138
G4double
GetCorrectedStep
();
139
G4bool
GetPreStepPointIsGeom
();
140
G4bool
GetFirstStep
();
141
G4StepStatus
GetfStepStatus
();
142
G4double
GetTempInitVelocity
();
143
G4double
GetTempVelocity
();
144
G4double
GetMass
();
145
G4double
GetsumEnergyChange
();
146
G4VParticleChange
*
GetfParticleChange
();
147
G4Track
*
GetfTrack
();
148
G4TrackVector
*
GetfSecondary
();
149
G4Step
*
GetfStep
();
150
G4StepPoint
*
GetfPreStepPoint
();
151
G4StepPoint
*
GetfPostStepPoint
();
152
G4VPhysicalVolume
*
GetfCurrentVolume
();
153
G4VSensitiveDetector
*
GetfSensitive
();
154
G4VProcess
*
GetfCurrentProcess
();
155
G4ProcessVector
*
GetfAtRestDoItVector
();
156
G4ProcessVector
*
GetfAlongStepDoItVector
();
157
G4ProcessVector
*
GetfPostStepDoItVector
();
158
G4ProcessVector
*
GetfAlongStepGetPhysIntVector
();
159
G4ProcessVector
*
GetfPostStepGetPhysIntVector
();
160
G4ProcessVector
*
GetfAtRestGetPhysIntVector
();
161
G4double
GetcurrentMinimumStep
();
162
G4double
GetnumberOfInteractionLengthLeft
();
163
size_t
GetfAtRestDoItProcTriggered
();
164
size_t
GetfAlongStepDoItProcTriggered
();
165
size_t
GetfPostStepDoItProcTriggered
();
166
G4int
GetfN2ndariesAtRestDoIt
();
167
G4int
GetfN2ndariesAlongStepDoIt
();
168
G4int
GetfN2ndariesPostStepDoIt
();
169
G4Navigator
*
GetfNavigator
();
170
G4int
GetverboseLevel
();
171
size_t
GetMAXofAtRestLoops
();
172
size_t
GetMAXofAlongStepLoops
();
173
size_t
GetMAXofPostStepLoops
();
174
G4SelectedAtRestDoItVector
*
GetfSelectedAtRestDoItVector
();
175
G4SelectedAlongStepDoItVector
*
GetfSelectedAlongStepDoItVector
();
176
G4SelectedPostStepDoItVector
*
GetfSelectedPostStepDoItVector
();
177
G4double
GetfPreviousStepSize
();
178
const
G4TouchableHandle
&
GetTouchableHandle
();
179
G4SteppingControl
GetStepControlFlag
();
180
G4UserSteppingAction
*
GetUserAction
();
181
G4double
GetphysIntLength
();
182
G4ForceCondition
GetfCondition
();
183
G4GPILSelection
GetfGPILSelection
();
184
//
185
G4bool
KillVerbose
;
186
//---------
187
private
:
188
//---------
189
190
// Member functions
191
192
void
DefinePhysicalStepLength
();
193
// Calculate corresponding physical length from the mean free path
194
// left for each discrete phyiscs process. The minimum allowable
195
// Step for each continious process will be also calculated.
196
void
InvokeAtRestDoItProcs
();
197
void
InvokeAlongStepDoItProcs
();
198
void
InvokePostStepDoItProcs
();
199
void
InvokePSDIP
(
size_t
);
//
200
G4double
CalculateSafety
();
201
// Return the estimated safety value at the PostStepPoint
202
void
ApplyProductionCut
(
G4Track
*);
203
204
// Member data
205
206
G4UserSteppingAction
*
fUserSteppingAction
;
207
208
G4VSteppingVerbose
*
fVerbose
;
209
210
G4double
PhysicalStep
;
211
G4double
GeometricalStep
;
212
G4double
CorrectedStep
;
213
G4bool
PreStepPointIsGeom
;
214
G4bool
FirstStep
;
215
G4StepStatus
fStepStatus
;
216
217
G4double
TempInitVelocity
;
218
G4double
TempVelocity
;
219
G4double
Mass
;
220
221
G4double
sumEnergyChange
;
222
223
G4VParticleChange
*
fParticleChange
;
224
G4Track
*
fTrack
;
225
G4TrackVector
*
fSecondary
;
226
G4Step
*
fStep
;
227
G4StepPoint
*
fPreStepPoint
;
228
G4StepPoint
*
fPostStepPoint
;
229
230
G4VPhysicalVolume
*
fCurrentVolume
;
231
G4VSensitiveDetector
*
fSensitive
;
232
G4VProcess
*
fCurrentProcess
;
233
// The pointer to the process of which DoIt or
234
// GetPhysicalInteractionLength has been just executed.
235
236
237
G4ProcessVector
*
fAtRestDoItVector
;
238
G4ProcessVector
*
fAlongStepDoItVector
;
239
G4ProcessVector
*
fPostStepDoItVector
;
240
241
G4ProcessVector
*
fAtRestGetPhysIntVector
;
242
G4ProcessVector
*
fAlongStepGetPhysIntVector
;
243
G4ProcessVector
*
fPostStepGetPhysIntVector
;
244
245
size_t
MAXofAtRestLoops
;
246
size_t
MAXofAlongStepLoops
;
247
size_t
MAXofPostStepLoops
;
248
249
size_t
fAtRestDoItProcTriggered
;
250
size_t
fAlongStepDoItProcTriggered
;
251
size_t
fPostStepDoItProcTriggered
;
252
253
G4int
fN2ndariesAtRestDoIt
;
254
G4int
fN2ndariesAlongStepDoIt
;
255
G4int
fN2ndariesPostStepDoIt
;
256
// These are the numbers of secondaries generated by the process
257
// just executed.
258
259
G4Navigator
*
fNavigator
;
260
261
G4int
verboseLevel
;
262
263
G4SelectedAtRestDoItVector
*
fSelectedAtRestDoItVector
;
264
G4SelectedAlongStepDoItVector
*
fSelectedAlongStepDoItVector
;
265
G4SelectedPostStepDoItVector
*
fSelectedPostStepDoItVector
;
266
267
G4double
fPreviousStepSize
;
268
269
G4TouchableHandle
fTouchableHandle
;
270
271
G4SteppingControl
StepControlFlag
;
272
273
G4double
kCarTolerance
;
274
// Cached geometrical tolerance on surface
275
G4double
proposedSafety
;
276
// This keeps the minimum safety value proposed by AlongStepGPILs.
277
G4ThreeVector
endpointSafOrigin
;
278
G4double
endpointSafety
;
279
// To get the true safety value at the PostStepPoint, you have
280
// to subtract the distance to 'endpointSafOrigin' from this value.
281
G4double
physIntLength
;
282
G4ForceCondition
fCondition
;
283
G4GPILSelection
fGPILSelection
;
284
// Above three variables are for the method
285
// DefinePhysicalStepLength(). To pass these information to
286
// the method Verbose, they are kept at here. Need a more
287
// elegant mechanism.
288
289
};
290
291
292
//*******************************************************************
293
//
294
// Inline function
295
//
296
//*******************************************************************
297
298
inline
G4double
G4SteppingManager::GetPhysicalStep
(){
299
return
PhysicalStep
;
300
}
301
302
inline
G4double
G4SteppingManager::GetGeometricalStep
(){
303
return
GeometricalStep
;
304
}
305
306
inline
G4double
G4SteppingManager::GetCorrectedStep
(){
307
return
CorrectedStep
;
308
}
309
310
inline
G4bool
G4SteppingManager::GetPreStepPointIsGeom
(){
311
return
PreStepPointIsGeom
;
312
}
313
314
inline
G4bool
G4SteppingManager::GetFirstStep
(){
315
return
FirstStep
;
316
}
317
318
inline
G4StepStatus
G4SteppingManager::GetfStepStatus
(){
319
return
fStepStatus
;
320
}
321
322
inline
G4double
G4SteppingManager::GetTempInitVelocity
(){
323
return
TempInitVelocity
;
324
}
325
inline
G4double
G4SteppingManager::GetTempVelocity
(){
326
return
TempVelocity
;
327
}
328
inline
G4double
G4SteppingManager::GetMass
(){
329
return
Mass
;
330
}
331
332
inline
G4double
G4SteppingManager::GetsumEnergyChange
(){
333
return
sumEnergyChange
;
334
}
335
336
inline
G4VParticleChange
*
G4SteppingManager::GetfParticleChange
(){
337
return
fParticleChange
;
338
}
339
340
inline
G4Track
*
G4SteppingManager::GetfTrack
(){
341
return
fTrack
;
342
}
343
344
inline
G4TrackVector
*
G4SteppingManager::GetfSecondary
(){
345
return
fStep
->
GetfSecondary
();
346
}
347
inline
G4Step
*
G4SteppingManager::GetfStep
(){
348
return
fStep
;
349
}
350
inline
G4StepPoint
*
G4SteppingManager::GetfPreStepPoint
(){
351
return
fPreStepPoint
;
352
}
353
inline
G4StepPoint
*
G4SteppingManager::GetfPostStepPoint
(){
354
return
fPostStepPoint
;
355
}
356
357
inline
G4VPhysicalVolume
*
G4SteppingManager::GetfCurrentVolume
(){
358
return
fCurrentVolume
;
359
}
360
inline
G4VSensitiveDetector
*
G4SteppingManager::GetfSensitive
(){
361
return
fSensitive
;
362
}
363
inline
G4VProcess
*
G4SteppingManager::GetfCurrentProcess
(){
364
return
fCurrentProcess
;
365
}
366
367
inline
G4ProcessVector
*
G4SteppingManager::GetfAtRestDoItVector
(){
368
return
fAtRestDoItVector
;
369
}
370
inline
G4ProcessVector
*
G4SteppingManager::GetfAlongStepDoItVector
(){
371
return
fAlongStepDoItVector
;
372
}
373
inline
G4ProcessVector
*
G4SteppingManager::GetfPostStepDoItVector
(){
374
return
fPostStepDoItVector
;
375
}
376
377
inline
G4ProcessVector
*
G4SteppingManager::GetfAtRestGetPhysIntVector
(){
378
return
fAtRestGetPhysIntVector
;
379
}
380
381
inline
G4ProcessVector
*
G4SteppingManager::GetfAlongStepGetPhysIntVector
(){
382
return
fAlongStepGetPhysIntVector
;
383
}
384
385
inline
G4ProcessVector
*
G4SteppingManager::GetfPostStepGetPhysIntVector
(){
386
return
fPostStepGetPhysIntVector
;
387
}
388
389
inline
size_t
G4SteppingManager::GetMAXofAtRestLoops
(){
390
return
MAXofAtRestLoops
;
391
}
392
inline
size_t
G4SteppingManager::GetMAXofAlongStepLoops
(){
393
return
MAXofAlongStepLoops
;
394
}
395
inline
size_t
G4SteppingManager::GetMAXofPostStepLoops
(){
396
return
MAXofPostStepLoops
;
397
}
398
399
inline
size_t
G4SteppingManager::GetfAtRestDoItProcTriggered
(){
400
return
fAtRestDoItProcTriggered
;
401
}
402
inline
size_t
G4SteppingManager::GetfAlongStepDoItProcTriggered
(){
403
return
fAtRestDoItProcTriggered
;
404
}
405
inline
size_t
G4SteppingManager::GetfPostStepDoItProcTriggered
(){
406
return
fPostStepDoItProcTriggered
;
407
}
408
inline
G4int
G4SteppingManager::GetfN2ndariesAtRestDoIt
(){
409
return
fN2ndariesAtRestDoIt
;
410
}
411
inline
G4int
G4SteppingManager::GetfN2ndariesAlongStepDoIt
(){
412
return
fN2ndariesAlongStepDoIt
;
413
}
414
inline
G4int
G4SteppingManager::GetfN2ndariesPostStepDoIt
(){
415
return
fN2ndariesPostStepDoIt
;
416
}
417
418
inline
G4Navigator
*
G4SteppingManager::GetfNavigator
(){
419
return
fNavigator
;
420
}
421
inline
G4int
G4SteppingManager::GetverboseLevel
(){
422
return
verboseLevel
;
423
}
424
425
inline
G4SelectedAtRestDoItVector
*
G4SteppingManager::GetfSelectedAtRestDoItVector
(){
426
return
fSelectedAtRestDoItVector
;
427
}
428
429
inline
G4SelectedAlongStepDoItVector
*
G4SteppingManager::GetfSelectedAlongStepDoItVector
(){
430
return
fSelectedAlongStepDoItVector
;
431
}
432
433
inline
G4SelectedPostStepDoItVector
*
G4SteppingManager::GetfSelectedPostStepDoItVector
(){
434
return
fSelectedPostStepDoItVector
;
435
}
436
437
inline
G4double
G4SteppingManager::GetfPreviousStepSize
(){
438
return
fPreviousStepSize
;
439
}
440
441
inline
const
G4TouchableHandle
&
G4SteppingManager::GetTouchableHandle
() {
442
return
fTouchableHandle
;
443
}
444
445
inline
G4SteppingControl
G4SteppingManager::GetStepControlFlag
(){
446
return
StepControlFlag
;
447
}
448
inline
G4double
G4SteppingManager::GetphysIntLength
(){
449
return
physIntLength
;
450
}
451
inline
G4ForceCondition
G4SteppingManager::GetfCondition
(){
452
return
fCondition
;
453
}
454
inline
G4GPILSelection
G4SteppingManager::GetfGPILSelection
(){
455
return
fGPILSelection
;
456
}
457
458
inline
const
G4TrackVector
*
G4SteppingManager::GetSecondary
()
const
{
459
return
fStep
->
GetSecondary
();
460
}
461
462
inline
void
G4SteppingManager::SetNavigator
(
G4Navigator
*
value
){
463
fNavigator
=
value
;
464
}
465
466
inline
void
G4SteppingManager::SetUserAction
(
G4UserSteppingAction
* apAction){
467
fUserSteppingAction
= apAction;
468
}
469
inline
G4UserSteppingAction
*
G4SteppingManager::GetUserAction
(){
470
return
fUserSteppingAction
;
471
}
472
473
inline
G4Track
*
G4SteppingManager::GetTrack
()
const
{
474
return
fTrack
;
475
}
476
477
inline
void
G4SteppingManager::SetVerboseLevel
(
G4int
vLevel){
478
verboseLevel
= vLevel;
479
}
480
481
inline
void
G4SteppingManager::SetVerbose
(
G4VSteppingVerbose
* yourVerbose){
482
fVerbose
= yourVerbose;
483
}
484
485
inline
G4Step
*
G4SteppingManager::GetStep
()
const
{
486
return
fStep
;
487
}
488
489
inline
G4double
G4SteppingManager::CalculateSafety
(){
490
return
std::max
(
endpointSafety
-
491
(
endpointSafOrigin
-
fPostStepPoint
->
GetPosition
()).mag(),
492
kCarTolerance
);
493
}
494
495
496
#endif
geant4
tree
geant4-10.6-release
source
tracking
include
G4SteppingManager.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:53
using
1.8.2 with
ECCE GitHub integration