Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Friends
CLHEP::HepLorentzVector Class Reference

#include <LorentzVector.h>

Public Types

enum  {
  X =0, Y =1, Z =2, T =3,
  NUM_COORDINATES =4, SIZE =NUM_COORDINATES
}
 

Public Member Functions

 HepLorentzVector (double x, double y, double z, double t)
 
 HepLorentzVector (double x, double y, double z)
 
 HepLorentzVector (double t)
 
 HepLorentzVector ()
 
 HepLorentzVector (const Hep3Vector &p, double e)
 
 HepLorentzVector (double e, const Hep3Vector &p)
 
 HepLorentzVector (const HepLorentzVector &)
 
 ~HepLorentzVector ()
 
 operator const Hep3Vector & () const
 
 operator Hep3Vector & ()
 
double x () const
 
double y () const
 
double z () const
 
double t () const
 
void setX (double)
 
void setY (double)
 
void setZ (double)
 
void setT (double)
 
double px () const
 
double py () const
 
double pz () const
 
double e () const
 
void setPx (double)
 
void setPy (double)
 
void setPz (double)
 
void setE (double)
 
Hep3Vector vect () const
 
void setVect (const Hep3Vector &)
 
double theta () const
 
double cosTheta () const
 
double phi () const
 
double rho () const
 
void setTheta (double)
 
void setPhi (double)
 
void setRho (double)
 
double operator() (int) const
 
double operator[] (int) const
 
double & operator() (int)
 
double & operator[] (int)
 
HepLorentzVectoroperator= (const HepLorentzVector &)
 
HepLorentzVector operator+ (const HepLorentzVector &) const
 
HepLorentzVectoroperator+= (const HepLorentzVector &)
 
HepLorentzVector operator- (const HepLorentzVector &) const
 
HepLorentzVectoroperator-= (const HepLorentzVector &)
 
HepLorentzVector operator- () const
 
HepLorentzVectoroperator*= (double)
 
HepLorentzVectoroperator/= (double)
 
bool operator== (const HepLorentzVector &) const
 
bool operator!= (const HepLorentzVector &) const
 
double perp2 () const
 
double perp () const
 
void setPerp (double)
 
double perp2 (const Hep3Vector &) const
 
double perp (const Hep3Vector &) const
 
double angle (const Hep3Vector &) const
 
double mag2 () const
 
double m2 () const
 
double mag () const
 
double m () const
 
double mt2 () const
 
double mt () const
 
double et2 () const
 
double et () const
 
double dot (const HepLorentzVector &) const
 
double operator* (const HepLorentzVector &) const
 
double invariantMass2 (const HepLorentzVector &w) const
 
double invariantMass (const HepLorentzVector &w) const
 
void setVectMag (const Hep3Vector &spatial, double magnitude)
 
void setVectM (const Hep3Vector &spatial, double mass)
 
double plus () const
 
double minus () const
 
Hep3Vector boostVector () const
 
HepLorentzVectorboost (double, double, double)
 
HepLorentzVectorboost (const Hep3Vector &)
 
HepLorentzVectorboostX (double beta)
 
HepLorentzVectorboostY (double beta)
 
HepLorentzVectorboostZ (double beta)
 
double rapidity () const
 
double pseudoRapidity () const
 
bool isTimelike () const
 
bool isSpacelike () const
 
bool isLightlike (double epsilon=tolerance) const
 
HepLorentzVectorrotateX (double)
 
HepLorentzVectorrotateY (double)
 
HepLorentzVectorrotateZ (double)
 
HepLorentzVectorrotateUz (const Hep3Vector &)
 
HepLorentzVectorrotate (double, const Hep3Vector &)
 
HepLorentzVectoroperator*= (const HepRotation &)
 
HepLorentzVectortransform (const HepRotation &)
 
HepLorentzVectoroperator*= (const HepLorentzRotation &)
 
HepLorentzVectortransform (const HepLorentzRotation &)
 
void set (double x, double y, double z, double t)
 
void set (double x, double y, double z, Tcomponent t)
 
 HepLorentzVector (double x, double y, double z, Tcomponent t)
 
void set (Tcomponent t, double x, double y, double z)
 
 HepLorentzVector (Tcomponent t, double x, double y, double z)
 
void set (double t)
 
void set (Tcomponent t)
 
 HepLorentzVector (Tcomponent t)
 
void set (const Hep3Vector &v)
 
 HepLorentzVector (const Hep3Vector &v)
 
HepLorentzVectoroperator= (const Hep3Vector &v)
 
void set (const Hep3Vector &v, double t)
 
void set (double t, const Hep3Vector &v)
 
double getX () const
 
double getY () const
 
double getZ () const
 
double getT () const
 
Hep3Vector v () const
 
Hep3Vector getV () const
 
void setV (const Hep3Vector &)
 
void setV (double x, double y, double z)
 
void setRThetaPhi (double r, double theta, double phi)
 
void setREtaPhi (double r, double eta, double phi)
 
void setRhoPhiZ (double rho, double phi, double z)
 
int compare (const HepLorentzVector &w) const
 
bool operator> (const HepLorentzVector &w) const
 
bool operator< (const HepLorentzVector &w) const
 
bool operator>= (const HepLorentzVector &w) const
 
bool operator<= (const HepLorentzVector &w) const
 
bool isNear (const HepLorentzVector &w, double epsilon=tolerance) const
 
double howNear (const HepLorentzVector &w) const
 
bool isNearCM (const HepLorentzVector &w, double epsilon=tolerance) const
 
double howNearCM (const HepLorentzVector &w) const
 
bool isParallel (const HepLorentzVector &w, double epsilon=tolerance) const
 
double howParallel (const HepLorentzVector &w) const
 
double deltaR (const HepLorentzVector &v) const
 
double howLightlike () const
 
double euclideanNorm2 () const
 
double euclideanNorm () const
 
double restMass2 () const
 
double invariantMass2 () const
 
double restMass () const
 
double invariantMass () const
 
HepLorentzVector rest4Vector () const
 
double beta () const
 
double gamma () const
 
double eta () const
 
double eta (const Hep3Vector &ref) const
 
double rapidity (const Hep3Vector &ref) const
 
double coLinearRapidity () const
 
Hep3Vector findBoostToCM () const
 
Hep3Vector findBoostToCM (const HepLorentzVector &w) const
 
double et2 (const Hep3Vector &) const
 
double et (const Hep3Vector &) const
 
double diff2 (const HepLorentzVector &w) const
 
double delta2Euclidean (const HepLorentzVector &w) const
 
double plus (const Hep3Vector &ref) const
 
double minus (const Hep3Vector &ref) const
 
HepLorentzVectorrotate (const Hep3Vector &axis, double delta)
 
HepLorentzVectorrotate (const HepAxisAngle &ax)
 
HepLorentzVectorrotate (const HepEulerAngles &e)
 
HepLorentzVectorrotate (double phi, double theta, double psi)
 
HepLorentzVectorboost (const Hep3Vector &axis, double beta)
 

Static Public Member Functions

static ZMpvMetric_t setMetric (ZMpvMetric_t met)
 
static ZMpvMetric_t getMetric ()
 
static double getTolerance ()
 
static double setTolerance (double tol)
 

Friends

HepLorentzVector rotationXOf (const HepLorentzVector &vec, double delta)
 
HepLorentzVector rotationYOf (const HepLorentzVector &vec, double delta)
 
HepLorentzVector rotationZOf (const HepLorentzVector &vec, double delta)
 
HepLorentzVector rotationOf (const HepLorentzVector &vec, const Hep3Vector &axis, double delta)
 
HepLorentzVector rotationOf (const HepLorentzVector &vec, const HepAxisAngle &ax)
 
HepLorentzVector rotationOf (const HepLorentzVector &vec, const HepEulerAngles &e)
 
HepLorentzVector rotationOf (const HepLorentzVector &vec, double phi, double theta, double psi)
 
HepLorentzVector boostXOf (const HepLorentzVector &vec, double beta)
 
HepLorentzVector boostYOf (const HepLorentzVector &vec, double beta)
 
HepLorentzVector boostZOf (const HepLorentzVector &vec, double beta)
 
HepLorentzVector boostOf (const HepLorentzVector &vec, const Hep3Vector &betaVector)
 
HepLorentzVector boostOf (const HepLorentzVector &vec, const Hep3Vector &axis, double beta)
 

Detailed Description

Author

Definition at line 72 of file LorentzVector.h.

Member Enumeration Documentation

anonymous enum

Constructor & Destructor Documentation

CLHEP::HepLorentzVector::HepLorentzVector ( double  x,
double  y,
double  z,
double  t 
)
inline
CLHEP::HepLorentzVector::HepLorentzVector ( double  x,
double  y,
double  z 
)
inline
CLHEP::HepLorentzVector::HepLorentzVector ( double  t)
explicit
CLHEP::HepLorentzVector::HepLorentzVector ( )
inline

Referenced by rest4Vector().

