80 G4cout <<
"G4LEnp:ApplyYourself: incident particle: "
83 <<
", Px = " << Px/
GeV <<
" GeV/c"
84 <<
", Py = " << Py/
GeV <<
" GeV/c"
85 <<
", Pz = " << Pz/
GeV <<
" GeV/c" <<
G4endl;
87 <<
", kinetic energy = " << ek/
GeV <<
" GeV"
88 <<
", mass = " << E0/
GeV <<
" GeV"
89 <<
", charge = " << Q <<
G4endl;
101 E0 = std::sqrt(std::abs(E02));
102 if (E02 < 0)E0 *= -1;
106 <<
", mass = " << E0/
GeV <<
" GeV"
107 <<
", charge = " << Q <<
G4endl;
116 G4int midBin = (je1 + je2)/2;
117 if (ek <
elab[midBin])
121 }
while (je2 - je1 > 1);
131 G4double b = sig[je1][0] - rc*elab[je1];
137 << ke1 <<
" " << ke2 <<
" "
138 << sigint1 <<
" " << sigint2 <<
G4endl;
141 G4int midBin = (ke1 + ke2)/2;
142 dsig = sig[je2][midBin] - sig[je1][midBin];
144 b = sig[je1][midBin] - rc*elab[je1];
146 if (sample < sigint) {
155 G4cout << ke1 <<
" " << ke2 <<
" "
156 << sigint1 <<
" " << sigint2 <<
G4endl;
158 }
while (ke2 - ke1 > 1);
160 dsig = sigint2 - sigint1;
162 b = ke1 - rc*sigint1;
167 G4cout <<
" energy bin " << je1 <<
" energy=" << elab[je1] <<
G4endl;
180 G4double pseudoMass = std::sqrt(totalEnergy*totalEnergy - P*P);
187 G4double p = std::sqrt(px*px + py*py + pz*pz);
192 G4cout <<
" particle 1 momentum in CM " << px/
GeV <<
" " << py/
GeV <<
" "
198 G4double pxnew = p*std::sin(theta)*std::cos(phi);
199 G4double pynew = p*std::sin(theta)*std::sin(phi);
203 if (px*px + py*py > 0) {
204 G4double cost, sint, ph, cosp, sinp;
206 sint = (std::sqrt(std::fabs((1-cost)*(1+cost))) + std::sqrt(px*px+py*py)/p)/2;
208 if (std::abs(px) > 0.000001*
GeV) ph = std::atan2(py,px);
211 px = (cost*cosp*pxnew - sinp*pynew + sint*cosp*pznew);
212 py = (cost*sinp*pxnew + cosp*pynew + sint*sinp*pznew);
213 pz = (-sint*pxnew + cost*pznew);
223 G4cout <<
" particle 1 momentum in CM " << px/
GeV <<
" " << py/
GeV <<
" "
234 G4double gammaCM = E1pM2/std::sqrt(E1pM2*E1pM2 - P*P);
237 G4cout <<
" betaCM " << betaCMx <<
" " << betaCMy <<
" "
238 << betaCMz <<
" " << betaCM <<
G4endl;
255 PA[4] = std::sqrt(M1*M1 + p*p);
257 G4double BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
258 G4double BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
260 PB[1] = PA[1] + BPGAM * BETA[1];
261 PB[2] = PA[2] + BPGAM * BETA[2];
262 PB[3] = PA[3] + BPGAM * BETA[3];
263 PB[4] = (PA[4] - BETPA) * BETA[4];
274 PA[4] = std::sqrt(M2*M2 + p*p);
276 BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
277 BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
279 PB[1] = PA[1] + BPGAM * BETA[1];
280 PB[2] = PA[2] + BPGAM * BETA[2];
281 PB[3] = PA[3] + BPGAM * BETA[3];
282 PB[4] = (PA[4] - BETPA) * BETA[4];
287 G4cout <<
" particle 1 momentum in LAB "
290 G4cout <<
" particle 2 momentum in LAB "
293 G4cout <<
" TOTAL momentum in LAB "
316 G4double ek = std::sqrt(plab*plab+nMass*nMass) - nMass;
326 G4int midBin = (je1 + je2)/2;
327 if (ek <
elab[midBin])
331 }
while (je2 - je1 > 1);
342 G4double b = sig[je1][0] - rc*elab[je1];
348 G4int midBin = (ke1 + ke2)/2;
349 dsig = sig[je2][midBin] - sig[je1][midBin];
351 b = sig[je1][midBin] - rc*elab[je1];
364 }
while (ke2 - ke1 > 1);
366 dsig = sigint2 - sigint1;
368 b = ke1 - rc*sigint1;
372 G4double t = 0.5*plab*plab*(1-std::cos(theta));
G4double SampleInvariantT(const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A)
static const double halfpi
void SetMomentum(const G4ThreeVector &momentum)
G4double GetKineticEnergy() const
CLHEP::Hep3Vector G4ThreeVector
G4double GetTotalEnergy() const
G4ParticleDefinition * GetDefinition() const
G4DynamicParticle * ReturnTargetParticle() const
const G4String & GetParticleName() const
G4double GetTotalMomentum() const
void SetMinEnergy(G4double anEnergy)
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
const G4ParticleDefinition * GetDefinition() const
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static const double twopi
static G4Proton * Proton()
static const G4float elab[NENERGY]
const G4LorentzVector & Get4Momentum() const
void SetEnergyChange(G4double anEnergy)
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
G4double GetPDGMass() const
static const double degree
void SetMaxEnergy(const G4double anEnergy)
G4HadFinalState theParticleChange
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4double GetPDGCharge() const
void SetMomentumChange(const G4ThreeVector &aV)
static const G4float sig[NENERGY][NANGLE]
G4ThreeVector GetMomentum() const
G4double GetTotalMomentum() const
G4double GetTotalEnergy() const