954{
955
956
957
958
962
963
964
968 G4double totalEnergy = kineticEnergy + mass ;
969 G4double pSquare = kineticEnergy *( totalEnergy + mass) ;
970 G4double eSquare = totalEnergy * totalEnergy;
971 G4double betaSquare = pSquare / eSquare;
973
974 G4double gamma = kineticEnergy / mass + 1.;
975 G4double r = electron_mass_c2 / mass;
976 G4double tMax = 2. * electron_mass_c2 *(gamma*gamma - 1.) / (1. + 2.*gamma*r + r*r);
977
978
980
981
982 if (deltaCut >= tMax)
984
987 rate = rate*rate ;
989
990
993
994 do {
996
997 if (0.0 == spin)
998 {
999 gRej = 1.0 - betaSquare * x ;
1000 }
1001 else if (0.5 == spin)
1002 {
1003 gRej = (1. - betaSquare * x + 0.5 * x*x * rate) / (1. + 0.5 * rate) ;
1004 }
1005 else
1006 {
1007 gRej = (1. - betaSquare * x ) * (1. + x/(3.*xc)) +
1008 x*x * rate * (1. + 0.5*x/xc) / 3.0 /
1009 (1. + 1./(3.*xc) + rate *(1.+ 0.5/xc) / 3.);
1010 }
1011
1013
1014 G4double deltaKineticEnergy = x * tMax;
1015 G4double deltaTotalMomentum = std::sqrt(deltaKineticEnergy *
1016 (deltaKineticEnergy + 2. * electron_mass_c2 ));
1017 G4double totalMomentum = std::sqrt(pSquare) ;
1018 G4double cosTheta = deltaKineticEnergy * (totalEnergy + electron_mass_c2) / (deltaTotalMomentum*totalMomentum);
1019
1020
1021 if ( cosTheta < -1. ) cosTheta = -1.;
1022 if ( cosTheta > 1. ) cosTheta = 1.;
1023
1024
1026 G4double sinTheta = std::sqrt(1. - cosTheta*cosTheta);
1027 G4double dirX = sinTheta * std::cos(phi);
1028 G4double dirY = sinTheta * std::sin(phi);
1030
1032 deltaDirection.rotateUz(particleDirection);
1033
1034
1038 deltaDirection.y(),
1039 deltaDirection.z());
1041
1042
1043 G4double finalKineticEnergy = kineticEnergy - deltaKineticEnergy;
1044 size_t totalNumber = 1;
1045
1046
1047
1048
1049
1050 size_t nSecondaries = 0;
1051 std::vector<G4DynamicParticle*>* secondaryVector = 0;
1052
1054 {
1056
1057
1058 if (pixeCrossSectionHandler == 0)
1059 {
1060
1061
1063 pixeCrossSectionHandler =
1067
1068 }
1069
1070
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1092
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1111
1112 if (finalKineticEnergy >= bindingEnergy)
1113
1114 {
1115
1117
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128 if (secondaryVector != 0)
1129 {
1130 nSecondaries = secondaryVector->size();
1131 for (size_t i = 0; i<nSecondaries; i++)
1132 {
1134 if (aSecondary)
1135 {
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149 if (e < finalKineticEnergy &&
1152 {
1153
1154 finalKineticEnergy -= e;
1155 totalNumber++;
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165 }
1166 else
1167 {
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180 delete aSecondary;
1181 (*secondaryVector)[i] = 0;
1182 }
1183 }
1184 }
1185 }
1186 }
1187 }
1188
1189
1190
1191
1193
1195 {
1196 G4double finalPx = totalMomentum*particleDirection.
x() - deltaTotalMomentum*deltaDirection.x();
1197 G4double finalPy = totalMomentum*particleDirection.
y() - deltaTotalMomentum*deltaDirection.y();
1198 G4double finalPz = totalMomentum*particleDirection.
z() - deltaTotalMomentum*deltaDirection.z();
1199 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz) ;
1200 finalPx /= finalMomentum;
1201 finalPy /= finalMomentum;
1202 finalPz /= finalMomentum;
1203
1205 }
1206 else
1207 {
1208 eDeposit = finalKineticEnergy;
1209 finalKineticEnergy = 0.;
1211 particleDirection.
y(),
1212 particleDirection.
z());
1214 GetAtRestProcessVector()->size())
1216 else
1218 }
1219
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237 if (secondaryVector != 0)
1238 {
1239 for (size_t l = 0; l < nSecondaries; l++)
1240 {
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257 }
1258 delete secondaryVector;
1259 }
1260
1262}
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)