83 G4cout <<
"G4LEnp:ApplyYourself: incident particle: "
86 <<
", Px = " << Px/
GeV <<
" GeV/c"
87 <<
", Py = " << Py/
GeV <<
" GeV/c"
88 <<
", Pz = " << Pz/
GeV <<
" GeV/c" <<
G4endl;
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;
109 <<
", mass = " << E0/
GeV <<
" GeV"
110 <<
", charge = " <<
Q <<
G4endl;
119 G4int midBin = (je1 + je2)/2;
120 if (ek <
elab[midBin])
124 }
while (je2 - je1 > 1);
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;
183 G4double pseudoMass = std::sqrt(totalEnergy*totalEnergy -
P*
P);
190 G4double p = std::sqrt(px*px + py*py + pz*pz);
195 G4cout <<
" particle 1 momentum in CM " << px/
GeV <<
" " << py/
GeV <<
" "
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;
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 <<
" "
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;
329 G4int midBin = (je1 + je2)/2;
330 if (ek <
elab[midBin])
334 }
while (je2 - je1 > 1);
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;
375 G4double t = 0.5*plab*plab*(1-std::cos(theta));
static constexpr double twopi
static constexpr double GeV
static constexpr double degree
static constexpr double pi
static constexpr double halfpi
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
static const G4float sig[NENERGY][NANGLE]
static const G4float elab[NENERGY]
G4DynamicParticle * ReturnTargetParticle() const
G4double GetPDGMass() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
static G4int GetModelID(const G4int modelIndex)
static G4Proton * Proton()