79 G4cout <<
"G4LEnp:ApplyYourself: incident particle: "
81 G4cout <<
"P = " << P/GeV <<
" GeV/c"
82 <<
", Px = " << Px/GeV <<
" GeV/c"
83 <<
", Py = " << Py/GeV <<
" GeV/c"
84 <<
", Pz = " << Pz/GeV <<
" GeV/c" <<
G4endl;
85 G4cout <<
"E = " << E/GeV <<
" GeV"
86 <<
", kinetic energy = " << ek/GeV <<
" GeV"
87 <<
", mass = " << E0/GeV <<
" GeV"
88 <<
", charge = " << Q <<
G4endl;
100 E0 = std::sqrt(std::abs(E02));
101 if (E02 < 0)E0 *= -1;
104 G4cout <<
"E = " << E/GeV <<
" GeV"
105 <<
", mass = " << E0/GeV <<
" GeV"
106 <<
", charge = " << Q <<
G4endl;
112 G4int je2 = NENERGY - 1;
115 G4int midBin = (je1 + je2)/2;
116 if (ek < elab[midBin])
120 }
while (je2 - je1 > 1);
121 G4double delab = elab[je2] - elab[je1];
127 G4int ke2 = NANGLE - 1;
128 G4double dsig = sig[je2][0] - sig[je1][0];
130 G4double b = sig[je1][0] - rc*elab[je1];
136 << ke1 <<
" " << ke2 <<
" "
137 << sigint1 <<
" " << sigint2 <<
G4endl;
140 G4int midBin = (ke1 + ke2)/2;
141 dsig = sig[je2][midBin] - sig[je1][midBin];
143 b = sig[je1][midBin] - rc*elab[je1];
145 if (sample < sigint) {
154 G4cout << ke1 <<
" " << ke2 <<
" "
155 << sigint1 <<
" " << sigint2 <<
G4endl;
157 }
while (ke2 - ke1 > 1);
159 dsig = sigint2 - sigint1;
161 b = ke1 - rc*sigint1;
163 G4double theta = (0.5 + kint)*pi/180.;
166 G4cout <<
" energy bin " << je1 <<
" energy=" << elab[je1] <<
G4endl;
167 G4cout <<
" angle bin " << kint <<
" angle=" << theta/degree <<
G4endl;
179 G4double pseudoMass = std::sqrt(totalEnergy*totalEnergy - P*P);
186 G4double p = std::sqrt(px*px + py*py + pz*pz);
189 G4cout <<
" E1, M1 (GeV) " << E1/GeV <<
" " << M1/GeV <<
G4endl;
190 G4cout <<
" E2, M2 (GeV) " << E2/GeV <<
" " << M2/GeV <<
G4endl;
191 G4cout <<
" particle 1 momentum in CM " << px/GeV <<
" " << py/GeV <<
" "
192 << pz/GeV <<
" " << p/GeV <<
G4endl;
197 G4double pxnew = p*std::sin(theta)*std::cos(phi);
198 G4double pynew = p*std::sin(theta)*std::sin(phi);
202 if (px*px + py*py > 0) {
203 G4double cost, sint, ph, cosp, sinp;
205 sint = (std::sqrt(std::fabs((1-cost)*(1+cost))) + std::sqrt(px*px+py*py)/p)/2;
206 py < 0 ? ph = 3*halfpi : ph = halfpi;
207 if (std::abs(px) > 0.000001*GeV) ph = std::atan2(py,px);
210 px = (cost*cosp*pxnew - sinp*pynew + sint*cosp*pznew);
211 py = (cost*sinp*pxnew + cosp*pynew + sint*sinp*pznew);
212 pz = (-sint*pxnew + cost*pznew);
222 G4cout <<
" particle 1 momentum in CM " << px/GeV <<
" " << py/GeV <<
" "
223 << pz/GeV <<
" " << p/GeV <<
G4endl;
233 G4double gammaCM = E1pM2/std::sqrt(E1pM2*E1pM2 - P*P);
236 G4cout <<
" betaCM " << betaCMx <<
" " << betaCMy <<
" "
237 << betaCMz <<
" " << betaCM <<
G4endl;
254 PA[4] = std::sqrt(M1*M1 + p*p);
256 G4double BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
257 G4double BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
259 PB[1] = PA[1] + BPGAM * BETA[1];
260 PB[2] = PA[2] + BPGAM * BETA[2];
261 PB[3] = PA[3] + BPGAM * BETA[3];
262 PB[4] = (PA[4] - BETPA) * BETA[4];
273 PA[4] = std::sqrt(M2*M2 + p*p);
275 BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
276 BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
278 PB[1] = PA[1] + BPGAM * BETA[1];
279 PB[2] = PA[2] + BPGAM * BETA[2];
280 PB[3] = PA[3] + BPGAM * BETA[3];
281 PB[4] = (PA[4] - BETPA) * BETA[4];
286 G4cout <<
" particle 1 momentum in LAB "
289 G4cout <<
" particle 2 momentum in LAB "
292 G4cout <<
" TOTAL momentum in LAB "
CLHEP::Hep3Vector G4ThreeVector
G4DLLIMPORT 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)
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)
void SetMaxEnergy(const G4double anEnergy)
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
G4DynamicParticle * ReturnTargetParticle() const
G4double GetPDGMass() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
static G4Proton * Proton()