Go to the documentation of this file.
13 #pragma implementation
16 #include "CLHEP/Vector/defs.h"
17 #include "CLHEP/Vector/LorentzVector.h"
18 #include "CLHEP/Vector/ZMxpv.h"
33 std::cerr <<
"HepLorentzVector subscripting: bad index (" <<
i <<
")"
50 <<
"HepLorentzVector subscripting: bad index (" <<
i <<
")"
57 (
double bx,
double by,
double bz){
58 double b2 = bx*bx + by*by + bz*bz;
59 register double ggamma = 1.0 / std::sqrt(1.0 - b2);
60 register double bp = bx*
x() + by*y() + bz*z();
61 register double gamma2 = b2 > 0 ? (ggamma - 1.0)/b2 : 0.0;
63 setX(
x() + gamma2*bp*bx + ggamma*bx*t());
64 setY(y() + gamma2*bp*by + ggamma*by*t());
65 setZ(z() + gamma2*bp*bz + ggamma*bz*t());
66 setT(ggamma*(t() + bp));
90 return os <<
"(" << v1.
x() <<
"," << v1.
y() <<
"," << v1.
z()
91 <<
";" << v1.
t() <<
")";
107 if (
is.fail() || c !=
'(' ) {
108 std::cerr <<
"Could not find required opening parenthesis "
109 <<
"in input of a HepLorentzVector" << std::endl;
113 is >>
x >> std::ws >> c;
114 if (
is.fail() || c !=
',' ) {
115 std::cerr <<
"Could not find x value and required trailing comma "
116 <<
"in input of a HepLorentzVector" << std::endl;
120 is >> y >> std::ws >> c;
121 if (
is.fail() || c !=
',' ) {
122 std::cerr <<
"Could not find y value and required trailing comma "
123 <<
"in input of a HepLorentzVector" << std::endl;
127 is >> z >> std::ws >> c;
128 if (
is.fail() || c !=
';' ) {
129 std::cerr <<
"Could not find z value and required trailing semicolon "
130 <<
"in input of a HepLorentzVector" << std::endl;
134 is >> t >> std::ws >> c;
135 if (
is.fail() || c !=
')' ) {
136 std::cerr <<
"Could not find t value and required close parenthesis "
137 <<
"in input of a HepLorentzVector" << std::endl;
153 "Attempt to do LorentzVector /= 0 -- \n"
154 "division by zero would produce infinite or NAN components"));
156 double oneOverC = 1.0/c;
165 "Attempt to do LorentzVector / 0 -- \n"
166 "division by zero would produce infinite or NAN components"));
168 double oneOverC = 1.0/c;
170 w.
getT() * oneOverC);
175 if (pp.
mag2() == 0) {
179 "boostVector computed for LorentzVector with t=0 -- infinite result"));
185 "boostVector computed for a non-timelike LorentzVector "));
193 register double b2 = bbeta*bbeta;
196 "boost along X with beta >= 1 (speed of light) -- no boost done"));
198 register double ggamma = std::sqrt(1./(1-b2));
199 register double tt = ee;
200 ee = ggamma*(ee + bbeta*pp.
getX());
201 pp.
setX(ggamma*(pp.
getX() + bbeta*tt));
207 register double b2 = bbeta*bbeta;
210 "boost along Y with beta >= 1 (speed of light) -- \nno boost done"));
212 register double ggamma = std::sqrt(1./(1-b2));
213 register double tt = ee;
214 ee = ggamma*(ee + bbeta*pp.
getY());
215 pp.
setY(ggamma*(pp.
getY() + bbeta*tt));
221 register double b2 = bbeta*bbeta;
224 "boost along Z with beta >= 1 (speed of light) -- \nno boost done"));
226 register double ggamma = std::sqrt(1./(1-b2));
227 register double tt = ee;
228 ee = ggamma*(ee + bbeta*pp.
getZ());
229 pp.
setZ(ggamma*(pp.
getZ() + bbeta*tt));
236 double oldTolerance (tolerance);
246 double HepLorentzVector::tolerance =
248 double HepLorentzVector::metric = 1.0;
HepLorentzVector & rotateY(double)
double operator()(int) const
HepLorentzVector & rotateZ(double)
Hep3Vector & rotateY(double)
HepRotation and so forth isNear() norm2() rectify() static Rotation row1 row4(To avoid bloat in the code pulled in for programs which don 't use all these features, we split the implementation .cc files. Only isNear() goes into the original Rotation.cc) --------------------------------------- HepAxisAngle and HepEulerAngles classes --------------------------------------- These classes are very useful and simple structures for holding the result of a nice intuituve decomposition of a rotation there is no longer much content in the distinct ZOOM PhysicsVectors library The only content left in the library is the object files representing the various Exception objects When we build the CLHEP classes for the ZOOM we will set up so as to use ZOOM SpaceVector is(but we can disable namespace usage and most of our users do so at this point). What I do is leave Hep3Vector in the global namespace
Hep3Vector & rotateX(double)
HepLorentzVector operator/(const HepLorentzVector &, double a)
Hep3Vector & rotateUz(const Hep3Vector &)
HepLorentzVector & boostX(double beta)
Issues Concerning the PhysicsVectors CLHEP Vector Merge The merge of ZOOM PhysicsVdectors and the CLHEP Vector package is completed The purpose of this document is to list the major issues that affected the merge of these and where relevant describe the resolutions More detailed documents describe more minor issues General Approach As agreed at the June CLHEP the approach is to combine the features of each ZOOM class with the corresponding CLHEP class expanding the interface to create a single lingua franca of what a Hep3Vector(for example) means. We are not forming SpaceVector as an class derived from Hep3Vector and enhancing it in that way. Another rule imposed by the agreement is to avoid using the Exceptions package(even though that will later go into CLHEP for other uses). A desirable goal is to avoid cluttering the interface and enlarging the code linked in when ordinary CLHEP Vector functionallity is used. To this end
HepLorentzVector & boostY(double beta)
static double setTolerance(double tol)
HepLorentzVector & rotateX(double)
std::istream & operator>>(std::istream &is, HepAxisAngle &aa)
Hep3Vector boostVector() const
Hep3Vector & rotateZ(double)
HepLorentzVector & boost(double, double, double)
HepLorentzVector & boostZ(double beta)
HepLorentzVector & operator/=(double)
std::ostream & operator<<(std::ostream &os, const HepAxisAngle &aa)
any side effects of that construction would occur twice The semantics of throw x
it has advantages For I leave the ZMthrows but substitute I replaced ZMthrow with ZMthrowA in this package ZMthrowA
HepLorentzVector & rotateUz(const Hep3Vector &)
static double getTolerance()