961{
962
963
964
965
969
970
971
975 G4double totalEnergy = kineticEnergy + mass ;
976 G4double pSquare = kineticEnergy *( totalEnergy + mass) ;
977 G4double eSquare = totalEnergy * totalEnergy;
978 G4double betaSquare = pSquare / eSquare;
980
981 G4double gamma = kineticEnergy / mass + 1.;
982 G4double r = electron_mass_c2 / mass;
983 G4double tMax = 2. * electron_mass_c2 *(gamma*gamma - 1.) / (1. + 2.*gamma*r + r*r);
984
985
987
988
989 if (deltaCut >= tMax)
991
994 rate = rate*rate ;
996
997
1000
1001 do {
1003
1004 if (0.0 == spin)
1005 {
1006 gRej = 1.0 - betaSquare * x ;
1007 }
1008 else if (0.5 == spin)
1009 {
1010 gRej = (1. - betaSquare * x + 0.5 * x*x * rate) / (1. + 0.5 * rate) ;
1011 }
1012 else
1013 {
1014 gRej = (1. - betaSquare * x ) * (1. + x/(3.*xc)) +
1015 x*x * rate * (1. + 0.5*x/xc) / 3.0 /
1016 (1. + 1./(3.*xc) + rate *(1.+ 0.5/xc) / 3.);
1017 }
1018
1020
1021 G4double deltaKineticEnergy = x * tMax;
1022 G4double deltaTotalMomentum = std::sqrt(deltaKineticEnergy *
1023 (deltaKineticEnergy + 2. * electron_mass_c2 ));
1024 G4double totalMomentum = std::sqrt(pSquare) ;
1025 G4double cosTheta = deltaKineticEnergy * (totalEnergy + electron_mass_c2) / (deltaTotalMomentum*totalMomentum);
1026
1027
1028 if ( cosTheta < -1. ) cosTheta = -1.;
1029 if ( cosTheta > 1. ) cosTheta = 1.;
1030
1031
1033 G4double sinTheta = std::sqrt(1. - cosTheta*cosTheta);
1034 G4double dirX = sinTheta * std::cos(phi);
1035 G4double dirY = sinTheta * std::sin(phi);
1037
1039 deltaDirection.rotateUz(particleDirection);
1040
1041
1045 deltaDirection.y(),
1046 deltaDirection.z());
1048
1049
1050 G4double finalKineticEnergy = kineticEnergy - deltaKineticEnergy;
1051 std::size_t totalNumber = 1;
1052
1053
1054
1055
1056
1057 std::size_t nSecondaries = 0;
1058 std::vector<G4DynamicParticle*>* secondaryVector = 0;
1059
1061 {
1063
1064
1065 if (pixeCrossSectionHandler == 0)
1066 {
1067
1068
1070 pixeCrossSectionHandler =
1074
1075 }
1076
1077
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1099
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1118
1119 if (finalKineticEnergy >= bindingEnergy)
1120
1121 {
1122
1124
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135 if (secondaryVector != 0)
1136 {
1137 nSecondaries = secondaryVector->size();
1138 for (std::size_t i = 0; i<nSecondaries; i++)
1139 {
1141 if (aSecondary)
1142 {
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156 if (e < finalKineticEnergy &&
1159 {
1160
1161 finalKineticEnergy -= e;
1162 totalNumber++;
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172 }
1173 else
1174 {
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187 delete aSecondary;
1188 (*secondaryVector)[i] = 0;
1189 }
1190 }
1191 }
1192 }
1193 }
1194 }
1195
1196
1197
1198
1200
1202 {
1203 G4double finalPx = totalMomentum*particleDirection.
x() - deltaTotalMomentum*deltaDirection.x();
1204 G4double finalPy = totalMomentum*particleDirection.
y() - deltaTotalMomentum*deltaDirection.y();
1205 G4double finalPz = totalMomentum*particleDirection.
z() - deltaTotalMomentum*deltaDirection.z();
1206 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz) ;
1207 finalPx /= finalMomentum;
1208 finalPy /= finalMomentum;
1209 finalPz /= finalMomentum;
1210
1212 }
1213 else
1214 {
1215 eDeposit = finalKineticEnergy;
1216 finalKineticEnergy = 0.;
1218 particleDirection.
y(),
1219 particleDirection.
z());
1221 GetAtRestProcessVector()->size())
1223 else
1225 }
1226
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244 if (secondaryVector != 0)
1245 {
1246 for (std::size_t l = 0; l < nSecondaries; l++)
1247 {
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264 }
1265 delete secondaryVector;
1266 }
1267
1269}
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)