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
G4ProcessManager.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
// ---------------- G4ProcessManager -----------------
36
// Class Description
37
// It collects all physics a particle can undertake as seven vectors.
38
// These vectors are
39
// one vector for all processes (called as "process List")
40
// two vectors for processes with AtRestGetPhysicalInteractionLength
41
// and AtRestDoIt
42
// two vectors for processes with AlongStepGetPhysicalInteractionLength
43
// and AlongStepDoIt
44
// two vectors for processes with PostStepGetPhysicalInteractionLength
45
// and PostStepDoIt
46
// The tracking will message three types of GetPhysicalInteractionLength
47
// in order to limit the Step and select the occurence of processes.
48
// It will message the corresponding DoIt() to apply the selected
49
// processes. In addition, the Tracking will limit the Step
50
// and select the occurence of the processes according to
51
// the shortest physical interaction length computed (except for
52
// processes at rest, for which the Tracking will select the
53
// occurence of the process which returns the shortest mean
54
// life-time from the GetPhysicalInteractionLength()).
55
//
56
// History:
57
// revised by G.Cosmo, 06 May 1996
58
// Added vector of processes at rest, 06 May 1996
59
// ------------------------------------------------------------
60
// New Physics scheme 8 Jan. 1997 H.Kurahige
61
// Add SetProcessOrdering methods 27 Mar 1998 H.Kurahige
62
// Add copy constructor (deep copy) 28 June 1998 H.Kurashige
63
// Add GetProcessActivation 3 May. 1999 H.Kurashige
64
// Use STL vector instead of RW vector 1. Mar 00 H.Kurashige
65
// Modify G4ProcessVectorOrdering to fix FindInsedrtPosition 15 Feb. 2005
66
// Add
67
// ------------------------------------------------------------
68
69
#ifndef G4ProcessManager_h
70
#define G4ProcessManager_h 1
71
72
#include "
globals.hh
"
73
#include "
G4ios.hh
"
74
#include <vector>
75
76
#include "
G4VProcess.hh
"
77
#include "
G4ProcessVector.hh
"
78
#include "
G4ParticleDefinition.hh
"
79
80
class
G4ProcessManagerMessenger
;
81
class
G4ProcessAttribute
;
82
83
// Indexes for ProcessVector
84
enum
G4ProcessVectorTypeIndex
85
{
86
typeGPIL
= 0,
// for GetPhysicalInteractionLength
87
typeDoIt
=1
// for DoIt
88
};
89
enum
G4ProcessVectorDoItIndex
90
{
91
idxAll
= -1,
// for all DoIt/GPIL
92
idxAtRest
= 0,
// for AtRestDoIt/GPIL
93
idxAlongStep
= 1,
// for AlongStepDoIt/GPIL
94
idxPostStep
=2,
// for AlongSTepDoIt/GPIL
95
NDoit
=3
96
};
97
98
// enumeration for Ordering Parameter
99
enum
G4ProcessVectorOrdering
100
{
101
ordInActive
= -1,
// ordering parameter to indicate InActive DoIt
102
ordDefault
= 1000,
// default ordering parameter
103
ordLast
= 9999
// ordering parameter to indicate the last DoIt
104
};
105
106
class
G4ProcessManager
107
{
108
109
public
:
110
// copy constructor
111
G4ProcessManager
(
G4ProcessManager
&
right
);
112
113
private
:
114
// hide default constructor and assignment operator
115
G4ProcessManager
& operator=(
const
G4ProcessManager
&right);
116
G4ProcessManager
();
117
118
public
:
119
120
G4ProcessManager
(
const
G4ParticleDefinition
* aParticleType);
121
// Constructor
122
123
~G4ProcessManager
();
124
// Destructor
125
126
G4int
operator==
(
const
G4ProcessManager
&right)
const
;
127
G4int
operator!=
(
const
G4ProcessManager
&right)
const
;
128
129
public
:
// with description
130
G4ProcessVector
*
GetProcessList
()
const
;
131
// Returns the address of the vector of all processes
132
133
G4int
GetProcessListLength
()
const
;
134
// Returns the number of process in the ProcessVector
135
136
G4int
GetProcessIndex
(
G4VProcess
*)
const
;
137
// Returns the index of the process in the process List
138
139
// --------------------------------------
140
141
G4ProcessVector
*
GetProcessVector
(
142
G4ProcessVectorDoItIndex
idx,
143
G4ProcessVectorTypeIndex
typ =
typeGPIL
144
)
const
;
145
// Returns the address of the vector of processes
146
147
G4ProcessVector
*
GetAtRestProcessVector
(
148
G4ProcessVectorTypeIndex
typ =
typeGPIL
149
)
const
;
150
// Returns the address of the vector of processes for
151
// AtRestGetPhysicalInteractionLength idx =0
152
// AtRestGetPhysicalDoIt idx =1
153
G4ProcessVector
*
GetAlongStepProcessVector
(
154
G4ProcessVectorTypeIndex
typ =
typeGPIL
155
)
const
;
156
// Returns the address of the vector of processes for
157
// AlongStepGetPhysicalInteractionLength idx =0
158
// AlongStepGetPhysicalDoIt idx =1
159
160
G4ProcessVector
*
GetPostStepProcessVector
(
161
G4ProcessVectorTypeIndex
typ =
typeGPIL
162
)
const
;
163
// Returns the address of the vector of processes for
164
// PostStepGetPhysicalInteractionLength idx =0
165
// PostStepGetPhysicalDoIt idx =1
166
167
G4int
GetProcessVectorIndex
(
168
G4VProcess
* aProcess,
169
G4ProcessVectorDoItIndex
idx,
170
G4ProcessVectorTypeIndex
typ =
typeGPIL
171
)
const
;
172
G4int
GetAtRestIndex
(
173
G4VProcess
* aProcess,
174
G4ProcessVectorTypeIndex
typ =
typeGPIL
175
)
const
;
176
G4int
GetAlongStepIndex
(
177
G4VProcess
* aProcess,
178
G4ProcessVectorTypeIndex
typ =
typeGPIL
179
)
const
;
180
G4int
GetPostStepIndex
(
181
G4VProcess
* aProcess,
182
G4ProcessVectorTypeIndex
typ =
typeGPIL
183
)
const
;
184
// Returns the index for GPIL/DoIt process vector of the process
185
186
G4int
AddProcess
(
187
G4VProcess
*aProcess,
188
G4int
ordAtRestDoIt =
ordInActive
,
189
G4int
ordAlongSteptDoIt =
ordInActive
,
190
G4int
ordPostStepDoIt =
ordInActive
191
);
192
// Add a process to the process List
193
// return values are index to the List. Negative return value
194
// indicates that the process has not be added due to some errors
195
// The first argument is a pointer to process.
196
// Following arguments are ordering parameters of the process in
197
// process vectors. If value is negative, the process is
198
// not added to the corresponding process vector.
199
200
// following methods are provided for simple processes
201
// AtRestProcess has only AtRestDoIt
202
// ContinuousProcess has only AlongStepDoIt
203
// DiscreteProcess has only PostStepDoIt
204
// If the ording parameter is not specified, the process is
205
// added at the end of List of process vectors
206
// If a process with same ordering parameter exists,
207
// this new process will be added just after processes
208
// with same ordering parameter
209
// (except for processes assigned to LAST explicitly )
210
// for both DoIt and GetPhysicalInteractionLength
211
//
212
213
G4int
AddRestProcess
(
G4VProcess
*aProcess,
G4int
ord =
ordDefault
);
214
G4int
AddDiscreteProcess
(
G4VProcess
*aProcess,
G4int
ord =
ordDefault
);
215
G4int
AddContinuousProcess
(
G4VProcess
*aProcess,
G4int
ord =
ordDefault
);
216
217
219
// Methods for setting ordering parameters
220
// Altanative methods for setting ordering parameters
221
// Note: AddProcess method should precede these methods
222
223
G4int
GetProcessOrdering
(
224
G4VProcess
*aProcess,
225
G4ProcessVectorDoItIndex
idDoIt
226
);
227
228
void
SetProcessOrdering
(
229
G4VProcess
*aProcess,
230
G4ProcessVectorDoItIndex
idDoIt,
231
G4int
ordDoIt =
ordDefault
232
);
233
// Set ordering parameter for DoIt specified by typeDoIt.
234
// If a process with same ordering parameter exists,
235
// this new process will be added just after processes
236
// with same ordering parameter
237
// Note: Ordering parameter will bet set to non-zero
238
// even if you set ordDoIt = 0
239
240
void
SetProcessOrderingToFirst
(
241
G4VProcess
*aProcess,
242
G4ProcessVectorDoItIndex
idDoIt
243
);
244
// Set ordering parameter to the first of all processes
245
// for DoIt specified by idDoIt.
246
// Note: If you use this method for two processes,
247
// a process called later will be first.
248
249
void
SetProcessOrderingToSecond
(
250
G4VProcess
*aProcess,
251
G4ProcessVectorDoItIndex
idDoIt
252
);
253
// Set ordering parameter to 1 for DoIt specified by idDoIt
254
// and the rpocess will be added just after
255
// the processes with ordering parameter equal to zero
256
// Note: If you use this method for two processes,
257
// a process called later will be .
258
259
void
SetProcessOrderingToLast
(
260
G4VProcess
*aProcess,
261
G4ProcessVectorDoItIndex
idDoIt
262
);
263
// Set ordering parameter to the last of all processes
264
// for DoIt specified by idDoIt.
265
// Note: If you use this method for two processes,
266
// a process called later will precede.
267
268
G4VProcess
*
RemoveProcess
(
G4VProcess
*aProcess);
269
G4VProcess
*
RemoveProcess
(
G4int
index
);
270
// Removes a process from the process List.
271
// return value is pointer to the removed process.
272
// (0 value will be returned in case of errors)
273
274
G4VProcess
*
SetProcessActivation
(
G4VProcess
*aProcess,
G4bool
fActive);
275
G4VProcess
*
SetProcessActivation
(
G4int
index,
G4bool
fActive);
276
// Set activation flag.
277
// return value is pointer to the applied process.
278
// (0 value will be returned in case of errors)
279
280
G4bool
GetProcessActivation
(
G4VProcess
*aProcess)
const
;
281
G4bool
GetProcessActivation
(
G4int
index)
const
;
282
// Get activation flag.
283
284
G4ParticleDefinition
*
GetParticleType
()
const
;
285
// get the particle type
286
void
SetParticleType
(
const
G4ParticleDefinition
*);
287
// set the particle type
288
289
void
StartTracking
(
G4Track
* aTrack=0);
290
void
EndTracking
();
291
// these two methods are used by G4TrackingManager
292
// in order to inform Start/End of tracking for each track
293
// to the process manager and all physics processes
294
295
296
public
:
297
enum
{
SizeOfProcVectorArray
= 6};
298
private
:
299
G4ProcessVector
* theProcVector[
SizeOfProcVectorArray
];
300
// vector for processes with GetPhysicalInteractionLength/DoIt
301
302
typedef
std::vector<G4ProcessAttribute*> G4ProcessAttrVector;
303
G4ProcessAttrVector* theAttrVector;
304
// vector for process attribute
305
306
protected
:
// with description
307
G4int
InsertAt
(
G4int
position
,
G4VProcess
* process,
G4int
ivec);
308
// insert process at position in theProcVector[ivec]
309
310
G4int
RemoveAt
(
G4int
position
,
G4VProcess
* process,
G4int
ivec);
311
// remove process at position in theProcVector[ivec]
312
313
G4int
FindInsertPosition
(
G4int
ord,
G4int
ivec);
314
// find insert position according to ordering parameter
315
// in theProcVector[ivec]
316
317
G4int
GetProcessVectorId
(
G4ProcessVectorDoItIndex
idx,
318
G4ProcessVectorTypeIndex
typ =
typeGPIL
)
const
;
319
320
void
CheckOrderingParameters
(
G4VProcess
*)
const
;
321
// check consistencies between ordering parameters and
322
// validity of DoIt of the Process
323
324
private
:
325
G4ProcessAttribute
* GetAttribute(
G4int
index)
const
;
326
G4ProcessAttribute
* GetAttribute(
G4VProcess
*aProcess)
const
;
327
// get Pointer to ProcessAttribute
328
329
G4VProcess
* ActivateProcess(
G4int
index);
330
G4VProcess
* InActivateProcess(
G4int
index);
331
// Activate/InActivateProcess Process
332
333
private
:
334
const
G4ParticleDefinition
* theParticleType;
335
// particle which has this process manager object
336
337
G4int
numberOfProcesses;
338
G4ProcessVector
* theProcessList;
339
// vector for all processes (called as "process List")
340
341
private
:
342
G4bool
duringTracking;
343
void
CreateGPILvectors();
344
void
SetIndexToProcessVector(
G4int
ivec);
345
346
G4bool
isSetOrderingFirstInvoked[
NDoit
];
347
G4bool
isSetOrderingLastInvoked[
NDoit
];
348
349
public
:
// with description
350
void
DumpInfo
();
351
352
void
SetVerboseLevel
(
G4int
value
);
353
G4int
GetVerboseLevel
()
const
;
354
// controle flag for output message
355
// 0: Silent
356
// 1: Warning message
357
// 2: More
358
359
protected
:
360
G4int
verboseLevel
;
361
362
private
:
363
static
G4ProcessManagerMessenger
* fProcessManagerMessenger;
364
static
G4int
counterOfObjects;
365
};
366
#include "G4ProcessManager.icc"
367
368
#endif
369
Generated on Sat May 25 2013 14:34:10 for Geant4 by
1.8.4