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