83 G4cout <<
"G4LEnp:ApplyYourself: incident particle: "
85 G4cout <<
"P = " << P/GeV <<
" GeV/c"
86 <<
", Px = " << Px/GeV <<
" GeV/c"
87 <<
", Py = " << Py/GeV <<
" GeV/c"
88 <<
", Pz = " << Pz/GeV <<
" GeV/c" <<
G4endl;
89 G4cout <<
"E = " << E/GeV <<
" GeV"
90 <<
", kinetic energy = " << ek/GeV <<
" GeV"
91 <<
", mass = " << E0/GeV <<
" GeV"
92 <<
", charge = " << Q <<
G4endl;
104 E0 = std::sqrt(std::abs(E02));
105 if (E02 < 0)E0 *= -1;
108 G4cout <<
"E = " << E/GeV <<
" GeV"
109 <<
", mass = " << E0/GeV <<
" GeV"
110 <<
", charge = " << Q <<
G4endl;
116 G4int je2 = NENERGY - 1;
119 G4int midBin = (je1 + je2)/2;
120 if (ek < elab[midBin])
124 }
while (je2 - je1 > 1);
125 G4double delab = elab[je2] - elab[je1];
131 G4int ke2 = NANGLE - 1;
132 G4double dsig = sig[je2][0] - sig[je1][0];
134 G4double b = sig[je1][0] - rc*elab[je1];
140 << ke1 <<
" " << ke2 <<
" "
141 << sigint1 <<
" " << sigint2 <<
G4endl;
144 G4int midBin = (ke1 + ke2)/2;
145 dsig = sig[je2][midBin] - sig[je1][midBin];
147 b = sig[je1][midBin] - rc*elab[je1];
149 if (sample < sigint) {
158 G4cout << ke1 <<
" " << ke2 <<
" "
159 << sigint1 <<
" " << sigint2 <<
G4endl;
161 }
while (ke2 - ke1 > 1);
163 dsig = sigint2 - sigint1;
165 b = ke1 - rc*sigint1;
167 G4double theta = (0.5 + kint)*pi/180.;
170 G4cout <<
" energy bin " << je1 <<
" energy=" << elab[je1] <<
G4endl;
171 G4cout <<
" angle bin " << kint <<
" angle=" << theta/degree <<
G4endl;
183 G4double pseudoMass = std::sqrt(totalEnergy*totalEnergy - P*P);
190 G4double p = std::sqrt(px*px + py*py + pz*pz);
193 G4cout <<
" E1, M1 (GeV) " << E1/GeV <<
" " << M1/GeV <<
G4endl;
194 G4cout <<
" E2, M2 (GeV) " << E2/GeV <<
" " << M2/GeV <<
G4endl;
195 G4cout <<
" particle 1 momentum in CM " << px/GeV <<
" " << py/GeV <<
" "
196 << pz/GeV <<
" " << p/GeV <<
G4endl;
201 G4double pxnew = p*std::sin(theta)*std::cos(phi);
202 G4double pynew = p*std::sin(theta)*std::sin(phi);
206 if (px*px + py*py > 0) {
207 G4double cost, sint, ph, cosp, sinp;
209 sint = (std::sqrt(std::fabs((1-cost)*(1+cost))) + std::sqrt(px*px+py*py)/p)/2;
210 py < 0 ? ph = 3*halfpi : ph = halfpi;
211 if (std::abs(px) > 0.000001*GeV) ph = std::atan2(py,px);
214 px = (cost*cosp*pxnew - sinp*pynew + sint*cosp*pznew);
215 py = (cost*sinp*pxnew + cosp*pynew + sint*sinp*pznew);
216 pz = (-sint*pxnew + cost*pznew);
226 G4cout <<
" particle 1 momentum in CM " << px/GeV <<
" " << py/GeV <<
" "
227 << pz/GeV <<
" " << p/GeV <<
G4endl;
237 G4double gammaCM = E1pM2/std::sqrt(E1pM2*E1pM2 - P*P);
240 G4cout <<
" betaCM " << betaCMx <<
" " << betaCMy <<
" "
241 << betaCMz <<
" " << betaCM <<
G4endl;
258 PA[4] = std::sqrt(M1*M1 + p*p);
260 G4double BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
261 G4double BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
263 PB[1] = PA[1] + BPGAM * BETA[1];
264 PB[2] = PA[2] + BPGAM * BETA[2];
265 PB[3] = PA[3] + BPGAM * BETA[3];
266 PB[4] = (PA[4] - BETPA) * BETA[4];
277 PA[4] = std::sqrt(M2*M2 + p*p);
279 BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
280 BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
282 PB[1] = PA[1] + BPGAM * BETA[1];
283 PB[2] = PA[2] + BPGAM * BETA[2];
284 PB[3] = PA[3] + BPGAM * BETA[3];
285 PB[4] = (PA[4] - BETPA) * BETA[4];
290 G4cout <<
" particle 1 momentum in LAB "
293 G4cout <<
" particle 2 momentum in LAB "
296 G4cout <<
" TOTAL momentum in LAB "
319 G4double ek = std::sqrt(plab*plab+nMass*nMass) - nMass;
324 G4int je2 = NENERGY - 1;
329 G4int midBin = (je1 + je2)/2;
330 if (ek < elab[midBin])
334 }
while (je2 - je1 > 1);
336 G4double delab = elab[je2] - elab[je1];
342 G4int ke2 = NANGLE - 1;
343 G4double dsig = sig[je2][0] - sig[je1][0];
345 G4double b = sig[je1][0] - rc*elab[je1];
351 G4int midBin = (ke1 + ke2)/2;
352 dsig = sig[je2][midBin] - sig[je1][midBin];
354 b = sig[je1][midBin] - rc*elab[je1];
367 }
while (ke2 - ke1 > 1);
369 dsig = sigint2 - sigint1;
371 b = ke1 - rc*sigint1;
374 G4double theta = (0.5 + kint)*pi/180.;
375 G4double t = 0.5*plab*plab*(1-std::cos(theta));
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
G4HadFinalState theParticleChange
void SetMinEnergy(G4double anEnergy)
const G4String & GetModelName() const
void SetMaxEnergy(const G4double anEnergy)
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus) override
G4double SampleInvariantT(const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A) override
G4DynamicParticle * ReturnTargetParticle() const
G4double GetPDGMass() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
static G4int GetModelID(const G4int modelIndex)
static G4Proton * Proton()