78 G4cout <<
"G4LEHadronProtonElastic:ApplyYourself: incident particle: "
80 G4cout <<
"P = " << P/GeV <<
" GeV/c"
81 <<
", Px = " << Px/GeV <<
" GeV/c"
82 <<
", Py = " << Py/GeV <<
" GeV/c"
83 <<
", Pz = " << Pz/GeV <<
" GeV/c" <<
G4endl;
84 G4cout <<
"E = " << E/GeV <<
" GeV"
85 <<
", kinetic energy = " << ek/GeV <<
" GeV"
86 <<
", mass = " << E0/GeV <<
" GeV"
87 <<
", charge = " << Q <<
G4endl;
88 G4cout <<
"G4LEHadronProtonElastic:ApplyYourself: material:" <<
G4endl;
99 E0 = std::sqrt(std::abs(E02));
100 if (E02 < 0)E0 *= -1;
102 G4cout <<
"G4LEHadronProtonElastic:ApplyYourself: total:" <<
G4endl;
103 G4cout <<
"E = " << E/GeV <<
" GeV"
104 <<
", mass = " << E0/GeV <<
" GeV"
105 <<
", charge = " << Q <<
G4endl;
119 G4double pseudoMass = std::sqrt(totalEnergy*totalEnergy - P*P);
126 G4double p = std::sqrt(px*px + py*py + pz*pz);
129 G4cout <<
" E1, M1 (GeV) " << E1/GeV <<
" " << M1/GeV <<
G4endl;
130 G4cout <<
" E2, M2 (GeV) " << E2/GeV <<
" " << M2/GeV <<
G4endl;
131 G4cout <<
" particle 1 momentum in CM " << px/GeV <<
" " << py/GeV <<
" "
132 << pz/GeV <<
" " << p/GeV <<
G4endl;
137 G4double pxnew = p*std::sin(theta)*std::cos(phi);
138 G4double pynew = p*std::sin(theta)*std::sin(phi);
142 if (px*px + py*py > 0)
144 G4double cost, sint, ph, cosp, sinp;
146 sint = (std::sqrt(std::fabs((1-cost)*(1+cost)))
147 + std::sqrt(px*px+py*py)/p)/2;
148 py < 0 ? ph = 3*halfpi : ph = halfpi;
149 if (std::abs(px) > 0.000001*GeV) ph = std::atan2(py,px);
152 px = (cost*cosp*pxnew - sinp*pynew + sint*cosp*pznew);
153 py = (cost*sinp*pxnew + cosp*pynew + sint*sinp*pznew);
154 pz = (-sint*pxnew + cost*pznew);
164 G4cout <<
" particle 1 momentum in CM " << px/GeV
165 <<
" " << py/GeV <<
" " << pz/GeV <<
" " << p/GeV
176 G4double gammaCM = E1pM2/std::sqrt(E1pM2*E1pM2 - P*P);
179 G4cout <<
" betaCM " << betaCMx <<
" " << betaCMy <<
" "
180 << betaCMz <<
" " << betaCM <<
G4endl;
197 PA[4] = std::sqrt(M1*M1 + p*p);
199 G4double BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
200 G4double BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
202 PB[1] = PA[1] + BPGAM * BETA[1];
203 PB[2] = PA[2] + BPGAM * BETA[2];
204 PB[3] = PA[3] + BPGAM * BETA[3];
205 PB[4] = (PA[4] - BETPA) * BETA[4];
216 PA[4] = std::sqrt(M2*M2 + p*p);
218 BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
219 BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
221 PB[1] = PA[1] + BPGAM * BETA[1];
222 PB[2] = PA[2] + BPGAM * BETA[2];
223 PB[3] = PA[3] + BPGAM * BETA[3];
224 PB[4] = (PA[4] - BETPA) * BETA[4];
229 G4cout <<
" particle 1 momentum in LAB "
232 G4cout <<
" particle 2 momentum in LAB "
235 G4cout <<
" TOTAL momentum in LAB "
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
G4double GetPDGMass() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const