102 fTrackSecondariesFirst(false),
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);
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 = " 407 for (
G4int i=0 ; i < numOfMaterials; i++)
414 G4Material* aMaterial = (*theMaterialTable)[i];
419 if (aMaterialPropertiesTable) {
425 if (theRefractionIndexVector) {
430 G4double currentRI = (*theRefractionIndexVector)[0];
432 if (currentRI > 1.0) {
437 G4double currentPM = theRefractionIndexVector->
441 aPhysicsOrderedFreeVector->
442 InsertValues(currentPM , currentCAI);
457 currentRI = (*theRefractionIndexVector)[ii];
458 currentPM = theRefractionIndexVector->
Energy(ii);
460 currentCAI = 0.5*(1.0/(prevRI*prevRI) +
461 1.0/(currentRI*currentRI));
463 currentCAI = prevCAI +
464 (currentPM - prevPM) * currentCAI;
466 aPhysicsOrderedFreeVector->
467 InsertValues(currentPM, currentCAI);
470 prevCAI = currentCAI;
500 const G4Track& aTrack,
504 *condition = NotForced;
532 if (aMaterialPropertiesTable)
533 Rindex = aMaterialPropertiesTable->
GetProperty(
"RINDEX");
543 if ( BetaMin >= 1. )
return StepLimit;
545 G4double GammaMin = 1./std::sqrt(1.-BetaMin*BetaMin);
547 if (gamma < GammaMin )
return StepLimit;
549 G4double kinEmin = mass*(GammaMin-1.);
552 GetRange(particleType,
556 GetRange(particleType,
561 if (Step < 1.*
um )
return StepLimit;
563 if (Step > 0. && Step < StepLimit) StepLimit = Step;
573 GetDefinition()->GetPDGCharge();
579 if (MeanNumberOfPhotons > 0.0) Step =
fMaxPhotons /
582 if (Step > 0. && Step < StepLimit) StepLimit = Step;
589 GetDEDX(particleType,
594 1./std::sqrt(1.-beta*beta*
598 Step = mass * deltaGamma / dedx;
600 if (Step > 0. && Step < StepLimit) StepLimit = Step;
604 *condition = StronglyForced;
622 if(beta <= 0.0)
return 0.0;
654 if (nMax < BetaInverse) {
661 else if (nMin > BetaInverse) {
679 G4double CAImin = CerenkovAngleIntegrals->
680 GetValue(Pmin, isOutRange);
681 ge = CAImax - CAImin;
691 (dp - ge * BetaInverse*BetaInverse);
G4double condition(const G4ErrorSymMatrix &m)
void SetMaxBetaChangePerStep(const G4double d)
G4long G4Poisson(G4double mean)
G4bool IsShortLived() const
static G4LossTableManager * Instance()
G4MaterialPropertyVector * GetProperty(const char *key)
void SetTrackSecondariesFirst(const G4bool state)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
G4double PostStepGetPhysicalInteractionLength(const G4Track &aTrack, G4double, G4ForceCondition *)
static G4MaterialTable * GetMaterialTable()
std::vector< G4Material * > G4MaterialTable
G4double GetTotalMomentum() const
G4PhysicsTable * thePhysicsTable
G4double GetTotalEnergy() const
G4double GetMaxLowEdgeEnergy()
static const double perCent
G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
const G4String & GetProcessName() const
G4double GetKineticEnergy() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4double GetAverageNumberOfPhotons(const G4double charge, const G4double beta, const G4Material *aMaterial, G4MaterialPropertyVector *Rindex) const
Hep3Vector & rotateUz(const Hep3Vector &)
static const double twopi
void SetProcessSubType(G4int)
void SetMaxNumPhotonsPerStep(const G4int NumPhotons)
size_t GetVectorLength() const
G4double Value(G4double theEnergy, size_t &lastidx) const
void SetPolarization(G4double polX, G4double polY, G4double polZ)
static size_t GetNumberOfMaterials()
void SetKineticEnergy(G4double aEnergy)
G4double GetEnergy(G4double aValue)
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep)
static G4OpticalPhoton * OpticalPhoton()
G4bool IsFilledVectorExist() const
G4double GetPDGMass() const
G4VParticleChange * pParticleChange
G4ParticleChange aParticleChange
void insertAt(size_t, G4PhysicsVector *)
G4Cerenkov(const G4String &processName="Cerenkov", G4ProcessType type=fElectromagnetic)
G4ParticleDefinition * GetDefinition() const
G4double Energy(size_t index) const
void BuildPhysicsTable(const G4ParticleDefinition &aParticleType)
static const double eplus
G4double GetMinLowEdgeEnergy()
G4double GetPDGCharge() const
void BuildThePhysicsTable()
G4bool fTrackSecondariesFirst
G4bool IsApplicable(const G4ParticleDefinition &aParticleType)