97 fTrackSecondariesFirst =
false;
190 GetAverageNumberOfPhotons(charge,beta,aMaterial,Rindex);
192 if (MeanNumberOfPhotons <= 0.0) {
205 MeanNumberOfPhotons = MeanNumberOfPhotons * step_length;
209 if (NumPhotons <= 0) {
222 if (fTrackSecondariesFirst) {
237 G4double maxCos = BetaInverse / nMax;
238 G4double maxSin2 = (1.0 - maxCos) * (1.0 + maxCos);
244 GetAverageNumberOfPhotons(charge,beta1,aMaterial,Rindex);
246 GetAverageNumberOfPhotons(charge,beta2,aMaterial,Rindex);
248 for (
G4int i = 0; i < NumPhotons; i++) {
260 sampledEnergy = Pmin + rand * dp;
261 sampledRI = Rindex->
Value(sampledEnergy);
262 cosTheta = BetaInverse / sampledRI;
264 sin2Theta = (1.0 - cosTheta)*(1.0 + cosTheta);
267 }
while (rand*maxSin2 > sin2Theta);
282 G4double sinTheta = std::sqrt(sin2Theta);
317 (photonPolarization.
x(),
318 photonPolarization.
y(),
319 photonPolarization.
z());
330 NumberOfPhotons = MeanNumberOfPhotons1 - delta *
331 (MeanNumberOfPhotons1-MeanNumberOfPhotons2)/
334 std::max(MeanNumberOfPhotons1,MeanNumberOfPhotons2);
335 }
while (N > NumberOfPhotons);
341 G4double aSecondaryTime = t0 + deltaTime;
347 new G4Track(aCerenkovPhoton,aSecondaryTime,aSecondaryPosition);
358 G4cout <<
"\n Exiting from G4Cerenkov::DoIt -- NumberOfSecondaries = "
369 void G4Cerenkov::BuildThePhysicsTable()
383 for (
G4int i=0 ; i < numOfMaterials; i++)
390 G4Material* aMaterial = (*theMaterialTable)[i];
395 if (aMaterialPropertiesTable) {
401 if (theRefractionIndexVector) {
406 G4double currentRI = (*theRefractionIndexVector)[0];
408 if (currentRI > 1.0) {
413 G4double currentPM = theRefractionIndexVector->
417 aPhysicsOrderedFreeVector->
418 InsertValues(currentPM , currentCAI);
433 currentRI = (*theRefractionIndexVector)[ii];
434 currentPM = theRefractionIndexVector->
Energy(ii);
436 currentCAI = 0.5*(1.0/(prevRI*prevRI) +
437 1.0/(currentRI*currentRI));
439 currentCAI = prevCAI +
440 (currentPM - prevPM) * currentCAI;
442 aPhysicsOrderedFreeVector->
443 InsertValues(currentPM, currentCAI);
446 prevCAI = currentCAI;
508 if (aMaterialPropertiesTable)
509 Rindex = aMaterialPropertiesTable->
GetProperty(
"RINDEX");
519 if ( BetaMin >= 1. )
return StepLimit;
521 G4double GammaMin = 1./std::sqrt(1.-BetaMin*BetaMin);
523 if (gamma < GammaMin )
return StepLimit;
525 G4double kinEmin = mass*(GammaMin-1.);
528 GetRange(particleType,
532 GetRange(particleType,
537 if (Step < 1.*um )
return StepLimit;
539 if (Step > 0. && Step < StepLimit) StepLimit = Step;
545 if (fMaxPhotons > 0) {
549 GetDefinition()->GetPDGCharge();
552 GetAverageNumberOfPhotons(charge,beta,aMaterial,Rindex);
555 if (MeanNumberOfPhotons > 0.0) Step = fMaxPhotons /
558 if (Step > 0. && Step < StepLimit) StepLimit = Step;
562 if (fMaxBetaChange > 0.) {
565 GetDEDX(particleType,
570 1./std::sqrt(1.-beta*beta*
572 (1.-fMaxBetaChange));
574 Step = mass * deltaGamma / dedx;
576 if (Step > 0. && Step < StepLimit) StepLimit = Step;
591 G4Cerenkov::GetAverageNumberOfPhotons(
const G4double charge,
598 if(beta <= 0.0)
return 0.0;
630 if (nMax < BetaInverse) {
637 else if (nMin > BetaInverse) {
655 G4double CAImin = CerenkovAngleIntegrals->
656 GetValue(Pmin, isOutRange);
657 ge = CAImax - CAImin;
667 (dp - ge * BetaInverse*BetaInverse);
G4double condition(const G4ErrorSymMatrix &m)
G4long G4Poisson(G4double mean)
G4int GetNumberOfSecondaries() const
static G4LossTableManager * Instance()
G4MaterialPropertyVector * GetProperty(const char *key)
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
G4double GetStepLength() const
const G4DynamicParticle * GetDynamicParticle() const
G4double PostStepGetPhysicalInteractionLength(const G4Track &aTrack, G4double, G4ForceCondition *)
G4TrackStatus GetTrackStatus() const
static G4MaterialTable * GetMaterialTable()
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
std::vector< G4Material * > G4MaterialTable
G4double G4NeutronHPJENDLHEData::G4double result
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4ParticleDefinition * GetDefinition() const
G4double GetVelocity() const
G4PhysicsTable * thePhysicsTable
size_t GetVectorLength() const
const G4String & GetParticleName() const
G4double GetMaxLowEdgeEnergy()
G4double GetTotalMomentum() const
G4StepPoint * GetPreStepPoint() const
G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetPosition() const
Hep3Vector & rotateUz(const Hep3Vector &)
void SetProcessSubType(G4int)
void SetPolarization(G4double polX, G4double polY, G4double polZ)
G4double Energy(size_t index) const
G4double Value(G4double theEnergy, size_t &lastidx) const
static size_t GetNumberOfMaterials()
const G4String & GetProcessName() const
void SetKineticEnergy(G4double aEnergy)
G4double GetEnergy(G4double aValue)
G4Material * GetMaterial() const
G4bool IsShortLived() const
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep)
static G4OpticalPhoton * OpticalPhoton()
virtual void Initialize(const G4Track &)
G4double GetPDGMass() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
void SetNumberOfSecondaries(G4int totSecondaries)
void SetParentID(const G4int aValue)
G4StepPoint * GetPostStepPoint() const
G4VParticleChange * pParticleChange
G4ParticleChange aParticleChange
void AddSecondary(G4Track *aSecondary)
void insertAt(size_t, G4PhysicsVector *)
G4Cerenkov(const G4String &processName="Cerenkov", G4ProcessType type=fElectromagnetic)
G4double GetGlobalTime() const
void ProposeTrackStatus(G4TrackStatus status)
void BuildPhysicsTable(const G4ParticleDefinition &aParticleType)
G4double GetMinLowEdgeEnergy()
G4double GetPDGCharge() const
G4ThreeVector GetDeltaPosition() const
G4bool IsFilledVectorExist() const
const G4TouchableHandle & GetTouchableHandle() const
G4bool IsApplicable(const G4ParticleDefinition &aParticleType)