#ifndef ROOT_Math_GenVector_Boost
#define ROOT_Math_GenVector_Boost 1
#include "Math/GenVector/LorentzVector.h"
#include "Math/GenVector/PxPyPzE4D.h"
#include "Math/GenVector/DisplacementVector3D.h"
#include "Math/GenVector/Cartesian3D.h"
#include "Math/GenVector/BoostX.h"
#include "Math/GenVector/BoostY.h"
#include "Math/GenVector/BoostZ.h"
namespace ROOT {
namespace Math {
class Boost {
public:
typedef double Scalar;
enum ELorentzRotationMatrixIndex {
kLXX = 0, kLXY = 1, kLXZ = 2, kLXT = 3
, kLYX = 4, kLYY = 5, kLYZ = 6, kLYT = 7
, kLZX = 8, kLZY = 9, kLZZ = 10, kLZT = 11
, kLTX = 12, kLTY = 13, kLTZ = 14, kLTT = 15
};
enum EBoostMatrixIndex {
kXX = 0, kXY = 1, kXZ = 2, kXT = 3
, kYY = 4, kYZ = 5, kYT = 6
, kZZ = 7, kZT = 8
, kTT = 9
};
Boost() { SetIdentity(); }
Boost(Scalar beta_x, Scalar beta_y, Scalar beta_z)
{ SetComponents(beta_x, beta_y, beta_z); }
template <class Avector>
explicit
Boost(const Avector & beta) { SetComponents(beta); }
template<class IT>
Boost(IT begin, IT end) { SetComponents(begin,end); }
explicit Boost( BoostX const & bx ) {SetComponents(bx.BetaVector());}
explicit Boost( BoostY const & by ) {SetComponents(by.BetaVector());}
explicit Boost( BoostZ const & bz ) {SetComponents(bz.BetaVector());}
Boost &
operator=( BoostX const & bx ) { return operator=(Boost(bx)); }
Boost &
operator=( BoostY const & by ) { return operator=(Boost(by)); }
Boost &
operator=( BoostZ const & bz ) { return operator=(Boost(bz)); }
void Rectify();
void
SetComponents (Scalar beta_x, Scalar beta_y, Scalar beta_z);
void
GetComponents (Scalar& beta_x, Scalar& beta_y, Scalar& beta_z) const;
template <class Avector>
void
SetComponents (const Avector & beta)
{ SetComponents(beta.x(), beta.y(), beta.z()); }
template<class IT>
void SetComponents(IT begin, IT end) {
IT a = begin; IT b = ++begin; IT c = ++begin;
assert (++begin==end);
SetComponents (*a, *b, *c);
}
template<class IT>
void GetComponents(IT begin, IT end) const {
IT a = begin; IT b = ++begin; IT c = ++begin;
assert (++begin==end);
GetComponents (*a, *b, *c);
}
template<class IT>
void GetComponents(IT begin ) const {
double bx,by,bz = 0;
GetComponents (bx,by,bz);
*begin++ = bx;
*begin++ = by;
*begin = bz;
}
typedef DisplacementVector3D<Cartesian3D<double>, DefaultCoordinateSystemTag > XYZVector;
XYZVector BetaVector() const;
void
GetLorentzRotation (Scalar r[]) const;
LorentzVector< ROOT::Math::PxPyPzE4D<double> >
operator() (const LorentzVector< ROOT::Math::PxPyPzE4D<double> > & v) const;
template <class CoordSystem>
LorentzVector<CoordSystem>
operator() (const LorentzVector<CoordSystem> & v) const {
LorentzVector< PxPyPzE4D<double> > xyzt(v);
LorentzVector< PxPyPzE4D<double> > r_xyzt = operator()(xyzt);
return LorentzVector<CoordSystem> ( r_xyzt );
}
template <class Foreign4Vector>
Foreign4Vector
operator() (const Foreign4Vector & v) const {
LorentzVector< PxPyPzE4D<double> > xyzt(v);
LorentzVector< PxPyPzE4D<double> > r_xyzt = operator()(xyzt);
return Foreign4Vector ( r_xyzt.X(), r_xyzt.Y(), r_xyzt.Z(), r_xyzt.T() );
}
template <class A4Vector>
inline
A4Vector operator* (const A4Vector & v) const
{
return operator()(v);
}
void Invert();
Boost Inverse() const;
bool operator == (const Boost & rhs) const {
for (unsigned int i=0; i < 10; ++i) {
if( fM[i] != rhs.fM[i] ) return false;
}
return true;
}
bool operator != (const Boost & rhs) const {
return ! operator==(rhs);
}
protected:
void SetIdentity();
private:
Scalar fM[10];
};
std::ostream & operator<< (std::ostream & os, const Boost & b);
}
}
#endif /* ROOT_Math_GenVector_Boost */