]>
Commit | Line | Data |
---|---|---|
5d321328 | 1 | // $Id$ |
2 | // Category: physics | |
3 | // | |
4 | // Author: I. Hrivnacova | |
5 | // | |
6 | // Class TG4PhysicsConstructorIon | |
7 | // ------------------------------ | |
8 | // See the class description in the header file. | |
9 | // According to ExN04IonPhysics.cc,v 1.1.2.1 2001/06/28 19:07:37 gunter Exp | |
10 | // GEANT4 tag Name: geant4-03-02 | |
11 | ||
12 | #include "TG4PhysicsConstructorIon.h" | |
13 | #include "TG4ProcessControlMap.h" | |
14 | #include "TG4ProcessMCMap.h" | |
15 | #include "TG4Globals.h" | |
16 | ||
17 | #include <G4ParticleDefinition.hh> | |
18 | #include <G4ProcessManager.hh> | |
19 | #include "G4IonConstructor.hh" | |
20 | ||
21 | //_____________________________________________________________________________ | |
22 | TG4PhysicsConstructorIon::TG4PhysicsConstructorIon(const G4String& name) | |
11f7ee82 | 23 | : TG4VPhysicsConstructor(name), |
24 | fSetEM(true), | |
25 | fSetHadron(true) { | |
26 | // | |
27 | } | |
28 | ||
29 | //_____________________________________________________________________________ | |
30 | TG4PhysicsConstructorIon::TG4PhysicsConstructorIon(G4int verboseLevel, | |
31 | G4bool setEM, | |
32 | G4bool setHadron, | |
33 | const G4String& name) | |
34 | : TG4VPhysicsConstructor(name, verboseLevel), | |
35 | fSetEM(setEM), | |
36 | fSetHadron(setHadron) { | |
5d321328 | 37 | // |
5d321328 | 38 | } |
39 | ||
40 | //_____________________________________________________________________________ | |
41 | TG4PhysicsConstructorIon::TG4PhysicsConstructorIon( | |
42 | const TG4PhysicsConstructorIon& right) | |
43 | { | |
44 | // | |
45 | TG4Globals::Exception("TG4PhysicsConstructorIon is protected from copying."); | |
46 | } | |
47 | ||
48 | //_____________________________________________________________________________ | |
49 | TG4PhysicsConstructorIon::~TG4PhysicsConstructorIon() { | |
50 | // | |
51 | } | |
52 | ||
53 | // operators | |
54 | ||
55 | //_____________________________________________________________________________ | |
56 | TG4PhysicsConstructorIon& | |
57 | TG4PhysicsConstructorIon::operator=(const TG4PhysicsConstructorIon &right) | |
58 | { | |
59 | // check assignement to self | |
60 | if (this == &right) return *this; | |
61 | ||
62 | TG4Globals::Exception( | |
63 | "TG4PhysicsConstructorIon is protected from assigning."); | |
64 | ||
65 | return *this; | |
66 | } | |
67 | ||
68 | ||
69 | // private methods | |
70 | ||
71 | //_____________________________________________________________________________ | |
11f7ee82 | 72 | void TG4PhysicsConstructorIon::ConstructHadProcessForGenericIon() |
5d321328 | 73 | { |
74 | // Constructs electromagnetic processes for generic ion. | |
75 | // --- | |
76 | ||
77 | // add process | |
78 | G4ProcessManager* pManager = G4GenericIon::GenericIon()->GetProcessManager(); | |
79 | pManager->AddDiscreteProcess(&fElasticProcess); | |
11f7ee82 | 80 | |
81 | // map to G3 controls | |
82 | TG4ProcessControlMap* controlMap = TG4ProcessControlMap::Instance(); | |
83 | controlMap->Add(&fElasticProcess, kHADR); | |
84 | ||
85 | // map to AliMCProcess codes | |
86 | TG4ProcessMCMap* mcMap = TG4ProcessMCMap::Instance(); | |
87 | mcMap->Add(&fElasticProcess, kPHElastic); | |
88 | } | |
89 | ||
90 | //_____________________________________________________________________________ | |
91 | void TG4PhysicsConstructorIon::ConstructHadProcessForDeuteron() | |
92 | { | |
93 | // Constructs electromagnetic processes for deuteron. | |
94 | // --- | |
95 | ||
96 | // add process | |
97 | G4ProcessManager* pManager = G4Deuteron::Deuteron()->GetProcessManager(); | |
98 | pManager->AddDiscreteProcess(&fElasticProcess); | |
99 | ||
100 | fDeuteronModel = new G4LEDeuteronInelastic(); | |
101 | fDeuteronProcess.RegisterMe(fDeuteronModel); | |
102 | pManager->AddDiscreteProcess(&fDeuteronProcess); | |
103 | ||
104 | // map to G3 controls | |
105 | TG4ProcessControlMap* controlMap = TG4ProcessControlMap::Instance(); | |
106 | controlMap->Add(&fDeuteronProcess, kHADR); | |
107 | ||
108 | // map to AliMCProcess codes | |
109 | TG4ProcessMCMap* mcMap = TG4ProcessMCMap::Instance(); | |
110 | mcMap->Add(&fDeuteronProcess, kPHInhelastic); | |
111 | } | |
112 | ||
113 | //_____________________________________________________________________________ | |
114 | void TG4PhysicsConstructorIon::ConstructHadProcessForTriton() | |
115 | { | |
116 | // Constructs electromagnetic processes for triton. | |
117 | // --- | |
118 | ||
119 | // add process | |
120 | G4ProcessManager* pManager = G4Triton::Triton()->GetProcessManager(); | |
121 | pManager->AddDiscreteProcess(&fElasticProcess); | |
122 | ||
123 | fTritonModel = new G4LETritonInelastic(); | |
124 | fTritonProcess.RegisterMe(fTritonModel); | |
125 | pManager->AddDiscreteProcess(&fTritonProcess); | |
126 | ||
127 | // map to G3 controls | |
128 | TG4ProcessControlMap* controlMap = TG4ProcessControlMap::Instance(); | |
129 | controlMap->Add(&fTritonProcess, kHADR); | |
130 | ||
131 | // map to AliMCProcess codes | |
132 | TG4ProcessMCMap* mcMap = TG4ProcessMCMap::Instance(); | |
133 | mcMap->Add(&fTritonProcess, kPHInhelastic); | |
134 | } | |
135 | ||
136 | //_____________________________________________________________________________ | |
137 | void TG4PhysicsConstructorIon::ConstructHadProcessForAlpha() | |
138 | { | |
139 | // Constructs electromagnetic processes for alpha. | |
140 | // --- | |
141 | ||
142 | // add process | |
143 | G4ProcessManager* pManager = G4Alpha::Alpha()->GetProcessManager(); | |
144 | pManager->AddDiscreteProcess(&fElasticProcess); | |
145 | ||
146 | fAlphaModel = new G4LEAlphaInelastic(); | |
147 | fAlphaProcess.RegisterMe(fAlphaModel); | |
148 | pManager->AddDiscreteProcess(&fAlphaProcess); | |
149 | ||
150 | // map to G3 controls | |
151 | TG4ProcessControlMap* controlMap = TG4ProcessControlMap::Instance(); | |
152 | controlMap->Add(&fAlphaProcess, kHADR); | |
153 | ||
154 | // map to AliMCProcess codes | |
155 | TG4ProcessMCMap* mcMap = TG4ProcessMCMap::Instance(); | |
156 | mcMap->Add(&fAlphaProcess, kPHInhelastic); | |
157 | } | |
158 | ||
159 | //_____________________________________________________________________________ | |
160 | void TG4PhysicsConstructorIon::ConstructHadProcessForHe3() | |
161 | { | |
162 | // Constructs electromagnetic processes for He3. | |
163 | // --- | |
164 | ||
165 | // add process | |
166 | G4ProcessManager* pManager = G4He3::He3()->GetProcessManager(); | |
167 | pManager->AddDiscreteProcess(&fElasticProcess); | |
168 | } | |
169 | ||
170 | //_____________________________________________________________________________ | |
171 | void TG4PhysicsConstructorIon::ConstructEMProcessForGenericIon() | |
172 | { | |
173 | // Constructs electromagnetic processes for generic ion. | |
174 | // --- | |
175 | ||
176 | // add process | |
177 | G4ProcessManager* pManager = G4GenericIon::GenericIon()->GetProcessManager(); | |
5d321328 | 178 | pManager->AddProcess(&fIonIonisation, ordInActive, 2, 2); |
179 | pManager->AddProcess(&fIonMultipleScattering); | |
180 | ||
181 | // set ordering | |
182 | pManager->SetProcessOrdering(&fIonMultipleScattering, idxAlongStep, 1); | |
183 | pManager->SetProcessOrdering(&fIonMultipleScattering, idxPostStep, 1); | |
184 | ||
185 | // map to G3 controls | |
186 | TG4ProcessControlMap* controlMap = TG4ProcessControlMap::Instance(); | |
5d321328 | 187 | controlMap->Add(&fIonIonisation, kLOSS); |
188 | controlMap->Add(&fIonMultipleScattering, kMULS); | |
189 | ||
190 | // map to AliMCProcess codes | |
191 | TG4ProcessMCMap* mcMap = TG4ProcessMCMap::Instance(); | |
5d321328 | 192 | mcMap->Add(&fIonIonisation, kPEnergyLoss); |
193 | mcMap->Add(&fIonMultipleScattering, kPMultipleScattering); | |
194 | } | |
195 | ||
196 | //_____________________________________________________________________________ | |
11f7ee82 | 197 | void TG4PhysicsConstructorIon::ConstructEMProcessForDeuteron() |
5d321328 | 198 | { |
199 | // Constructs electromagnetic processes for deuteron. | |
200 | // --- | |
201 | ||
202 | // add process | |
203 | G4ProcessManager* pManager = G4Deuteron::Deuteron()->GetProcessManager(); | |
5d321328 | 204 | |
205 | pManager->AddProcess(&fDeuteronIonisation, ordInActive, 2, 2); | |
206 | pManager->AddProcess(&fDeuteronMultipleScattering); | |
207 | ||
208 | // set ordering | |
209 | pManager->SetProcessOrdering(&fDeuteronMultipleScattering, idxAlongStep, 1); | |
210 | pManager->SetProcessOrdering(&fDeuteronMultipleScattering, idxPostStep, 1); | |
211 | ||
212 | // map to G3 controls | |
213 | TG4ProcessControlMap* controlMap = TG4ProcessControlMap::Instance(); | |
5d321328 | 214 | controlMap->Add(&fDeuteronIonisation, kLOSS); |
215 | controlMap->Add(&fDeuteronMultipleScattering, kMULS); | |
216 | ||
217 | // map to AliMCProcess codes | |
218 | TG4ProcessMCMap* mcMap = TG4ProcessMCMap::Instance(); | |
5d321328 | 219 | mcMap->Add(&fDeuteronIonisation, kPEnergyLoss); |
220 | mcMap->Add(&fDeuteronMultipleScattering, kPMultipleScattering); | |
221 | } | |
222 | ||
223 | //_____________________________________________________________________________ | |
11f7ee82 | 224 | void TG4PhysicsConstructorIon::ConstructEMProcessForTriton() |
5d321328 | 225 | { |
226 | // Constructs electromagnetic processes for triton. | |
227 | // --- | |
228 | ||
229 | // add process | |
230 | G4ProcessManager* pManager = G4Triton::Triton()->GetProcessManager(); | |
5d321328 | 231 | |
232 | pManager->AddProcess(&fTritonIonisation, ordInActive, 2, 2); | |
233 | pManager->AddProcess(&fTritonMultipleScattering); | |
234 | ||
235 | // set ordering | |
236 | pManager->SetProcessOrdering(&fTritonMultipleScattering, idxAlongStep, 1); | |
237 | pManager->SetProcessOrdering(&fTritonMultipleScattering, idxPostStep, 1); | |
238 | ||
239 | // map to G3 controls | |
240 | TG4ProcessControlMap* controlMap = TG4ProcessControlMap::Instance(); | |
5d321328 | 241 | controlMap->Add(&fTritonIonisation, kLOSS); |
242 | controlMap->Add(&fTritonMultipleScattering, kMULS); | |
243 | ||
244 | // map to AliMCProcess codes | |
245 | TG4ProcessMCMap* mcMap = TG4ProcessMCMap::Instance(); | |
5d321328 | 246 | mcMap->Add(&fTritonIonisation, kPEnergyLoss); |
247 | mcMap->Add(&fTritonMultipleScattering, kPMultipleScattering); | |
248 | } | |
249 | ||
250 | //_____________________________________________________________________________ | |
11f7ee82 | 251 | void TG4PhysicsConstructorIon::ConstructEMProcessForAlpha() |
5d321328 | 252 | { |
253 | // Constructs electromagnetic processes for alpha. | |
254 | // --- | |
255 | ||
256 | // add process | |
257 | G4ProcessManager* pManager = G4Alpha::Alpha()->GetProcessManager(); | |
5d321328 | 258 | |
259 | pManager->AddProcess(&fAlphaIonisation, ordInActive, 2, 2); | |
260 | pManager->AddProcess(&fAlphaMultipleScattering); | |
261 | ||
262 | // set ordering | |
263 | pManager->SetProcessOrdering(&fAlphaMultipleScattering, idxAlongStep, 1); | |
264 | pManager->SetProcessOrdering(&fAlphaMultipleScattering, idxPostStep, 1); | |
265 | ||
266 | // map to G3 controls | |
267 | TG4ProcessControlMap* controlMap = TG4ProcessControlMap::Instance(); | |
5d321328 | 268 | controlMap->Add(&fAlphaIonisation, kLOSS); |
269 | controlMap->Add(&fAlphaMultipleScattering, kMULS); | |
270 | ||
271 | // map to AliMCProcess codes | |
272 | TG4ProcessMCMap* mcMap = TG4ProcessMCMap::Instance(); | |
5d321328 | 273 | mcMap->Add(&fAlphaIonisation, kPEnergyLoss); |
274 | mcMap->Add(&fAlphaMultipleScattering, kPMultipleScattering); | |
275 | } | |
276 | ||
277 | //_____________________________________________________________________________ | |
11f7ee82 | 278 | void TG4PhysicsConstructorIon::ConstructEMProcessForHe3() |
5d321328 | 279 | { |
280 | // Constructs electromagnetic processes for He3. | |
281 | // --- | |
282 | ||
283 | // add process | |
284 | G4ProcessManager* pManager = G4He3::He3()->GetProcessManager(); | |
5d321328 | 285 | pManager->AddProcess(&fHe3Ionisation, ordInActive, 2, 2); |
286 | pManager->AddProcess(&fHe3MultipleScattering); | |
287 | ||
288 | // set ordering | |
289 | pManager->SetProcessOrdering(&fHe3MultipleScattering, idxAlongStep, 1); | |
290 | pManager->SetProcessOrdering(&fHe3MultipleScattering, idxPostStep, 1); | |
291 | ||
292 | // map to G3 controls | |
293 | TG4ProcessControlMap* controlMap = TG4ProcessControlMap::Instance(); | |
294 | controlMap->Add(&fHe3Ionisation, kLOSS); | |
295 | controlMap->Add(&fHe3MultipleScattering, kMULS); | |
296 | ||
297 | // map to AliMCProcess codes | |
298 | TG4ProcessMCMap* mcMap = TG4ProcessMCMap::Instance(); | |
299 | mcMap->Add(&fHe3Ionisation, kPEnergyLoss); | |
300 | mcMap->Add(&fHe3MultipleScattering, kPMultipleScattering); | |
301 | } | |
302 | ||
11f7ee82 | 303 | |
5d321328 | 304 | // protected methods |
305 | ||
306 | //_____________________________________________________________________________ | |
307 | void TG4PhysicsConstructorIon::ConstructParticle() | |
308 | { | |
309 | // Instantiates particles. | |
310 | // --- | |
311 | ||
312 | // Construct light ions | |
313 | G4IonConstructor pConstructor; | |
314 | pConstructor.ConstructParticle(); | |
315 | } | |
316 | ||
317 | //_____________________________________________________________________________ | |
318 | void TG4PhysicsConstructorIon::ConstructProcess() | |
319 | { | |
320 | // Constructs electromagnetic processes for e+. | |
321 | // --- | |
322 | ||
11f7ee82 | 323 | if (fSetHadron) { |
324 | // Elastic Process | |
325 | fElasticModel = new G4LElastic(); | |
326 | fElasticProcess.RegisterMe(fElasticModel); | |
327 | ||
328 | // Hadron processes | |
329 | ConstructHadProcessForGenericIon(); | |
330 | ConstructHadProcessForDeuteron(); | |
331 | ConstructHadProcessForTriton(); | |
332 | ConstructHadProcessForAlpha(); | |
333 | ConstructHadProcessForHe3(); | |
334 | ||
335 | if (VerboseLevel() > 1) { | |
336 | G4cout << "### Ion EM physics constructed." << G4endl; | |
337 | } | |
338 | } | |
339 | ||
340 | if (fSetEM) { | |
341 | // EM processes | |
342 | ConstructEMProcessForGenericIon(); | |
343 | ConstructEMProcessForDeuteron(); | |
344 | ConstructEMProcessForTriton(); | |
345 | ConstructEMProcessForAlpha(); | |
346 | ConstructEMProcessForHe3(); | |
347 | ||
348 | if (VerboseLevel() > 1) { | |
349 | G4cout << "### Ion hadron physics constructed." << G4endl; | |
350 | } | |
351 | } | |
352 | ||
353 | if (VerboseLevel() > 0) { | |
5d321328 | 354 | G4cout << "### Ion physics constructed." << G4endl; |
11f7ee82 | 355 | } |
5d321328 | 356 | } |