CLHEP::HepLorentzVector::HepLorentzVector ( const Hep3Vector p,
double  e 
)
inline
CLHEP::HepLorentzVector::HepLorentzVector ( double  e,
const Hep3Vector p 
)
inline
CLHEP::HepLorentzVector::HepLorentzVector ( const HepLorentzVector )
inline
CLHEP::HepLorentzVector::~HepLorentzVector ( )
inline
CLHEP::HepLorentzVector::HepLorentzVector ( double  x,
double  y,
double  z,
Tcomponent  t 
)
inline
CLHEP::HepLorentzVector::HepLorentzVector ( Tcomponent  t,
double  x,
double  y,
double  z 
)
inline
CLHEP::HepLorentzVector::HepLorentzVector ( Tcomponent  t)
inlineexplicit
CLHEP::HepLorentzVector::HepLorentzVector ( const Hep3Vector v)
inlineexplicit

Member Function Documentation

double CLHEP::HepLorentzVector::angle ( const Hep3Vector ) const
inline
double CLHEP::HepLorentzVector::beta ( ) const

Definition at line 75 of file LorentzVectorK.cc.

References CLHEP::Hep3Vector::mag2().

Referenced by G4NeutronHPFinalState::adjust_final_state(), G4EMDissociation::ApplyYourself(), G4EMDissociationCrossSection::GetElementCrossSection(), and G4DeltaAngle::SampleDirection().

75  {
76  if (ee == 0) {
77  if (pp.mag2() == 0) {
78  return 0;
79  } else {
80  std::cerr << "HepLorentzVector::beta() - "
81  << "beta computed for HepLorentzVector with t=0 -- infinite result"
82  << std::endl;
83  return 1./ee;
84  }
85  }
86 // if (restMass2() <= 0) {
87 // std::cerr << "HepLorentzVector::beta() - "
88 // << "beta computed for a non-timelike HepLorentzVector" << std::endl;
89 // // result will make analytic sense but is physically meaningless
90 // }
91  return std::sqrt (pp.mag2() / (ee*ee)) ;
92 } /* beta */
double mag2() const
HepLorentzVector & CLHEP::HepLorentzVector::boost ( double  bx,
double  by,
double  bz 
)

Definition at line 59 of file LorentzVector.cc.

References test::x, and z.

Referenced by G4HadronElastic::ApplyYourself(), G4NeutronRadCapture::ApplyYourself(), G4ChargeExchange::ApplyYourself(), G4MuMinusCapturePrecompound::ApplyYourself(), G4MuonMinusBoundDecay::ApplyYourself(), G4WilsonAbrasionModel::ApplyYourself(), G4EMDissociation::ApplyYourself(), G4LorentzConvertor::backToTheLab(), G4KineticTrackVector::Boost(), G4DecayProducts::Boost(), G4Nucleon::Boost(), G4ExcitedString::Boost(), G4KineticTrackVector::BoostBeam(), G4InuclEvaporation::BreakItUp(), G4StatMF::BreakItUp(), G4WilsonAblationModel::BreakItUp(), G4GEMChannel::BreakUp(), G4CompetitiveFission::BreakUp(), G4EvaporationChannel::BreakUp(), G4UnstableFragmentBreakUp::BreakUpFragment(), G4QMDCollision::CalKinematicsOfBinaryCollisions(), G4NeutronHPInelasticCompFS::CompositeApply(), G4DalitzDecayChannel::DecayIt(), G4TauLeptonicDecayChannel::DecayIt(), G4MuonDecayChannelWithSpin::DecayIt(), G4NuclearDecayChannel::DecayIt(), G4MuonRadiativeDecayChannelWithSpin::DecayIt(), G4BigBanger::deExcite(), G4MuMinusCaptureCascade::DoBoundMuonMinusDecay(), G4CascadeFinalStateAlgorithm::FillUsingKopylov(), G4VGammaDeexcitation::GenerateGamma(), G4HadPhaseSpaceKopylov::GenerateMultiBody(), G4UnstableFermiFragment::GetFragment(), G4FermiConfigurationList::GetFragments(), G4NuclNuclDiffuseElastic::GetInvCoulombElasticXsc(), G4DiffuseElastic::GetInvCoulombElasticXsc(), G4NuclNuclDiffuseElastic::GetInvElasticSumXsc(), G4DiffuseElastic::GetInvElasticSumXsc(), G4NuclNuclDiffuseElastic::GetInvElasticXsc(), G4DiffuseElastic::GetInvElasticXsc(), G4LorentzConvertor::getKinEnergyInTheTRS(), G4LorentzConvertor::getTRSMomentum(), G4GeneralPhaseSpaceDecay::ManyBodyDecayIt(), G4PreCompoundEmission::PerformEmission(), G4GeneratorPrecompoundInterface::PropagateNuclNucl(), CexmcChargeExchangeReconstructor::Reconstruct(), G4QuasiElRatios::RelDecayIn2(), G4DeltaAngle::SampleDirection(), G4AntiNuclElastic::SampleInvariantT(), G4NuclNuclDiffuseElastic::SampleInvariantT(), G4DiffuseElastic::SampleInvariantT(), G4eeTo3PiModel::SampleSecondaries(), G4HeatedKleinNishinaCompton::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4eeToHadronsModel::SampleSecondaries(), G4AntiNuclElastic::SampleThetaLab(), G4NuclNuclDiffuseElastic::SampleThetaLab(), G4DiffuseElastic::SampleThetaLab(), G4NuclNuclDiffuseElastic::ThetaCMStoThetaLab(), G4DiffuseElastic::ThetaCMStoThetaLab(), G4NuclNuclDiffuseElastic::ThetaLabToThetaCMS(), G4DiffuseElastic::ThetaLabToThetaCMS(), G4LorentzConvertor::toTheCenterOfMass(), G4LorentzConvertor::toTheTargetRestFrame(), and G4ReactionKinematics::TwoBodyScattering().

59  {
60  double b2 = bx*bx + by*by + bz*bz;
61  register double ggamma = 1.0 / std::sqrt(1.0 - b2);
62  register double bp = bx*x() + by*y() + bz*z();
63  register double gamma2 = b2 > 0 ? (ggamma - 1.0)/b2 : 0.0;
64 
65  setX(x() + gamma2*bp*bx + ggamma*bx*t());
66  setY(y() + gamma2*bp*by + ggamma*by*t());
67  setZ(z() + gamma2*bp*bz + ggamma*bz*t());
68  setT(ggamma*(t() + bp));
69  return *this;
70 }
HepLorentzVector& CLHEP::HepLorentzVector::boost ( const Hep3Vector )
inline
HepLorentzVector & CLHEP::HepLorentzVector::boost ( const Hep3Vector axis,
double  beta 
)

Definition at line 50 of file LorentzVectorB.cc.

References CLHEP::Hep3Vector::dot(), CLHEP::Hep3Vector::mag2(), G4InuclParticleNames::pp, and CLHEP::Hep3Vector::unit().

50  {
51  if (bbeta==0) {
52  return *this; // do nothing for a 0 boost
53  }
54  double r2 = aaxis.mag2();
55  if ( r2 == 0 ) {
56  std::cerr << "HepLorentzVector::boost() - "
57  << "A zero vector used as axis defining a boost -- no boost done"
58  << std::endl;
59  return *this;
60  }
61  double b2 = bbeta*bbeta;
62  if (b2 >= 1) {
63  std::cerr << "HepLorentzVector::boost() - "
64  << "LorentzVector boosted with beta >= 1 (speed of light) -- \n"
65  << "no boost done" << std::endl;
66  } else {
67  Hep3Vector u = aaxis.unit();
68  register double ggamma = std::sqrt(1./(1.-b2));
69  register double betaDotV = u.dot(pp)*bbeta;
70  register double tt = ee;
71 
72  ee = ggamma * (tt + betaDotV);
73  pp += ( ((ggamma-1)/b2)*betaDotV*bbeta + ggamma*bbeta*tt ) * u;
74  // Note: I have verified the behavior of this even when beta is very
75  // small -- (gamma-1)/b2 becomes inaccurate by O(1), but it is then
76  // multiplied by O(beta**2) and added to an O(beta) term, so the
77  // inaccuracy does not affect the final result.
78  }
79  return *this;
80 } /* boost (axis, beta) */
Hep3Vector CLHEP::HepLorentzVector::boostVector ( ) const

Definition at line 177 of file LorentzVector.cc.

References CLHEP::Hep3Vector::mag2(), and restMass2().

