953{
954
955
956
957
961
962
963
967 G4double totalEnergy = kineticEnergy + mass ;
968 G4double pSquare = kineticEnergy *( totalEnergy + mass) ;
969 G4double eSquare = totalEnergy * totalEnergy;
970 G4double betaSquare = pSquare / eSquare;
972
973 G4double gamma = kineticEnergy / mass + 1.;
974 G4double r = electron_mass_c2 / mass;
975 G4double tMax = 2. * electron_mass_c2 *(gamma*gamma - 1.) / (1. + 2.*gamma*r + r*r);
976
977
979
980
981 if (deltaCut >= tMax)
983
986 rate = rate*rate ;
988
989
992
993 do {
995
996 if (0.0 == spin)
997 {
998 gRej = 1.0 - betaSquare * x ;
999 }
1000 else if (0.5 == spin)
1001 {
1002 gRej = (1. - betaSquare * x + 0.5 * x*x * rate) / (1. + 0.5 * rate) ;
1003 }
1004 else
1005 {
1006 gRej = (1. - betaSquare * x ) * (1. + x/(3.*xc)) +
1007 x*x * rate * (1. + 0.5*x/xc) / 3.0 /
1008 (1. + 1./(3.*xc) + rate *(1.+ 0.5/xc) / 3.);
1009 }
1010
1012
1013 G4double deltaKineticEnergy = x * tMax;
1014 G4double deltaTotalMomentum = std::sqrt(deltaKineticEnergy *
1015 (deltaKineticEnergy + 2. * electron_mass_c2 ));
1016 G4double totalMomentum = std::sqrt(pSquare) ;
1017 G4double cosTheta = deltaKineticEnergy * (totalEnergy + electron_mass_c2) / (deltaTotalMomentum*totalMomentum);
1018
1019
1020 if ( cosTheta < -1. ) cosTheta = -1.;
1021 if ( cosTheta > 1. ) cosTheta = 1.;
1022
1023
1025 G4double sinTheta = std::sqrt(1. - cosTheta*cosTheta);
1026 G4double dirX = sinTheta * std::cos(phi);
1027 G4double dirY = sinTheta * std::sin(phi);
1029
1031 deltaDirection.rotateUz(particleDirection);
1032
1033
1037 deltaDirection.y(),
1038 deltaDirection.z());
1040
1041
1042 G4double finalKineticEnergy = kineticEnergy - deltaKineticEnergy;
1043 std::size_t totalNumber = 1;
1044
1045
1046
1047
1048
1049 std::size_t nSecondaries = 0;
1050 std::vector<G4DynamicParticle*>* secondaryVector = 0;
1051
1053 {
1055
1056
1057 if (pixeCrossSectionHandler == 0)
1058 {
1059
1060
1062 pixeCrossSectionHandler =
1066
1067 }
1068
1069
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1091
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1110
1111 if (finalKineticEnergy >= bindingEnergy)
1112
1113 {
1114
1116
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127 if (secondaryVector != 0)
1128 {
1129 nSecondaries = secondaryVector->size();
1130 for (std::size_t i = 0; i<nSecondaries; i++)
1131 {
1133 if (aSecondary)
1134 {
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148 if (e < finalKineticEnergy &&
1151 {
1152
1153 finalKineticEnergy -= e;
1154 totalNumber++;
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164 }
1165 else
1166 {
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179 delete aSecondary;
1180 (*secondaryVector)[i] = 0;
1181 }
1182 }
1183 }
1184 }
1185 }
1186 }
1187
1188
1189
1190
1192
1194 {
1195 G4double finalPx = totalMomentum*particleDirection.
x() - deltaTotalMomentum*deltaDirection.x();
1196 G4double finalPy = totalMomentum*particleDirection.
y() - deltaTotalMomentum*deltaDirection.y();
1197 G4double finalPz = totalMomentum*particleDirection.
z() - deltaTotalMomentum*deltaDirection.z();
1198 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz) ;
1199 finalPx /= finalMomentum;
1200 finalPy /= finalMomentum;
1201 finalPz /= finalMomentum;
1202
1204 }
1205 else
1206 {
1207 eDeposit = finalKineticEnergy;
1208 finalKineticEnergy = 0.;
1210 particleDirection.
y(),
1211 particleDirection.
z());
1213 GetAtRestProcessVector()->size())
1215 else
1217 }
1218
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236 if (secondaryVector != 0)
1237 {
1238 for (std::size_t l = 0; l < nSecondaries; l++)
1239 {
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256 }
1257 delete secondaryVector;
1258 }
1259
1261}
std::vector< G4DynamicParticle * > * GenerateParticles(G4int Z, G4int shellId)
G4double BindingEnergy() const
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
static G4AtomicTransitionManager * Instance()
void SetMomentumDirection(const G4ThreeVector &aDirection)
const G4ThreeVector & GetMomentumDirection() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(G4double aEnergy)
static G4Electron * Electron()
void AddSecondary(G4Track *aSecondary)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double GetPDGSpin() const
G4int SelectRandomShell(G4int Z, G4double e) const
void LoadShellData(const G4String &dataFile)
G4int SelectRandomAtom(const G4Material *material, G4double e) const
static G4Proton * ProtonDefinition()
G4ParticleDefinition * GetDefinition() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
void SetNumberOfSecondaries(G4int totSecondaries)
G4double bindingEnergy(G4int A, G4int Z)