22double HepLorentzVector::tolerance =
24double HepLorentzVector::metric = 1.0;
35 std::cerr <<
"HepLorentzVector subscripting: bad index (" << i <<
")"
52 <<
"HepLorentzVector subscripting: bad index (" << i <<
")"
59 (
double bx,
double by,
double bz){
60 double b2 = bx*bx + by*by + bz*bz;
61 register double ggamma = 1.0 / std::sqrt(1.0 - b2);
62 register double bp = bx*
x() + by*
y() + bz*
z();
63 register double gamma2 = b2 > 0 ? (ggamma - 1.0)/b2 : 0.0;
65 setX(
x() + gamma2*bp*bx + ggamma*bx*
t());
66 setY(
y() + gamma2*bp*by + ggamma*by*
t());
67 setZ(
z() + gamma2*bp*bz + ggamma*bz*
t());
68 setT(ggamma*(
t() + bp));
92 return os <<
"(" << v1.
x() <<
"," << v1.
y() <<
"," << v1.
z()
93 <<
";" << v1.
t() <<
")";
109 if (is.fail() || c !=
'(' ) {
110 std::cerr <<
"Could not find required opening parenthesis "
111 <<
"in input of a HepLorentzVector" << std::endl;
115 is >> x >> std::ws >> c;
116 if (is.fail() || c !=
',' ) {
117 std::cerr <<
"Could not find x value and required trailing comma "
118 <<
"in input of a HepLorentzVector" << std::endl;
122 is >> y >> std::ws >> c;
123 if (is.fail() || c !=
',' ) {
124 std::cerr <<
"Could not find y value and required trailing comma "
125 <<
"in input of a HepLorentzVector" << std::endl;
129 is >> z >> std::ws >> c;
130 if (is.fail() || c !=
';' ) {
131 std::cerr <<
"Could not find z value and required trailing semicolon "
132 <<
"in input of a HepLorentzVector" << std::endl;
136 is >> t >> std::ws >> c;
137 if (is.fail() || c !=
')' ) {
138 std::cerr <<
"Could not find t value and required close parenthesis "
139 <<
"in input of a HepLorentzVector" << std::endl;
159 double oneOverC = 1.0/c;
172 double oneOverC = 1.0/c;
174 w.
getT() * oneOverC);
179 if (pp.
mag2() == 0) {
182 std::cerr <<
"HepLorentzVector::boostVector() - "
183 <<
"boostVector computed for LorentzVector with t=0 -- infinite result"
189 std::cerr <<
"HepLorentzVector::boostVector() - "
190 <<
"boostVector computed for a non-timelike LorentzVector " << std::endl;
198 register double b2 = bbeta*bbeta;
200 std::cerr <<
"HepLorentzVector::boostX() - "
201 <<
"boost along X with beta >= 1 (speed of light) -- \n"
202 <<
"no boost done" << std::endl;
204 register double ggamma = std::sqrt(1./(1-b2));
205 register double tt = ee;
206 ee = ggamma*(ee + bbeta*pp.
getX());
207 pp.
setX(ggamma*(pp.
getX() + bbeta*tt));
213 register double b2 = bbeta*bbeta;
215 std::cerr <<
"HepLorentzVector::boostY() - "
216 <<
"boost along Y with beta >= 1 (speed of light) -- \n"
217 <<
"no boost done" << std::endl;
219 register double ggamma = std::sqrt(1./(1-b2));
220 register double tt = ee;
221 ee = ggamma*(ee + bbeta*pp.
getY());
222 pp.
setY(ggamma*(pp.
getY() + bbeta*tt));
228 register double b2 = bbeta*bbeta;
230 std::cerr <<
"HepLorentzVector::boostZ() - "
231 <<
"boost along Z with beta >= 1 (speed of light) -- \n"
232 <<
"no boost done" << std::endl;
234 register double ggamma = std::sqrt(1./(1-b2));
235 register double tt = ee;
236 ee = ggamma*(ee + bbeta*pp.
getZ());
237 pp.
setZ(ggamma*(pp.
getZ() + bbeta*tt));
244 double oldTolerance (tolerance);
Hep3Vector & rotateY(double)
Hep3Vector & rotateX(double)
Hep3Vector & rotateZ(double)
Hep3Vector & rotateUz(const Hep3Vector &)
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
HepLorentzVector & boostZ(double beta)
static double setTolerance(double tol)
HepLorentzVector & boostX(double beta)
HepLorentzVector & rotateZ(double)
HepLorentzVector & boostY(double beta)
HepLorentzVector & rotateX(double)
HepLorentzVector & operator/=(double)
HepLorentzVector & rotateUz(const Hep3Vector &)
static double getTolerance()
HepLorentzVector & rotateY(double)
double operator()(int) const
std::istream & operator>>(std::istream &is, HepRandom &dist)
std::ostream & operator<<(std::ostream &os, const HepRandom &dist)
HepLorentzVector operator/(const HepLorentzVector &, double a)