18double HepLorentzVector::tolerance =
20double HepLorentzVector::metric = 1.0;
31 std::cerr <<
"HepLorentzVector subscripting: bad index (" << i <<
")"
48 <<
"HepLorentzVector subscripting: bad index (" << i <<
")"
55 (
double bx,
double by,
double bz){
56 double b2 = bx*bx + by*by + bz*bz;
57 double ggamma = 1.0 / std::sqrt(1.0 - b2);
58 double bp = bx*
x() + by*
y() + bz*
z();
59 double gamma2 = b2 > 0 ? (ggamma - 1.0)/b2 : 0.0;
61 setX(
x() + gamma2*bp*bx + ggamma*bx*
t());
62 setY(
y() + gamma2*bp*by + ggamma*by*
t());
63 setZ(
z() + gamma2*bp*bz + ggamma*bz*
t());
64 setT(ggamma*(
t() + bp));
88 return os <<
"(" << v1.
x() <<
"," << v1.
y() <<
"," << v1.
z()
89 <<
";" << v1.
t() <<
")";
105 if (is.fail() || c !=
'(' ) {
106 std::cerr <<
"Could not find required opening parenthesis "
107 <<
"in input of a HepLorentzVector" << std::endl;
111 is >> x >> std::ws >> c;
112 if (is.fail() || c !=
',' ) {
113 std::cerr <<
"Could not find x value and required trailing comma "
114 <<
"in input of a HepLorentzVector" << std::endl;
118 is >> y >> std::ws >> c;
119 if (is.fail() || c !=
',' ) {
120 std::cerr <<
"Could not find y value and required trailing comma "
121 <<
"in input of a HepLorentzVector" << std::endl;
125 is >> z >> std::ws >> c;
126 if (is.fail() || c !=
';' ) {
127 std::cerr <<
"Could not find z value and required trailing semicolon "
128 <<
"in input of a HepLorentzVector" << std::endl;
132 is >> t >> std::ws >> c;
133 if (is.fail() || c !=
')' ) {
134 std::cerr <<
"Could not find t value and required close parenthesis "
135 <<
"in input of a HepLorentzVector" << std::endl;
155 double oneOverC = 1.0/c;
168 double oneOverC = 1.0/c;
170 w.
getT() * oneOverC);
175 if (pp.
mag2() == 0) {
178 std::cerr <<
"HepLorentzVector::boostVector() - "
179 <<
"boostVector computed for LorentzVector with t=0 -- infinite result"
185 std::cerr <<
"HepLorentzVector::boostVector() - "
186 <<
"boostVector computed for a non-timelike LorentzVector " << std::endl;
194 double b2 = bbeta*bbeta;
196 std::cerr <<
"HepLorentzVector::boostX() - "
197 <<
"boost along X with beta >= 1 (speed of light) -- \n"
198 <<
"no boost done" << std::endl;
200 double ggamma = std::sqrt(1./(1-b2));
202 ee = ggamma*(ee + bbeta*pp.
getX());
203 pp.
setX(ggamma*(pp.
getX() + bbeta*tt));
209 double b2 = bbeta*bbeta;
211 std::cerr <<
"HepLorentzVector::boostY() - "
212 <<
"boost along Y with beta >= 1 (speed of light) -- \n"
213 <<
"no boost done" << std::endl;
215 double ggamma = std::sqrt(1./(1-b2));
217 ee = ggamma*(ee + bbeta*pp.
getY());
218 pp.
setY(ggamma*(pp.
getY() + bbeta*tt));
224 double b2 = bbeta*bbeta;
226 std::cerr <<
"HepLorentzVector::boostZ() - "
227 <<
"boost along Z with beta >= 1 (speed of light) -- \n"
228 <<
"no boost done" << std::endl;
230 double ggamma = std::sqrt(1./(1-b2));
232 ee = ggamma*(ee + bbeta*pp.
getZ());
233 pp.
setZ(ggamma*(pp.
getZ() + bbeta*tt));
240 double oldTolerance (tolerance);
Hep3Vector & rotateY(double)
Hep3Vector & rotateX(double)
Hep3Vector & rotateZ(double)
static const int ToleranceTicks
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)