Referenced by G4FTFAnnihilation::Annihilate(), G4NeutronRadCapture::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4ChargeExchange::ApplyYourself(), CexmcChargeExchangeProductionModel< OutputParticle >::ApplyYourself(), G4MuMinusCapturePrecompound::ApplyYourself(), G4MuonMinusBoundDecay::ApplyYourself(), G4INCLXXInterface::ApplyYourself(), G4StatMF::BreakItUp(), G4GEMChannel::BreakUp(), G4CompetitiveFission::BreakUp(), G4EvaporationChannel::BreakUp(), G4UnstableFragmentBreakUp::BreakUpFragment(), G4DiffractiveExcitation::CreateStrings(), G4NuclearDecayChannel::DecayIt(), G4BigBanger::deExcite(), G4MuMinusCaptureCascade::DoBoundMuonMinusDecay(), G4ElasticHNScattering::ElasticScattering(), G4DiffractiveExcitation::ExciteParticipants(), G4QGSDiffractiveExcitation::ExciteParticipants(), G4SingleDiffractiveExcitation::ExciteParticipants(), G4CascadeFinalStateAlgorithm::FillUsingKopylov(), G4VElasticCollision::FinalState(), G4VAnnihilationCollision::FinalState(), G4VScatteringCollision::FinalState(), findBoostToCM(), G4Absorber::FindProducts(), G4HadDecayGenerator::Generate(), G4VGammaDeexcitation::GenerateGamma(), G4HadPhaseSpaceKopylov::GenerateMultiBody(), G4UnstableFermiFragment::GetFragment(), G4FermiConfigurationList::GetFragments(), G4NuclNuclDiffuseElastic::GetInvCoulombElasticXsc(), G4DiffuseElastic::GetInvCoulombElasticXsc(), G4NuclNuclDiffuseElastic::GetInvElasticSumXsc(), G4DiffuseElastic::GetInvElasticSumXsc(), G4NuclNuclDiffuseElastic::GetInvElasticXsc(), G4DiffuseElastic::GetInvElasticXsc(), G4LorentzConvertor::getKinEnergyInTheTRS(), G4LorentzConvertor::getTRSMomentum(), G4PreCompoundEmission::PerformEmission(), G4GeneratorPrecompoundInterface::PropagateNuclNucl(), CexmcChargeExchangeReconstructor::Reconstruct(), G4QuasiElRatios::RelDecayIn2(), G4DeltaAngle::SampleDirection(), G4AntiNuclElastic::SampleInvariantT(), G4NuclNuclDiffuseElastic::SampleInvariantT(), G4DiffuseElastic::SampleInvariantT(), G4eeTo3PiModel::SampleSecondaries(), G4HeatedKleinNishinaCompton::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4eeToHadronsModel::SampleSecondaries(), G4NuclNuclDiffuseElastic::SampleThetaLab(), G4DiffuseElastic::SampleThetaLab(), G4NuclNuclDiffuseElastic::ThetaCMStoThetaLab(), G4DiffuseElastic::ThetaCMStoThetaLab(), G4NuclNuclDiffuseElastic::ThetaLabToThetaCMS(), G4DiffuseElastic::ThetaLabToThetaCMS(), G4LorentzConvertor::toTheTargetRestFrame(), G4ExcitedString::TransformToAlignedCms(), and G4ExcitedString::TransformToCenterOfMass().

177  {
178  if (ee == 0) {
179  if (pp.mag2() == 0) {
180  return Hep3Vector(0,0,0);
181  } else {
182  std::cerr << "HepLorentzVector::boostVector() - "
183  << "boostVector computed for LorentzVector with t=0 -- infinite result"
184  << std::endl;
185  return pp/ee;
186  }
187  }
188  if (restMass2() <= 0) {
189  std::cerr << "HepLorentzVector::boostVector() - "
190  << "boostVector computed for a non-timelike LorentzVector " << std::endl;
191  // result will make analytic sense but is physically meaningless
192  }
193  return pp * (1./ee);
194 } /* boostVector */
double mag2() const
double restMass2() const
HepLorentzVector & CLHEP::HepLorentzVector::boostX ( double  beta)

Definition at line 197 of file LorentzVector.cc.

References CLHEP::Hep3Vector::getX(), and CLHEP::Hep3Vector::setX().

197  {
198  register double b2 = bbeta*bbeta;
199  if (b2 >= 1) {
200  std::cerr << "HepLorentzVector::boostX() - "
201  << "boost along X with beta >= 1 (speed of light) -- \n"
202  << "no boost done" << std::endl;
203  } else {
204  register double ggamma = std::sqrt(1./(1-b2));
205  register double tt = ee;
206  ee = ggamma*(ee + bbeta*pp.getX());
207  pp.setX(ggamma*(pp.getX() + bbeta*tt));
208  }
209  return *this;
210 } /* boostX */
void setX(double)
double getX() const
HepLorentzVector & CLHEP::HepLorentzVector::boostY ( double  beta)

Definition at line 212 of file LorentzVector.cc.

References CLHEP::Hep3Vector::getY(), and CLHEP::Hep3Vector::setY().

212  {
213  register double b2 = bbeta*bbeta;
214  if (b2 >= 1) {
215  std::cerr << "HepLorentzVector::boostY() - "
216  << "boost along Y with beta >= 1 (speed of light) -- \n"
217  << "no boost done" << std::endl;
218  } else {
219  register double ggamma = std::sqrt(1./(1-b2));
220  register double tt = ee;
221  ee = ggamma*(ee + bbeta*pp.getY());
222  pp.setY(ggamma*(pp.getY() + bbeta*tt));
223  }
224  return *this;
225 } /* boostY */
double getY() const
void setY(double)
HepLorentzVector & CLHEP::HepLorentzVector::boostZ ( double  beta)

Definition at line 227 of file LorentzVector.cc.

References CLHEP::Hep3Vector::getZ(), and CLHEP::Hep3Vector::setZ().

227  {
228  register double b2 = bbeta*bbeta;
229  if (b2 >= 1) {
230  std::cerr << "HepLorentzVector::boostZ() - "
231  << "boost along Z with beta >= 1 (speed of light) -- \n"
232  << "no boost done" << std::endl;
233  } else {
234  register double ggamma = std::sqrt(1./(1-b2));
235  register double tt = ee;
236  ee = ggamma*(ee + bbeta*pp.getZ());
237  pp.setZ(ggamma*(pp.getZ() + bbeta*tt));
238  }
239  return *this;
240 } /* boostZ */
void setZ(double)
double getZ() const
double CLHEP::HepLorentzVector::coLinearRapidity ( ) const

Definition at line 171 of file LorentzVectorK.cc.

References CLHEP::Hep3Vector::mag().

171  {
172  register double v1 = pp.mag();
173 // if (std::fabs(ee) == std::fabs(v1)) {
174 // std::cerr << "HepLorentzVector::coLinearRapidity() - "
175 // << "co-Linear rapidity for 4-vector with |E| = |P| -- infinite result"
176 // << std::endl;
177 // }
178  if (std::fabs(ee) < std::fabs(v1)) {
179  std::cerr << "HepLorentzVector::coLinearRapidity() - "
180  << "co-linear rapidity for spacelike 4-vector -- undefined"
181  << std::endl;
182  return 0;
183  }
184  double q = (ee + v1) / (ee - v1);
185  return .5 * std::log(q);
186 } /* rapidity */
double mag() const
int CLHEP::HepLorentzVector::compare ( const HepLorentzVector w) const

Definition at line 29 of file LorentzVectorC.cc.

References CLHEP::Hep3Vector::compare().

Referenced by operator<(), operator<=(), operator>(), and operator>=().

29  {
30  if ( ee > w.ee ) {
31  return 1;
32  } else if ( ee < w.ee ) {
33  return -1;
34  } else {
35  return ( pp.compare(w.pp) );
36  }
37 } /* Compare */
int compare(const Hep3Vector &v) const
Definition: SpaceVector.cc:122
double CLHEP::HepLorentzVector::cosTheta ( ) const
inline
double CLHEP::HepLorentzVector::delta2Euclidean ( const HepLorentzVector w) const
inline
double CLHEP::HepLorentzVector::deltaR ( const HepLorentzVector v) const

Definition at line 195 of file LorentzVectorC.cc.

References test::a, test::b, CLHEP::Hep3Vector::deltaPhi(), eta(), and getV().

195  {
196 
197  double a = eta() - w.eta();
198  double b = pp.deltaPhi(w.getV());
199 
200  return std::sqrt ( a*a + b*b );
201 
202 } /* deltaR */
double deltaPhi(const Hep3Vector &v2) const
Definition: ThreeVector.cc:172
double eta() const
double CLHEP::HepLorentzVector::diff2 ( const HepLorentzVector w) const
inline
double CLHEP::HepLorentzVector::dot ( const HepLorentzVector ) const
inline
double CLHEP::HepLorentzVector::e ( ) const
inline

