60{
63
70
72 {
78 G4cout <<
"G4LEHadronProtonElastic:ApplyYourself: incident particle: "
80 G4cout <<
"P = " << P/GeV <<
" GeV/c"
81 << ", Px = " << Px/GeV << " GeV/c"
82 << ", Py = " << Py/GeV << " GeV/c"
83 <<
", Pz = " << Pz/GeV <<
" GeV/c" <<
G4endl;
84 G4cout <<
"E = " << E/GeV <<
" GeV"
85 << ", kinetic energy = " << ek/GeV << " GeV"
86 << ", mass = " << E0/GeV << " GeV"
87 <<
", charge = " << Q <<
G4endl;
88 G4cout <<
"G4LEHadronProtonElastic:ApplyYourself: material:" <<
G4endl;
90 << ", Z = " << Z
91 << ", atomic mass "
94
95
96
97 E += proton_mass_c2;
99 E0 = std::sqrt(std::abs(E02));
100 if (E02 < 0)E0 *= -1;
101 Q += Z;
102 G4cout <<
"G4LEHadronProtonElastic:ApplyYourself: total:" <<
G4endl;
103 G4cout <<
"E = " << E/GeV <<
" GeV"
104 << ", mass = " << E0/GeV << " GeV"
105 <<
", charge = " << Q <<
G4endl;
106 }
107
109
110
111
113
119 G4double pseudoMass = std::sqrt(totalEnergy*totalEnergy - P*P);
120
121
122
126 G4double p = std::sqrt(px*px + py*py + pz*pz);
127
129 G4cout <<
" E1, M1 (GeV) " << E1/GeV <<
" " << M1/GeV <<
G4endl;
130 G4cout <<
" E2, M2 (GeV) " << E2/GeV <<
" " << M2/GeV <<
G4endl;
131 G4cout <<
" particle 1 momentum in CM " << px/GeV <<
" " << py/GeV <<
" "
132 << pz/GeV <<
" " << p/GeV <<
G4endl;
133 }
134
135
137 G4double pxnew = p*std::sin(theta)*std::cos(phi);
138 G4double pynew = p*std::sin(theta)*std::sin(phi);
140
141
142 if (px*px + py*py > 0)
143 {
144 G4double cost, sint, ph, cosp, sinp;
145 cost = pz/p;
146 sint = (std::sqrt(std::fabs((1-cost)*(1+cost)))
147 + std::sqrt(px*px+py*py)/p)/2;
148 py < 0 ? ph = 3*halfpi : ph = halfpi;
149 if (std::abs(px) > 0.000001*GeV) ph = std::atan2(py,px);
150 cosp = std::cos(ph);
151 sinp = std::sin(ph);
152 px = (cost*cosp*pxnew - sinp*pynew + sint*cosp*pznew);
153 py = (cost*sinp*pxnew + cosp*pynew + sint*sinp*pznew);
154 pz = (-sint*pxnew + cost*pznew);
155 }
156 else {
157 px = pxnew;
158 py = pynew;
159 pz = pznew;
160 }
161
164 G4cout <<
" particle 1 momentum in CM " << px/GeV
165 << " " << py/GeV << " " << pz/GeV << " " << p/GeV
167 }
168
169
170
176 G4double gammaCM = E1pM2/std::sqrt(E1pM2*E1pM2 - P*P);
177
179 G4cout <<
" betaCM " << betaCMx <<
" " << betaCMy <<
" "
180 << betaCMz <<
" " << betaCM <<
G4endl;
182 }
183
184
185
187 BETA[1] = -betaCMx;
188 BETA[2] = -betaCMy;
189 BETA[3] = -betaCMz;
190 BETA[4] = gammaCM;
191
192
193
194 PA[1] = px;
195 PA[2] = py;
196 PA[3] = pz;
197 PA[4] = std::sqrt(M1*M1 + p*p);
198
199 G4double BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
200 G4double BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
201
202 PB[1] = PA[1] + BPGAM * BETA[1];
203 PB[2] = PA[2] + BPGAM * BETA[2];
204 PB[3] = PA[3] + BPGAM * BETA[3];
205 PB[4] = (PA[4] - BETPA) * BETA[4];
206
210
211
212
213 PA[1] = -px;
214 PA[2] = -py;
215 PA[3] = -pz;
216 PA[4] = std::sqrt(M2*M2 + p*p);
217
218 BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
219 BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
220
221 PB[1] = PA[1] + BPGAM * BETA[1];
222 PB[2] = PA[2] + BPGAM * BETA[2];
223 PB[3] = PA[3] + BPGAM * BETA[3];
224 PB[4] = (PA[4] - BETPA) * BETA[4];
225
227
229 G4cout <<
" particle 1 momentum in LAB "
232 G4cout <<
" particle 2 momentum in LAB "
235 G4cout <<
" TOTAL momentum in LAB "
237 << " "
240 }
241
244 delete newP;
246
248}
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
void SetMomentum(const G4ThreeVector &momentum)
G4ThreeVector GetMomentum() const
G4double GetTotalMomentum() const
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
G4double GetTotalMomentum() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetTotalEnergy() const
G4DynamicParticle * ReturnTargetParticle() const
G4double GetPDGMass() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
static G4Proton * Proton()