94 firstParticle(nullptr),
95 currParticle(nullptr),
98 latDisplacement(true),
100 fDispBeyondSafety(false),
101 fNewPosition(0.,0.,0.),
102 fNewDirection(0.,0.,1.)
156 for(
auto & msc :
mscModels) {
if(msc == p) {
return; } }
157 mscModels.push_back(p);
173 G4cout <<
"### G4VMultipleScattering::PrepearPhysicsTable() for "
186 if(pname !=
"deuteron" && pname !=
"triton" &&
187 pname !=
"alpha+" && pname !=
"helium" &&
188 pname !=
"alpha" && pname !=
"He3" &&
189 pname !=
"hydrogen") {
193 if(&part == theGenericIon) {
isIon =
true; }
198 size_t n = v->
size();
199 for(
size_t j=0; j<
n; ++j) {
200 if((*v)[j] ==
this) {
214 G4cout <<
"### G4VMultipleScattering::PrepearPhysicsTable() for "
218 <<
" isIon: " <<
isIon <<
" isMaster: " << master
256 if(!msc) {
continue; }
289 G4cout <<
"### G4VMultipleScattering::BuildPhysicsTable() for "
291 <<
" and particle " << num <<
" isIon: " <<
isIon
292 <<
" IsMaster: " << master <<
G4endl;
319 if(!msc) {
continue; }
331 num ==
"e+" || num ==
"mu+" ||
332 num ==
"mu-" || num ==
"proton"||
333 num ==
"pi+" || num ==
"pi-" ||
334 num ==
"kaon+" || num ==
"kaon-" ||
335 num ==
"alpha" || num ==
"anti_proton" ||
336 num ==
"GenericIon" || num ==
"alpha+" ||
343 G4cout <<
"### G4VMultipleScattering::BuildPhysicsTable() done for "
345 <<
" and particle " << num
356 if (endOfLine !=
G4String(
"<br>\n")) {
501 if(tPathLength < range && tPathLength >
geomMin) {
521 if(postSafety > 0.0 && dispR <= postSafety) {
528 if(dispR < postSafety) {
538 G4double safety = postSafety + dispR;
551 && std::abs(dist) < maxshift) {
567 maxshift =
std::min(maxshift, geomLength);
568 if(0.0 < maxshift + dist) {
571 G4double R2 = (postpoint - point).mag2();
574 for(
G4int i=0; i<10; ++i) {
577 point, fNewDirection, maxshift, &dist, &safety)
578 && std::abs(newdist + dist) < maxshift) {
580 G4double R2new = (postpoint - point).mag2();
583 if(dist >= 0.0 || R2new > R2) {
break; }
602 }
else if(postSafety > geomMin) {
678 if(masterProcess && masterProcess !=
this) {
return yes; }
681 static const G4String ss[4] = {
"1",
"2",
"3",
"4"};
682 for(
G4int i=0; i<nmod; ++i) {
694 G4cout <<
"Physics table are stored for "
697 <<
" with a name <" << name <<
"> " <<
G4endl;
700 G4cout <<
"Fail to store Physics Table for "
703 <<
" in the directory <" << directory
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4GenericIon * GenericIon()
void SetCrossSectionTable(G4PhysicsTable *, G4bool isLocal)
G4double GetKineticEnergy() const
G4SafetyHelper * safetyHelper
G4MscStepLimitType MscMuHadStepLimitType() const
G4VMultipleScattering(const G4String &name="msc", G4ProcessType type=fElectromagnetic)
void SetIonisation(G4VEnergyLossProcess *, const G4ParticleDefinition *part)
G4bool IsActive(G4double kinEnergy)
void ReLocateWithinVolume(const G4ThreeVector &pGlobalPoint)
G4SafetyHelper * GetSafetyHelper() const
G4ParticleChangeForMSC fParticleChange
static G4ParticleTable * GetParticleTable()
static constexpr double MeV
G4MscStepLimitType MscStepLimitType() const
void SetHighEnergyLimit(G4double)
G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4double minSubRange, G4int verb)
void ProposePosition(const G4ThreeVector &finalPosition)
G4bool LateralDisplacement() const
G4VEnergyLossProcess * GetEnergyLossProcess(const G4ParticleDefinition *)
G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
const G4VProcess * GetMasterProcess() const
void BuildPhysicsTable(const G4ParticleDefinition *aParticle)
virtual G4ThreeVector & SampleScattering(const G4ThreeVector &, G4double safety)
G4double MaxKinEnergy() const
G4bool RecheckDistanceToCurrentBoundary(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double *prDistance, G4double *prNewSafety=0) const
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p, G4bool theMaster)
const G4String & GetParticleName() const
const G4String & GetParticleType() const
void SetLateralDisplasmentFlag(G4bool val)
G4MscStepLimitType stepLimit
G4bool StorePhysicsTable(const G4String &filename, G4bool ascii=false)
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &) override
G4bool MuHadLateralDisplacement() const
static const G4double emax
const G4ParticleDefinition * GetParticleDefinition() const
G4double MscMuHadRangeFactor() const
G4double condition(const G4ErrorSymMatrix &m)
void BuildPhysicsTable(const G4ParticleDefinition &) override
void SetMasterThread(G4bool val)
virtual void Initialize(const G4Track &)
G4VEmModel * GetModel(G4int idx, G4bool ver=false)
G4double GetPDGMass() const
void DumpModelList(std::ostream &out, G4int verb)
G4ProcessVector * GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
const G4ParticleDefinition * currParticle
G4double ContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimalStep, G4double ¤tSafety)
static constexpr double proton_mass_c2
const G4ParticleDefinition * firstParticle
void SetVerboseLevel(G4int value)
G4int NumberOfModels() const
void Register(G4VEnergyLossProcess *p)
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *, const G4Region *)
G4PhysicsTable * GetCrossSectionTable()
G4double minDisplacement2
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4VParticleChange * pParticleChange
G4bool LatDisplacementBeyondSafety() const
const G4ParticleDefinition const G4Material *G4double range
G4double GetRange(const G4ParticleDefinition *part, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
virtual ~G4VMultipleScattering()
G4double GetStepLength() const
const G4ThreeVector & GetPosition() const
G4VEmModel * SelectModel(G4double kinEnergy, size_t idx)
void SetStepLimitType(G4MscStepLimitType)
G4double GetContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimalStep, G4double ¤tSafety) override
G4VMscModel * EmModel(size_t index=0) const
G4EmModelManager * modelManager
G4int WorkerVerbose() const
G4VEmModel * GetModelByIndex(G4int idx=0, G4bool ver=false) const
virtual void StartTracking(G4Track *)
const G4String & GetProcessName() const
const G4ThreeVector & GetMomentumDirection() const
void SetPolarAngleLimit(G4double)
void StartTracking(G4Track *) override
void DeRegister(G4VEnergyLossProcess *p)
static constexpr double eV
G4LossTableManager * emManager
void StreamInfo(std::ostream &outFile, const G4ParticleDefinition &, G4String endOfLine=G4String("\n")) const
G4StepPoint * GetPostStepPoint() const
void SetIonisation(G4VEnergyLossProcess *)
virtual G4double ComputeTruePathLengthLimit(const G4Track &track, G4double &stepLimit)
void ProposeTrueStepLength(G4double truePathLength)
G4VParticleChange * AlongStepDoIt(const G4Track &, const G4Step &) override
static G4Electron * Electron()
G4double GetMeanFreePath(const G4Track &track, G4double, G4ForceCondition *condition) override
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4ForceCondition *condition) override
void SetRangeFactor(G4double)
G4double MscRangeFactor() const
static G4TransportationManager * GetTransportationManager()
void PreparePhysicsTable(const G4ParticleDefinition &) override
virtual G4double ComputeTrueStepLength(G4double geomPathLength)
G4double MscThetaLimit() const
static constexpr double nm
void SetEmModel(G4VMscModel *, size_t index=0)
G4double AlongStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4double currentMinimalStep, G4double ¤tSafety, G4GPILSelection *selection) override
std::vector< G4VMscModel * > mscModels
void SetParticleChange(G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
G4ProcessManager * GetProcessManager() const
virtual void ProcessDescription(std::ostream &outFile) const override
G4ThreeVector fNewPosition
virtual void StreamProcessInfo(std::ostream &, G4String) const
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
void SetGeomFactor(G4double)
void SetProcessSubType(G4int)
G4GLOB_DLL std::ostream G4cout
static G4LossTableManager * Instance()
G4double MscGeomFactor() const
G4ThreeVector fNewDirection
virtual void InitialiseProcess(const G4ParticleDefinition *)=0
void AddEmModel(G4int order, G4VEmModel *, const G4Region *region=nullptr)
G4double ComputeSafety(const G4ThreeVector &pGlobalPoint, G4double maxRadius=DBL_MAX)
G4double HighEnergyLimit() const
G4VEnergyLossProcess * fIonisation
G4VMscModel * currentModel
const G4ThreeVector * GetMomentumDirection() const
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
static G4EmParameters * Instance()
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4int GetProcessSubType() const
G4EmParameters * theParameters