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
00050
00051
00052
00053
00054
00055 #include "G4eSingleCoulombScatteringModel.hh"
00056 #include "G4SystemOfUnits.hh"
00057 #include "Randomize.hh"
00058 #include "G4ParticleChangeForGamma.hh"
00059 #include "G4Proton.hh"
00060 #include "G4ProductionCutsTable.hh"
00061 #include "G4NucleiProperties.hh"
00062
00063 #include "G4UnitsTable.hh"
00064
00065
00066
00067
00068 using namespace std;
00069
00070 G4eSingleCoulombScatteringModel::G4eSingleCoulombScatteringModel(const G4String& nam)
00071 : G4VEmModel(nam),
00072
00073 cosThetaMin(1.0),
00074 isInitialised(false)
00075 {
00076 fNistManager = G4NistManager::Instance();
00077 theParticleTable = G4ParticleTable::GetParticleTable();
00078 fParticleChange = 0;
00079
00080 pCuts=0;
00081 currentMaterial = 0;
00082 currentElement = 0;
00083 currentCouple = 0;
00084
00085 lowEnergyLimit = 0*eV;
00086 recoilThreshold = 0.*eV;
00087 particle = 0;
00088 mass=0;
00089 currentMaterialIndex = -1;
00090
00091 Mottcross = new G4ScreeningMottCrossSection();
00092
00093 }
00094
00095
00096
00097
00098 G4eSingleCoulombScatteringModel::~G4eSingleCoulombScatteringModel()
00099 { delete Mottcross;}
00100
00101
00102
00103 void G4eSingleCoulombScatteringModel::Initialise(const G4ParticleDefinition* p,
00104 const G4DataVector& )
00105 {
00106 SetupParticle(p);
00107 currentCouple = 0;
00108 currentMaterialIndex = -1;
00109 cosThetaMin = cos(PolarAngleLimit());
00110 Mottcross->Initialise(p,cosThetaMin);
00111
00112 pCuts = G4ProductionCutsTable::GetProductionCutsTable()->GetEnergyCutsVector(3);
00113
00114
00115 if(!isInitialised) {
00116 isInitialised = true;
00117 fParticleChange = GetParticleChangeForGamma();
00118 }
00119 }
00120
00121
00122
00123 G4double G4eSingleCoulombScatteringModel::ComputeCrossSectionPerAtom(
00124 const G4ParticleDefinition* p,
00125 G4double kinEnergy,
00126 G4double Z,
00127 G4double ,
00128 G4double,
00129 G4double )
00130 {
00131
00132 SetupParticle(p);
00133
00134 G4double cross =0.0;
00135 if(kinEnergy < lowEnergyLimit) return cross;
00136
00137 DefineMaterial(CurrentCouple());
00138
00139
00140 Mottcross->SetupKinematic(kinEnergy, Z);
00141 cross = Mottcross->NuclearCrossSection();
00142
00143
00144 return cross;
00145 }
00146
00147
00148
00149 void G4eSingleCoulombScatteringModel::SampleSecondaries(
00150 std::vector<G4DynamicParticle*>* fvect,
00151 const G4MaterialCutsCouple* couple,
00152 const G4DynamicParticle* dp,
00153 G4double cutEnergy,
00154 G4double)
00155 {
00156 G4double kinEnergy = dp->GetKineticEnergy();
00157
00158
00159
00160 if(kinEnergy < lowEnergyLimit) return;
00161
00162 DefineMaterial(couple);
00163 SetupParticle(dp->GetDefinition());
00164
00165
00166 currentElement = SelectRandomAtom(couple,particle,
00167 kinEnergy,cutEnergy,kinEnergy);
00168
00169 G4double Z = currentElement->GetZ();
00170 G4int iz = G4int(Z);
00171 G4int ia = SelectIsotopeNumber(currentElement);
00172
00173
00174
00175 G4double cross= Mottcross->GetTotalCross();
00176
00177
00178 if(cross == 0.0)return;
00179
00180 G4ThreeVector dir = dp->GetMomentumDirection();
00181 G4ThreeVector newDirection=Mottcross->GetNewDirection();
00182 newDirection.rotateUz(dir);
00183
00184 fParticleChange->ProposeMomentumDirection(newDirection);
00185
00186
00187 G4double trec= Mottcross->GetTrec();
00188
00189 G4double finalT = kinEnergy - trec;
00190
00191
00192 if(finalT <= lowEnergyLimit) {
00193 trec = kinEnergy;
00194 finalT = 0.0;
00195 }
00196
00197 fParticleChange->SetProposedKineticEnergy(finalT);
00198
00199 G4double tcut = recoilThreshold;
00200 if(pCuts) { tcut= std::min(tcut,(*pCuts)[currentMaterialIndex]);
00201 }
00202
00203
00204 if(trec > tcut) {
00205
00206
00207 G4ParticleDefinition* ion = theParticleTable->GetIon(iz, ia, 0.0);
00208
00209
00210 G4double ptot=sqrt(Mottcross->GetMom2Lab());
00211
00212 G4double plab = sqrt(finalT*(finalT + 2.0*mass));
00213 G4ThreeVector p2 = (ptot*dir - plab*newDirection).unit();
00214
00215 G4DynamicParticle* newdp = new G4DynamicParticle(ion, p2, trec);
00216 fvect->push_back(newdp);
00217 }
00218
00219 else if(trec > 0.0) {
00220 fParticleChange->ProposeNonIonizingEnergyDeposit(trec);
00221 if(trec< tcut) fParticleChange->ProposeLocalEnergyDeposit(trec);
00222 }
00223
00224
00225 }
00226
00227
00228