208{
209
210
211
212
214
217
220
224
226 if(!MPT)
228
230 if(!Rindex)
232
235
236
237
240
241 if(MeanNumberOfPhotons <= 0.0)
242 {
243
246 }
247
249 MeanNumberOfPhotons = MeanNumberOfPhotons * step_length;
251
252 if(fNumPhotons <= 0 || !fStackingFlag)
253 {
254
257 }
258
259
261
262 if(fTrackSecondariesFirst)
263 {
266 }
267
268
272
275
276 G4double maxCos = BetaInverse / nMax;
277 G4double maxSin2 = (1.0 - maxCos) * (1.0 + maxCos);
278
281
286
287 for(
G4int i = 0; i < fNumPhotons; ++i)
288 {
289
293
294
295 do
296 {
298 sampledEnergy = Pmin + rand * dp;
299 sampledRI = Rindex->
Value(sampledEnergy);
300 cosTheta = BetaInverse / sampledRI;
301
302 sin2Theta = (1.0 - cosTheta) * (1.0 + cosTheta);
304
305
306 } while(rand * maxSin2 > sin2Theta);
307
308
309
310
315 G4double sinTheta = std::sqrt(sin2Theta);
317 cosTheta);
318
319
320 photonMomentum.rotateUz(p0);
321
322
323 G4ThreeVector photonPolarization(cosTheta * cosPhi, cosTheta * sinPhi,
324 -sinTheta);
325
326
327 photonPolarization.rotateUz(p0);
328
329
332
335
337
338 do
339 {
341 NumberOfPhotons = MeanNumberOfPhotons1 -
342 rand * (MeanNumberOfPhotons1 - MeanNumberOfPhotons2);
343 N =
344 G4UniformRand() * std::max(MeanNumberOfPhotons1, MeanNumberOfPhotons2);
345
346 } while(N > NumberOfPhotons);
347
350 delta /
353 0.5);
354
355 G4double aSecondaryTime = t0 + deltaTime;
357
358
360 new G4Track(aCerenkovPhoton, aSecondaryTime, aSecondaryPosition);
361
366 }
367
369 {
370 G4cout <<
"\n Exiting from G4Cerenkov::DoIt -- NumberOfSecondaries = "
372 }
373
375}
G4long G4Poisson(G4double mean)
G4double GetAverageNumberOfPhotons(const G4double charge, const G4double beta, const G4Material *aMaterial, G4MaterialPropertyVector *Rindex) const
void SetPolarization(const G4ThreeVector &)
G4ParticleDefinition * GetDefinition() const
void SetKineticEnergy(G4double aEnergy)
static G4OpticalPhoton * OpticalPhoton()
void AddSecondary(G4Track *aSecondary)
virtual void Initialize(const G4Track &)
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 SetParentID(const G4int aValue)
void ProposeTrackStatus(G4TrackStatus status)
G4int GetNumberOfSecondaries() const
void SetNumberOfSecondaries(G4int totSecondaries)
G4ParticleChange aParticleChange
G4VParticleChange * pParticleChange