10 #pragma implementation 
   13 #include "CLHEP/Vector/BoostZ.h" 
   14 #include "CLHEP/Vector/Boost.h" 
   15 #include "CLHEP/Vector/Rotation.h" 
   16 #include "CLHEP/Vector/LorentzRotation.h" 
   22 HepBoostZ & HepBoostZ::set (
double bbeta) {
 
   23   double b2 = bbeta*bbeta;
 
   25     std::cerr << 
"HepBoostZ::set() - " 
   26       << 
"Beta supplied to set HepBoostZ represents speed >= c." << std::endl;
 
   28     gamma_ = 1.0 / std::sqrt(1.0 - b2);
 
   32   gamma_ = 1.0 / std::sqrt(1.0 - b2);
 
   38 HepRep4x4 HepBoostZ::rep4x4()
 const {
 
   39   double bg = beta_*gamma_;
 
   40   return HepRep4x4(   1,      0,    0,    0,
 
   46 HepRep4x4Symmetric HepBoostZ::rep4x4Symmetric()
 const {
 
   47   double bg = beta_*gamma_;
 
   48   return HepRep4x4Symmetric(   1,      0,    0,    0,
 
   56 void HepBoostZ::decompose (HepRotation & rotation, HepBoost & boost)
 const {
 
   57   HepAxisAngle vdelta = HepAxisAngle();
 
   58   rotation = HepRotation(vdelta);
 
   59   Hep3Vector bbeta = boostVector();
 
   60   boost = HepBoost(bbeta);
 
   63 void HepBoostZ::decompose (HepAxisAngle & rotation, Hep3Vector & boost)
 const {
 
   64   rotation = HepAxisAngle();
 
   65   boost = boostVector();
 
   68 void HepBoostZ::decompose (HepBoost & boost, HepRotation & rotation)
 const {
 
   69   HepAxisAngle vdelta = HepAxisAngle();
 
   70   rotation = HepRotation(vdelta);
 
   71   Hep3Vector bbeta = boostVector();
 
   72   boost = HepBoost(bbeta);
 
   75 void HepBoostZ::decompose (Hep3Vector & boost, HepAxisAngle & rotation)
 const {
 
   76   rotation = HepAxisAngle();
 
   77   boost = boostVector();
 
   82 double HepBoostZ::distance2( 
const HepBoost & b )
 const {
 
   83   return b.distance2(*
this);
 
   86 double HepBoostZ::distance2( 
const HepRotation & r )
 const {
 
   88   double dr2  = r.norm2();
 
   92 double HepBoostZ::distance2( 
const HepLorentzRotation & lt )
 const {
 
   96   double db2 = distance2(b1);
 
   97   double dr2  = r1.norm2();
 
  101 bool HepBoostZ::isNear (
const HepRotation & r, 
double epsilon)
 const {
 
  102   double db2 = norm2();
 
  103   if (db2 > epsilon*epsilon) 
return false;
 
  104   double dr2  = r.norm2();
 
  105   return (db2+dr2 <= epsilon*epsilon);
 
  108 bool HepBoostZ::isNear ( 
const HepLorentzRotation & lt, 
 
  109                                         double epsilon  )
 const {
 
  112   double db2 = distance2(b1);
 
  114   if (db2 > epsilon*epsilon) 
return false;
 
  115   double dr2  = r1.norm2();
 
  121 void HepBoostZ::rectify() {
 
  126   double b2 = beta_*beta_;
 
  128     beta_ = 1.0 - 1.0e-8;                       
 
  131   gamma_ = 1.0 / std::sqrt(1.0 - b2);
 
  139   return HepBoostZ ( (beta()+b.beta()) / (1+beta()*b.beta()) );
 
  142   HepLorentzRotation me (*
this);
 
  146   HepLorentzRotation me (*
this);
 
  150   HepLorentzRotation me (*
this);
 
  157   os << 
"Boost in Z direction (beta = " << beta_ 
 
  158                         << 
", gamma = " << gamma_ << 
") ";
 
G4ErrorMatrix operator*(const G4ErrorMatrix &m1, const G4ErrorMatrix &m2)
 
void print(const std::vector< T > &data)