135 for(
G4int i = 0; i < numOfMaterials; ++i)
141 G4Material* aMaterial = (*theMaterialTable)[i];
145 if(aMaterialPropertiesTable)
151 if(theRefractionIndexVector)
155 G4double currentRI = (*theRefractionIndexVector)[0];
163 aPhysicsOrderedFreeVector->
InsertValues(currentPM, currentCAI);
175 currentRI = (*theRefractionIndexVector)[ii];
176 currentPM = theRefractionIndexVector->
Energy(ii);
177 currentCAI = prevCAI + (currentPM - prevPM) * 0.5 *
178 (1.0 / (prevRI * prevRI) +
179 1.0 / (currentRI * currentRI));
181 aPhysicsOrderedFreeVector->
InsertValues(currentPM, currentCAI);
184 prevCAI = currentCAI;
241 if(MeanNumberOfPhotons <= 0.0)
249 MeanNumberOfPhotons = MeanNumberOfPhotons * step_length;
252 if(fNumPhotons <= 0 || !fStackingFlag)
262 if(fTrackSecondariesFirst)
276 G4double maxCos = BetaInverse / nMax;
277 G4double maxSin2 = (1.0 - maxCos) * (1.0 + maxCos);
287 for(
G4int i = 0; i < fNumPhotons; ++i)
298 sampledEnergy = Pmin + rand * dp;
299 sampledRI = Rindex->
Value(sampledEnergy);
300 cosTheta = BetaInverse / sampledRI;
302 sin2Theta = (1.0 - cosTheta) * (1.0 + cosTheta);
306 }
while(rand * maxSin2 > sin2Theta);
315 G4double sinTheta = std::sqrt(sin2Theta);
323 G4ThreeVector photonPolarization(cosTheta * cosPhi, cosTheta * sinPhi,
341 NumberOfPhotons = MeanNumberOfPhotons1 -
342 rand * (MeanNumberOfPhotons1 - MeanNumberOfPhotons2);
344 G4UniformRand() * std::max(MeanNumberOfPhotons1, MeanNumberOfPhotons2);
346 }
while(N > NumberOfPhotons);
355 G4double aSecondaryTime = t0 + deltaTime;
360 new G4Track(aCerenkovPhoton, aSecondaryTime, aSecondaryPosition);
370 G4cout <<
"\n Exiting from G4Cerenkov::DoIt -- NumberOfSecondaries = "
422 if(aMaterialPropertiesTable)
439 G4double GammaMin = 1. / std::sqrt(1. - BetaMin * BetaMin);
443 G4double kinEmin = mass * (GammaMin - 1.);
447 particleType, kineticEnergy, couple);
453 if(Step < 1.e-15 * mm)
467 if(MeanNumberOfPhotons > 0.0)
468 Step = fMaxPhotons / MeanNumberOfPhotons;
469 if(Step > 0. && Step < StepLimit)
474 if(fMaxBetaChange > 0.)
477 particleType, kineticEnergy, couple);
479 gamma - 1. / std::sqrt(1. - beta * beta * (1. - fMaxBetaChange) *
480 (1. - fMaxBetaChange));
482 Step = mass * deltaGamma / dedx;
483 if(Step > 0. && Step < StepLimit)
499 const G4double Rfact = 369.81 / (eV * cm);
507 G4int materialIndex = aMaterial->GetIndex();
518 G4double Pmax = Rindex->GetMaxLowEdgeEnergy();
521 G4double nMin = Rindex->GetMinValue();
522 G4double nMax = Rindex->GetMaxValue();
529 if(nMax < BetaInverse)
535 else if(nMin > BetaInverse)
546 Pmin = Rindex->GetEnergy(BetaInverse);
550 ge = CAImax - CAImin;
559 G4double NumPhotons = Rfact * charge / eplus * charge / eplus *
560 (dp - ge * BetaInverse * BetaInverse);
568 fTrackSecondariesFirst = state;
574 fMaxBetaChange = value * CLHEP::perCent;
580 fMaxPhotons = NumPhotons;
G4double condition(const G4ErrorSymMatrix &m)
std::vector< G4Material * > G4MaterialTable
G4long G4Poisson(G4double mean)
G4GLOB_DLL std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
void SetMaxBetaChangePerStep(const G4double d)
G4PhysicsTable * thePhysicsTable
G4double PostStepGetPhysicalInteractionLength(const G4Track &aTrack, G4double, G4ForceCondition *) override
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override
void SetTrackSecondariesFirst(const G4bool state)
void DumpPhysicsTable() const
G4double GetAverageNumberOfPhotons(const G4double charge, const G4double beta, const G4Material *aMaterial, G4MaterialPropertyVector *Rindex) const
void BuildPhysicsTable(const G4ParticleDefinition &aParticleType) override
void PreparePhysicsTable(const G4ParticleDefinition &part) override
G4Cerenkov(const G4String &processName="Cerenkov", G4ProcessType type=fElectromagnetic)
G4bool IsApplicable(const G4ParticleDefinition &aParticleType) override
void SetStackPhotons(const G4bool)
G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
void SetMaxNumPhotonsPerStep(const G4int NumPhotons)
void SetPolarization(const G4ThreeVector &)
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
G4double GetTotalMomentum() const
void SetKineticEnergy(G4double aEnergy)
static G4LossTableManager * Instance()
G4double GetRange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
G4double GetDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
G4MaterialPropertyVector * GetProperty(const char *key, G4bool warning=false)
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
static size_t GetNumberOfMaterials()
static G4MaterialTable * GetMaterialTable()
G4int GetCerenkovVerboseLevel() const
G4int GetCerenkovMaxPhotonsPerStep() const
static G4OpticalParameters * Instance()
G4double GetCerenkovMaxBetaChange() const
G4bool GetCerenkovTrackSecondariesFirst() const
G4bool GetCerenkovStackPhotons() const
static G4OpticalPhoton * OpticalPhoton()
void AddSecondary(G4Track *aSecondary)
virtual void Initialize(const G4Track &)
G4bool IsShortLived() const
G4double GetPDGMass() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
void InsertValues(G4double energy, G4double value)
G4double GetMinLowEdgeEnergy()
G4double GetMaxLowEdgeEnergy()
std::size_t entries() const
void insertAt(std::size_t, G4PhysicsVector *)
G4double Energy(std::size_t index) const
G4double Value(G4double theEnergy, std::size_t &lastidx) const
G4bool IsFilledVectorExist() const
std::size_t GetVectorLength() const
void DumpValues(G4double unitE=1.0, G4double unitV=1.0) 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)
void SetVerboseLevel(G4int value)
G4ParticleChange aParticleChange
void SetProcessSubType(G4int)
G4VParticleChange * pParticleChange
const G4String & GetProcessName() const