224{
226
229
232
236
238 if(!MPT)
240
242 if(!Rindex)
244
247
250
251 if(MeanNumberOfPhotons <= 0.0)
252 {
253
256 }
257
259 MeanNumberOfPhotons = MeanNumberOfPhotons * step_length;
261
262 if(fNumPhotons <= 0 || !fStackingFlag)
263 {
264
267 }
268
269
271
272 if(fTrackSecondariesFirst)
273 {
276 }
277
278
282
285
286 G4double maxCos = BetaInverse / nMax;
287 G4double maxSin2 = (1.0 - maxCos) * (1.0 + maxCos);
288
291
296
297 for(
G4int i = 0; i < fNumPhotons; ++i)
298 {
299
303
304
305 do
306 {
308 sampledEnergy = Pmin + rand * dp;
309 sampledRI = Rindex->
Value(sampledEnergy);
310 cosTheta = BetaInverse / sampledRI;
311
312 sin2Theta = (1.0 - cosTheta) * (1.0 + cosTheta);
314
315
316 } while(rand * maxSin2 > sin2Theta);
317
318
319
320
325 G4double sinTheta = std::sqrt(sin2Theta);
327 cosTheta);
328
329
330 photonMomentum.rotateUz(p0);
331
332
333 G4ThreeVector photonPolarization(cosTheta * cosPhi, cosTheta * sinPhi,
334 -sinTheta);
335
336
337 photonPolarization.rotateUz(p0);
338
339
340 auto aCerenkovPhoton =
342
343 aCerenkovPhoton->SetPolarization(photonPolarization);
344 aCerenkovPhoton->SetKineticEnergy(sampledEnergy);
345
347
348 do
349 {
351 NumberOfPhotons = MeanNumberOfPhotons1 -
352 rand * (MeanNumberOfPhotons1 - MeanNumberOfPhotons2);
354 G4UniformRand() * std::max(MeanNumberOfPhotons1, MeanNumberOfPhotons2);
355
356 }
while(
N > NumberOfPhotons);
357
360 delta /
363 0.5);
364
365 G4double aSecondaryTime = t0 + deltaTime;
367
368
370 new G4Track(aCerenkovPhoton, aSecondaryTime, aSecondaryPosition);
371
377 }
378
380 {
381 G4cout <<
"\n Exiting from G4Cerenkov::DoIt -- NumberOfSecondaries = "
383 }
384
386}
G4long G4Poisson(G4double mean)
G4double GetAverageNumberOfPhotons(const G4double charge, const G4double beta, const G4Material *aMaterial, G4MaterialPropertyVector *Rindex) const
G4ParticleDefinition * GetDefinition() const
static G4OpticalPhoton * OpticalPhoton()
void AddSecondary(G4Track *aSecondary)
void Initialize(const G4Track &) override
G4double GetVelocity() const
G4double GetGlobalTime() const
const G4ThreeVector & GetPosition() const
const G4TouchableHandle & GetTouchableHandle() const
G4ThreeVector GetDeltaPosition() const
G4StepPoint * GetPreStepPoint() const
G4double GetStepLength() const
G4StepPoint * GetPostStepPoint() const
G4TrackStatus GetTrackStatus() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
void SetCreatorModelID(const G4int id)
void SetParentID(const G4int aValue)
void ProposeTrackStatus(G4TrackStatus status)
G4int GetNumberOfSecondaries() const
void SetNumberOfSecondaries(G4int totSecondaries)
G4ParticleChange aParticleChange
G4VParticleChange * pParticleChange