97 fTrackSecondariesFirst =
false;
107 BuildThePhysicsTable();
176 GetAverageNumberOfPhotons(charge,beta,aMaterial,Rindex);
178 if (MeanNumberOfPhotons <= 0.0) {
191 MeanNumberOfPhotons = MeanNumberOfPhotons * step_length;
195 if (NumPhotons <= 0) {
208 if (fTrackSecondariesFirst) {
223 G4double maxCos = BetaInverse / nMax;
224 G4double maxSin2 = (1.0 - maxCos) * (1.0 + maxCos);
230 GetAverageNumberOfPhotons(charge,beta1,aMaterial,Rindex);
232 GetAverageNumberOfPhotons(charge,beta2,aMaterial,Rindex);
234 for (
G4int i = 0; i < NumPhotons; i++) {
246 sampledEnergy = Pmin + rand * dp;
247 sampledRI = Rindex->
Value(sampledEnergy);
248 cosTheta = BetaInverse / sampledRI;
250 sin2Theta = (1.0 - cosTheta)*(1.0 + cosTheta);
253 }
while (rand*maxSin2 > sin2Theta);
268 G4double sinTheta = std::sqrt(sin2Theta);
303 (photonPolarization.
x(),
304 photonPolarization.
y(),
305 photonPolarization.
z());
316 NumberOfPhotons = MeanNumberOfPhotons1 - delta *
317 (MeanNumberOfPhotons1-MeanNumberOfPhotons2)/
320 std::max(MeanNumberOfPhotons1,MeanNumberOfPhotons2);
321 }
while (N > NumberOfPhotons);
327 G4double aSecondaryTime = t0 + deltaTime;
333 new G4Track(aCerenkovPhoton,aSecondaryTime,aSecondaryPosition);
344 G4cout <<
"\n Exiting from G4Cerenkov::DoIt -- NumberOfSecondaries = "
355void G4Cerenkov::BuildThePhysicsTable()
369 for (
G4int i=0 ; i < numOfMaterials; i++)
377 G4Material* aMaterial = (*theMaterialTable)[i];
382 if (aMaterialPropertiesTable) {
387 if (theRefractionIndexVector) {
392 G4double currentRI = (*theRefractionIndexVector)[0];
394 if (currentRI > 1.0) {
399 G4double currentPM = theRefractionIndexVector->
403 aPhysicsOrderedFreeVector->
404 InsertValues(currentPM , currentCAI);
419 currentRI = (*theRefractionIndexVector)[ii];
420 currentPM = theRefractionIndexVector->
Energy(ii);
422 currentCAI = 0.5*(1.0/(prevRI*prevRI) +
423 1.0/(currentRI*currentRI));
425 currentCAI = prevCAI +
426 (currentPM - prevPM) * currentCAI;
428 aPhysicsOrderedFreeVector->
429 InsertValues(currentPM, currentCAI);
432 prevCAI = currentCAI;
488 if (aMaterialPropertiesTable)
489 Rindex = aMaterialPropertiesTable->
GetProperty(
"RINDEX");
499 if ( BetaMin >= 1. )
return StepLimit;
501 G4double GammaMin = 1./std::sqrt(1.-BetaMin*BetaMin);
503 if (gamma < GammaMin )
return StepLimit;
505 G4double kinEmin = mass*(GammaMin-1.);
508 GetRange(particleType,
512 GetRange(particleType,
517 if (Step < 1.*um )
return StepLimit;
519 if (Step > 0. && Step < StepLimit) StepLimit = Step;
525 if (fMaxPhotons > 0) {
529 GetDefinition()->GetPDGCharge();
532 GetAverageNumberOfPhotons(charge,beta,aMaterial,Rindex);
535 if (MeanNumberOfPhotons > 0.0) Step = fMaxPhotons /
538 if (Step > 0. && Step < StepLimit) StepLimit = Step;
542 if (fMaxBetaChange > 0.) {
545 GetDEDX(particleType,
550 1./std::sqrt(1.-beta*beta*
552 (1.-fMaxBetaChange));
554 Step = mass * deltaGamma / dedx;
556 if (Step > 0. && Step < StepLimit) StepLimit = Step;
571G4Cerenkov::GetAverageNumberOfPhotons(
const G4double charge,
576 const G4double Rfact = 369.81/(eV * cm);
578 if(beta <= 0.0)
return 0.0;
610 if (nMax < BetaInverse) {
617 else if (nMin > BetaInverse) {
635 G4double CAImin = CerenkovAngleIntegrals->
636 GetValue(Pmin, isOutRange);
637 ge = CAImax - CAImin;
646 G4double NumPhotons = Rfact * charge/eplus * charge/eplus *
647 (dp - ge * BetaInverse*BetaInverse);
G4double condition(const G4ErrorSymMatrix &m)
std::vector< G4Material * > G4MaterialTable
G4long G4Poisson(G4double mean)
G4DLLIMPORT std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
G4PhysicsTable * thePhysicsTable
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep)
G4Cerenkov(const G4String &processName="Cerenkov", G4ProcessType type=fElectromagnetic)
G4double PostStepGetPhysicalInteractionLength(const G4Track &aTrack, G4double, G4ForceCondition *)
G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
void SetPolarization(G4double polX, G4double polY, G4double polZ)
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
G4double GetTotalMomentum() const
void SetKineticEnergy(G4double aEnergy)
static G4LossTableManager * Instance()
G4MaterialPropertyVector * GetProperty(const char *key)
static const G4MaterialTable * GetMaterialTable()
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
static size_t GetNumberOfMaterials()
static G4OpticalPhoton * OpticalPhoton()
void AddSecondary(G4Track *aSecondary)
virtual void Initialize(const G4Track &)
G4double GetPDGMass() const
G4double GetPDGCharge() const
G4double GetMinLowEdgeEnergy()
G4double GetMaxLowEdgeEnergy()
G4double GetEnergy(G4double aValue)
void insertAt(size_t, G4PhysicsVector *)
G4double Value(G4double theEnergy)
size_t GetVectorLength() const
G4double Energy(size_t index) const
G4bool IsFilledVectorExist() const
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
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
void SetParentID(const G4int aValue)
void ProposeTrackStatus(G4TrackStatus status)
G4int GetNumberOfSecondaries() const
void SetNumberOfSecondaries(G4int totSecondaries)
G4ParticleChange aParticleChange
void SetProcessSubType(G4int)
G4VParticleChange * pParticleChange
const G4String & GetProcessName() const