Referenced by G4NeutronHPFinalState::adjust_final_state(), G4BinaryLightIonReaction::ApplyYourself(), G4NeutronHPCaptureFS::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4NeutronRadCapture::ApplyYourself(), G4ChargeExchange::ApplyYourself(), G4MuMinusCapturePrecompound::ApplyYourself(), G4BinaryCascade::ApplyYourself(), G4MuonMinusBoundDecay::ApplyYourself(), G4EMDissociation::ApplyYourself(), G4INCLXXInterface::ApplyYourself(), atrobo(), attrad(), G4LorentzConvertor::backToTheLab(), G4Nucleon::Boost(), G4NucleiModel::boundaryTransition(), G4StatMF::BreakItUp(), G4WilsonAblationModel::BreakItUp(), G4CompetitiveFission::BreakUp(), G4EvaporationChannel::BreakUp(), G4QMDMeanField::Cal2BodyQuantities(), G4QMDNucleus::CalEnergyAndAngularMomentumInCM(), G4QMDCollision::CalFinalStateOfTheBinaryCollision(), G4QMDCollision::CalFinalStateOfTheBinaryCollisionJQMD(), G4QMDMeanField::CalGraduate(), G4QMDCollision::CalKinematicsOfBinaryCollisions(), G4HadronicProcess::CheckEnergyMomentumConservation(), G4HadronicProcess::CheckResult(), G4QuasiElRatios::ChExer(), G4CascadeCheckBalance::collide(), G4NeutronHPInelasticCompFS::CompositeApply(), G4CascadeInterface::createBullet(), G4DiffractiveExcitation::CreateStrings(), cromsc(), G4CollisionNN::CrossSection(), csharm(), curr(), dadmaa(), dadmel(), dadmks(), dadmmu(), dadmro(), daltra(), damg(), dampaa(), damppk(), dchanh(), G4NuclearDecayChannel::DecayIt(), dechkk(), G4NonEquilibriumEvaporator::deExcite(), G4BigBanger::deExcite(), G4AblaInterface::DeExcite(), G4Fissioner::deExcite(), G4EquilibriumEvaporator::deExcite(), G4CascadeCheckBalance::deltaE(), dhadri(), diagr(), diqdzz(), diqzzd(), dispt(), distcm(), distr(), distrc(), dlower(), G4MuMinusCaptureCascade::DoBoundMuonMinusDecay(), G4Fancy3DNucleus::DoLorentzContraction(), dor94fs(), dor94fw(), dph5pi(), drandm(), dshnel(), dshnto(), dsigin(), dsihae(), dtchoi(), dtwopa(), dupper(), dwrph(), G4CascadeCheckBalance::ekin(), evtemc(), evtput(), faltra(), fhad(), G4CascadeRecoilMaker::fillRecoil(), G4HadronicProcess::FillResult(), G4VKinkyStringDecay::FragmentString(), G4ExcitedStringDecay::FragmentStrings(), G4FragmentingString::G4FragmentingString(), gadap(), gadap2(), gadapf(), gauss1(), gauss2(), gauss3(), gauss4(), gen_delta(), gen_qel(), G4VGammaDeexcitation::GenerateGamma(), G4LorentzConvertor::getKinEnergyInTheTRS(), G4QMDParticipant::GetKineticEnergy(), G4RKPropagation::GetSphereIntersectionTimes(), G4Scatterer::GetTimeToInteraction(), G4HadProjectile::GetTotalEnergy(), hastrt(), hatest(), hijing(), hijsft(), hijsrt(), hirobo(), hkkfil(), initdk(), initdk_new(), G4IntraNucleiCascader::initialize(), jetta(), kkevdi(), kkevds(), kkevle(), kkevnu(), kkevsd(), kkevss(), kkevsv(), kkevt(), kkevvs(), kkevvv(), lepto(), leptox(), linit(), lminew(), lmprin(), lmsimp(), lnstrf(), lscale(), lsigmx(), lu3ent(), lu4ent(), luboei(), lucell(), ludecy(), luedit(), luindf(), lujmas(), luptdi(), luradk(), lurobo(), lushow(), lusphe(), lustrf(), lutabu(), lutest(), luthru(), lwbb(), lxsect(), lzp(), modb(), operator()(), operator<<(), G4ReactionProduct::operator=(), phoin(), plu(), po_grv98lo(), G4InuclParticle::print(), G4LorentzConvertor::printBullet(), G4LorentzConvertor::printTarget(), profb(), G4GeneratorPrecompoundInterface::Propagate(), G4GeneratorPrecompoundInterface::PropagateNuclNucl(), pyeig4(), pygrvs(), pygrvw(), pyklim(), pymaxi(), pymult(), pyovly(), pyrand(), pyresd(), pyscat(), pysigh(), pyspen(), pysspa(), pysspb(), pystfe(), pystfu(), pystpr(), pytbbn(), pytest(), pythia(), pywidt(), pyxtot(), rdxsec(), G4CascadeCheckBalance::relativeE(), G4QuasiElRatios::RelDecayIn2(), G4AntiNuclElastic::SampleInvariantT(), G4KleinNishinaModel::SampleSecondaries(), samppt(), saptre(), G4QuasiElasticChannel::Scatter(), G4VPartonStringModel::Scatter(), G4QuasiElRatios::Scatter(), G4QGSParticipants::SelectInteractions(), selpth(), G4CollisionOutput::setOnShell(), sewew(), shmak(), shmak1(), sigshd(), sihndi(), strafo(), G4RKPropagation::Transport(), ulalem(), ulangl(), ulmass(), var(), G4CascadeRecoilMaker::wholeEvent(), G4Absorber::WillBeAbsorbed(), xshpto(), and zorval().

double CLHEP::HepLorentzVector::et ( ) const
inline

Referenced by fer4m(), fer4mp(), fer4mt(), gen_delta(), and pywidt().

double CLHEP::HepLorentzVector::et ( const Hep3Vector ) const
inline
double CLHEP::HepLorentzVector::et2 ( ) const
inline
double CLHEP::HepLorentzVector::et2 ( const Hep3Vector ) const
inline
double CLHEP::HepLorentzVector::eta ( ) const
inline

Referenced by deltaR().

double CLHEP::HepLorentzVector::eta ( const Hep3Vector ref) const
inline
double CLHEP::HepLorentzVector::euclideanNorm ( ) const
inline

Referenced by howParallel(), and isParallel().

double CLHEP::HepLorentzVector::euclideanNorm2 ( ) const
inline

Referenced by isParallel().

Hep3Vector CLHEP::HepLorentzVector::findBoostToCM ( ) const
Hep3Vector CLHEP::HepLorentzVector::findBoostToCM ( const HepLorentzVector w) const

Definition at line 227 of file LorentzVectorK.cc.

References CLHEP::Hep3Vector::mag2(), and plottest35::t1.

227  {
228  double t1 = ee + w.ee;
229  Hep3Vector v1 = pp + w.pp;
230  if (t1 == 0) {
231  if (v1.mag2() == 0) {
232  return Hep3Vector(0,0,0);
233  } else {
234  std::cerr << "HepLorentzVector::findBoostToCM() - "
235  << "boostToCM computed for two 4-vectors with combined t=0 -- "
236  << "infinite result" << std::endl;
237  return Hep3Vector(v1*(1./t1)); // Yup, 1/0 -- that is how we return infinity
238  }
239  }
240 // if (t1*t1 - v1.mag2() <= 0) {
241 // std::cerr << "HepLorentzVector::findBoostToCM() - "
242 // << "boostToCM computed for pair of HepLorentzVectors with non-timelike sum"
243 // << std::endl;
244 // // result will make analytic sense but is physically meaningless
245 // }
246  return Hep3Vector(v1 * (-1./t1));
247 } /* boostToCM(w) */
tuple t1
Definition: plottest35.py:33
double CLHEP::HepLorentzVector::gamma ( ) const

Definition at line 94 of file LorentzVectorK.cc.

References CLHEP::Hep3Vector::mag2().

Referenced by G4QMDNucleus::CalEnergyAndAngularMomentumInCM(), G4DeltaAngle::SampleDirection(), and G4KineticTrack::SampleResidualLifetime().

94  {
95  double v2 = pp.mag2();
96  double t2 = ee*ee;
97  if (ee == 0) {
98  if (pp.mag2() == 0) {
99  return 1;
100  } else {
101  std::cerr << "HepLorentzVector::gamma() - "
102  << "gamma computed for HepLorentzVector with t=0 -- zero result"
103  << std::endl;
104  return 0;
105  }
106  }
107  if (t2 < v2) {
108  std::cerr << "HepLorentzVector::gamma() - "
109  << "gamma computed for a spacelike HepLorentzVector -- imaginary result"
110  << std::endl;
111  // analytic result would be imaginary.
112  return 0;
113 // } else if ( t2 == v2 ) {
114 // std::cerr << "HepLorentzVector::gamma() - "
115 // << "gamma computed for a lightlike HepLorentzVector -- infinite result"
116 // << std::endl;
117  }
118  return 1./std::sqrt(1. - v2/t2 );
119 } /* gamma */
double mag2() const
ZMpvMetric_t CLHEP::HepLorentzVector::getMetric ( )
static

Definition at line 35 of file LorentzVectorK.cc.

References CLHEP::TimeNegative, and CLHEP::TimePositive.

35  {
36  return ( (metric > 0) ? TimePositive : TimeNegative );
37 }
double CLHEP::HepLorentzVector::getT ( ) const
inline
double CLHEP::HepLorentzVector::getTolerance ( )
static

Definition at line 249 of file LorentzVector.cc.

249  {
250 // Get the tolerance for two LorentzVectors to be considered near each other
251  return tolerance;
252 }
Hep3Vector CLHEP::HepLorentzVector::getV ( ) const
inline
double CLHEP::HepLorentzVector::getX ( ) const
inline
double CLHEP::HepLorentzVector::getY ( ) const
inline
double CLHEP::HepLorentzVector::getZ ( ) const
inline
double CLHEP::HepLorentzVector::howLightlike ( ) const

