213{
215
217
220
221 if(gamma <= 1.0e3)
222 {
224 }
226
228 const G4Field* pField =
nullptr;
229
231 G4bool fieldExertsForce =
false;
232
233 if((particleCharge != 0.0))
234 {
236 if(fieldMgr != nullptr)
237 {
238
240 }
241 }
242 if(fieldExertsForce)
243 {
246 G4double globPosVec[4], FieldValueVec[6];
247 globPosVec[0] = globPosition.
x();
248 globPosVec[1] = globPosition.
y();
249 globPosVec[2] = globPosition.
z();
250 globPosVec[3] = trackData.GetGlobalTime();
251
253 FieldValue =
254 G4ThreeVector(FieldValueVec[0], FieldValueVec[1], FieldValueVec[2]);
255
259 if(perpB > 0.0)
260 {
261
263
264 if(fVerboseLevel > 0)
265 {
266 G4cout <<
"SR photon energy = " << energyOfSR / keV <<
" keV" <<
G4endl;
267 }
268
269
270 if(energyOfSR <= 0.0)
271 {
273 }
277
278
279 G4double cosTheta, sinTheta, fcos, beta;
280
281 do
282 {
284 fcos = (1 + cosTheta * cosTheta) * 0.5;
285 }
286
288
289 beta = std::sqrt(1. - 1. / (gamma * gamma));
290
291 cosTheta = (cosTheta + beta) / (1. + beta * cosTheta);
292
293 if(cosTheta > 1.)
294 cosTheta = 1.;
295 if(cosTheta < -1.)
296 cosTheta = -1.;
297
298 sinTheta = std::sqrt(1. - cosTheta * cosTheta);
299
301
302 G4double dirx = sinTheta * std::cos(Phi);
303 G4double diry = sinTheta * std::sin(Phi);
305
307 gammaDirection.rotateUz(particleDirection);
308
309
311 gammaPolarization = gammaPolarization.
unit();
312
313
314 auto aGamma =
316 aGamma->SetPolarization(gammaPolarization.
x(), gammaPolarization.
y(),
317 gammaPolarization.
z());
318
320
321
322 G4double newKinEnergy = kineticEnergy - energyOfSR;
323
324 if(newKinEnergy > 0.)
325 {
329 }
330 else
331 {
335 if(charge < 0.)
336 {
338 }
339 else
340 {
342 }
343 }
344
345
346 G4Track* aSecondaryTrack =
new G4Track(aGamma, trackData.GetGlobalTime(), trackData.GetPosition());
347 aSecondaryTrack->
SetTouchableHandle(stepData.GetPostStepPoint()->GetTouchableHandle());
348 aSecondaryTrack->
SetParentID(trackData.GetTrackID());
351 }
352 else
353 {
355 }
356 }
358}
void AddSecondary(G4Track *aSecondary)
void Initialize(const G4Track &) override
void ProposeEnergy(G4double finalEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double GetRandomEnergySR(G4double, G4double)
void SetTouchableHandle(const G4TouchableHandle &apValue)
void SetCreatorModelID(const G4int id)
void SetParentID(const G4int aValue)
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetNumberOfSecondaries(G4int totSecondaries)
G4ParticleChange aParticleChange