00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #include "G4VMscModel.hh"
00050 #include "G4SystemOfUnits.hh"
00051 #include "G4ParticleChangeForMSC.hh"
00052 #include "G4TransportationManager.hh"
00053 #include "G4LossTableBuilder.hh"
00054
00055
00056
00057
00058 G4VMscModel::G4VMscModel(const G4String& nam):
00059 G4VEmModel(nam),
00060 safetyHelper(0),
00061 ionisation(0),
00062 facrange(0.04),
00063 facgeom(2.5),
00064 facsafety(0.3),
00065 skin(1.0),
00066 dtrl(0.05),
00067 lambdalimit(mm),
00068 geomMin(1.e-6*CLHEP::mm),
00069 geomMax(1.e50*CLHEP::mm),
00070 steppingAlgorithm(fUseSafety),
00071 samplez(false),
00072 latDisplasment(true)
00073 {
00074 dedx = 2.0*CLHEP::MeV*CLHEP::cm2/CLHEP::g;
00075 localrange = DBL_MAX;
00076 localtkin = 0.0;
00077 man = G4LossTableManager::Instance();
00078 currentPart = 0;
00079 }
00080
00081
00082
00083 G4VMscModel::~G4VMscModel()
00084 {}
00085
00086
00087
00088 G4ParticleChangeForMSC*
00089 G4VMscModel::GetParticleChangeForMSC(const G4ParticleDefinition* p)
00090 {
00091 if(!safetyHelper) {
00092 safetyHelper = G4TransportationManager::GetTransportationManager()
00093 ->GetSafetyHelper();
00094 safetyHelper->InitialiseHelper();
00095 }
00096 G4ParticleChangeForMSC* change = 0;
00097 if (pParticleChange) {
00098 change = static_cast<G4ParticleChangeForMSC*>(pParticleChange);
00099 } else {
00100 change = new G4ParticleChangeForMSC();
00101 }
00102 if(p) {
00103
00104
00105 if(p->GetParticleName() == "GenericIon") {
00106 if(xSectionTable) {
00107 xSectionTable->clearAndDestroy();
00108 delete xSectionTable;
00109 xSectionTable = 0;
00110 }
00111
00112
00113 } else if(p->GetPDGMass() < 4.5*GeV || ForceBuildTableFlag()) {
00114 G4double emin = std::max(LowEnergyLimit(), LowEnergyActivationLimit());
00115 G4double emax = std::min(HighEnergyLimit(), HighEnergyActivationLimit());
00116 emin = std::max(emin, man->MinKinEnergy());
00117 emax = std::min(emax, man->MaxKinEnergy());
00118 G4LossTableBuilder* builder = man->GetTableBuilder();
00119 xSectionTable = builder->BuildTableForModel(xSectionTable, this, p,
00120 emin, emax, true);
00121 theDensityFactor = builder->GetDensityFactors();
00122 theDensityIdx = builder->GetCoupleIndexes();
00123 }
00124 }
00125 return change;
00126 }
00127
00128
00129
00130 G4ThreeVector&
00131 G4VMscModel::SampleScattering(const G4ThreeVector&, G4double)
00132 {
00133 return fDisplacement;
00134 }
00135
00136
00137
00138 G4double G4VMscModel::ComputeTruePathLengthLimit(const G4Track&, G4double&)
00139 {
00140 return DBL_MAX;
00141 }
00142
00143
00144
00145 G4double G4VMscModel::ComputeGeomPathLength(G4double truePathLength)
00146 {
00147 return truePathLength;
00148 }
00149
00150
00151
00152 G4double G4VMscModel::ComputeTrueStepLength(G4double geomPathLength)
00153 {
00154 return geomPathLength;
00155 }
00156
00157
00158
00159 void G4VMscModel::SampleSecondaries(std::vector<G4DynamicParticle*>*,
00160 const G4MaterialCutsCouple*,
00161 const G4DynamicParticle*,
00162 G4double, G4double)
00163 {}
00164
00165