Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
source
processes
management
include
G4VProcess.hh
Go to the documentation of this file.
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
// $Id$
28
//
29
//
30
// ------------------------------------------------------------
31
// GEANT 4 class header file
32
//
33
// History: first implementation, based on object model of
34
// 2nd December 1995, G.Cosmo
35
//
36
// Class Description
37
// This class is the virtual class for physics process objects.
38
// It defines public methods which describe the behavior of
39
// a physics process.
40
//
41
// ------------------------------------------------------------
42
// New Physics scheme 18 Dec. 1996 H.Kurahige
43
// ------------------------------------------------------------
44
// change DoIt/GetPIL arguments type 20 Mar. 1997 H.Kurashige
45
// modified AlongStepGPIL 17 Dec. 1997 H.Kurashige
46
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
47
// Add process trype 27 Mar. 1998 H.Kurashige
48
// Remove thePhysicsTable 2 Aug. 1998 H.Kurashige
49
// Add PILfactor and GPIL 3 Nov. 2000 H.Kurashige
50
// Add Store/RetrievePhysicsTable 8 Nov. 2000 H.Kurashige
51
// Modify Store/RetrievePhysicsTable methods 9 Mar. 2001 H.Kurashige
52
// Added PreparePhysicsTable 20 Aug. 2004 H.Kurashige
53
// Added isXXXXDoItIsEnabled 2 Oct. 2007 H.Kurashige
54
// Added ProcessSubType 15 Nov. 2007 H.Kurashige
55
56
#ifndef G4VProcess_h
57
#define G4VProcess_h 1
58
59
#include "
globals.hh
"
60
#include <cmath>
61
#include "
G4ios.hh
"
62
63
class
G4ParticleDefinition
;
64
class
G4DynamicParticle
;
65
class
G4Track
;
66
class
G4Step
;
67
68
#include "
G4PhysicsTable.hh
"
69
#include "
G4VParticleChange.hh
"
70
#include "
G4ForceCondition.hh
"
71
#include "
G4GPILSelection.hh
"
72
#include "
G4ParticleChange.hh
"
73
#include "
G4ProcessType.hh
"
74
75
class
G4VProcess
76
{
77
// A virtual class for physics process objects. It defines
78
// public methods which describe the behavior of a
79
// physics process.
80
81
private
:
82
// hide default constructor and assignment operator as private
83
// do not hide default constructor for alpha version
84
// G4VProcess G4VProcess();
85
G4VProcess
& operator=(
const
G4VProcess
&
right
);
86
87
public
:
// with description
88
// constructor requires the process name and type
89
G4VProcess
(
const
G4String
& aName =
"NoName"
,
90
G4ProcessType
aType =
fNotDefined
);
91
92
// copy constructor copys the name but does not copy the
93
// physics table (0 pointer is assigned)
94
G4VProcess
(
const
G4VProcess
&right);
95
96
public
:
97
// destructor
98
virtual
~G4VProcess
();
99
100
// equal opperators
101
G4int
operator==
(
const
G4VProcess
&right)
const
;
102
G4int
operator!=
(
const
G4VProcess
&right)
const
;
103
104
public
:
// with description
106
// DoIt /////////////////
108
virtual
G4VParticleChange
*
PostStepDoIt
(
109
const
G4Track
& track,
110
const
G4Step
& stepData
111
) = 0;
112
113
virtual
G4VParticleChange
*
AlongStepDoIt
(
114
const
G4Track
& track,
115
const
G4Step
& stepData
116
) = 0;
117
virtual
G4VParticleChange
*
AtRestDoIt
(
118
const
G4Track
& track,
119
const
G4Step
& stepData
120
) = 0;
121
// A virtual base class function that has to be overridden
122
// by any subclass. The DoIt method actually performs the
123
// physics process and determines either momentum change
124
// of the production of secondaries etc.
125
// arguments
126
// const G4Track& track:
127
// reference to the current G4Track information
128
// const G4Step& stepData:
129
// reference to the current G4Step information
130
132
// GPIL //////////////
134
virtual
G4double
AlongStepGetPhysicalInteractionLength
(
135
const
G4Track
& track,
136
G4double
previousStepSize,
137
G4double
currentMinimumStep,
138
G4double
& proposedSafety,
139
G4GPILSelection
* selection) = 0;
140
141
virtual
G4double
AtRestGetPhysicalInteractionLength
(
142
const
G4Track
& track,
143
G4ForceCondition
*
condition
144
) = 0;
145
146
virtual
G4double
PostStepGetPhysicalInteractionLength
(
147
const
G4Track
& track,
148
G4double
previousStepSize,
149
G4ForceCondition
* condition
150
) = 0;
151
152
// Returns the Step-size (actual length) which is allowed
153
// by "this" process. (for AtRestGetPhysicalInteractionLength,
154
// return value is Step-time) The NumberOfInteractionLengthLeft is
155
// recalculated by using previousStepSize and the Step-size is
156
// calucalted accoding to the resultant NumberOfInteractionLengthLeft.
157
// using NumberOfInteractionLengthLeft, which is recalculated at
158
// arguments
159
// const G4Track& track:
160
// reference to the current G4Track information
161
// G4double* previousStepSize:
162
// the Step-size (actual length) of the previous Step
163
// of this track. Negative calue indicates that
164
// NumberOfInteractionLengthLeft must be reset.
165
// the current physical interaction legth of this process
166
// G4ForceCondition* condition:
167
// the flag indicates DoIt of this process is forced
168
// to be called
169
// Forced: Corresponding DoIt is forced
170
// NotForced: Corresponding DoIt is called
171
// if the Step size of this Step is determined
172
// by this process
173
// !! AlongStepDoIt is always called !!
174
// G4double& currentMinimumStep:
175
// this value is used for transformation of
176
// true path length to geometrical path length
177
178
G4double
GetCurrentInteractionLength
()
const
;
179
// Returns currentInteractionLength
180
182
void
SetPILfactor
(
G4double
value
);
183
G4double
GetPILfactor
()
const
;
184
// Set/Get factor for PhysicsInteractionLength
185
// which is passed to G4SteppingManager for both AtRest and PostStep
186
187
// These three GPIL methods are used by Stepping Manager.
188
// They invoke virtual GPIL methods listed above.
189
// As for AtRest and PostStep the returned value is multipled by thePILfactor
190
//
191
G4double
AlongStepGPIL
(
const
G4Track
& track,
192
G4double
previousStepSize,
193
G4double
currentMinimumStep,
194
G4double
& proposedSafety,
195
G4GPILSelection
* selection );
196
197
G4double
AtRestGPIL
(
const
G4Track
& track,
198
G4ForceCondition
* condition );
199
200
G4double
PostStepGPIL
(
const
G4Track
& track,
201
G4double
previousStepSize,
202
G4ForceCondition
* condition );
203
205
virtual
G4bool
IsApplicable
(
const
G4ParticleDefinition
&){
return
true
;}
206
// Returns true if this process object is applicable to
207
// the particle type
208
// Process will not be registered to a particle if IsApplicable is false
209
210
virtual
void
BuildPhysicsTable
(
const
G4ParticleDefinition
&){}
211
// Messaged by the Particle definition (via the Process manager)
212
// whenever cross section tables have to be rebuilt (i.e. if new
213
// materials have been defined).
214
// It is overloaded by individual processes when they need physics
215
// tables.
216
217
virtual
void
PreparePhysicsTable
(
const
G4ParticleDefinition
&){}
218
// Messaged by the Particle definition (via the Process manager)
219
// whenever cross section tables have to be prepare for rebuilt
220
// (i.e. if new materials have been defined).
221
// It is overloaded by individual processes when they need physics
222
// tables.
223
224
// Processes which Build physics tables independent of cuts
225
// (for example in their constructors)
226
// should preferably use private
227
// void BuildThePhysicsTable() and void PreparePhysicsTable().
228
// Not another BuildPhysicsTable, please.
229
230
231
virtual
G4bool
StorePhysicsTable
(
const
G4ParticleDefinition
* ,
232
const
G4String
&,
G4bool
){
return
true
;}
233
// Store PhysicsTable in a file.
234
// (return false in case of failure at I/O )
235
236
virtual
G4bool
RetrievePhysicsTable
(
const
G4ParticleDefinition
* ,
237
const
G4String
&,
G4bool
){
return
false
;}
238
// Retrieve Physics from a file.
239
// (return true if the Physics Table can be build by using file)
240
// (return false if the process has no functionality or in case of failure)
241
// File name should be defined by each process
242
// and the file should be placed under the directory specifed by the argument.
243
const
G4String
&
GetPhysicsTableFileName
(
const
G4ParticleDefinition
* ,
244
const
G4String
& directory,
245
const
G4String
& tableName,
246
G4bool
ascii =
false
);
247
// this method is utility for Store/RetreivePhysicsTable
248
250
const
G4String
&
GetProcessName
()
const
;
251
// Returns the name of the process.
252
253
G4ProcessType
GetProcessType
()
const
;
254
// Returns the process type.
255
256
void
SetProcessType
(
G4ProcessType
);
257
// Set the process type.
258
259
G4int
GetProcessSubType
()
const
;
260
// Returns the process sub type.
261
262
void
SetProcessSubType
(
G4int
);
263
// Set the process sub type.
264
265
static
const
G4String
&
GetProcessTypeName
(
G4ProcessType
);
266
// Returns the process type name
267
268
virtual
void
StartTracking
(
G4Track
*);
269
virtual
void
EndTracking
();
270
// inform Start/End of tracking for each track to the physics process
271
272
public
:
273
virtual
void
SetProcessManager
(
const
G4ProcessManager
*);
274
// A process manager set its own pointer when the process is registered
275
// the process Manager
276
virtual
const
G4ProcessManager
*
GetProcessManager
();
277
// Get the process manager which the process belongs to
278
279
protected
:
280
const
G4ProcessManager
*
aProcessManager
;
281
282
protected
:
283
G4VParticleChange
*
pParticleChange
;
284
// The pointer to G4VParticleChange object
285
// which is modified and returned by address by the DoIt() method.
286
// This pointer should be set in each physics process
287
// after construction of derived class object.
288
289
G4ParticleChange
aParticleChange
;
290
// This object is kept for compatibility with old scheme
291
// This will be removed in future
292
293
G4double
theNumberOfInteractionLengthLeft
;
294
// The flight length left for the current tracking particle
295
// in unit of "Interaction length".
296
297
G4double
currentInteractionLength
;
298
// The InteractionLength in the current material
299
300
G4double
theInitialNumberOfInteractionLength
;
301
// The initial value when ResetNumberOfInteractionLengthLeft is invoked
302
303
public
:
// with description
304
virtual
void
ResetNumberOfInteractionLengthLeft
();
305
// reset (determine the value of)NumberOfInteractionLengthLeft
306
307
G4double
GetNumberOfInteractionLengthLeft
()
const
;
308
// get NumberOfInteractionLengthLeft
309
310
G4double
GetTotalNumberOfInteractionLengthTraversed
()
const
;
311
// get NumberOfInteractionLength
312
// after ResetNumberOfInteractionLengthLeft is invoked
313
314
protected
:
// with description
315
void
SubtractNumberOfInteractionLengthLeft
(
316
G4double
previousStepSize
317
);
318
// subtract NumberOfInteractionLengthLeft by the value corresponding to
319
// previousStepSize
320
321
void
ClearNumberOfInteractionLengthLeft
();
322
// clear NumberOfInteractionLengthLeft
323
// !!! This method should be at the end of PostStepDoIt()
324
// !!! and AtRestDoIt
325
326
public
:
// with description
327
// These methods indicate which DoIt is enabled
328
// These methods are used by G4ProcessManager to check
329
// that ordering parameters are set properly
330
G4bool
isAtRestDoItIsEnabled
()
const
;
331
G4bool
isAlongStepDoItIsEnabled
()
const
;
332
G4bool
isPostStepDoItIsEnabled
()
const
;
333
334
protected
:
335
G4String
theProcessName
;
336
// The name of the process
337
338
G4String
thePhysicsTableFileName
;
339
340
G4ProcessType
theProcessType
;
341
// The type of the process
342
343
G4int
theProcessSubType
;
344
// The sub type of the process
345
346
G4double
thePILfactor
;
347
// factor for PhysicsInteractionLength
348
// which is passed to G4SteppingManager
349
350
G4bool
enableAtRestDoIt
;
351
G4bool
enableAlongStepDoIt
;
352
G4bool
enablePostStepDoIt
;
353
354
public
:
// with description
355
virtual
void
DumpInfo
()
const
;
356
// dump out process information
357
358
public
:
// with description
359
void
SetVerboseLevel
(
G4int
value);
360
G4int
GetVerboseLevel
()
const
;
361
// set/get controle flag for output message
362
// 0: Silent
363
// 1: Warning message
364
// 2: More
365
366
367
protected
:
368
G4int
verboseLevel
;
369
// controle flag for output message
370
371
};
372
373
// -----------------------------------------
374
// inlined function members implementation
375
// -----------------------------------------
376
#include "
Randomize.hh
"
377
378
inline
379
const
G4String
&
G4VProcess::GetProcessName
()
const
380
{
381
return
theProcessName
;
382
}
383
384
inline
385
G4ProcessType
G4VProcess::GetProcessType
()
const
386
{
387
return
theProcessType
;
388
}
389
390
inline
391
void
G4VProcess::SetProcessType
(
G4ProcessType
aType)
392
{
393
theProcessType
= aType;
394
}
395
396
inline
397
G4int
G4VProcess::GetProcessSubType
()
const
398
{
399
return
theProcessSubType
;
400
}
401
402
inline
403
void
G4VProcess::SetProcessSubType
(
G4int
value
)
404
{
405
theProcessSubType
=
value
;
406
}
407
408
inline
void
G4VProcess::SetVerboseLevel
(
G4int
value
)
409
{
410
verboseLevel
=
value
;
411
}
412
413
inline
G4int
G4VProcess::GetVerboseLevel
()
const
414
{
415
return
verboseLevel
;
416
}
417
418
inline
void
G4VProcess::ClearNumberOfInteractionLengthLeft
()
419
{
420
theInitialNumberOfInteractionLength
= -1.0;
421
theNumberOfInteractionLengthLeft
= -1.0;
422
}
423
424
inline
G4double
G4VProcess::GetNumberOfInteractionLengthLeft
()
const
425
{
426
return
theNumberOfInteractionLengthLeft
;
427
}
428
429
inline
G4double
G4VProcess::GetTotalNumberOfInteractionLengthTraversed
()
const
430
{
431
return
theInitialNumberOfInteractionLength
-
theNumberOfInteractionLengthLeft
;}
432
433
inline
G4double
G4VProcess::GetCurrentInteractionLength
()
const
434
{
435
return
currentInteractionLength
;
436
}
437
438
inline
void
G4VProcess::SetPILfactor
(
G4double
value
)
439
{
440
if
(value>0.) {
441
thePILfactor
=
value
;
442
}
443
}
444
445
inline
G4double
G4VProcess::GetPILfactor
()
const
446
{
447
return
thePILfactor
;
448
}
449
450
inline
G4double
G4VProcess::AlongStepGPIL
(
const
G4Track
& track,
451
G4double
previousStepSize,
452
G4double
currentMinimumStep,
453
G4double
& proposedSafety,
454
G4GPILSelection
* selection )
455
{
456
G4double
value
457
=
AlongStepGetPhysicalInteractionLength
(track, previousStepSize, currentMinimumStep, proposedSafety, selection);
458
return
value
;
459
}
460
461
inline
G4double
G4VProcess::AtRestGPIL
(
const
G4Track
& track,
462
G4ForceCondition
*
condition
)
463
{
464
G4double
value
465
=
AtRestGetPhysicalInteractionLength
(track, condition);
466
return
thePILfactor
*
value
;
467
}
468
469
inline
G4double
G4VProcess::PostStepGPIL
(
const
G4Track
& track,
470
G4double
previousStepSize,
471
G4ForceCondition
*
condition
)
472
{
473
G4double
value
474
=
PostStepGetPhysicalInteractionLength
(track, previousStepSize, condition);
475
return
thePILfactor
*
value
;
476
}
477
478
inline
479
void
G4VProcess::SetProcessManager
(
const
G4ProcessManager
* procMan)
480
{
481
aProcessManager
= procMan;
482
}
483
484
inline
485
const
G4ProcessManager
*
G4VProcess::GetProcessManager
()
486
{
487
return
aProcessManager
;
488
}
489
490
inline
491
G4bool
G4VProcess::isAtRestDoItIsEnabled
()
const
492
{
493
return
enableAtRestDoIt
;
494
}
495
496
inline
497
G4bool
G4VProcess::isAlongStepDoItIsEnabled
()
const
498
{
499
return
enableAlongStepDoIt
;
500
}
501
502
inline
503
G4bool
G4VProcess::isPostStepDoItIsEnabled
()
const
504
{
505
return
enablePostStepDoIt
;
506
}
507
508
#endif
Generated on Sat May 25 2013 14:34:10 for Geant4 by
1.8.4