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: G4ProcessManager.icc,v 1.6 2007/03/30 01:02:28 kurasige Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-03-cand-01 $ |
---|
29 | // |
---|
30 | // |
---|
31 | |
---|
32 | #include "G4ProcessAttribute.hh" |
---|
33 | |
---|
34 | // ----------------------------------------- |
---|
35 | // inlined function members implementation |
---|
36 | // ----------------------------------------- |
---|
37 | inline |
---|
38 | void G4ProcessManager::SetParticleType(const G4ParticleDefinition* aParticle) |
---|
39 | { |
---|
40 | theParticleType = aParticle; |
---|
41 | } |
---|
42 | |
---|
43 | inline |
---|
44 | G4ProcessVector* G4ProcessManager::GetProcessList() const |
---|
45 | { |
---|
46 | return theProcessList; |
---|
47 | } |
---|
48 | |
---|
49 | inline |
---|
50 | G4int G4ProcessManager::GetProcessListLength() const |
---|
51 | { |
---|
52 | return numberOfProcesses; |
---|
53 | } |
---|
54 | |
---|
55 | inline |
---|
56 | G4int G4ProcessManager::GetProcessIndex(G4VProcess* aProcess) const |
---|
57 | { |
---|
58 | G4int idx = theProcessList->index(aProcess); |
---|
59 | if (idx>=numberOfProcesses) idx = -1; |
---|
60 | return idx; |
---|
61 | } |
---|
62 | |
---|
63 | inline |
---|
64 | G4int G4ProcessManager::GetProcessVectorId(G4ProcessVectorDoItIndex idx, |
---|
65 | G4ProcessVectorTypeIndex typ) const |
---|
66 | { |
---|
67 | if ( idx == idxAtRest ) { |
---|
68 | if (typ == typeGPIL) { return 0; } |
---|
69 | else { return 1; } |
---|
70 | } else if ( idx == idxAlongStep ) { |
---|
71 | if (typ == typeGPIL) { return 2; } |
---|
72 | else { return 3; } |
---|
73 | } else if ( idx == idxPostStep ) { |
---|
74 | if (typ == typeGPIL) { return 4; } |
---|
75 | else { return 5; } |
---|
76 | } else { |
---|
77 | return -1; |
---|
78 | } |
---|
79 | } |
---|
80 | |
---|
81 | inline |
---|
82 | G4ProcessVector* G4ProcessManager::GetProcessVector( |
---|
83 | G4ProcessVectorDoItIndex idx, |
---|
84 | G4ProcessVectorTypeIndex typ |
---|
85 | ) const |
---|
86 | { |
---|
87 | G4int ivec = GetProcessVectorId(idx, typ); |
---|
88 | if ( ivec >=0 ) { |
---|
89 | return theProcVector[ivec]; |
---|
90 | } else { |
---|
91 | return 0; |
---|
92 | } |
---|
93 | } |
---|
94 | |
---|
95 | inline |
---|
96 | G4ProcessVector* G4ProcessManager::GetAtRestProcessVector(G4ProcessVectorTypeIndex typ) const |
---|
97 | { |
---|
98 | if (typ == typeGPIL) { return theProcVector[0]; } |
---|
99 | else { return theProcVector[1]; } |
---|
100 | } |
---|
101 | |
---|
102 | inline |
---|
103 | G4ProcessVector* G4ProcessManager::GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ) const |
---|
104 | { |
---|
105 | if (typ == typeGPIL) { return theProcVector[2]; } |
---|
106 | else { return theProcVector[3]; } |
---|
107 | } |
---|
108 | |
---|
109 | inline |
---|
110 | G4ProcessVector* G4ProcessManager::GetPostStepProcessVector(G4ProcessVectorTypeIndex typ) const |
---|
111 | { |
---|
112 | if (typ == typeGPIL) { return theProcVector[4]; } |
---|
113 | else { return theProcVector[5]; } |
---|
114 | } |
---|
115 | |
---|
116 | inline |
---|
117 | G4int G4ProcessManager::GetAtRestIndex( |
---|
118 | G4VProcess* aProcess, |
---|
119 | G4ProcessVectorTypeIndex typ |
---|
120 | ) const |
---|
121 | { |
---|
122 | return GetProcessVectorIndex(aProcess, idxAtRest, typ); |
---|
123 | } |
---|
124 | |
---|
125 | inline |
---|
126 | G4int G4ProcessManager::GetAlongStepIndex( |
---|
127 | G4VProcess* aProcess, |
---|
128 | G4ProcessVectorTypeIndex typ |
---|
129 | ) const |
---|
130 | { |
---|
131 | return GetProcessVectorIndex(aProcess, idxAlongStep, typ); |
---|
132 | } |
---|
133 | |
---|
134 | inline |
---|
135 | G4int G4ProcessManager::GetPostStepIndex( |
---|
136 | G4VProcess* aProcess, |
---|
137 | G4ProcessVectorTypeIndex typ |
---|
138 | ) const |
---|
139 | { |
---|
140 | return GetProcessVectorIndex(aProcess, idxPostStep, typ); |
---|
141 | } |
---|
142 | |
---|
143 | inline |
---|
144 | G4int G4ProcessManager::AddRestProcess(G4VProcess *aProcess,G4int ord) |
---|
145 | { |
---|
146 | return AddProcess(aProcess, ord, ordInActive, ordInActive); |
---|
147 | } |
---|
148 | |
---|
149 | inline |
---|
150 | G4int G4ProcessManager::AddContinuousProcess(G4VProcess *aProcess,G4int ord) |
---|
151 | { |
---|
152 | return AddProcess(aProcess, ordInActive, ord, ordInActive); |
---|
153 | } |
---|
154 | |
---|
155 | inline |
---|
156 | G4int G4ProcessManager::AddDiscreteProcess(G4VProcess *aProcess,G4int ord) |
---|
157 | { |
---|
158 | return AddProcess(aProcess, ordInActive, ordInActive, ord); |
---|
159 | } |
---|
160 | |
---|
161 | inline |
---|
162 | G4ParticleDefinition* G4ProcessManager::GetParticleType() const |
---|
163 | { |
---|
164 | return (G4ParticleDefinition* )theParticleType; |
---|
165 | } |
---|
166 | |
---|
167 | |
---|
168 | inline |
---|
169 | void G4ProcessManager::SetVerboseLevel(G4int value) |
---|
170 | { |
---|
171 | verboseLevel = value; |
---|
172 | } |
---|
173 | |
---|
174 | inline |
---|
175 | G4int G4ProcessManager::GetVerboseLevel() const |
---|
176 | { |
---|
177 | return verboseLevel; |
---|
178 | } |
---|
179 | |
---|