+++ /dev/null
-// -*- C++ -*-
-// CLASSDOC OFF
-// $Id$
-// ---------------------------------------------------------------------------
-// CLASSDOC ON
-//
-// This file is a part of the CLHEP - a Class Library for High Energy Physics.
-//
-// HepLorentzVector is a Lorentz vector consisting of Hep3Vector and
-// HepDouble components. Lorentz transformations (rotations and boosts)
-// of these vectors are perfomed by multiplying with objects of
-// the HepLorenzRotation class.
-//
-// .SS See Also
-// ThreeVector.h, Rotation.h, LorentzRotation.h
-//
-// .SS Authors
-// Leif Lonnblad and Anders Nilsson. Modified by Evgueni Tcherniaev.
-//
-
-#ifndef HEP_LORENTZVECTOR_H
-#define HEP_LORENTZVECTOR_H
-
-#ifdef GNUPRAGMA
-#pragma interface
-#endif
-
-#include "CLHEP/config/CLHEP.h"
-#include "CLHEP/Vector/ThreeVector.h"
-#include "CLHEP/Vector/Rotation.h"
-
-#ifdef HEP_NO_INLINE_IN_DECLARATION
-#define inline
-#endif
-
-#include <iostream.h>
-class HepLorentzRotation;
-
-class HepLorentzVector {
-
-public:
-
- inline HepLorentzVector(HepDouble x = 0.0, HepDouble y = 0.0,
- HepDouble z = 0.0, HepDouble t = 0.0);
- // Constructor giving the components x, y, z, t.
-
- inline HepLorentzVector(const Hep3Vector &, HepDouble);
- // Constructor giving a 3-Vector and a time component.
-
- inline HepLorentzVector(const HepLorentzVector &);
- // Copy constructor.
-
- inline ~HepLorentzVector();
- // The destructor.
-
- inline operator Hep3Vector () const;
- inline operator Hep3Vector & ();
- // Conversion (cast) to Hep3Vector.
-
- inline HepDouble x() const;
- inline HepDouble y() const;
- inline HepDouble z() const;
- inline HepDouble t() const;
- // Get position and time.
-
- inline void setX(HepDouble);
- inline void setY(HepDouble);
- inline void setZ(HepDouble);
- inline void setT(HepDouble);
- // Set position and time.
-
- inline HepDouble px() const;
- inline HepDouble py() const;
- inline HepDouble pz() const;
- inline HepDouble e() const;
- // Get momentum and energy.
-
- inline void setPx(HepDouble);
- inline void setPy(HepDouble);
- inline void setPz(HepDouble);
- inline void setE(HepDouble);
- // Set momentum and energy.
-
- inline Hep3Vector vect() const;
- // Get spatial component.
-
- inline void setVect(const Hep3Vector &);
- // Set spatial component.
-
- inline HepDouble theta() const;
- inline HepDouble cosTheta() const;
- inline HepDouble phi() const;
- inline HepDouble rho() const;
- // Get spatial vector components in spherical coordinate system.
-
- inline void setTheta(HepDouble);
- inline void setPhi(HepDouble);
- inline void setRho(HepDouble);
- // Set spatial vector components in spherical coordinate system.
-
- inline HepDouble operator () (int) const;
- // Get components by index.
-
- inline HepLorentzVector & operator = (const HepLorentzVector &);
- // Assignment.
-
- inline HepLorentzVector operator + (const HepLorentzVector &) const;
- inline HepLorentzVector & operator += (const HepLorentzVector &);
- // Additions.
-
- inline HepLorentzVector operator - (const HepLorentzVector &) const;
- inline HepLorentzVector & operator -= (const HepLorentzVector &);
- // Subtractions.
-
- inline HepLorentzVector operator - () const;
- // Unary minus.
-
- inline HepBoolean operator == (const HepLorentzVector &) const;
- inline HepBoolean operator != (const HepLorentzVector &) const;
- // Comparisons.
-
- inline HepDouble perp2() const;
- // Transverse component of the spatial vector squared.
-
- inline HepDouble perp() const;
- // Transverse component of the spatial vector (R in cylindrical system).
-
- inline HepDouble perp2(const Hep3Vector &) const;
- // Transverse component of the spatial vector w.r.t. given axis squared.
-
- inline HepDouble perp(const Hep3Vector &) const;
- // Transverse component of the spatial vector w.r.t. given axis.
-
- inline HepDouble angle(const Hep3Vector &) const;
- // Angle wrt. another vector.
-
- inline HepDouble mag2() const;
- inline HepDouble m2() const;
- // Invariant mass squared.
-
- inline HepDouble mag() const;
- inline HepDouble m() const;
- // Invariant mass. If mag2() is negative then -sqrt(-mag2()) is returned.
-
- inline HepDouble dot(const HepLorentzVector &) const;
- inline HepDouble operator * (const HepLorentzVector &) const;
- // Scalar product.
-
- inline HepDouble plus() const;
- inline HepDouble minus() const;
- // Returns the positive/negative light-cone component t +/- z.
-
-
- inline Hep3Vector boostVector() const ;
- // Returns the spatial components divided by the time component.
-
- void boost(HepDouble, HepDouble, HepDouble);
- inline void boost(const Hep3Vector &);
- // Lorentz boost.
-
- inline void rotateX(HepDouble);
- // Rotate the spatial component around the x-axis.
-
- inline void rotateY(HepDouble);
- // Rotate the spatial component around the y-axis.
-
- inline void rotateZ(HepDouble);
- // Rotate the spatial component around the z-axis.
-
- inline void rotateUz(Hep3Vector &);
- // Rotates the reference frame from Uz to newUz (unit vector).
-
- inline void rotate(HepDouble, const Hep3Vector &);
- // Rotate the spatial component around specified axis.
-
- inline HepLorentzVector & operator *= (const HepRotation &);
- inline HepLorentzVector & transform(const HepRotation &);
- // Transformation with HepRotation.
-
- HepLorentzVector & operator *= (const HepLorentzRotation &);
- HepLorentzVector & transform(const HepLorentzRotation &);
- // Transformation with HepLorenzRotation.
-
-private:
-
- Hep3Vector pp;
- HepDouble ee;
-
-};
-
-ostream & operator << (ostream &, const HepLorentzVector &);
-// Output to a stream.
-
-#ifdef HEP_NO_INLINE_IN_DECLARATION
-#undef inline
-#endif
-
-#ifdef HEP_SHORT_NAMES
-typedef HepLorentzVector VectorL;
-typedef HepLorentzVector Vector4;
-typedef HepLorentzVector DVectorL;
-typedef HepLorentzVector DVector4;
-typedef HepLorentzVector FVectorL;
-typedef HepLorentzVector FVector4;
-#endif
-
-typedef HepLorentzVector HepLorentzVectorD;
-typedef HepLorentzVector HepLorentzVectorF;
-
-#ifndef HEP_DEBUG_INLINE
-#include "CLHEP/Vector/LorentzVector.icc"
-#endif
-
-#endif /* HEP_LORENTZVECTOR_H */
+++ /dev/null
-// -*- C++ -*-
-// $Id$
-// ---------------------------------------------------------------------------
-//
-// This file is a part of the CLHEP - a Class Library for High Energy Physics.
-//
-// This is the definitions of the inline member functions of the
-// HepLorentzVector class.
-//
-
-#ifdef HEP_DEBUG_INLINE
-#define inline
-#endif
-
-inline HepDouble HepLorentzVector::x() const { return pp.x(); }
-inline HepDouble HepLorentzVector::y() const { return pp.y(); }
-inline HepDouble HepLorentzVector::z() const { return pp.z(); }
-inline HepDouble HepLorentzVector::t() const { return ee; }
-
-inline HepLorentzVector::
-HepLorentzVector(HepDouble x, HepDouble y, HepDouble z, HepDouble t)
- : pp(x, y, z), ee(t) {}
-
-inline HepLorentzVector::HepLorentzVector(const Hep3Vector & p, HepDouble e)
- : pp(p), ee(e) {}
-
-inline HepLorentzVector::HepLorentzVector(const HepLorentzVector & p)
- : pp(p.x(), p.y(), p.z()), ee(p.t()) {}
-
-inline HepLorentzVector::~HepLorentzVector() {}
-
-inline HepLorentzVector::operator Hep3Vector () const { return pp; }
-inline HepLorentzVector::operator Hep3Vector & () { return pp; }
-
-inline void HepLorentzVector::setX(HepDouble a) { pp.setX(a); }
-inline void HepLorentzVector::setY(HepDouble a) { pp.setY(a); }
-inline void HepLorentzVector::setZ(HepDouble a) { pp.setZ(a); }
-inline void HepLorentzVector::setT(HepDouble a) { ee = a;}
-
-inline HepDouble HepLorentzVector::px() const { return pp.x(); }
-inline HepDouble HepLorentzVector::py() const { return pp.y(); }
-inline HepDouble HepLorentzVector::pz() const { return pp.z(); }
-inline HepDouble HepLorentzVector::e() const { return ee; }
-
-inline void HepLorentzVector::setPx(HepDouble a) { pp.setX(a); }
-inline void HepLorentzVector::setPy(HepDouble a) { pp.setY(a); }
-inline void HepLorentzVector::setPz(HepDouble a) { pp.setZ(a); }
-inline void HepLorentzVector::setE(HepDouble a) { ee = a;}
-
-inline Hep3Vector HepLorentzVector::vect() const { return pp; }
-inline void HepLorentzVector::setVect(const Hep3Vector &p) { pp = p; }
-
-inline HepDouble HepLorentzVector::theta() const { return pp.theta(); }
-inline HepDouble HepLorentzVector::cosTheta() const { return pp.cosTheta(); }
-inline HepDouble HepLorentzVector::phi() const { return pp.phi(); }
-inline HepDouble HepLorentzVector::rho() const { return pp.mag(); }
-
-inline void HepLorentzVector::setTheta(HepDouble a) { pp.setTheta(a); }
-inline void HepLorentzVector::setPhi(HepDouble a) { pp.setPhi(a); }
-inline void HepLorentzVector::setRho(HepDouble a) { pp.setMag(a); }
-
-inline HepDouble HepLorentzVector::operator () (int i) const {
- if (i==3) { return ee; } else { return pp(i); }
-}
-
-inline HepLorentzVector &
-HepLorentzVector::operator = (const HepLorentzVector & q) {
- pp = q.vect();
- ee = q.t();
- return *this;
-}
-
-inline HepLorentzVector
-HepLorentzVector::operator + (const HepLorentzVector & q) const {
- return HepLorentzVector(x()+q.x(), y()+q.y(), z()+q.z(), t()+q.t());
-}
-
-inline HepLorentzVector &
-HepLorentzVector::operator += (const HepLorentzVector & q) {
- pp += q.vect();
- ee += q.t();
- return *this;
-}
-
-inline HepLorentzVector
-HepLorentzVector::operator - (const HepLorentzVector & q) const {
- return HepLorentzVector(x()-q.x(), y()-q.y(), z()-q.z(), t()-q.t());
-}
-
-inline HepLorentzVector &
-HepLorentzVector::operator -= (const HepLorentzVector & q) {
- pp -= q.vect();
- ee -= q.t();
- return *this;
-}
-
-inline HepLorentzVector HepLorentzVector::operator - () const {
- return HepLorentzVector(-x(), -y(), -z(), -t());
-}
-
-inline HepBoolean
-HepLorentzVector::operator == (const HepLorentzVector & q) const {
- return (vect()==q.vect() && t()==q.t());
-}
-
-inline HepBoolean
-HepLorentzVector::operator != (const HepLorentzVector & q) const {
- return (vect()!=q.vect() || t()!=q.t());
-}
-
-inline HepDouble HepLorentzVector::perp2() const {
- return pp.perp2();
-}
-
-inline HepDouble HepLorentzVector::perp() const {
- return pp.perp();
-}
-
-inline HepDouble HepLorentzVector::perp2(const Hep3Vector &v) const {
- return pp.perp2(v);
-}
-
-inline HepDouble HepLorentzVector::perp(const Hep3Vector &v) const {
- return pp.perp(v);
-}
-
-inline HepDouble HepLorentzVector::angle(const Hep3Vector &v) const {
- return pp.angle(v);
-}
-
-inline HepDouble HepLorentzVector::mag2() const {
- return t()*t() - pp.mag2();
-}
-
-inline HepDouble HepLorentzVector::mag() const {
- HepDouble mm = mag2();
- return mm < 0.0 ? -sqrt(-mm) : sqrt(mm);
-}
-
-inline HepDouble HepLorentzVector::m2() const { return mag2(); }
-inline HepDouble HepLorentzVector::m() const { return mag(); }
-
-
-inline HepDouble HepLorentzVector::dot(const HepLorentzVector & q) const {
- return t()*q.t() - z()*q.z() - y()*q.y() - x()*q.x();
-}
-
-inline HepDouble
-HepLorentzVector::operator * (const HepLorentzVector & q) const {
- return dot(q);
-}
-
-inline HepDouble HepLorentzVector::plus() const {
- return t() + z();
-}
-
-inline HepDouble HepLorentzVector::minus() const {
- return t() - z();
-}
-
-inline Hep3Vector HepLorentzVector::boostVector() const {
- return Hep3Vector(x()/t(), y()/t(), z()/t());
-}
-
-inline void HepLorentzVector::boost(const Hep3Vector & b){
- boost(b.x(), b.y(), b.z());
-}
-
-inline void HepLorentzVector::rotateX(HepDouble a) { pp.rotateX(a); }
-inline void HepLorentzVector::rotateY(HepDouble a) { pp.rotateY(a); }
-inline void HepLorentzVector::rotateZ(HepDouble a) { pp.rotateZ(a); }
-inline void HepLorentzVector::rotateUz(Hep3Vector &v) { pp.rotateUz(v); }
-inline void HepLorentzVector::rotate(HepDouble a, const Hep3Vector &v) {
- pp.rotate(a,v);
-}
-
-inline HepLorentzVector &
-HepLorentzVector::operator *= (const HepRotation & m) {
- pp *= m;
- return *this;
-}
-
-inline HepLorentzVector &
-HepLorentzVector::transform(const HepRotation & m) {
- pp.transform(m);
- return *this;
-}
-
-#ifdef HEP_DEBUG_INLINE
-#undef inline
-#endif
+++ /dev/null
-// -*- C++ -*-
-// CLASSDOC OFF
-// $Id$
-// ---------------------------------------------------------------------------
-// CLASSDOC ON
-//
-// This file is a part of the CLHEP - a Class Library for High Energy Physics.
-//
-// This is the definition of the HepRotation class for performing rotations
-// on objects of the Hep3Vector class.
-//
-// .SS See Also
-// ThreeVector.h, LorentzVector.h, LorentzRotation.h
-//
-// .SS Author
-// Leif Lonnblad
-
-#ifndef HEP_ROTATION_H
-#define HEP_ROTATION_H
-
-#ifdef GNUPRAGMA
-#pragma interface
-#endif
-
-#include "CLHEP/config/CLHEP.h"
-#include "CLHEP/Vector/ThreeVector.h"
-
-#ifdef HEP_NO_INLINE_IN_DECLARATION
-#define inline
-#endif
-
-class HepRotation {
-
-public:
-
- inline HepRotation();
- // Default constructor. Gives a unit matrix.
-
- inline HepRotation(const HepRotation &);
- // Copy constructor.
-
- inline HepDouble xx() const;
- inline HepDouble xy() const;
- inline HepDouble xz() const;
- inline HepDouble yx() const;
- inline HepDouble yy() const;
- inline HepDouble yz() const;
- inline HepDouble zx() const;
- inline HepDouble zy() const;
- inline HepDouble zz() const;
- // Elements of the rotation matrix (Geant4).
-
- HepDouble operator () (int, int) const;
- // Returns (i,j) element of the rotation matrix.
-
- inline HepRotation & operator = (const HepRotation &);
- // Assignment.
-
- inline HepBoolean operator == (const HepRotation &) const;
- inline HepBoolean operator != (const HepRotation &) const;
- // Comparisons (Geant4).
-
- inline HepBoolean isIdentity() const;
- // Returns true if the identity matrix (Geant4).
-
- inline Hep3Vector operator * (const Hep3Vector &) const;
- // Multiplication with a Hep3Vector.
-
- HepRotation operator * (const HepRotation &) const;
- inline HepRotation & operator *= (const HepRotation &);
- inline HepRotation & transform(const HepRotation &);
- // Matrix multiplication.
- // Note a *= b; <=> a = a * b; while a.transform(b); <=> a = b * a;
-
- inline HepRotation inverse() const;
- // Returns the inverse.
-
- inline HepRotation & invert();
- // Inverts the Rotation matrix.
-
- HepRotation & rotateX(HepDouble);
- // Rotation around the x-axis.
-
- HepRotation & rotateY(HepDouble);
- // Rotation around the y-axis.
-
- HepRotation & rotateZ(HepDouble);
- // Rotation around the z-axis.
-
- HepRotation & rotate(HepDouble, const Hep3Vector &);
- inline HepRotation & rotate(HepDouble, const Hep3Vector *);
- // Rotation around a specified vector.
-
- HepRotation & rotateAxes(const Hep3Vector & newX,
- const Hep3Vector & newY,
- const Hep3Vector & newZ);
- // Rotation of local axes (Geant4).
-
- HepDouble phiX() const;
- HepDouble phiY() const;
- HepDouble phiZ() const;
- HepDouble thetaX() const;
- HepDouble thetaY() const;
- HepDouble thetaZ() const;
- // Return angles (RADS) made by rotated axes against original axes (Geant4).
-
- void getAngleAxis(HepDouble &, Hep3Vector &) const;
- // Returns the rotation angle and rotation axis (Geant4).
-
-protected:
-
- inline HepRotation(HepDouble, HepDouble, HepDouble, HepDouble, HepDouble,
- HepDouble, HepDouble, HepDouble, HepDouble);
- // Protected constructor.
-
- HepDouble rxx, rxy, rxz, ryx, ryy, ryz, rzx, rzy, rzz;
- // The matrix elements.
-};
-
-#ifdef HEP_NO_INLINE_IN_DECLARATION
-#undef inline
-#endif
-
-#ifdef HEP_SHORT_NAMES
-typedef HepRotation Rotation;
-#endif
-
-#ifndef HEP_DEBUG_INLINE
-#include "CLHEP/Vector/Rotation.icc"
-#endif
-
-#endif /* HEP_ROTATION_H */
-
+++ /dev/null
-// -*- C++ -*-
-// $Id$
-// ---------------------------------------------------------------------------
-//
-// This file is a part of the CLHEP - a Class Library for High Energy Physics.
-//
-// This is the definitions of the inline member functions of the
-// HepRotation class
-//
-
-#ifdef HEP_DEBUG_INLINE
-#define inline
-#endif
-
-inline HepRotation::HepRotation()
-: rxx(1.0), rxy(0.0), rxz(0.0), ryx(0.0), ryy(1.0), ryz(0.0),
- rzx(0.0), rzy(0.0), rzz(1.0) {}
-
-inline HepRotation::HepRotation(const HepRotation & m)
-: rxx(m.rxx), rxy(m.rxy), rxz(m.rxz), ryx(m.ryx), ryy(m.ryy), ryz(m.ryz),
- rzx(m.rzx), rzy(m.rzy), rzz(m.rzz) {}
-
-inline HepRotation::HepRotation(HepDouble mxx, HepDouble mxy, HepDouble mxz,
- HepDouble myx, HepDouble myy, HepDouble myz,
- HepDouble mzx, HepDouble mzy, HepDouble mzz)
-: rxx(mxx), rxy(mxy), rxz(mxz), ryx(myx), ryy(myy), ryz(myz),
- rzx(mzx), rzy(mzy), rzz(mzz) {}
-
-inline HepDouble HepRotation::xx() const { return rxx; }
-inline HepDouble HepRotation::xy() const { return rxy; }
-inline HepDouble HepRotation::xz() const { return rxz; }
-inline HepDouble HepRotation::yx() const { return ryx; }
-inline HepDouble HepRotation::yy() const { return ryy; }
-inline HepDouble HepRotation::yz() const { return ryz; }
-inline HepDouble HepRotation::zx() const { return rzx; }
-inline HepDouble HepRotation::zy() const { return rzy; }
-inline HepDouble HepRotation::zz() const { return rzz; }
-
-inline HepRotation & HepRotation::operator = (const HepRotation & m) {
- rxx = m.rxx;
- rxy = m.rxy;
- rxz = m.rxz;
- ryx = m.ryx;
- ryy = m.ryy;
- ryz = m.ryz;
- rzx = m.rzx;
- rzy = m.rzy;
- rzz = m.rzz;
- return *this;
-}
-
-inline HepBoolean HepRotation::operator == (const HepRotation& m) const {
- return (rxx == m.rxx && rxy == m.rxy && rxz == m.rxz &&
- ryx == m.ryx && ryy == m.ryy && ryz == m.ryz &&
- rzx == m.rzx && rzy == m.rzy && rzz == m.rzz) ? true : false;
-}
-
-inline HepBoolean HepRotation::operator != (const HepRotation &m) const {
- return (rxx != m.rxx || rxy != m.rxy || rxz != m.rxz ||
- ryx != m.ryx || ryy != m.ryy || ryz != m.ryz ||
- rzx != m.rzx || rzy != m.rzy || rzz != m.rzz) ? true : false;
-}
-
-inline HepBoolean HepRotation::isIdentity() const {
- return (rxx == 1.0 && rxy == 0.0 && rxz == 0.0 &&
- ryx == 0.0 && ryy == 1.0 && ryz == 0.0 &&
- rzx == 0.0 && rzy == 0.0 && rzz == 1.0) ? true : false;
-}
-
-inline Hep3Vector HepRotation::operator * (const Hep3Vector & p) const {
- return Hep3Vector(rxx*p.x() + rxy*p.y() + rxz*p.z(),
- ryx*p.x() + ryy*p.y() + ryz*p.z(),
- rzx*p.x() + rzy*p.y() + rzz*p.z());
-}
-
-inline HepRotation & HepRotation::operator *= (const HepRotation & m) {
- return *this = operator * (m);
-}
-
-inline HepRotation & HepRotation::transform(const HepRotation & m) {
- return *this = m.operator * (*this);
-}
-
-inline HepRotation HepRotation::inverse() const {
- return HepRotation(rxx, ryx, rzx, rxy, ryy, rzy, rxz, ryz, rzz);
-}
-
-inline HepRotation & HepRotation::invert() {
- return *this=inverse();
-}
-
-inline HepRotation & HepRotation::rotate(HepDouble psi, const Hep3Vector * p) {
- return rotate(psi, *p);
-}
-
-#ifdef HEP_DEBUG_INLINE
-#undef inline
-#endif
+++ /dev/null
-// -*- C++ -*-
-// CLASSDOC OFF
-// $Id$
-// ---------------------------------------------------------------------------
-// CLASSDOC ON
-//
-// This file is a part of the CLHEP - a Class Library for High Energy Physics.
-//
-// Hep3Vector is a general 3-vector class defining vectors in three
-// dimension using HepDouble components. Rotations of these vectors are
-// performed by multiplying with an object of the HepRotation class.
-//
-// .SS See Also
-// LorentzVector.h, Rotation.h, LorentzRotation.h
-//
-// .SS Authors
-// Leif Lonnblad and Anders Nilsson.
-//
-
-#ifndef HEP_THREEVECTOR_H
-#define HEP_THREEVECTOR_H
-
-#ifdef GNUPRAGMA
-#pragma interface
-#endif
-
-#include "CLHEP/config/CLHEP.h"
-
-#ifdef HEP_NO_INLINE_IN_DECLARATION
-#define inline
-#endif
-
-#include <iostream.h>
-class HepRotation;
-
-class Hep3Vector {
-
-public:
-
- inline Hep3Vector(HepDouble x = 0.0, HepDouble y = 0.0, HepDouble z = 0.0);
- // The constructor.
-
- inline Hep3Vector(const Hep3Vector &);
- // The copy constructor.
-
- inline ~Hep3Vector();
- // The destructor.
-
- inline HepDouble x() const;
- inline HepDouble y() const;
- inline HepDouble z() const;
- // The components in cartesian coordinate system.
-
- HepDouble operator () (int) const;
- // Get components by index (Geant4).
-
- inline void setX(HepDouble);
- inline void setY(HepDouble);
- inline void setZ(HepDouble);
- // Set the components in cartesian coordinate system.
-
- inline HepDouble phi() const;
- // The azimuth angle.
-
- inline HepDouble theta() const;
- // The polar angle.
-
- inline HepDouble cosTheta() const;
- // Cosine of the polar angle.
-
- inline HepDouble mag2() const;
- // The magnitude squared (rho^2 in spherical coordinate system).
-
- inline HepDouble mag() const;
- // The magnitude (rho in spherical coordinate system).
-
- inline void setPhi(HepDouble);
- // Set phi keeping mag and theta constant (BaBar).
-
- inline void setTheta(HepDouble);
- // Set theta keeping mag and phi constant (BaBar).
-
- inline void setMag(HepDouble);
- // Set magnitude keeping theta and phi constant (BaBar).
-
- inline HepDouble perp2() const;
- // The transverse component squared (R^2 in cylindrical coordinate system).
-
- inline HepDouble perp() const;
- // The transverse component (R in cylindrical coordinate system).
-
- inline HepDouble perp2(const Hep3Vector &) const;
- // The transverse component w.r.t. given axis squared.
-
- inline HepDouble perp(const Hep3Vector &) const;
- // The transverse component w.r.t. given axis.
-
- inline Hep3Vector & operator = (const Hep3Vector &);
- // Assignment.
-
- inline HepBoolean operator == (const Hep3Vector &) const;
- inline HepBoolean operator != (const Hep3Vector &) const;
- // Comparisons (Geant4).
-
- inline Hep3Vector & operator += (const Hep3Vector &);
- // Addition.
-
- inline Hep3Vector & operator -= (const Hep3Vector &);
- // Subtraction.
-
- inline Hep3Vector operator - () const;
- // Unary minus.
-
- inline Hep3Vector & operator *= (HepDouble);
- // Scaling with real numbers.
-
- inline Hep3Vector unit() const;
- // Unit vector parallel to this.
-
- inline Hep3Vector orthogonal() const;
- // Vector orthogonal to this (Geant4).
-
- inline HepDouble dot(const Hep3Vector &) const;
- // Scalar product.
-
- inline Hep3Vector cross(const Hep3Vector &) const;
- // Cross product.
-
- inline HepDouble angle(const Hep3Vector &) const;
- // The angle w.r.t. another 3-vector.
-
- void rotateX(HepDouble);
- // Rotates the Hep3Vector around the x-axis.
-
- void rotateY(HepDouble);
- // Rotates the Hep3Vector around the y-axis.
-
- void rotateZ(HepDouble);
- // Rotates the Hep3Vector around the z-axis.
-
- void rotateUz(Hep3Vector&);
- // Rotates reference frame from Uz to newUz (unit vector) (Geant4).
-
- void rotate(HepDouble, const Hep3Vector &);
- // Rotates around the axis specified by another Hep3Vector.
-
- Hep3Vector & operator *= (const HepRotation &);
- Hep3Vector & transform(const HepRotation &);
- // Transformation with a Rotation matrix.
-
-private:
-
- HepDouble dx, dy, dz;
- // The components.
-};
-
-#ifdef HEP_NO_INLINE_IN_DECLARATION
-#undef inline
-#endif
-
-ostream & operator << (ostream &, const Hep3Vector &);
-// Output to a stream.
-
-extern const Hep3Vector HepXHat, HepYHat, HepZHat;
-
-#ifdef HEP_SHORT_NAMES
-typedef Hep3Vector Vector3;
-typedef Hep3Vector DVector3;
-typedef Hep3Vector FVector3;
-static const Hep3Vector & xhat = HepXHat;
-static const Hep3Vector & yhat = HepYHat;
-static const Hep3Vector & zhat = HepZHat;
-#endif
-typedef Hep3Vector HepThreeVectorD;
-typedef Hep3Vector HepThreeVectorF;
-
-#ifdef HEP_DEBUG_INLINE
-
-Hep3Vector operator + (const Hep3Vector &, const Hep3Vector &);
-// Addition of 3-vectors.
-
-Hep3Vector operator - (const Hep3Vector &, const Hep3Vector &);
-// Subtraction of 3-vectors.
-
-HepDouble operator * (const Hep3Vector &, const Hep3Vector &);
-// Scalar product of 3-vectors.
-
-Hep3Vector operator * (const Hep3Vector &, HepDouble a);
-Hep3Vector operator * (HepDouble a, const Hep3Vector &);
-// Scaling of 3-vectors with a real number
-
-#else
-#include "CLHEP/Vector/ThreeVector.icc"
-#endif
-
-#endif /* HEP_THREEVECTOR_H */
+++ /dev/null
-// -*- C++ -*-
-// $Id$
-// ---------------------------------------------------------------------------
-//
-// This file is a part of the CLHEP - a Class Library for High Energy Physics.
-//
-// This is the definitions of the inline member functions of the
-// Hep3Vector class.
-//
-
-#ifdef HEP_DEBUG_INLINE
-#define inline
-#endif
-
-inline Hep3Vector::Hep3Vector(HepDouble x, HepDouble y, HepDouble z)
-: dx(x), dy(y), dz(z) {}
-
-inline HepDouble Hep3Vector::x() const {
- return dx;
-}
-
-inline HepDouble Hep3Vector::y() const {
- return dy;
-}
-
-inline HepDouble Hep3Vector::z() const {
- return dz;
-}
-
-inline void Hep3Vector::setX(HepDouble x) {
- dx = x;
-}
-
-inline void Hep3Vector::setY(HepDouble y) {
- dy = y;
-}
-
-inline void Hep3Vector::setZ(HepDouble z) {
- dz = z;
-}
-
-inline Hep3Vector::Hep3Vector(const Hep3Vector & p)
-: dx(p.x()), dy(p.y()), dz(p.z()) {}
-
-inline Hep3Vector::~Hep3Vector() {}
-
-inline Hep3Vector & Hep3Vector::operator = (const Hep3Vector & p) {
- dx = p.x();
- dy = p.y();
- dz = p.z();
- return *this;
-}
-
-inline HepBoolean Hep3Vector::operator == (const Hep3Vector& v) const {
- return (v.x()==x() && v.y()==y() && v.z()==z()) ? true : false;
-}
-
-inline HepBoolean Hep3Vector::operator != (const Hep3Vector& v) const {
- return (v.x()!=x() || v.y()!=y() || v.z()!=z()) ? true : false;
-}
-
-inline Hep3Vector& Hep3Vector::operator += (const Hep3Vector & p) {
- dx += p.x();
- dy += p.y();
- dz += p.z();
- return *this;
-}
-
-inline Hep3Vector& Hep3Vector::operator -= (const Hep3Vector & p) {
- dx -= p.x();
- dy -= p.y();
- dz -= p.z();
- return *this;
-}
-
-inline Hep3Vector Hep3Vector::operator - () const {
- return Hep3Vector(-dx, -dy, -dz);
-}
-
-inline Hep3Vector& Hep3Vector::operator *= (HepDouble a) {
- dx *= a;
- dy *= a;
- dz *= a;
- return *this;
-}
-
-inline HepDouble Hep3Vector::dot(const Hep3Vector & p) const {
- return dx*p.x() + dy*p.y() + dz*p.z();
-}
-
-inline Hep3Vector Hep3Vector::cross(const Hep3Vector & p) const {
- return Hep3Vector(dy*p.z()-p.y()*dz, dz*p.x()-p.z()*dx, dx*p.y()-p.x()*dy);
-}
-
-inline HepDouble Hep3Vector::mag2() const {
- return dx*dx + dy*dy + dz*dz;
-}
-
-inline HepDouble Hep3Vector::mag() const {
- return sqrt(mag2());
-}
-
-inline Hep3Vector Hep3Vector::unit() const {
- HepDouble tot = mag2();
- Hep3Vector p(*this);
- return tot > 0.0 ? p *= (1.0/sqrt(tot)) : p;
-}
-
-inline Hep3Vector Hep3Vector::orthogonal() const {
- HepDouble x = abs(dx), y = abs(dy), z = abs(dz);
- if (x < y) {
- return x < z ? Hep3Vector(0,dz,-dy) : Hep3Vector(dy,-dx,0);
- }else{
- return y < z ? Hep3Vector(-dz,0,dx) : Hep3Vector(dy,-dx,0);
- }
-}
-
-inline HepDouble Hep3Vector::perp2() const {
- return dx*dx + dy*dy;
-}
-
-inline HepDouble Hep3Vector::perp() const {
- return sqrt(perp2());
-}
-
-inline HepDouble Hep3Vector::perp2(const Hep3Vector & p) const {
- HepDouble tot = p.mag2();
- return tot > 0.0 ? mag2()-sqr(dot(p))/tot : mag2();
-}
-
-inline HepDouble Hep3Vector::perp(const Hep3Vector & p) const {
- return sqrt(perp2(p));
-}
-
-inline HepDouble Hep3Vector::phi() const {
- return dx == 0.0 && dy == 0.0 ? 0.0 : atan2(dy,dx);
-}
-
-inline HepDouble Hep3Vector::theta() const {
- return dx == 0.0 && dy == 0.0 && dz == 0.0 ? 0.0 : atan2(perp(),dz);
-}
-
-inline HepDouble Hep3Vector::cosTheta() const {
- HepDouble ptot = mag();
- return ptot == 0.0 ? 1.0 : dz/ptot;
-}
-
-inline HepDouble Hep3Vector::angle(const Hep3Vector & q) const {
- HepDouble ptot2 = mag2()*q.mag2();
- return ptot2 <= 0.0 ? 0.0 : acos(dot(q)/sqrt(ptot2));
-}
-
-inline void Hep3Vector::setMag(HepDouble ma){
- HepDouble th = theta();
- HepDouble ph = phi();
-
- setX(ma*sin(th)*cos(ph));
- setY(ma*sin(th)*sin(ph));
- setZ(ma*cos(th));
-}
-
-inline void Hep3Vector::setTheta(HepDouble th){
- HepDouble ma = mag();
- HepDouble ph = phi();
-
- setX(ma*sin(th)*cos(ph));
- setY(ma*sin(th)*sin(ph));
- setZ(ma*cos(th));
-}
-
-inline void Hep3Vector::setPhi(HepDouble ph){
- HepDouble ma = mag();
- HepDouble th = theta();
-
- setX(ma*sin(th)*cos(ph));
- setY(ma*sin(th)*sin(ph));
- setZ(ma*cos(th));
-}
-
-inline Hep3Vector operator + (const Hep3Vector & a, const Hep3Vector & b) {
- return Hep3Vector(a.x() + b.x(), a.y() + b.y(), a.z() + b.z());
-}
-
-inline Hep3Vector operator - (const Hep3Vector & a, const Hep3Vector & b) {
- return Hep3Vector(a.x() - b.x(), a.y() - b.y(), a.z() - b.z());
-}
-
-inline Hep3Vector operator * (const Hep3Vector & p, HepDouble a) {
- return Hep3Vector(a*p.x(), a*p.y(), a*p.z());
-}
-
-inline Hep3Vector operator * (HepDouble a, const Hep3Vector & p) {
- return Hep3Vector(a*p.x(), a*p.y(), a*p.z());
-}
-
-inline HepDouble operator * (const Hep3Vector & a, const Hep3Vector & b) {
- return a.dot(b);
-}
-
-#ifdef HEP_DEBUG_INLINE
-#undef inline
-#endif