189 G4StepPoint* pPreStepPoint = aStep.GetPreStepPoint();
190 G4StepPoint* pPostStepPoint = aStep.GetPostStepPoint();
194 G4double t0 = pPreStepPoint->GetGlobalTime();
208 G4double beta = (pPreStepPoint ->GetBeta() +
209 pPostStepPoint->GetBeta())*0.5;
214 if (MeanNumberOfPhotons <= 0.0) {
225 step_length = aStep.GetStepLength();
227 MeanNumberOfPhotons = MeanNumberOfPhotons * step_length;
231 if (NumPhotons <= 0) {
245 if (aTrack.GetTrackStatus() == fAlive )
259 G4double maxCos = BetaInverse / nMax;
260 G4double maxSin2 = (1.0 - maxCos) * (1.0 + maxCos);
262 G4double beta1 = pPreStepPoint ->GetBeta();
263 G4double beta2 = pPostStepPoint->GetBeta();
270 for (
G4int i = 0; i < NumPhotons; i++) {
282 sampledEnergy = Pmin + rand * dp;
283 sampledRI = Rindex->
Value(sampledEnergy);
284 cosTheta = BetaInverse / sampledRI;
286 sin2Theta = (1.0 - cosTheta)*(1.0 + cosTheta);
290 }
while (rand*maxSin2 > sin2Theta);
305 G4double sinTheta = std::sqrt(sin2Theta);
320 photonMomentum.rotateUz(p0);
332 photonPolarization.rotateUz(p0);
340 (photonPolarization.x(),
341 photonPolarization.y(),
342 photonPolarization.z());
352 NumberOfPhotons = MeanNumberOfPhotons1 - rand *
353 (MeanNumberOfPhotons1-MeanNumberOfPhotons2);
355 std::max(MeanNumberOfPhotons1,MeanNumberOfPhotons2);
357 }
while (N > NumberOfPhotons);
359 G4double delta = rand * aStep.GetStepLength();
361 G4double deltaTime = delta / (pPreStepPoint->GetVelocity()+
362 rand*(pPostStepPoint->GetVelocity()-
363 pPreStepPoint->GetVelocity())*0.5);
365 G4double aSecondaryTime = t0 + deltaTime;
368 x0 + rand * aStep.GetDeltaPosition();
370 G4Track* aSecondaryTrack =
371 new G4Track(aCerenkovPhoton,aSecondaryTime,aSecondaryPosition);
373 aSecondaryTrack->SetTouchableHandle(
374 aStep.GetPreStepPoint()->GetTouchableHandle());
376 aSecondaryTrack->SetParentID(aTrack.GetTrackID());
382 G4cout <<
"\n Exiting from G4Cerenkov::DoIt -- NumberOfSecondaries = "
G4long G4Poisson(G4double mean)
G4MaterialPropertyVector * GetProperty(const char *key)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
G4double GetMaxLowEdgeEnergy()
G4GLOB_DLL std::ostream G4cout
G4double GetAverageNumberOfPhotons(const G4double charge, const G4double beta, const G4Material *aMaterial, G4MaterialPropertyVector *Rindex) const
static const double twopi
G4double Value(G4double theEnergy, size_t &lastidx) const
void SetPolarization(G4double polX, G4double polY, G4double polZ)
void SetKineticEnergy(G4double aEnergy)
static G4OpticalPhoton * OpticalPhoton()
G4VParticleChange * pParticleChange
G4ParticleChange aParticleChange
G4ParticleDefinition * GetDefinition() const
G4double GetMinLowEdgeEnergy()
G4double GetPDGCharge() const
G4bool fTrackSecondariesFirst