Definition at line 249 of file LorentzVectorC.cc.

References restMass2().

249  {
250  double m1 = std::fabs(restMass2());
251  double twoT2 = 2*ee*ee;
252  if (m1 < twoT2) {
253  return m1/twoT2;
254  } else {
255  return 1;
256  }
257 } /* HowLightlike */
double restMass2() const
double CLHEP::HepLorentzVector::howNear ( const HepLorentzVector w) const

Definition at line 67 of file LorentzVectorC.cc.

References CLHEP::Hep3Vector::dot(), and mag2().

Referenced by howNearCM().

67  {
68  double wdw = std::fabs(pp.dot(w.pp)) + .25*((ee+w.ee)*(ee+w.ee));
69  double delta = (pp - w.pp).mag2() + (ee-w.ee)*(ee-w.ee);
70  if ( (wdw > 0) && (delta < wdw) ) {
71  return std::sqrt (delta/wdw);
72  } else if ( (wdw == 0) && (delta == 0) ) {
73  return 0;
74  } else {
75  return 1;
76  }
77 } /* howNear() */
double dot(const Hep3Vector &) const
double mag2() const
double CLHEP::HepLorentzVector::howNearCM ( const HepLorentzVector w) const

Definition at line 133 of file LorentzVectorC.cc.

References CLHEP::Hep3Vector::dot(), howNear(), and CLHEP::Hep3Vector::mag2().

133  {
134 
135  double tTotal = (ee + w.ee);
136  Hep3Vector vTotal (pp + w.pp);
137  double vTotal2 = vTotal.mag2();
138 
139  if ( vTotal2 >= tTotal*tTotal ) {
140  // Either one or both vectors are spacelike, or the dominant T components
141  // are in opposite directions. So boosting and testing makes no sense;
142  // but we do consider two exactly equal vectors to be equal in any frame,
143  // even if they are spacelike and can't be boosted to a CM frame.
144  if (*this == w) {
145  return 0;
146  } else {
147  return 1;
148  }
149  }
150 
151  if ( vTotal2 == 0 ) { // no boost needed!
152  return (howNear(w));
153  }
154 
155  // Find the boost to the CM frame. We know that the total vector is timelike.
156 
157  double tRecip = 1./tTotal;
158  Hep3Vector bboost ( vTotal * (-tRecip) );
159 
160  //-| Note that you could do pp/t and not be terribly inefficient since
161  //-| SpaceVector/t itself takes 1/t and multiplies. The code here saves
162  //-| a redundant check for t=0.
163 
164  // Boost both vectors. Since we have the same boost, there is no need
165  // to repeat the beta and gamma calculation; and there is no question
166  // about beta >= 1. That is why we don't just call w.boosted().
167 
168  double b2 = vTotal2*tRecip*tRecip;
169 // if ( b2 >= 1 ) { // NaN-proofing
170 // std::cerr << "HepLorentzVector::howNearCM() - "
171 // << "boost vector in howNearCM appears to be tachyonic" << std::endl;
172 // }
173  register double ggamma = std::sqrt(1./(1.-b2));
174  register double boostDotV1 = bboost.dot(pp);
175  register double gm1_b2 = (ggamma-1)/b2;
176 
177  HepLorentzVector w1 ( pp + ((gm1_b2)*boostDotV1+ggamma*ee) * bboost,
178  ggamma * (ee + boostDotV1) );
179 
180  register double boostDotV2 = bboost.dot(w.pp);
181  HepLorentzVector w2 ( w.pp + ((gm1_b2)*boostDotV2+ggamma*w.ee) * bboost,
182  ggamma * (w.ee + boostDotV2) );
183 
184  return (w1.howNear(w2));
185 
186 } /* howNearCM() */
double howNear(const HepLorentzVector &w) const
double CLHEP::HepLorentzVector::howParallel ( const HepLorentzVector w) const

Definition at line 227 of file LorentzVectorC.cc.

References euclideanNorm().

227  {
228 
229  double norm = euclideanNorm();
230  double wnorm = w.euclideanNorm();
231  if ( norm == 0 ) {
232  if ( wnorm == 0 ) {
233  return 0;
234  } else {
235  return 1;
236  }
237  }
238  if ( wnorm == 0 ) {
239  return 1;
240  }
241 
242  HepLorentzVector w1 = *this / norm;
243  HepLorentzVector w2 = w / wnorm;
244  double x1 = (w1-w2).euclideanNorm();
245  return (x1 < 1) ? x1 : 1;
246 
247 } /* howParallel */
double euclideanNorm() const
double CLHEP::HepLorentzVector::invariantMass ( const HepLorentzVector w) const

Definition at line 192 of file LorentzVectorK.cc.

References invariantMass2(), isLightlike(), and isSpacelike().

Referenced by G4AblaInterface::DeExcite().

192  {
193  double m1 = invariantMass2(w);
194  if (m1 < 0) {
195  // We should find out why:
196  if ( ee * w.ee < 0 ) {
197  std::cerr << "HepLorentzVector::invariantMass() - "
198  << "invariant mass meaningless: \n"
199  << "a negative-mass input led to spacelike 4-vector sum" << std::endl;
200  return 0;
201  } else if ( (isSpacelike() && !isLightlike()) ||
202  (w.isSpacelike() && !w.isLightlike()) ) {
203  std::cerr << "HepLorentzVector::invariantMass() - "
204  << "invariant mass meaningless because of spacelike input"
205  << std::endl;
206  return 0;
207  } else {
208  // Invariant mass squared for a pair of timelike or lightlike vectors
209  // mathematically cannot be negative. If the vectors are within the
210  // tolerance of being lightlike or timelike, we can assume that prior
211  // or current roundoffs have caused the negative result, and return 0
212  // without comment.
213  return 0;
214  }
215  }
216  return (ee+w.ee >=0 ) ? std::sqrt(m1) : - std::sqrt(m1);
217 } /* invariantMass */
bool isSpacelike() const
double invariantMass2() const
bool isLightlike(double epsilon=tolerance) const
double CLHEP::HepLorentzVector::invariantMass ( ) const
inline
double CLHEP::HepLorentzVector::invariantMass2 ( const HepLorentzVector w) const
inline
double CLHEP::HepLorentzVector::invariantMass2 ( ) const
inline

Referenced by invariantMass().

bool CLHEP::HepLorentzVector::isLightlike ( double  epsilon = tolerance) const
inline

Referenced by invariantMass().

bool CLHEP::HepLorentzVector::isNear ( const HepLorentzVector w,
double  epsilon = tolerance 
) const

Definition at line 57 of file LorentzVectorC.cc.

References CLHEP::Hep3Vector::dot(), and mag2().

Referenced by isNearCM().

58  {
59  double limit = std::fabs(pp.dot(w.pp));
60  limit += .25*((ee+w.ee)*(ee+w.ee));
61  limit *= epsilon*epsilon;
62  double delta = (pp - w.pp).mag2();
63  delta += (ee-w.ee)*(ee-w.ee);
64  return (delta <= limit );
65 } /* isNear() */
double dot(const Hep3Vector &) const
double mag2() const
bool CLHEP::HepLorentzVector::isNearCM ( const HepLorentzVector w,
double  epsilon = tolerance 
) const

Definition at line 85 of file LorentzVectorC.cc.

References CLHEP::Hep3Vector::dot(), isNear(), CLHEP::Hep3Vector::mag2(), and G4InuclParticleNames::pp.

85  {
86 
87  double tTotal = (ee + w.ee);
88  Hep3Vector vTotal (pp + w.pp);
89  double vTotal2 = vTotal.mag2();
90 
91  if ( vTotal2 >= tTotal*tTotal ) {
92  // Either one or both vectors are spacelike, or the dominant T components
93  // are in opposite directions. So boosting and testing makes no sense;
94  // but we do consider two exactly equal vectors to be equal in any frame,
95  // even if they are spacelike and can't be boosted to a CM frame.
96  return (*this == w);
97  }
98 
99  if ( vTotal2 == 0 ) { // no boost needed!
100  return (isNear(w, epsilon));
101  }
102 
103  // Find the boost to the CM frame. We know that the total vector is timelike.
104 
105  double tRecip = 1./tTotal;
106  Hep3Vector bboost ( vTotal * (-tRecip) );
107 
108  //-| Note that you could do pp/t and not be terribly inefficient since
109  //-| SpaceVector/t itself takes 1/t and multiplies. The code here saves
110  //-| a redundant check for t=0.
111 
112  // Boost both vectors. Since we have the same boost, there is no need
113  // to repeat the beta and gamma calculation; and there is no question
114  // about beta >= 1. That is why we don't just call w.boosted().
115 
116  double b2 = vTotal2*tRecip*tRecip;
117 
118  register double ggamma = std::sqrt(1./(1.-b2));
119  register double boostDotV1 = bboost.dot(pp);
120  register double gm1_b2 = (ggamma-1)/b2;
121 
122  HepLorentzVector w1 ( pp + ((gm1_b2)*boostDotV1+ggamma*ee) * bboost,
123  ggamma * (ee + boostDotV1) );
124 
125  register double boostDotV2 = bboost.dot(w.pp);
126  HepLorentzVector w2 ( w.pp + ((gm1_b2)*boostDotV2+ggamma*w.ee) * bboost,
127  ggamma * (w.ee + boostDotV2) );
128 
129  return (w1.isNear(w2, epsilon));
130 
131 } /* isNearCM() */
bool isNear(const HepLorentzVector &w, double epsilon=tolerance) const
bool CLHEP::HepLorentzVector::isParallel ( const HepLorentzVector w,
double  epsilon = tolerance 
) const

