99 firstParticle(nullptr),
100 currParticle(nullptr),
103 latDisplacement(true),
105 fDispBeyondSafety(false),
106 fNewPosition(0.,0.,0.),
107 fNewDirection(0.,0.,1.)
188 if(masterProc && masterProc !=
this) { master =
false; }
196 if(pname !=
"deuteron" && pname !=
"triton" &&
197 pname !=
"alpha+" && pname !=
"helium" &&
198 pname !=
"alpha" && pname !=
"He3" &&
199 pname !=
"hydrogen") {
203 if(&part == theGenericIon) {
isIon =
true; }
208 size_t n = v->
size();
209 for(
size_t j=0; j<
n; ++j) {
210 if((*v)[j] ==
this) {
224 G4cout <<
"### G4VMultipleScattering::PrepearPhysicsTable() for " 228 <<
" isIon= " <<
isIon 290 G4cout <<
"### G4VMultipleScattering::BuildPhysicsTable() for " 292 <<
" and particle " << num
299 if(masterProcess && masterProcess !=
this) { master =
false; }
337 num ==
"e+" || num ==
"mu+" ||
338 num ==
"mu-" || num ==
"proton"||
339 num ==
"pi+" || num ==
"pi-" ||
340 num ==
"kaon+" || num ==
"kaon-" ||
341 num ==
"alpha" || num ==
"anti_proton" ||
342 num ==
"GenericIon")))
353 G4cout <<
"### G4VMultipleScattering::BuildPhysicsTable() done for " 355 <<
" and particle " << num
410 const G4Track&
track,
414 G4GPILSelection* selection)
417 *selection = NotCandidateForSelection;
420 G4double ekin = track.GetKineticEnergy();
429 ekin *=
proton_mass_c2/track.GetParticleDefinition()->GetPDGMass();
435 SelectModel(ekin,track.GetMaterialCutsCouple()->GetIndex()));
446 *selection = CandidateForSelection;
479 step.GetPostStepPoint()->GetMomentumDirection());
484 G4double geomLength = step.GetStepLength();
494 track.GetMaterialCutsCouple());
511 if(tPathLength < range && tPathLength >
geomMin) {
514 step.GetPostStepPoint()->GetMomentumDirection(),
minSafety);
524 sFact*(step.GetPreStepPoint()->GetSafety() - geomLength);
528 if(postSafety > 0.0 && r2 <= postSafety*postSafety) {
539 if(dispR < postSafety) {
549 G4double safety = postSafety + dispR;
562 && std::abs(dist) < maxshift) {
578 maxshift =
std::min(maxshift, geomLength);
579 if(0.0 < maxshift + dist) {
580 G4ThreeVector postpoint = step.GetPostStepPoint()->GetPosition();
582 G4double R2 = (postpoint - point).mag2();
585 for(
G4int i=0; i<10; ++i) {
588 point, fNewDirection, maxshift, &dist, &safety)
589 && std::abs(newdist + dist) < maxshift) {
591 G4double R2new = (postpoint - point).mag2();
594 if(dist >= 0.0 || R2new > R2) {
break; }
613 }
else if(postSafety > geomMin) {
648 const G4Track&
track,
653 G4GPILSelection selection = NotCandidateForSelection;
664 const G4Track&
track,
693 if(masterProcess && masterProcess !=
this) {
return yes; }
696 static const G4String ss[4] = {
"1",
"2",
"3",
"4"};
697 for(
G4int i=0; i<nmod; ++i) {
709 G4cout <<
"Physics table are stored for " 712 <<
" with a name <" << name <<
"> " <<
G4endl;
715 G4cout <<
"Fail to store Physics Table for " 718 <<
" in the directory <" << directory
G4double condition(const G4ErrorSymMatrix &m)
G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii)
G4EmParameters * theParameters
const G4VProcess * GetMasterProcess() const
static const G4double geomMin
G4VEmModel * SelectModel(G4double kinEnergy, size_t idx)
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
void ReLocateWithinVolume(const G4ThreeVector &pGlobalPoint)
virtual void StartTracking(G4Track *)
static G4LossTableManager * Instance()
G4EmModelManager * modelManager
G4MscStepLimitType MscStepLimitType() const
G4ThreeVector fNewPosition
G4VEmModel * GetModel(G4int, G4bool ver=false)
void DeRegister(G4VEnergyLossProcess *p)
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
G4double GetMeanFreePath(const G4Track &track, G4double, G4ForceCondition *condition)
void SetLateralDisplasmentFlag(G4bool val)
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4ForceCondition *condition)
void SetEmModel(G4VMscModel *, G4int index=1)
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *, const G4Region *)
G4PhysicsTable * GetCrossSectionTable()
const G4String & GetParticleType() const
G4ProcessManager * GetProcessManager() const
virtual ~G4VMultipleScattering()
G4VMscModel * EmModel(G4int index=1) const
void SetStepLimitType(G4MscStepLimitType)
G4MscStepLimitType MscMuHadStepLimitType() const
G4VEnergyLossProcess * fIonisation
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
static const G4double minDisplacement2
G4int GetProcessSubType() const
void SetHighEnergyLimit(G4double)
G4VMultipleScattering(const G4String &name="msc", G4ProcessType type=fElectromagnetic)
G4bool MuHadLateralDisplacement() const
const G4ParticleDefinition * currParticle
G4ParticleChangeForMSC fParticleChange
const G4String & GetProcessName() const
virtual G4double ComputeTrueStepLength(G4double geomPathLength)
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
virtual G4double ComputeTruePathLengthLimit(const G4Track &track, G4double &stepLimit)
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
void SetParticleChange(G4VParticleChange *, G4VEmFluctuationModel *f=0)
G4double GetRange(const G4ParticleDefinition *part, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
G4double MscRangeFactor() const
G4double HighEnergyLimit() const
G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false)
void SetRangeFactor(G4double)
G4SafetyHelper * GetSafetyHelper() const
virtual void ProcessDescription(std::ostream &outFile) const
void SetProcessSubType(G4int)
void SetCrossSectionTable(G4PhysicsTable *, G4bool isLocal)
void Register(G4VEnergyLossProcess *p)
G4bool RecheckDistanceToCurrentBoundary(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double *prDistance, G4double *prNewSafety=0) const
G4LossTableManager * emManager
G4bool IsActive(G4double kinEnergy)
void DumpModelList(G4int verb)
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4double minSubRange, G4int verb)
G4double ComputeSafety(const G4ThreeVector &pGlobalPoint, G4double maxRadius=DBL_MAX)
G4double MscThetaLimit() const
static G4TransportationManager * GetTransportationManager()
static const G4double emax
void SetMasterThread(G4bool val)
static const G4double minSafety
G4bool LatDisplacementBeyondSafety() const
G4ProcessVector * GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4VEnergyLossProcess * GetEnergyLossProcess(const G4ParticleDefinition *)
void SetIonisation(G4VEnergyLossProcess *, const G4ParticleDefinition *part)
static G4GenericIon * GenericIon()
void BuildPhysicsTable(const G4ParticleDefinition *aParticle)
static G4ParticleTable * GetParticleTable()
G4double MaxKinEnergy() const
G4VParticleChange * AlongStepDoIt(const G4Track &, const G4Step &)
G4double ContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimalStep, G4double ¤tSafety)
const G4ParticleDefinition * firstParticle
G4VEmModel * GetModelByIndex(G4int idx=0, G4bool ver=false) const
G4double GetPDGMass() const
void AddEmModel(G4int order, G4VEmModel *, const G4Region *region=0)
static G4EmParameters * Instance()
G4VParticleChange * pParticleChange
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p, G4bool theMaster)
virtual void InitialiseProcess(const G4ParticleDefinition *)=0
G4MscStepLimitType stepLimit
void SetGeomFactor(G4double)
static G4Electron * Electron()
G4bool StorePhysicsTable(const G4String &filename, G4bool ascii=false)
G4ThreeVector fNewDirection
virtual void PrintInfo()=0
G4int WorkerVerbose() const
void PrintInfoDefinition()
void BuildPhysicsTable(const G4ParticleDefinition &)
G4double AlongStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4double currentMinimalStep, G4double ¤tSafety, G4GPILSelection *selection)
void StartTracking(G4Track *)
G4double MscMuHadRangeFactor() const
G4int NumberOfModels() const
std::vector< G4VMscModel * > mscModels
void SetPolarAngleLimit(G4double)
G4bool LateralDisplacement() const
G4double MscGeomFactor() const
void SetVerboseLevel(G4int value)
G4double GetContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimalStep, G4double ¤tSafety)
G4VMscModel * currentModel
void PreparePhysicsTable(const G4ParticleDefinition &)
G4SafetyHelper * safetyHelper
virtual G4ThreeVector & SampleScattering(const G4ThreeVector &, G4double safety)
void SetIonisation(G4VEnergyLossProcess *)