88 fNewPosition(0.,0.,0.),
89 fNewDirection(0.,0.,1.)
95 lowestKinEnergy = 10*CLHEP::eV;
97 geomMin = 0.05*CLHEP::nm;
98 minDisplacement2 = geomMin*geomMin;
104 mscModels.reserve(2);
121 if(
nullptr == ptr) {
return; }
123 modelManager->
AddEmModel(order, ptr, fm, region);
131 if(
nullptr == ptr) {
return; }
132 if(!mscModels.empty()) {
133 for(
auto & msc : mscModels) {
if(msc == ptr) {
return; } }
135 mscModels.push_back(ptr);
144 if(
nullptr == firstParticle) { firstParticle = ∂ }
147 currParticle =
nullptr;
149 if(firstParticle == &part) {
154 latDisplacement, master,
160 if(
nullptr == safetyHelper) {
174 if(firstParticle == &part) {
183 numberOfModels, master);
208 for(
G4int i=0; i<numberOfModels; ++i) {
211 if(
nullptr != eloss) {
228 physStepLimit = gPathLength = tPathLength = currentMinimalStep;
244 if(1 < numberOfModels) {
252 if(currentModel->
IsActive(ekin) && tPathLength > geomMin
253 && ekin >= lowestKinEnergy) {
257 if (tPathLength < physStepLimit) {
294 fPositionChanged =
false;
300 tPathLength = geomLength;
320 tPathLength = std::min(tPathLength, physStepLimit);
323 if(tPathLength < range && tPathLength > geomMin) {
325 static const G4double minSafety = 1.20*CLHEP::nm;
334 if(r2 > minDisplacement2) {
336 fPositionChanged =
true;
343 if(postSafety > 0.0 && dispR <= postSafety) {
344 fNewPosition += displacement;
350 if(dispR < postSafety) {
351 fNewPosition += displacement;
354 }
else if(postSafety > geomMin) {
355 fNewPosition += displacement*(postSafety/dispR);
359 fPositionChanged =
false;
362 if(fPositionChanged) {
418 if(part != firstParticle || !emManager->
IsMaster()) {
return yes; }
439 if(
nullptr != firstParticle) {
G4double condition(const G4ErrorSymMatrix &m)
@ NotCandidateForSelection
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fm, const G4Region *r)
void DumpModelList(std::ostream &out, G4int verb)
G4int NumberOfModels() const
static G4EmParameters * Instance()
static void PrepareMscProcess(G4VMultipleScattering *proc, const G4ParticleDefinition &part, G4EmModelManager *modelManager, G4MscStepLimitType &stepLimit, G4double &facrange, G4bool &latDisplacement, G4bool &master, G4bool &isIon, G4bool &baseMat)
static void BuildMscProcess(G4VMultipleScattering *proc, const G4VMultipleScattering *masterProc, const G4ParticleDefinition &part, const G4ParticleDefinition *firstPart, G4int nModels, G4bool master)
static G4bool StoreMscTable(G4VMultipleScattering *proc, const G4ParticleDefinition *part, const G4String &directory, const G4int nModels, const G4int verb, const G4bool ascii)
G4bool GetBaseMaterialFlag()
static G4LossTableManager * Instance()
G4VEnergyLossProcess * GetEnergyLossProcess(const G4ParticleDefinition *)
G4LossTableBuilder * GetTableBuilder()
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p, G4bool theMaster)
void BuildPhysicsTable(const G4ParticleDefinition *aParticle)
void DeRegister(G4VEnergyLossProcess *p)
void Register(G4VEnergyLossProcess *p)
const G4ThreeVector & GetProposedPosition() const
void InitialiseMSC(const G4Track &, const G4Step &step)
void ProposePosition(const G4ThreeVector &finalPosition)
G4double GetPDGMass() const
const G4String & GetParticleName() const
G4double ComputeSafety(const G4ThreeVector &pGlobalPoint, G4double maxRadius=DBL_MAX)
void ReLocateWithinVolume(const G4ThreeVector &pGlobalPoint)
const G4ThreeVector & GetMomentumDirection() const
G4double GetStepLength() const
G4StepPoint * GetPostStepPoint() const
const G4ParticleDefinition * GetParticleDefinition() const
G4double GetKineticEnergy() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
static G4TransportationManager * GetTransportationManager()
G4SafetyHelper * GetSafetyHelper() const
void SetCurrentCouple(const G4MaterialCutsCouple *)
void SetParticleChange(G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
G4bool IsActive(G4double kinEnergy) const
virtual void StartTracking(G4Track *)
virtual G4double ComputeTruePathLengthLimit(const G4Track &track, G4double &stepLimit)=0
void SetIonisation(G4VEnergyLossProcess *, const G4ParticleDefinition *part)
virtual G4double ComputeTrueStepLength(G4double geomPathLength)=0
G4double GetRange(const G4ParticleDefinition *part, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
virtual G4ThreeVector & SampleScattering(const G4ThreeVector &, G4double safety)=0
void AddEmModel(G4int order, G4VMscModel *, const G4Region *region=nullptr)
G4double GetMeanFreePath(const G4Track &track, G4double, G4ForceCondition *condition) override
G4ParticleChangeForMSC fParticleChange
G4VMscModel * GetModelByIndex(G4int idx, G4bool ver=false) const
void StartTracking(G4Track *) override
void PreparePhysicsTable(const G4ParticleDefinition &) override
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4double ContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimalStep, G4double ¤tSafety)
G4VMultipleScattering(const G4String &name="msc", G4ProcessType type=fElectromagnetic)
void ProcessDescription(std::ostream &outFile) const override
G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
void SetEmModel(G4VMscModel *, G4int idx=0)
G4double AlongStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4double currentMinimalStep, G4double ¤tSafety, G4GPILSelection *selection) override
void StreamInfo(std::ostream &outFile, const G4ParticleDefinition &, G4bool rst=false) const
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4ForceCondition *condition) override
G4VParticleChange * AlongStepDoIt(const G4Track &, const G4Step &) override
G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override
~G4VMultipleScattering() override
G4VEmModel * SelectModel(G4double kinEnergy, size_t idx)
G4double GetContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimalStep, G4double ¤tSafety) override
void ProposeTrueStepLength(G4double truePathLength)
void SetVerboseLevel(G4int value)
const G4VProcess * GetMasterProcess() const
void SetProcessSubType(G4int)
G4VParticleChange * pParticleChange
G4int GetProcessSubType() const
const G4String & GetProcessName() const