Definition at line 208 of file LorentzVectorC.cc.

References euclideanNorm(), and euclideanNorm2().

208  {
209  double norm = euclideanNorm();
210  double wnorm = w.euclideanNorm();
211  if ( norm == 0 ) {
212  if ( wnorm == 0 ) {
213  return true;
214  } else {
215  return false;
216  }
217  }
218  if ( wnorm == 0 ) {
219  return false;
220  }
221  HepLorentzVector w1 = *this / norm;
222  HepLorentzVector w2 = w / wnorm;
223  return ( (w1-w2).euclideanNorm2() <= epsilon*epsilon );
224 } /* isParallel */
double euclideanNorm() const
double euclideanNorm2() const
bool CLHEP::HepLorentzVector::isSpacelike ( ) const
inline

Referenced by invariantMass().

bool CLHEP::HepLorentzVector::isTimelike ( ) const
inline
double CLHEP::HepLorentzVector::m ( ) const
inline
double CLHEP::HepLorentzVector::m2 ( ) const
inline
double CLHEP::HepLorentzVector::mag ( ) const
inline
double CLHEP::HepLorentzVector::mag2 ( ) const
inline
double CLHEP::HepLorentzVector::minus ( ) const
inline
double CLHEP::HepLorentzVector::minus ( const Hep3Vector ref) const

Definition at line 55 of file LorentzVectorK.cc.

References CLHEP::Hep3Vector::dot(), and CLHEP::Hep3Vector::mag().

55  {
56  double r = ref.mag();
57  if (r == 0) {
58  std::cerr << "HepLorentzVector::minus() - "
59  << "A zero vector used as reference to LorentzVector minus-part"
60  << std::endl;
61  return ee;
62  }
63  return ee - pp.dot(ref)/r;
64 } /* plus */
double dot(const Hep3Vector &) const
double CLHEP::HepLorentzVector::mt ( ) const
inline

Referenced by quench().

double CLHEP::HepLorentzVector::mt2 ( ) const
inline
CLHEP::HepLorentzVector::operator const Hep3Vector & ( ) const
inline
CLHEP::HepLorentzVector::operator Hep3Vector & ( )
inline
bool CLHEP::HepLorentzVector::operator!= ( const HepLorentzVector ) const
inline
double CLHEP::HepLorentzVector::operator() ( int  i) const

Definition at line 26 of file LorentzVector.cc.

References e(), T, X, Y, and Z.

26  {
27  switch(i) {
28  case X:
29  case Y:
30  case Z:
31  return pp(i);
32  case T:
33  return e();
34  default:
35  std::cerr << "HepLorentzVector subscripting: bad index (" << i << ")"
36  << std::endl;
37  }
38  return 0.;
39 }
double & CLHEP::HepLorentzVector::operator() ( int  i)

Definition at line 41 of file LorentzVector.cc.

References T, X, Y, and Z.

41  {
42  static double dummy;
43  switch(i) {
44  case X:
45  case Y:
46  case Z:
47  return pp(i);
48  case T:
49  return ee;
50  default:
51  std::cerr
52  << "HepLorentzVector subscripting: bad index (" << i << ")"
53  << std::endl;
54  return dummy;
55  }
56 }
double CLHEP::HepLorentzVector::operator* ( const HepLorentzVector ) const
inline
HepLorentzVector& CLHEP::HepLorentzVector::operator*= ( double  )
inline
HepLorentzVector& CLHEP::HepLorentzVector::operator*= ( const HepRotation )
inline
HepLorentzVector & CLHEP::HepLorentzVector::operator*= ( const HepLorentzRotation m1)

Definition at line 21 of file LorentzVectorL.cc.

References CLHEP::HepLorentzRotation::vectorMultiplication().

21  {
22  return *this = m1.vectorMultiplication(*this);
23 }
HepLorentzVector CLHEP::HepLorentzVector::operator+ ( const HepLorentzVector ) const
inline
HepLorentzVector& CLHEP::HepLorentzVector::operator+= ( const HepLorentzVector )
inline
HepLorentzVector CLHEP::HepLorentzVector::operator- ( const HepLorentzVector ) const
inline
HepLorentzVector CLHEP::HepLorentzVector::operator- ( ) const
inline
HepLorentzVector& CLHEP::HepLorentzVector::operator-= ( const HepLorentzVector )
inline
HepLorentzVector & CLHEP::HepLorentzVector::operator/= ( double  c)

Definition at line 152 of file LorentzVector.cc.

References test::c.

152  {
153 // if (c == 0) {
154 // std::cerr << "HepLorentzVector::operator /=() - "
155 // << "Attempt to do LorentzVector /= 0 -- \n"
156 // << "division by zero would produce infinite or NAN components"
157 // << std::endl;
158 // }
159  double oneOverC = 1.0/c;
160  pp *= oneOverC;
161  ee *= oneOverC;
162  return *this;
163 } /* w /= c */
bool CLHEP::HepLorentzVector::operator< ( const HepLorentzVector w) const

Definition at line 42 of file LorentzVectorC.cc.

References compare().

42  {
43  return (compare(w) < 0);
44 }
int compare(const HepLorentzVector &w) const
bool CLHEP::HepLorentzVector::operator<= ( const HepLorentzVector w) const

Definition at line 48 of file LorentzVectorC.cc.

References compare().

48  {
49  return (compare(w) <= 0);
50 }
int compare(const HepLorentzVector &w) const
HepLorentzVector& CLHEP::HepLorentzVector::operator= ( const HepLorentzVector )
inline
HepLorentzVector& CLHEP::HepLorentzVector::operator= ( const Hep3Vector v)
inline
bool CLHEP::HepLorentzVector::operator== ( const HepLorentzVector ) const
inline
bool CLHEP::HepLorentzVector::operator> ( const HepLorentzVector w) const

Definition at line 39 of file LorentzVectorC.cc.

References compare().

39  {
40  return (compare(w) > 0);
41 }
int compare(const HepLorentzVector &w) const
bool CLHEP::HepLorentzVector::operator>= ( const HepLorentzVector w) const

Definition at line 45 of file LorentzVectorC.cc.

References compare().

45  {
46  return (compare(w) >= 0);
47 }
int compare(const HepLorentzVector &w) const
double CLHEP::HepLorentzVector::operator[] ( int  ) const
inline
double& CLHEP::HepLorentzVector::operator[] ( int  )
inline
double CLHEP::HepLorentzVector::perp ( ) const
inline
double CLHEP::HepLorentzVector::perp ( const Hep3Vector ) const
inline
double CLHEP::HepLorentzVector::perp2 ( ) const
inline
double CLHEP::HepLorentzVector::perp2 ( const Hep3Vector ) const
inline
double CLHEP::HepLorentzVector::phi ( ) const
inline
double CLHEP::HepLorentzVector::plus ( ) const
inline
double CLHEP::HepLorentzVector::plus ( const Hep3Vector ref) const

Definition at line 44 of file LorentzVectorK.cc.

References CLHEP::Hep3Vector::dot(), and CLHEP::Hep3Vector::mag().

44  {
45  double r = ref.mag();
46  if (r == 0) {
47  std::cerr << "HepLorentzVector::plus() - "
48  << "A zero vector used as reference to LorentzVector plus-part"
49  << std::endl;
50  return ee;
51  }
52  return ee + pp.dot(ref)/r;
53 } /* plus */
double dot(const Hep3Vector &) const
double CLHEP::HepLorentzVector::pseudoRapidity ( ) const
inline
double CLHEP::HepLorentzVector::px ( ) const
inline
double CLHEP::HepLorentzVector::py ( ) const
inline
double CLHEP::HepLorentzVector::pz ( ) const
inline
double CLHEP::HepLorentzVector::rapidity ( ) const

Definition at line 128 of file LorentzVectorK.cc.

References CLHEP::Hep3Vector::getZ().

Referenced by G4FTFAnnihilation::Annihilate(), and G4DiffractiveExcitation::ExciteParticipants().

128  {
129  register double z1 = pp.getZ();
130 // if (std::fabs(ee) == std::fabs(z1)) {
131 // std::cerr << "HepLorentzVector::rapidity() - "
132 // << "rapidity for 4-vector with |E| = |Pz| -- infinite result"
133 // << std::endl;
134 // }
135  if (std::fabs(ee) < std::fabs(z1)) {
136  std::cerr << "HepLorentzVector::rapidity() - "
137  << "rapidity for spacelike 4-vector with |E| < |Pz| -- undefined"
138  << std::endl;
139  return 0;
140  }
141  double q = (ee + z1) / (ee - z1);
142  //-| This cannot be negative now, since both numerator
143  //-| and denominator have the same sign as ee.
144  return .5 * std::log(q);
145 } /* rapidity */
double getZ() const
double CLHEP::HepLorentzVector::rapidity ( const Hep3Vector ref) const

