12 #pragma implementation
34 std::cerr <<
"HepLorentzVector subscripting: bad index (" << i <<
")"
51 <<
"HepLorentzVector subscripting: bad index (" << i <<
")"
58 (
double bx,
double by,
double bz){
59 double b2 = bx*bx + by*by + bz*bz;
60 double ggamma = 1.0 / std::sqrt(1.0 - b2);
61 double bp = bx*
x() + by*
y() + bz*
z();
62 double gamma2 = b2 > 0 ? (ggamma - 1.0)/b2 : 0.0;
64 setX(
x() + gamma2*bp*bx + ggamma*bx*
t());
65 setY(
y() + gamma2*bp*by + ggamma*by*
t());
66 setZ(
z() + gamma2*bp*bz + ggamma*bz*
t());
67 setT(ggamma*(
t() + bp));
91 return os <<
"(" << v1.
x() <<
"," << v1.
y() <<
"," << v1.
z()
92 <<
";" << v1.
t() <<
")";
108 if (is.fail() || c !=
'(' ) {
109 std::cerr <<
"Could not find required opening parenthesis "
110 <<
"in input of a HepLorentzVector" << std::endl;
114 is >> x >> std::ws >>
c;
115 if (is.fail() || c !=
',' ) {
116 std::cerr <<
"Could not find x value and required trailing comma "
117 <<
"in input of a HepLorentzVector" << std::endl;
121 is >> y >> std::ws >>
c;
122 if (is.fail() || c !=
',' ) {
123 std::cerr <<
"Could not find y value and required trailing comma "
124 <<
"in input of a HepLorentzVector" << std::endl;
128 is >> z >> std::ws >>
c;
129 if (is.fail() || c !=
';' ) {
130 std::cerr <<
"Could not find z value and required trailing semicolon "
131 <<
"in input of a HepLorentzVector" << std::endl;
135 is >> t >> std::ws >>
c;
136 if (is.fail() || c !=
')' ) {
137 std::cerr <<
"Could not find t value and required close parenthesis "
138 <<
"in input of a HepLorentzVector" << std::endl;
158 double oneOverC = 1.0/
c;
171 double oneOverC = 1.0/
c;
173 w.
getT() * oneOverC);
181 std::cerr <<
"HepLorentzVector::boostVector() - "
182 <<
"boostVector computed for LorentzVector with t=0 -- infinite result"
188 std::cerr <<
"HepLorentzVector::boostVector() - "
189 <<
"boostVector computed for a non-timelike LorentzVector " << std::endl;
197 double b2 = bbeta*bbeta;
199 std::cerr <<
"HepLorentzVector::boostX() - "
200 <<
"boost along X with beta >= 1 (speed of light) -- \n"
201 <<
"no boost done" << std::endl;
203 double ggamma = std::sqrt(1./(1-b2));
212 double b2 = bbeta*bbeta;
214 std::cerr <<
"HepLorentzVector::boostY() - "
215 <<
"boost along Y with beta >= 1 (speed of light) -- \n"
216 <<
"no boost done" << std::endl;
218 double ggamma = std::sqrt(1./(1-b2));
227 double b2 = bbeta*bbeta;
229 std::cerr <<
"HepLorentzVector::boostZ() - "
230 <<
"boost along Z with beta >= 1 (speed of light) -- \n"
231 <<
"no boost done" << std::endl;
233 double ggamma = std::sqrt(1./(1-b2));