100 latDisplasment(true),
107 geomMin = 0.01*CLHEP::nm;
108 lowestKinEnergy = 10*
eV;
111 polarAngleLimit = 0.0;
113 physStepLimit = gPathLength = tPathLength = 0.0;
118 fPositionChanged =
false;
148 modelManager->
AddEmModel(order, p, fm, region);
156 G4int n = mscModels.size();
157 if(index >= n) {
for(
G4int i=n; i<=index; ++i) { mscModels.push_back(0); } }
158 mscModels[index] =
p;
166 if(index >= 0 && index <
G4int(mscModels.size())) { p = mscModels[index]; }
175 return modelManager->
GetModel(idx, ver);
186 if(!firstParticle) { firstParticle = ∂ }
192 if(pname !=
"deuteron" && pname !=
"triton" &&
193 pname !=
"alpha+" && pname !=
"helium" &&
194 pname !=
"alpha" && pname !=
"He3" &&
195 pname !=
"hydrogen") {
200 if(theGenericIon && firstParticle != theGenericIon) {
203 size_t n = v->
size();
204 for(
size_t j=0; j<
n; ++j) {
205 if((*v)[j] ==
this) {
206 firstParticle = theGenericIon;
219 G4cout <<
"### G4VMultipleScattering::PrepearPhysicsTable() for "
223 <<
" isIon= " << isIon
227 if(firstParticle == &part) {
233 for(
G4int i=0; i<numberOfModels; ++i) {
237 if(0 == i) { currentModel = msc; }
272 G4cout <<
"### G4VMultipleScattering::BuildPhysicsTable() for "
274 <<
" and particle " << num
281 if(masterProcess !=
this) { master =
false; }
283 if(firstParticle == &part) {
305 for(
G4int i=0; i<numberOfModels; ++i) {
319 num ==
"e+" || num ==
"mu+" ||
320 num ==
"mu-" || num ==
"proton"||
321 num ==
"pi+" || num ==
"pi-" ||
322 num ==
"kaon+" || num ==
"kaon-" ||
323 num ==
"alpha" || num ==
"anti_proton" ||
324 num ==
"GenericIon")))
335 G4cout <<
"### G4VMultipleScattering::BuildPhysicsTable() done for "
337 <<
" and particle " << num
375 if(1 == numberOfModels) {
377 if(eloss) { currentModel->
SetIonisation(fIonisation, currParticle); }
381 for(
G4int i=0; i<numberOfModels; ++i) {
400 physStepLimit = gPathLength = tPathLength = currentMinimalStep;
415 if(1 < numberOfModels) {
420 if(currentModel->
IsActive(ekin) && gPathLength >= geomMin
421 && ekin >= lowestKinEnergy) {
425 if (tPathLength < physStepLimit) {
428 }
else { isActive =
false; }
463 fPositionChanged =
false;
469 tPathLength = geomLength;
489 if (tPathLength > physStepLimit) {
490 tPathLength = physStepLimit;
494 if(tPathLength + geomMin < range && tPathLength > geomMin) {
497 G4double maxDisp = (tPathLength + geomLength)*0.5;
498 G4double postSafety= preSafety - maxDisp;
499 G4bool safetyRecomputed =
false;
500 if(postSafety < maxDisp) {
501 safetyRecomputed =
true;
502 postSafety = safetyHelper->
ComputeSafety(fNewPosition,maxDisp);
515 fPositionChanged =
true;
519 if(r2 > postSafety*postSafety) {
521 if(!safetyRecomputed) {
522 postSafety = safetyHelper->
ComputeSafety(fNewPosition, dispR);
525 if(dispR > postSafety) {
526 fac = 0.99*postSafety/dispR;
530 fNewPosition += fac*displacement;
547 if(fPositionChanged) {
600 if(part != firstParticle) {
return yes; }
602 static const G4String ss[4] = {
"1",
"2",
"3",
"4"};
603 for(
G4int i=0; i<nmod; ++i) {
615 G4cout <<
"Physics table are stored for "
618 <<
" with a name <" << name <<
"> " <<
G4endl;
621 G4cout <<
"Fail to store Physics Table for "
624 <<
" in the directory <" << directory
646 for(
G4int i=0; i<numberOfModels; ++i) {
G4double condition(const G4ErrorSymMatrix &m)
G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii)
const G4VProcess * GetMasterProcess() const
G4VEmModel * SelectModel(G4double kinEnergy, size_t idx)
virtual void Initialize(const G4Track &)
G4SafetyHelper * GetSafetyHelper() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
void ReLocateWithinVolume(const G4ThreeVector &pGlobalPoint)
virtual void StartTracking(G4Track *)
static G4LossTableManager * Instance()
G4double GetStepLength() const
G4double HighEnergyLimit() const
void SetLateralDisplasmentFlag(G4bool val)
G4double GeomFactor() const
G4VEmModel * GetModel(G4int, G4bool ver=false)
void DeRegister(G4VEnergyLossProcess *p)
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
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()
virtual ~G4VMultipleScattering()
void SetStepLimitType(G4MscStepLimitType)
G4ProcessManager * GetProcessManager() const
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
const G4String & GetParticleName() const
void SetHighEnergyLimit(G4double)
G4VMultipleScattering(const G4String &name="msc", G4ProcessType type=fElectromagnetic)
G4StepPoint * GetPreStepPoint() const
G4MscStepLimitType StepLimitType() const
G4ParticleChangeForMSC fParticleChange
virtual G4double ComputeTrueStepLength(G4double geomPathLength)
const G4ThreeVector & GetMomentumDirection() const
G4double RangeFactor() const
G4double GetKineticEnergy() 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)
const G4ThreeVector & GetPosition() const
G4double GetRange(const G4ParticleDefinition *part, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false)
void SetRangeFactor(G4double)
void ProposeTrueStepLength(G4double truePathLength)
const G4ParticleDefinition * GetParticleDefinition() const
void SetProcessSubType(G4int)
const G4String & GetParticleType() const
void SetCrossSectionTable(G4PhysicsTable *, G4bool isLocal)
void Register(G4VEnergyLossProcess *p)
const G4String & GetProcessName() const
G4bool IsActive(G4double kinEnergy)
void DumpModelList(G4int verb)
G4bool LateralDisplasmentFlag() const
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4double minSubRange, G4int verb)
G4double ComputeSafety(const G4ThreeVector &pGlobalPoint, G4double maxRadius=DBL_MAX)
static G4TransportationManager * GetTransportationManager()
void SetMasterThread(G4bool val)
G4VEnergyLossProcess * GetEnergyLossProcess(const G4ParticleDefinition *)
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
void SetIonisation(G4VEnergyLossProcess *, const G4ParticleDefinition *part)
static G4GenericIon * GenericIon()
G4int NumberOfModels() const
void ProposePosition(const G4ThreeVector &finalPosition)
void BuildPhysicsTable(const G4ParticleDefinition *aParticle)
G4double GetPDGMass() const
static G4ParticleTable * GetParticleTable()
G4VParticleChange * AlongStepDoIt(const G4Track &, const G4Step &)
G4double ContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimalStep, G4double ¤tSafety)
G4StepPoint * GetPostStepPoint() const
void AddEmModel(G4int order, G4VEmModel *, const G4Region *region=0)
G4VParticleChange * pParticleChange
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double GetSafety() const
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p, G4bool theMaster)
virtual void InitialiseProcess(const G4ParticleDefinition *)=0
void SetGeomFactor(G4double)
static G4Electron * Electron()
G4bool StorePhysicsTable(const G4String &filename, G4bool ascii=false)
virtual void PrintInfo()=0
void PrintInfoDefinition()
void BuildPhysicsTable(const G4ParticleDefinition &)
G4ProcessVector * GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
void SetRangeFactor(G4double val)
G4double AlongStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4double currentMinimalStep, G4double ¤tSafety, G4GPILSelection *selection)
void StartTracking(G4Track *)
G4double MaxKinEnergy() const
G4VMscModel * EmModel(G4int index=1) const
G4int GetProcessSubType() const
void SetPolarAngleLimit(G4double)
void SetVerboseLevel(G4int value)
G4double GetContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimalStep, G4double ¤tSafety)
void SetStepLimitType(G4MscStepLimitType val)
G4VEmModel * GetModelByIndex(G4int idx=0, G4bool ver=false) const
void PreparePhysicsTable(const G4ParticleDefinition &)
virtual G4ThreeVector & SampleScattering(const G4ThreeVector &, G4double safety)
void SetIonisation(G4VEnergyLossProcess *)