Definition at line 147 of file LorentzVectorK.cc.

References CLHEP::Hep3Vector::dot(), and CLHEP::Hep3Vector::mag2().

147  {
148  register double r = ref.mag2();
149  if (r == 0) {
150  std::cerr << "HepLorentzVector::rapidity() - "
151  << "A zero vector used as reference to LorentzVector rapidity"
152  << std::endl;
153  return 0;
154  }
155  register double vdotu = pp.dot(ref)/std::sqrt(r);
156 // if (std::fabs(ee) == std::fabs(vdotu)) {
157 // std::cerr << "HepLorentzVector::rapidity() - "
158 // << "rapidity for 4-vector with |E| = |Pu| -- infinite result"
159 // << std::endl;
160 // }
161  if (std::fabs(ee) < std::fabs(vdotu)) {
162  std::cerr << "HepLorentzVector::rapidity() - "
163  << "rapidity for spacelike 4-vector with |E| < |P*ref| -- undefined "
164  << std::endl;
165  return 0;
166  }
167  double q = (ee + vdotu) / (ee - vdotu);
168  return .5 * std::log(q);
169 } /* rapidity(ref) */
double dot(const Hep3Vector &) const
HepLorentzVector CLHEP::HepLorentzVector::rest4Vector ( ) const

Definition at line 66 of file LorentzVectorK.cc.

References HepLorentzVector(), m(), and t().

66  {
67  return HepLorentzVector (0, 0, 0, (t() < 0.0 ? -m() : m()));
68 }
double CLHEP::HepLorentzVector::restMass ( ) const
inline
double CLHEP::HepLorentzVector::restMass2 ( ) const
inline

Referenced by boostVector(), and howLightlike().

double CLHEP::HepLorentzVector::rho ( ) const
inline
HepLorentzVector & CLHEP::HepLorentzVector::rotate ( double  a,
const Hep3Vector v1 
)

Definition at line 19 of file LorentzVectorR.cc.

References CLHEP::Hep3Vector::rotate().

Referenced by G4HadronicProcess::FillResult(), and CLHEP::rotationOf().

19  {
20  pp.rotate(a,v1);
21  return *this;
22 }
Hep3Vector & rotate(double, const Hep3Vector &)
Definition: ThreeVectorR.cc:28
HepLorentzVector & CLHEP::HepLorentzVector::rotate ( const Hep3Vector axis,
double  delta 
)

Definition at line 24 of file LorentzVectorR.cc.

References CLHEP::Hep3Vector::rotate().

25  {
26  pp.rotate (aaxis, ddelta);
27  return *this;
28 }
Hep3Vector & rotate(double, const Hep3Vector &)
Definition: ThreeVectorR.cc:28
HepLorentzVector & CLHEP::HepLorentzVector::rotate ( const HepAxisAngle ax)

Definition at line 30 of file LorentzVectorR.cc.

References CLHEP::Hep3Vector::rotate().

30  {
31  pp.rotate (ax);
32  return *this;
33 }
Hep3Vector & rotate(double, const Hep3Vector &)
Definition: ThreeVectorR.cc:28
HepLorentzVector & CLHEP::HepLorentzVector::rotate ( const HepEulerAngles e)

Definition at line 35 of file LorentzVectorR.cc.

References CLHEP::Hep3Vector::rotate().

35  {
36  pp.rotate (e1);
37  return *this;
38 }
Hep3Vector & rotate(double, const Hep3Vector &)
Definition: ThreeVectorR.cc:28
HepLorentzVector & CLHEP::HepLorentzVector::rotate ( double  phi,
double  theta,
double  psi 
)

Definition at line 40 of file LorentzVectorR.cc.

References CLHEP::Hep3Vector::rotate().

42  {
43  pp.rotate (phi1, theta1, psi1);
44  return *this;
45 }
Hep3Vector & rotate(double, const Hep3Vector &)
Definition: ThreeVectorR.cc:28
HepLorentzVector & CLHEP::HepLorentzVector::rotateUz ( const Hep3Vector v1)

Definition at line 85 of file LorentzVector.cc.

References CLHEP::Hep3Vector::rotateUz().

Referenced by G4eeTo3PiModel::SampleSecondaries().

85  {
86  pp.rotateUz(v1);
87  return *this;
88 }
Hep3Vector & rotateUz(const Hep3Vector &)
Definition: ThreeVector.cc:72
HepLorentzVector & CLHEP::HepLorentzVector::rotateX ( double  a)

Definition at line 72 of file LorentzVector.cc.

References CLHEP::Hep3Vector::rotateX().

Referenced by CLHEP::rotationXOf().

72  {
73  pp.rotateX(a);
74  return *this;
75 }
Hep3Vector & rotateX(double)
Definition: ThreeVector.cc:124
HepLorentzVector & CLHEP::HepLorentzVector::rotateY ( double  a)
HepLorentzVector & CLHEP::HepLorentzVector::rotateZ ( double  a)
void CLHEP::HepLorentzVector::set ( double  x,
double  y,
double  z,
double  t 
)
inline
void CLHEP::HepLorentzVector::set ( double  x,
double  y,
double  z,
Tcomponent  t 
)
inline
void CLHEP::HepLorentzVector::set ( Tcomponent  t,
double  x,
double  y,
double  z 
)
inline
void CLHEP::HepLorentzVector::set ( double  t)
inline
void CLHEP::HepLorentzVector::set ( Tcomponent  t)
inline
void CLHEP::HepLorentzVector::set ( const Hep3Vector v)
inline
void CLHEP::HepLorentzVector::set ( const Hep3Vector v,
double  t 
)
inline
void CLHEP::HepLorentzVector::set ( double  t,
const Hep3Vector v 
)
inline
void CLHEP::HepLorentzVector::setE ( double  )
inline
ZMpvMetric_t CLHEP::HepLorentzVector::setMetric ( ZMpvMetric_t  met)
static

Definition at line 25 of file LorentzVectorK.cc.

References CLHEP::TimeNegative, and CLHEP::TimePositive.

Referenced by CLHEP::HepLorentzRotation::set().

25  {
26  ZMpvMetric_t oldMetric = (metric > 0) ? TimePositive : TimeNegative;
27  if ( met == TimeNegative ) {
28  metric = -1.0;
29  } else {
30  metric = 1.0;
31  }
32  return oldMetric;
33 }
void CLHEP::HepLorentzVector::setPerp ( double  )
inline
void CLHEP::HepLorentzVector::setPhi ( double  )
inline
void CLHEP::HepLorentzVector::setPx ( double  )
inline
void CLHEP::HepLorentzVector::setPy ( double  )
inline
void CLHEP::HepLorentzVector::setPz ( double  )
inline
void CLHEP::HepLorentzVector::setREtaPhi ( double  r,
double  eta,
double  phi 
)
inline
void CLHEP::HepLorentzVector::setRho ( double  )
inline
void CLHEP::HepLorentzVector::setRhoPhiZ ( double  rho,
double  phi,
double  z 
)
inline
void CLHEP::HepLorentzVector::setRThetaPhi ( double  r,
double  theta,
double  phi 
)
inline
void CLHEP::HepLorentzVector::setT ( double  )
inline
void CLHEP::HepLorentzVector::setTheta ( double  )
inline
double CLHEP::HepLorentzVector::setTolerance ( double  tol)
static

Definition at line 242 of file LorentzVector.cc.

242  {
243 // Set the tolerance for two LorentzVectors to be considered near each other
244  double oldTolerance (tolerance);
245  tolerance = tol;
246  return oldTolerance;
247 }
void CLHEP::HepLorentzVector::setV ( const Hep3Vector )
inline
void CLHEP::HepLorentzVector::setV ( double  x,
double  y,
double  z 
)
inline
void CLHEP::HepLorentzVector::setVect ( const Hep3Vector )
inline
void CLHEP::HepLorentzVector::setVectM ( const Hep3Vector spatial,
double  mass 
)
inline
void CLHEP::HepLorentzVector::setVectMag ( const Hep3Vector spatial,
double  magnitude 
)
inline
void CLHEP::HepLorentzVector::setX ( double  )
inline

Referenced by CLHEP::operator>>().

void CLHEP::HepLorentzVector::setY ( double  )
inline

Referenced by CLHEP::operator>>().

void CLHEP::HepLorentzVector::setZ ( double  )
inline
double CLHEP::HepLorentzVector::t ( ) const
inline
double CLHEP::HepLorentzVector::theta ( ) const
inline
HepLorentzVector& CLHEP::HepLorentzVector::transform ( const HepRotation )
inline
HepLorentzVector & CLHEP::HepLorentzVector::transform ( const HepLorentzRotation m1)

Definition at line 26 of file LorentzVectorL.cc.

References CLHEP::HepLorentzRotation::vectorMultiplication().

