59{
62
69
71 {
77 G4cout <<
"G4LEHadronProtonElastic:ApplyYourself: incident particle: "
79 G4cout <<
"P = " << P/GeV <<
" GeV/c"
80 << ", Px = " << Px/GeV << " GeV/c"
81 << ", Py = " << Py/GeV << " GeV/c"
82 <<
", Pz = " << Pz/GeV <<
" GeV/c" <<
G4endl;
83 G4cout <<
"E = " << E/GeV <<
" GeV"
84 << ", kinetic energy = " << ek/GeV << " GeV"
85 << ", mass = " << E0/GeV << " GeV"
86 <<
", charge = " << Q <<
G4endl;
87 G4cout <<
"G4LEHadronProtonElastic:ApplyYourself: material:" <<
G4endl;
89 << ", Z = " << Z
90 << ", atomic mass "
93
94
95
96 E += proton_mass_c2;
98 E0 = std::sqrt(std::abs(E02));
99 if (E02 < 0)E0 *= -1;
100 Q += Z;
101 G4cout <<
"G4LEHadronProtonElastic:ApplyYourself: total:" <<
G4endl;
102 G4cout <<
"E = " << E/GeV <<
" GeV"
103 << ", mass = " << E0/GeV << " GeV"
104 <<
", charge = " << Q <<
G4endl;
105 }
106
108
109
110
112
118 G4double pseudoMass = std::sqrt(totalEnergy*totalEnergy - P*P);
119
120
121
125 G4double p = std::sqrt(px*px + py*py + pz*pz);
126
128 G4cout <<
" E1, M1 (GeV) " << E1/GeV <<
" " << M1/GeV <<
G4endl;
129 G4cout <<
" E2, M2 (GeV) " << E2/GeV <<
" " << M2/GeV <<
G4endl;
130 G4cout <<
" particle 1 momentum in CM " << px/GeV <<
" " << py/GeV <<
" "
131 << pz/GeV <<
" " << p/GeV <<
G4endl;
132 }
133
134
136 G4double pxnew = p*std::sin(theta)*std::cos(phi);
137 G4double pynew = p*std::sin(theta)*std::sin(phi);
139
140
141 if (px*px + py*py > 0)
142 {
143 G4double cost, sint, ph, cosp, sinp;
144 cost = pz/p;
145 sint = (std::sqrt(std::fabs((1-cost)*(1+cost)))
146 + std::sqrt(px*px+py*py)/p)/2;
147 py < 0 ? ph = 3*halfpi : ph = halfpi;
148 if (std::abs(px) > 0.000001*GeV) ph = std::atan2(py,px);
149 cosp = std::cos(ph);
150 sinp = std::sin(ph);
151 px = (cost*cosp*pxnew - sinp*pynew + sint*cosp*pznew);
152 py = (cost*sinp*pxnew + cosp*pynew + sint*sinp*pznew);
153 pz = (-sint*pxnew + cost*pznew);
154 }
155 else {
156 px = pxnew;
157 py = pynew;
158 pz = pznew;
159 }
160
163 G4cout <<
" particle 1 momentum in CM " << px/GeV
164 << " " << py/GeV << " " << pz/GeV << " " << p/GeV
166 }
167
168
169
175 G4double gammaCM = E1pM2/std::sqrt(E1pM2*E1pM2 - P*P);
176
178 G4cout <<
" betaCM " << betaCMx <<
" " << betaCMy <<
" "
179 << betaCMz <<
" " << betaCM <<
G4endl;
181 }
182
183
184
186 BETA[1] = -betaCMx;
187 BETA[2] = -betaCMy;
188 BETA[3] = -betaCMz;
189 BETA[4] = gammaCM;
190
191
192
193 PA[1] = px;
194 PA[2] = py;
195 PA[3] = pz;
196 PA[4] = std::sqrt(M1*M1 + p*p);
197
198 G4double BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
199 G4double BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
200
201 PB[1] = PA[1] + BPGAM * BETA[1];
202 PB[2] = PA[2] + BPGAM * BETA[2];
203 PB[3] = PA[3] + BPGAM * BETA[3];
204 PB[4] = (PA[4] - BETPA) * BETA[4];
205
209
210
211
212 PA[1] = -px;
213 PA[2] = -py;
214 PA[3] = -pz;
215 PA[4] = std::sqrt(M2*M2 + p*p);
216
217 BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
218 BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
219
220 PB[1] = PA[1] + BPGAM * BETA[1];
221 PB[2] = PA[2] + BPGAM * BETA[2];
222 PB[3] = PA[3] + BPGAM * BETA[3];
223 PB[4] = (PA[4] - BETPA) * BETA[4];
224
226
228 G4cout <<
" particle 1 momentum in LAB "
231 G4cout <<
" particle 2 momentum in LAB "
234 G4cout <<
" TOTAL momentum in LAB "
236 << " "
239 }
240
243 delete newP;
245
247}
double A(double temperature)
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()