Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:39

0001 // -*- C++ -*-
0002 // ---------------------------------------------------------------------------
0003 //
0004 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
0005 // 
0006 // This is the definitions of the inline member functions of the
0007 // HepBoostY class
0008 //
0009 
0010 #include <cmath>
0011 
0012 namespace CLHEP  {
0013 
0014 // ----------  Constructors and Assignment:
0015 
0016 inline HepBoostY::HepBoostY() : beta_(0.0), gamma_(1.0) {}
0017 
0018 inline HepBoostY::HepBoostY(const HepBoostY & b) : 
0019     beta_ (b.beta_), 
0020     gamma_(b.gamma_) {}
0021 
0022 inline HepBoostY & HepBoostY::operator = (const HepBoostY & b) { 
0023   beta_  = b.beta_; 
0024   gamma_ = b.gamma_;
0025   return *this;
0026 }
0027 
0028 inline HepBoostY::HepBoostY(double bbeta) { set(bbeta); }
0029 
0030 // - Protected method:
0031 inline HepBoostY::HepBoostY( double bbeta, double ggamma ) :
0032                                         beta_(bbeta), gamma_(ggamma) {}
0033 
0034 // ----------  Accessors:
0035 
0036 inline double  HepBoostY::beta() const {   
0037   return beta_;
0038 }
0039 
0040 inline double  HepBoostY::gamma() const {
0041   return gamma_;
0042 }
0043 
0044 inline Hep3Vector HepBoostY::boostVector() const { 
0045   return  Hep3Vector( 0, beta_, 0 );
0046 }
0047 
0048 inline Hep3Vector HepBoostY::getDirection() const { 
0049   return  Hep3Vector( 0.0, 1.0, 0.0 );
0050 }
0051 
0052 inline double HepBoostY::xx() const { return 1.0;}
0053 inline double HepBoostY::xy() const { return 0.0;}
0054 inline double HepBoostY::xz() const { return 0.0;}
0055 inline double HepBoostY::xt() const { return 0.0;}
0056 inline double HepBoostY::yx() const { return 0.0;}
0057 inline double HepBoostY::yy() const { return gamma();}
0058 inline double HepBoostY::yz() const { return 0.0;}
0059 inline double HepBoostY::yt() const { return beta()*gamma();}
0060 inline double HepBoostY::zx() const { return 0.0;}
0061 inline double HepBoostY::zy() const { return 0.0;}
0062 inline double HepBoostY::zz() const { return 1.0;}
0063 inline double HepBoostY::zt() const { return 0.0;}
0064 inline double HepBoostY::tx() const { return 0.0;}
0065 inline double HepBoostY::ty() const { return beta()*gamma();}
0066 inline double HepBoostY::tz() const { return 0.0;}
0067 inline double HepBoostY::tt() const { return gamma();}
0068 
0069 inline HepLorentzVector HepBoostY::col1() const {
0070   return HepLorentzVector ( 1, 0, 0, 0 );
0071 }
0072 inline HepLorentzVector HepBoostY::col2() const {
0073   return HepLorentzVector ( 0, gamma(), 0, beta()*gamma() );
0074 }
0075 inline HepLorentzVector HepBoostY::col3() const {
0076   return HepLorentzVector ( 0, 0, 1, 0 );
0077 }
0078 inline HepLorentzVector HepBoostY::col4() const {
0079   return HepLorentzVector ( 0, beta()*gamma(), 0, gamma() );
0080 }
0081 
0082 inline HepLorentzVector HepBoostY::row1() const {
0083   return HepLorentzVector ( col1() );
0084 }
0085 inline HepLorentzVector HepBoostY::row2() const {
0086   return HepLorentzVector ( col2() );
0087 }
0088 inline HepLorentzVector HepBoostY::row3() const {
0089   return HepLorentzVector ( col3() );
0090 }
0091 inline HepLorentzVector HepBoostY::row4() const {
0092   return HepLorentzVector ( col4() );
0093 }
0094 
0095 // ----------  Comparisons:
0096 
0097 inline int HepBoostY::compare( const HepBoostY & b ) const {
0098   if (beta() < b.beta()) {
0099     return -1;
0100   } else if (beta() > b.beta()) {
0101     return 1;
0102   } else {
0103     return 0;
0104   }
0105 }
0106 
0107 inline bool HepBoostY::operator == ( const HepBoostY & b ) const {
0108   return beta_ == b.beta_;
0109 }
0110 inline bool HepBoostY::operator != ( const HepBoostY & b ) const {
0111   return beta_ != b.beta_;
0112 }
0113 inline bool HepBoostY::operator <= ( const HepBoostY & b ) const {
0114   return beta_ <= b.beta_;
0115 }
0116 inline bool HepBoostY::operator >= ( const HepBoostY & b ) const {
0117   return beta_ >= b.beta_;
0118 }
0119 inline bool HepBoostY::operator <  ( const HepBoostY & b ) const {
0120   return beta_ <  b.beta_;
0121 }
0122 inline bool HepBoostY::operator >  ( const HepBoostY & b ) const {
0123   return beta_ >  b.beta_;
0124 }
0125 
0126 
0127 inline bool HepBoostY::isIdentity() const {
0128   return ( beta() == 0 );
0129 }
0130 
0131 inline double HepBoostY::distance2( const HepBoostY & b ) const {
0132   double d = beta()*gamma() - b.beta()*b.gamma();
0133   return d*d;
0134 }
0135 
0136 inline double HepBoostY::howNear(const HepBoostY & b) const {
0137   return std::sqrt(distance2(b)); }
0138 inline double HepBoostY::howNear(const HepBoost  & b) const {
0139   return std::sqrt(distance2(b)); }
0140 inline double HepBoostY::howNear(const HepRotation & r) const {
0141   return std::sqrt(distance2(r)); }
0142 inline double HepBoostY::howNear(const HepLorentzRotation & lt) const {
0143   return std::sqrt(distance2(lt)); }
0144 
0145 inline bool HepBoostY::isNear(const HepBoostY & b,
0146                                         double epsilon) const {
0147   return (distance2(b) <= epsilon*epsilon);
0148 }
0149 inline bool HepBoostY::isNear(const HepBoost & b,
0150                                         double epsilon) const {
0151   return (distance2(b) <= epsilon*epsilon);
0152 }
0153 
0154 // ----------  Properties:
0155 
0156 double HepBoostY::norm2() const {
0157   double bg = beta_*gamma_;
0158   return bg*bg;
0159 }
0160 
0161 // ---------- Application:
0162 
0163 inline HepLorentzVector
0164 HepBoostY::operator * (const HepLorentzVector & p) const {
0165   double bg = beta_*gamma_;
0166   return HepLorentzVector(   p.x(),
0167               gamma_*p.y() + bg*p.t(),
0168                  p.z(),
0169               gamma_*p.t() + bg*p.y());
0170 }
0171 
0172 HepLorentzVector HepBoostY::operator() (const HepLorentzVector & w) const {
0173   return operator*(w);
0174 }
0175 
0176 // ---------- Operations in the group of 4-Rotations
0177 
0178 inline HepBoostY HepBoostY::inverse() const {
0179   return HepBoostY( -beta(), gamma() );
0180 }
0181 
0182 inline HepBoostY inverseOf ( const HepBoostY & b ) {
0183   return HepBoostY( -b.beta(), b.gamma());
0184 }
0185 
0186 inline HepBoostY & HepBoostY::invert() {
0187   beta_ = -beta_;
0188   return *this;
0189 }
0190 
0191 // ---------- Tolerance:
0192 
0193 inline double HepBoostY::getTolerance() {
0194   return Hep4RotationInterface::tolerance;
0195 }
0196 inline double HepBoostY::setTolerance(double tol) {
0197   return Hep4RotationInterface::setTolerance(tol);
0198 }
0199 
0200 }  // namespace CLHEP