26  {
27  return *this = m1.vectorMultiplication(*this);
28 }
Hep3Vector CLHEP::HepLorentzVector::v ( ) const
inline
Hep3Vector CLHEP::HepLorentzVector::vect ( ) const
inline

Referenced by G4BinaryLightIonReaction::ApplyYourself(), G4RPGPiMinusInelastic::ApplyYourself(), G4RPGPiPlusInelastic::ApplyYourself(), G4NeutronHPFissionFS::ApplyYourself(), G4RPGKMinusInelastic::ApplyYourself(), G4RPGProtonInelastic::ApplyYourself(), G4RPGAntiProtonInelastic::ApplyYourself(), G4RPGAntiSigmaPlusInelastic::ApplyYourself(), G4RPGSigmaPlusInelastic::ApplyYourself(), G4RPGXiMinusInelastic::ApplyYourself(), G4RPGAntiOmegaMinusInelastic::ApplyYourself(), G4RPGAntiSigmaMinusInelastic::ApplyYourself(), G4RPGAntiXiMinusInelastic::ApplyYourself(), G4RPGOmegaMinusInelastic::ApplyYourself(), G4NeutronHPCaptureFS::ApplyYourself(), G4RPGKPlusInelastic::ApplyYourself(), G4RPGSigmaMinusInelastic::ApplyYourself(), G4NeutronHPChannelList::ApplyYourself(), G4RPGXiZeroInelastic::ApplyYourself(), G4LENDModel::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4NeutronRadCapture::ApplyYourself(), G4ChargeExchange::ApplyYourself(), G4NeutronHPElasticFS::ApplyYourself(), G4MuonVDNuclearModel::ApplyYourself(), G4LENDElastic::ApplyYourself(), G4LENDInelastic::ApplyYourself(), G4LowEIonFragmentation::ApplyYourself(), G4LEpp::ApplyYourself(), G4ElectroVDNuclearModel::ApplyYourself(), G4TheoFSGenerator::ApplyYourself(), G4LEnp::ApplyYourself(), CexmcChargeExchangeProductionModel< OutputParticle >::ApplyYourself(), G4LFission::ApplyYourself(), G4MuMinusCapturePrecompound::ApplyYourself(), G4BinaryCascade::ApplyYourself(), G4MuonMinusBoundDecay::ApplyYourself(), G4FissionLibrary::ApplyYourself(), G4EMDissociation::ApplyYourself(), G4WilsonAbrasionModel::ApplyYourself(), G4INCLXXInterface::ApplyYourself(), G4NeutronHPInelasticBaseFS::BaseApply(), G4Nucleon::Boost(), G4NucleiModel::boundaryTransition(), G4InuclEvaporation::BreakItUp(), G4GEMChannel::BreakUp(), G4EvaporationChannel::BreakUp(), G4RPGInelastic::CalculateMomenta(), G4QMDCollision::CalKinematicsOfBinaryCollisions(), G4HadronicProcess::CheckEnergyMomentumConservation(), G4NucleiModel::choosePointAlongTraj(), G4NeutronHPInelasticCompFS::CompositeApply(), G4DiffractiveExcitation::CreateStrings(), G4IntraNucleiCascader::decayTrappedParticle(), G4NonEquilibriumEvaporator::deExcite(), G4Fissioner::deExcite(), G4MuMinusCaptureCascade::DoBoundMuonMinusDecay(), G4Fancy3DNucleus::DoLorentzContraction(), G4ElasticHNScattering::ElasticScattering(), G4DiffractiveExcitation::ExciteParticipants(), G4QGSDiffractiveExcitation::ExciteParticipants(), G4SingleDiffractiveExcitation::ExciteParticipants(), G4LorentzConvertor::fillKinematics(), G4HadronicProcess::FillResult(), G4FragmentingString::G4FragmentingString(), G4VGammaDeexcitation::GenerateGamma(), G4NucleiModel::generateInteractionPartners(), gentable(), gethneu(), G4NuclNuclDiffuseElastic::GetInvCoulombElasticXsc(), G4DiffuseElastic::GetInvCoulombElasticXsc(), G4NuclNuclDiffuseElastic::GetInvElasticSumXsc(), G4DiffuseElastic::GetInvElasticSumXsc(), G4NuclNuclDiffuseElastic::GetInvElasticXsc(), G4DiffuseElastic::GetInvElasticXsc(), getneu(), G4CascadParticle::getPathToTheNextZone(), G4RKPropagation::GetSphereIntersectionTimes(), G4NeutronHPThermalBoost::GetThermalEnergy(), G4Scatterer::GetTimeToInteraction(), G4HadProjectile::GetTotalMomentum(), G4NucleiModel::initializeCascad(), jettarun(), jettout(), G4CascadeInterface::makeDynamicParticle(), G4CascadeDeexciteBase::makeFragment(), G4CascadeRecoilMaker::makeRecoilFragment(), G4ReactionProduct::operator=(), G4CascadeHistory::PrintEntry(), G4DecayStrongResonances::Propagate(), G4GeneratorPrecompoundInterface::Propagate(), G4CascadParticle::propagateAlongThePath(), G4GeneratorPrecompoundInterface::PropagateNuclNucl(), G4QuasiElRatios::RelDecayIn2(), G4LorentzConvertor::rotate(), G4AntiNuclElastic::SampleInvariantT(), G4NuclNuclDiffuseElastic::SampleInvariantT(), G4DiffuseElastic::SampleInvariantT(), G4HeatedKleinNishinaCompton::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4NuclNuclDiffuseElastic::SampleThetaLab(), G4DiffuseElastic::SampleThetaLab(), G4Scatterer::Scatter(), G4QuasiElasticChannel::Scatter(), G4VPartonStringModel::Scatter(), G4DynamicParticle::Set4Momentum(), G4LorentzConvertor::setBullet(), G4InuclParticle::setMomentum(), G4CollisionOutput::setOnShell(), G4HadronicWhiteBoard::SetProjectile(), G4LorentzConvertor::setTarget(), G4KineticTrack::SetTrackingMomentum(), G4NuclNuclDiffuseElastic::ThetaCMStoThetaLab(), G4DiffuseElastic::ThetaCMStoThetaLab(), G4LorentzConvertor::toTheCenterOfMass(), G4LorentzConvertor::toTheTargetRestFrame(), G4RKPropagation::Transport(), G4KineticTrack::Update4Momentum(), and G4KineticTrack::UpdateTrackingMomentum().

double CLHEP::HepLorentzVector::x ( ) const
inline
double CLHEP::HepLorentzVector::y ( ) const
inline
double CLHEP::HepLorentzVector::z ( ) const
inline

Friends And Related Function Documentation

HepLorentzVector boostOf ( const HepLorentzVector vec,
const Hep3Vector betaVector 
)
friend
HepLorentzVector boostOf ( const HepLorentzVector vec,
const Hep3Vector axis,
double  beta 
)
friend
HepLorentzVector boostXOf ( const HepLorentzVector vec,
double  beta 
)
friend
HepLorentzVector boostYOf ( const HepLorentzVector vec,
double  beta 
)
friend
HepLorentzVector boostZOf ( const HepLorentzVector vec,
double  beta 
)
friend
HepLorentzVector rotationOf ( const HepLorentzVector vec,
const Hep3Vector axis,
double  delta 
)
friend

Definition at line 47 of file LorentzVectorR.cc.

49  {
50  HepLorentzVector vv (vec);
51  return vv.rotate (aaxis, ddelta);
52 }
HepLorentzVector rotationOf ( const HepLorentzVector vec,
const HepAxisAngle ax 
)
friend

Definition at line 55 of file LorentzVectorR.cc.

55  {
56  HepLorentzVector vv (vec);
57  return vv.rotate (ax);
58 }
HepLorentzVector rotationOf ( const HepLorentzVector vec,
const HepEulerAngles e 
)
friend

Definition at line 61 of file LorentzVectorR.cc.

61  {
62  HepLorentzVector vv (vec);
63  return vv.rotate (e1);
64 }
HepLorentzVector rotationOf ( const HepLorentzVector vec,
double  phi,
double  theta,
double  psi 
)
friend

Definition at line 66 of file LorentzVectorR.cc.

69  {
70  HepLorentzVector vv (vec);
71  return vv.rotate (phi1, theta1, psi1);
72 }
HepLorentzVector rotationXOf ( const HepLorentzVector vec,
double  delta 
)
friend

Definition at line 28 of file LorentzVectorB.cc.

28  {
29  HepLorentzVector vv (vec);
30  return vv.rotateX (phi);
31 }
double phi() const
HepLorentzVector rotationYOf ( const HepLorentzVector vec,
double  delta 
)
friend

Definition at line 34 of file LorentzVectorB.cc.

34  {
35  HepLorentzVector vv (vec);
36  return vv.rotateY (phi);
37 }
double phi() const
HepLorentzVector rotationZOf ( const HepLorentzVector vec,
double  delta 
)
friend

Definition at line 40 of file LorentzVectorB.cc.

40  {
41  HepLorentzVector vv (vec);
42  return vv.rotateZ (phi);
43 }
double phi() const

The documentation for this class was generated from the following files: