Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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 (HepLorentzVector &&)=default
 
 ~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 &)
 
HepLorentzVectoroperator= (HepLorentzVector &&)=default
 
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 67 of file LorentzVector.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NUM_COORDINATES 
SIZE 

Definition at line 71 of file LorentzVector.h.

Constructor & Destructor Documentation

◆ HepLorentzVector() [1/12]

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

◆ HepLorentzVector() [2/12]

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

◆ HepLorentzVector() [3/12]

CLHEP::HepLorentzVector::HepLorentzVector ( double  t)
explicit

◆ HepLorentzVector() [4/12]

CLHEP::HepLorentzVector::HepLorentzVector ( )
inline

Referenced by rest4Vector().

◆ HepLorentzVector() [5/12]

CLHEP::HepLorentzVector::HepLorentzVector ( const Hep3Vector p,
double  e 
)
inline

◆ HepLorentzVector() [6/12]

CLHEP::HepLorentzVector::HepLorentzVector ( double  e,
const Hep3Vector p 
)
inline

◆ HepLorentzVector() [7/12]

CLHEP::HepLorentzVector::HepLorentzVector ( const HepLorentzVector )
inline

◆ HepLorentzVector() [8/12]

CLHEP::HepLorentzVector::HepLorentzVector ( HepLorentzVector &&  )
inlinedefault

◆ ~HepLorentzVector()

CLHEP::HepLorentzVector::~HepLorentzVector ( )
inline

◆ HepLorentzVector() [9/12]

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

◆ HepLorentzVector() [10/12]

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

◆ HepLorentzVector() [11/12]

CLHEP::HepLorentzVector::HepLorentzVector ( Tcomponent  t)
inlineexplicit

◆ HepLorentzVector() [12/12]

CLHEP::HepLorentzVector::HepLorentzVector ( const Hep3Vector v)
inlineexplicit

Member Function Documentation

◆ angle()

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

◆ beta()

double CLHEP::HepLorentzVector::beta ( ) const

Definition at line 72 of file LorentzVectorK.cc.

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

Referenced by G4ParticleHPFinalState::adjust_final_state(), G4EMDissociation::ApplyYourself(), G4EMDissociationCrossSection::GetElementCrossSection(), and G4BetheHeitler5DModel::SampleSecondaries().

◆ boost() [1/3]

HepLorentzVector & CLHEP::HepLorentzVector::boost ( const Hep3Vector )
inline

◆ boost() [2/3]

HepLorentzVector & CLHEP::HepLorentzVector::boost ( const Hep3Vector axis,
double  beta 
)

Definition at line 47 of file LorentzVectorB.cc.

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

◆ boost() [3/3]

HepLorentzVector & CLHEP::HepLorentzVector::boost ( double  bx,
double  by,
double  bz 
)

Definition at line 54 of file LorentzVector.cc.

55 {
56 double b2 = bx*bx + by*by + bz*bz;
57 double ggamma = 1.0 / std::sqrt(1.0 - b2);
58 double bp = bx*x() + by*y() + bz*z();
59 double gamma2 = b2 > 0 ? (ggamma - 1.0)/b2 : 0.0;
60
61 setX(x() + gamma2*bp*bx + ggamma*bx*t());
62 setY(y() + gamma2*bp*by + ggamma*by*t());
63 setZ(z() + gamma2*bp*bz + ggamma*bz*t());
64 setT(ggamma*(t() + bp));
65 return *this;
66}

Referenced by G4WilsonAbrasionModel::ApplyYourself(), G4EMDissociation::ApplyYourself(), G4NeutronElectronElModel::ApplyYourself(), G4NeutrinoElectronCcModel::ApplyYourself(), G4MuMinusCapturePrecompound::ApplyYourself(), G4MuonMinusBoundDecay::ApplyYourself(), G4NeutronRadCapture::ApplyYourself(), G4ChargeExchange::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4LMsdGenerator::ApplyYourself(), G4ParticleHPElasticFS::ApplyYourself(), G4LorentzConvertor::backToTheLab(), G4Nucleon::Boost(), G4DecayProducts::Boost(), G4ExcitedString::Boost(), G4KineticTrackVector::Boost(), G4KineticTrackVector::BoostBeam(), G4InuclEvaporation::BreakItUp(), G4WilsonAblationModel::BreakItUp(), G4StatMF::BreakItUp(), G4UnstableFragmentBreakUp::BreakUpChain(), G4QMDCollision::CalKinematicsOfBinaryCollisions(), G4NeutrinoNucleusModel::ClusterDecay(), G4NeutrinoNucleusModel::CoherentPion(), G4LightTargetCollider::collide(), G4FermiPhaseSpaceDecay::Decay(), G4DalitzDecayChannel::DecayIt(), G4MuonDecayChannelWithSpin::DecayIt(), G4MuonRadiativeDecayChannelWithSpin::DecayIt(), G4TauLeptonicDecayChannel::DecayIt(), G4ECDecay::DecayIt(), G4ITDecay::DecayIt(), G4BigBanger::deExcite(), G4GEMChannel::EmittedFragment(), G4GEMChannelVI::EmittedFragment(), G4EvaporationChannel::EmittedFragment(), G4CompetitiveFission::EmittedFragment(), G4CascadeFinalStateAlgorithm::FillUsingKopylov(), G4NeutrinoNucleusModel::FinalBarion(), G4HadPhaseSpaceKopylov::GenerateMultiBody(), G4DiffuseElastic::GetInvCoulombElasticXsc(), G4NuclNuclDiffuseElastic::GetInvCoulombElasticXsc(), G4DiffuseElastic::GetInvElasticSumXsc(), G4NuclNuclDiffuseElastic::GetInvElasticSumXsc(), G4DiffuseElastic::GetInvElasticXsc(), G4NuclNuclDiffuseElastic::GetInvElasticXsc(), G4LorentzConvertor::getKinEnergyInTheTRS(), G4LorentzConvertor::getTRSMomentum(), G4GeneralPhaseSpaceDecay::ManyBodyDecayIt(), G4NeutrinoNucleusModel::MesonDecay(), G4PreCompoundEmission::PerformEmission(), G4GeneratorPrecompoundInterface::PropagateNuclNucl(), G4QuasiElRatios::RelDecayIn2(), G4DiffuseElastic::SampleInvariantT(), G4DiffuseElasticV2::SampleInvariantT(), G4NuclNuclDiffuseElastic::SampleInvariantT(), G4AntiNuclElastic::SampleInvariantT(), G4eSingleCoulombScatteringModel::SampleSecondaries(), G4HeatedKleinNishinaCompton::SampleSecondaries(), G4IonCoulombScatteringModel::SampleSecondaries(), G4eeToTwoGammaModel::SampleSecondaries(), G4hCoulombScatteringModel::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4eeToHadronsModel::SampleSecondaries(), G4eeTo3PiModel::SampleSecondaries(), G4BetheHeitler5DModel::SampleSecondaries(), G4DiffuseElastic::SampleThetaLab(), G4NuclNuclDiffuseElastic::SampleThetaLab(), G4AntiNuclElastic::SampleThetaLab(), G4GammaTransition::SampleTransition(), G4Fragment::SetExcEnergyAndMomentum(), G4DiffuseElastic::ThetaCMStoThetaLab(), G4DiffuseElasticV2::ThetaCMStoThetaLab(), G4NuclNuclDiffuseElastic::ThetaCMStoThetaLab(), G4DiffuseElastic::ThetaLabToThetaCMS(), G4DiffuseElasticV2::ThetaLabToThetaCMS(), G4NuclNuclDiffuseElastic::ThetaLabToThetaCMS(), G4LorentzConvertor::toTheCenterOfMass(), and G4LorentzConvertor::toTheTargetRestFrame().

◆ boostVector()

Hep3Vector CLHEP::HepLorentzVector::boostVector ( ) const

Definition at line 173 of file LorentzVector.cc.

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

Referenced by G4FTFAnnihilation::Annihilate(), G4NeutronElectronElModel::ApplyYourself(), G4NeutrinoElectronCcModel::ApplyYourself(), G4MuMinusCapturePrecompound::ApplyYourself(), G4MuonMinusBoundDecay::ApplyYourself(), G4NeutronRadCapture::ApplyYourself(), G4ChargeExchange::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4BinaryLightIonReaction::ApplyYourself(), G4INCLXXInterface::ApplyYourself(), G4LMsdGenerator::ApplyYourself(), G4StatMF::BreakItUp(), G4UnstableFragmentBreakUp::BreakUpChain(), G4NeutrinoNucleusModel::ClusterDecay(), G4NeutrinoNucleusModel::CoherentPion(), G4LightTargetCollider::collide(), G4DiffractiveExcitation::CreateStrings(), G4FermiPhaseSpaceDecay::Decay(), G4ECDecay::DecayIt(), G4ITDecay::DecayIt(), G4BigBanger::deExcite(), G4QGSParticipants::DeterminePartonMomenta(), G4ElasticHNScattering::ElasticScattering(), G4GEMChannel::EmittedFragment(), G4GEMChannelVI::EmittedFragment(), G4EvaporationChannel::EmittedFragment(), G4CompetitiveFission::EmittedFragment(), G4QuarkExchange::ExciteParticipants(), G4SingleDiffractiveExcitation::ExciteParticipants(), G4QGSDiffractiveExcitation::ExciteParticipants(), G4DiffractiveExcitation::ExciteParticipants(), G4CascadeFinalStateAlgorithm::FillUsingKopylov(), G4NeutrinoNucleusModel::FinalBarion(), G4VAnnihilationCollision::FinalState(), G4VElasticCollision::FinalState(), G4VScatteringCollision::FinalState(), findBoostToCM(), G4Absorber::FindProducts(), G4ExcitedStringDecay::FragmentStrings(), G4HadDecayGenerator::Generate(), G4HadPhaseSpaceKopylov::GenerateMultiBody(), G4DiffuseElastic::GetInvCoulombElasticXsc(), G4NuclNuclDiffuseElastic::GetInvCoulombElasticXsc(), G4DiffuseElastic::GetInvElasticSumXsc(), G4NuclNuclDiffuseElastic::GetInvElasticSumXsc(), G4DiffuseElastic::GetInvElasticXsc(), G4NuclNuclDiffuseElastic::GetInvElasticXsc(), G4LorentzConvertor::getKinEnergyInTheTRS(), G4LorentzConvertor::getTRSMomentum(), G4NeutrinoNucleusModel::MesonDecay(), G4PreCompoundEmission::PerformEmission(), G4GeneratorPrecompoundInterface::PropagateNuclNucl(), G4QuasiElRatios::RelDecayIn2(), G4DiffuseElastic::SampleInvariantT(), G4DiffuseElasticV2::SampleInvariantT(), G4NuclNuclDiffuseElastic::SampleInvariantT(), G4AntiNuclElastic::SampleInvariantT(), G4eSingleCoulombScatteringModel::SampleSecondaries(), G4HeatedKleinNishinaCompton::SampleSecondaries(), G4IonCoulombScatteringModel::SampleSecondaries(), G4hCoulombScatteringModel::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4eeToHadronsModel::SampleSecondaries(), G4BetheHeitler5DModel::SampleSecondaries(), G4DiffuseElastic::SampleThetaLab(), G4NuclNuclDiffuseElastic::SampleThetaLab(), G4GammaTransition::SampleTransition(), G4Fragment::SetExcEnergyAndMomentum(), G4DiffuseElastic::ThetaCMStoThetaLab(), G4DiffuseElasticV2::ThetaCMStoThetaLab(), G4NuclNuclDiffuseElastic::ThetaCMStoThetaLab(), G4DiffuseElastic::ThetaLabToThetaCMS(), G4DiffuseElasticV2::ThetaLabToThetaCMS(), G4NuclNuclDiffuseElastic::ThetaLabToThetaCMS(), G4LorentzConvertor::toTheTargetRestFrame(), G4FragmentingString::TransformToAlignedCms(), G4ExcitedString::TransformToAlignedCms(), G4FragmentingString::TransformToCenterOfMass(), and G4ExcitedString::TransformToCenterOfMass().

◆ boostX()

HepLorentzVector & CLHEP::HepLorentzVector::boostX ( double  beta)

Definition at line 193 of file LorentzVector.cc.

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

◆ boostY()

HepLorentzVector & CLHEP::HepLorentzVector::boostY ( double  beta)

Definition at line 208 of file LorentzVector.cc.

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

◆ boostZ()

HepLorentzVector & CLHEP::HepLorentzVector::boostZ ( double  beta)

Definition at line 223 of file LorentzVector.cc.

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

Referenced by G4BetheHeitler5DModel::SampleSecondaries().

◆ coLinearRapidity()

double CLHEP::HepLorentzVector::coLinearRapidity ( ) const

Definition at line 168 of file LorentzVectorK.cc.

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

◆ compare()

int CLHEP::HepLorentzVector::compare ( const HepLorentzVector w) const

Definition at line 25 of file LorentzVectorC.cc.

25 {
26 if ( ee > w.ee ) {
27 return 1;
28 } else if ( ee < w.ee ) {
29 return -1;
30 } else {
31 return ( pp.compare(w.pp) );
32 }
33} /* Compare */
int compare(const Hep3Vector &v) const
Definition: SpaceVector.cc:118

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

◆ cosTheta()

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

◆ delta2Euclidean()

double CLHEP::HepLorentzVector::delta2Euclidean ( const HepLorentzVector w) const
inline

◆ deltaR()

double CLHEP::HepLorentzVector::deltaR ( const HepLorentzVector v) const

Definition at line 191 of file LorentzVectorC.cc.

191 {
192
193 double a = eta() - w.eta();
194 double b = pp.deltaPhi(w.getV());
195
196 return std::sqrt ( a*a + b*b );
197
198} /* deltaR */
double deltaPhi(const Hep3Vector &v2) const
Definition: ThreeVector.cc:135

◆ diff2()

double CLHEP::HepLorentzVector::diff2 ( const HepLorentzVector w) const
inline

◆ dot()

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

◆ e()

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

Referenced by G4ParticleHPFinalState::adjust_final_state(), G4NeutrinoElectronNcModel::ApplyYourself(), G4NeutronElectronElModel::ApplyYourself(), G4ANuElNucleusCcModel::ApplyYourself(), G4ANuElNucleusNcModel::ApplyYourself(), G4ANuMuNucleusCcModel::ApplyYourself(), G4ANuMuNucleusNcModel::ApplyYourself(), G4NuElNucleusCcModel::ApplyYourself(), G4NuElNucleusNcModel::ApplyYourself(), G4NuMuNucleusCcModel::ApplyYourself(), G4NuMuNucleusNcModel::ApplyYourself(), G4MuMinusCapturePrecompound::ApplyYourself(), G4MuonMinusBoundDecay::ApplyYourself(), G4NeutronRadCapture::ApplyYourself(), G4ChargeExchange::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4BinaryCascade::ApplyYourself(), G4BinaryLightIonReaction::ApplyYourself(), G4INCLXXInterface::ApplyYourself(), G4LMsdGenerator::ApplyYourself(), G4TheoFSGenerator::ApplyYourself(), G4ParticleHPCaptureFS::ApplyYourself(), G4ParticleHPElasticFS::ApplyYourself(), G4LorentzConvertor::backToTheLab(), G4Nucleon::Boost(), G4NucleiModel::boundaryTransition(), G4WilsonAblationModel::BreakItUp(), G4StatMF::BreakItUp(), G4UnstableFragmentBreakUp::BreakUpChain(), G4QMDMeanField::Cal2BodyQuantities(), G4QMDNucleus::CalEnergyAndAngularMomentumInCM(), G4QMDCollision::CalFinalStateOfTheBinaryCollision(), G4QMDCollision::CalFinalStateOfTheBinaryCollisionJQMD(), G4QMDMeanField::CalGraduate(), G4QMDCollision::CalKinematicsOfBinaryCollisions(), G4HadronicProcess::CheckEnergyMomentumConservation(), G4HadronicProcess::CheckResult(), G4QuasiElRatios::ChExer(), G4NeutrinoNucleusModel::CoherentPion(), G4CascadeCheckBalance::collide(), G4CascadeInterface::createBullet(), G4DiffractiveExcitation::CreateStrings(), G4CollisionNN::CrossSection(), G4BigBanger::deExcite(), G4EquilibriumEvaporator::deExcite(), G4Fissioner::deExcite(), G4NonEquilibriumEvaporator::deExcite(), G4CascadeCheckBalance::deltaE(), G4QGSParticipants::DeterminePartonMomenta(), G4Fancy3DNucleus::DoLorentzContraction(), G4CascadeCheckBalance::ekin(), G4CascadeRecoilMaker::fillRecoil(), G4NeutrinoNucleusModel::FinalBarion(), G4NeutrinoNucleusModel::FinalMomentum(), G4Absorber::FindProducts(), G4ExcitedStringDecay::FragmentStrings(), G4FragmentingString::G4FragmentingString(), G4LorentzConvertor::getKinEnergyInTheTRS(), G4QMDParticipant::GetKineticEnergy(), G4RKPropagation::GetSphereIntersectionTimes(), G4Scatterer::GetTimeToInteraction(), G4HadProjectile::GetTotalEnergy(), G4IntraNucleiCascader::initialize(), G4NeutrinoNucleusModel::MesonDecay(), operator()(), G4ReactionProduct::operator=(), G4InuclParticle::print(), G4LorentzConvertor::printBullet(), G4MCTSimParticle::PrintSingle(), G4LorentzConvertor::printTarget(), G4GeneratorPrecompoundInterface::PropagateNuclNucl(), G4CascadeCheckBalance::relativeE(), G4QuasiElRatios::RelDecayIn2(), G4ParticleHPEnAngCorrelation::Sample(), G4AntiNuclElastic::SampleInvariantT(), G4ANuElNucleusCcModel::SampleLVkr(), G4ANuElNucleusNcModel::SampleLVkr(), G4ANuMuNucleusCcModel::SampleLVkr(), G4ANuMuNucleusNcModel::SampleLVkr(), G4NuElNucleusCcModel::SampleLVkr(), G4NuElNucleusNcModel::SampleLVkr(), G4NuMuNucleusCcModel::SampleLVkr(), G4NuMuNucleusNcModel::SampleLVkr(), G4eSingleCoulombScatteringModel::SampleSecondaries(), G4IonCoulombScatteringModel::SampleSecondaries(), G4hCoulombScatteringModel::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4eeToHadronsModel::SampleSecondaries(), G4eeTo3PiModel::SampleSecondaries(), G4QuasiElRatios::Scatter(), G4QuasiElasticChannel::Scatter(), G4QGSParticipants::SelectInteractions(), G4CollisionOutput::setOnShell(), G4RKPropagation::Transport(), G4CascadeRecoilMaker::wholeEvent(), and G4Absorber::WillBeAbsorbed().

◆ et() [1/2]

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

◆ et() [2/2]

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

◆ et2() [1/2]

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

◆ et2() [2/2]

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

◆ eta() [1/2]

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

Referenced by deltaR().

◆ eta() [2/2]

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

◆ euclideanNorm()

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

Referenced by howParallel(), and isParallel().

◆ euclideanNorm2()

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

Referenced by isParallel().

◆ findBoostToCM() [1/2]

◆ findBoostToCM() [2/2]

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

Definition at line 224 of file LorentzVectorK.cc.

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

◆ gamma()

double CLHEP::HepLorentzVector::gamma ( ) const

Definition at line 91 of file LorentzVectorK.cc.

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

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

◆ getMetric()

ZMpvMetric_t CLHEP::HepLorentzVector::getMetric ( )
static

Definition at line 32 of file LorentzVectorK.cc.

32 {
33 return ( (metric > 0) ? TimePositive : TimeNegative );
34}
@ TimePositive
Definition: LorentzVector.h:59
@ TimeNegative
Definition: LorentzVector.h:59

◆ getT()

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

◆ getTolerance()

double CLHEP::HepLorentzVector::getTolerance ( )
static

Definition at line 245 of file LorentzVector.cc.

245 {
246// Get the tolerance for two LorentzVectors to be considered near each other
247 return tolerance;
248}

◆ getV()

Hep3Vector CLHEP::HepLorentzVector::getV ( ) const
inline

◆ getX()

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

◆ getY()

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

◆ getZ()

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

◆ howLightlike()

double CLHEP::HepLorentzVector::howLightlike ( ) const

Definition at line 245 of file LorentzVectorC.cc.

245 {
246 double m1 = std::fabs(restMass2());
247 double twoT2 = 2*ee*ee;
248 if (m1 < twoT2) {
249 return m1/twoT2;
250 } else {
251 return 1;
252 }
253} /* HowLightlike */

◆ howNear()

double CLHEP::HepLorentzVector::howNear ( const HepLorentzVector w) const

Definition at line 63 of file LorentzVectorC.cc.

63 {
64 double wdw = std::fabs(pp.dot(w.pp)) + .25*((ee+w.ee)*(ee+w.ee));
65 double delta = (pp - w.pp).mag2() + (ee-w.ee)*(ee-w.ee);
66 if ( (wdw > 0) && (delta < wdw) ) {
67 return std::sqrt (delta/wdw);
68 } else if ( (wdw == 0) && (delta == 0) ) {
69 return 0;
70 } else {
71 return 1;
72 }
73} /* howNear() */
double dot(const Hep3Vector &) const

Referenced by howNearCM().

◆ howNearCM()

double CLHEP::HepLorentzVector::howNearCM ( const HepLorentzVector w) const

Definition at line 129 of file LorentzVectorC.cc.

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

◆ howParallel()

double CLHEP::HepLorentzVector::howParallel ( const HepLorentzVector w) const

Definition at line 223 of file LorentzVectorC.cc.

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

◆ invariantMass() [1/2]

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

◆ invariantMass() [2/2]

double CLHEP::HepLorentzVector::invariantMass ( const HepLorentzVector w) const

Definition at line 189 of file LorentzVectorK.cc.

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

◆ invariantMass2() [1/2]

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

Referenced by invariantMass().

◆ invariantMass2() [2/2]

double CLHEP::HepLorentzVector::invariantMass2 ( const HepLorentzVector w) const
inline

◆ isLightlike()

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

Referenced by invariantMass().

◆ isNear()

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

Definition at line 53 of file LorentzVectorC.cc.

54 {
55 double limit = std::fabs(pp.dot(w.pp));
56 limit += .25*((ee+w.ee)*(ee+w.ee));
57 limit *= epsilon*epsilon;
58 double delta = (pp - w.pp).mag2();
59 delta += (ee-w.ee)*(ee-w.ee);
60 return (delta <= limit );
61} /* isNear() */
double epsilon(double density, double temperature)

Referenced by isNearCM().

◆ isNearCM()

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

Definition at line 80 of file LorentzVectorC.cc.

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

◆ isParallel()

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

Definition at line 204 of file LorentzVectorC.cc.

204 {
205 double norm = euclideanNorm();
206 double wnorm = w.euclideanNorm();
207 if ( norm == 0 ) {
208 if ( wnorm == 0 ) {
209 return true;
210 } else {
211 return false;
212 }
213 }
214 if ( wnorm == 0 ) {
215 return false;
216 }
217 HepLorentzVector w1 = *this / norm;
218 HepLorentzVector w2 = w / wnorm;
219 return ( (w1-w2).euclideanNorm2() <= epsilon*epsilon );
220} /* isParallel */
double euclideanNorm2() const

◆ isSpacelike()

bool CLHEP::HepLorentzVector::isSpacelike ( ) const
inline

Referenced by invariantMass().

◆ isTimelike()

bool CLHEP::HepLorentzVector::isTimelike ( ) const
inline

◆ m()

◆ m2()

◆ mag()

◆ mag2()

◆ minus() [1/2]

◆ minus() [2/2]

double CLHEP::HepLorentzVector::minus ( const Hep3Vector ref) const

Definition at line 52 of file LorentzVectorK.cc.

52 {
53 double r = ref.mag();
54 if (r == 0) {
55 std::cerr << "HepLorentzVector::minus() - "
56 << "A zero vector used as reference to LorentzVector minus-part"
57 << std::endl;
58 return ee;
59 }
60 return ee - pp.dot(ref)/r;
61} /* plus */

◆ mt()

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

◆ mt2()

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

◆ operator const Hep3Vector &()

CLHEP::HepLorentzVector::operator const Hep3Vector & ( ) const
inline

◆ operator Hep3Vector &()

CLHEP::HepLorentzVector::operator Hep3Vector & ( )
inline

◆ operator!=()

bool CLHEP::HepLorentzVector::operator!= ( const HepLorentzVector ) const
inline

◆ operator()() [1/2]

double & CLHEP::HepLorentzVector::operator() ( int  i)

Definition at line 37 of file LorentzVector.cc.

37 {
38 static double dummy;
39 switch(i) {
40 case X:
41 case Y:
42 case Z:
43 return pp(i);
44 case T:
45 return ee;
46 default:
47 std::cerr
48 << "HepLorentzVector subscripting: bad index (" << i << ")"
49 << std::endl;
50 return dummy;
51 }
52}

◆ operator()() [2/2]

double CLHEP::HepLorentzVector::operator() ( int  i) const

Definition at line 22 of file LorentzVector.cc.

22 {
23 switch(i) {
24 case X:
25 case Y:
26 case Z:
27 return pp(i);
28 case T:
29 return e();
30 default:
31 std::cerr << "HepLorentzVector subscripting: bad index (" << i << ")"
32 << std::endl;
33 }
34 return 0.;
35}

◆ operator*()

double CLHEP::HepLorentzVector::operator* ( const HepLorentzVector ) const
inline

◆ operator*=() [1/3]

HepLorentzVector & CLHEP::HepLorentzVector::operator*= ( const HepLorentzRotation m1)

Definition at line 17 of file LorentzVectorL.cc.

17 {
18 return *this = m1.vectorMultiplication(*this);
19}

◆ operator*=() [2/3]

HepLorentzVector & CLHEP::HepLorentzVector::operator*= ( const HepRotation )
inline

◆ operator*=() [3/3]

HepLorentzVector & CLHEP::HepLorentzVector::operator*= ( double  )
inline

◆ operator+()

HepLorentzVector CLHEP::HepLorentzVector::operator+ ( const HepLorentzVector ) const
inline

◆ operator+=()

HepLorentzVector & CLHEP::HepLorentzVector::operator+= ( const HepLorentzVector )
inline

◆ operator-() [1/2]

HepLorentzVector CLHEP::HepLorentzVector::operator- ( ) const
inline

◆ operator-() [2/2]

HepLorentzVector CLHEP::HepLorentzVector::operator- ( const HepLorentzVector ) const
inline

◆ operator-=()

HepLorentzVector & CLHEP::HepLorentzVector::operator-= ( const HepLorentzVector )
inline

◆ operator/=()

HepLorentzVector & CLHEP::HepLorentzVector::operator/= ( double  c)

Definition at line 148 of file LorentzVector.cc.

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

◆ operator<()

bool CLHEP::HepLorentzVector::operator< ( const HepLorentzVector w) const

Definition at line 38 of file LorentzVectorC.cc.

38 {
39 return (compare(w) < 0);
40}
int compare(const HepLorentzVector &w) const

◆ operator<=()

bool CLHEP::HepLorentzVector::operator<= ( const HepLorentzVector w) const

Definition at line 44 of file LorentzVectorC.cc.

44 {
45 return (compare(w) <= 0);
46}

◆ operator=() [1/3]

HepLorentzVector & CLHEP::HepLorentzVector::operator= ( const Hep3Vector v)
inline

◆ operator=() [2/3]

HepLorentzVector & CLHEP::HepLorentzVector::operator= ( const HepLorentzVector )
inline

◆ operator=() [3/3]

HepLorentzVector & CLHEP::HepLorentzVector::operator= ( HepLorentzVector &&  )
inlinedefault

◆ operator==()

bool CLHEP::HepLorentzVector::operator== ( const HepLorentzVector ) const
inline

◆ operator>()

bool CLHEP::HepLorentzVector::operator> ( const HepLorentzVector w) const

Definition at line 35 of file LorentzVectorC.cc.

35 {
36 return (compare(w) > 0);
37}

◆ operator>=()

bool CLHEP::HepLorentzVector::operator>= ( const HepLorentzVector w) const

Definition at line 41 of file LorentzVectorC.cc.

41 {
42 return (compare(w) >= 0);
43}

◆ operator[]() [1/2]

double & CLHEP::HepLorentzVector::operator[] ( int  )
inline

◆ operator[]() [2/2]

double CLHEP::HepLorentzVector::operator[] ( int  ) const
inline

◆ perp() [1/2]

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

◆ perp() [2/2]

double CLHEP::HepLorentzVector::perp ( const Hep3Vector ) const
inline

◆ perp2() [1/2]

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

◆ perp2() [2/2]

double CLHEP::HepLorentzVector::perp2 ( const Hep3Vector ) const
inline

◆ phi()

◆ plus() [1/2]

◆ plus() [2/2]

double CLHEP::HepLorentzVector::plus ( const Hep3Vector ref) const

Definition at line 41 of file LorentzVectorK.cc.

41 {
42 double r = ref.mag();
43 if (r == 0) {
44 std::cerr << "HepLorentzVector::plus() - "
45 << "A zero vector used as reference to LorentzVector plus-part"
46 << std::endl;
47 return ee;
48 }
49 return ee + pp.dot(ref)/r;
50} /* plus */

◆ pseudoRapidity()

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

◆ px()

◆ py()

◆ pz()

◆ rapidity() [1/2]

double CLHEP::HepLorentzVector::rapidity ( ) const

Definition at line 125 of file LorentzVectorK.cc.

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

◆ rapidity() [2/2]

double CLHEP::HepLorentzVector::rapidity ( const Hep3Vector ref) const

Definition at line 144 of file LorentzVectorK.cc.

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

◆ rest4Vector()

HepLorentzVector CLHEP::HepLorentzVector::rest4Vector ( ) const

Definition at line 63 of file LorentzVectorK.cc.

63 {
64 return HepLorentzVector (0, 0, 0, (t() < 0.0 ? -m() : m()));
65}

◆ restMass()

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

◆ restMass2()

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

Referenced by boostVector(), and howLightlike().

◆ rho()

◆ rotate() [1/5]

HepLorentzVector & CLHEP::HepLorentzVector::rotate ( const Hep3Vector axis,
double  delta 
)

Definition at line 20 of file LorentzVectorR.cc.

21 {
22 pp.rotate (aaxis, ddelta);
23 return *this;
24}
Hep3Vector & rotate(double, const Hep3Vector &)
Definition: ThreeVectorR.cc:24

◆ rotate() [2/5]

HepLorentzVector & CLHEP::HepLorentzVector::rotate ( const HepAxisAngle ax)

Definition at line 26 of file LorentzVectorR.cc.

26 {
27 pp.rotate (ax);
28 return *this;
29}

◆ rotate() [3/5]

HepLorentzVector & CLHEP::HepLorentzVector::rotate ( const HepEulerAngles e)

Definition at line 31 of file LorentzVectorR.cc.

31 {
32 pp.rotate (e1);
33 return *this;
34}

◆ rotate() [4/5]

HepLorentzVector & CLHEP::HepLorentzVector::rotate ( double  phi,
double  theta,
double  psi 
)

Definition at line 36 of file LorentzVectorR.cc.

38 {
39 pp.rotate (phi1, theta1, psi1);
40 return *this;
41}

◆ rotate() [5/5]

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

Definition at line 15 of file LorentzVectorR.cc.

15 {
16 pp.rotate(a,v1);
17 return *this;
18}

◆ rotateUz()

HepLorentzVector & CLHEP::HepLorentzVector::rotateUz ( const Hep3Vector v1)

Definition at line 81 of file LorentzVector.cc.

81 {
82 pp.rotateUz(v1);
83 return *this;
84}
Hep3Vector & rotateUz(const Hep3Vector &)
Definition: ThreeVector.cc:33

Referenced by G4eeTo3PiModel::SampleSecondaries().

◆ rotateX()

HepLorentzVector & CLHEP::HepLorentzVector::rotateX ( double  a)

Definition at line 68 of file LorentzVector.cc.

68 {
69 pp.rotateX(a);
70 return *this;
71}
Hep3Vector & rotateX(double)
Definition: ThreeVector.cc:87

◆ rotateY()

HepLorentzVector & CLHEP::HepLorentzVector::rotateY ( double  a)

Definition at line 72 of file LorentzVector.cc.

72 {
73 pp.rotateY(a);
74 return *this;
75}
Hep3Vector & rotateY(double)
Definition: ThreeVector.cc:97

Referenced by G4DiffractiveExcitation::ExciteParticipants().

◆ rotateZ()

HepLorentzVector & CLHEP::HepLorentzVector::rotateZ ( double  a)

Definition at line 76 of file LorentzVector.cc.

76 {
77 pp.rotateZ(a);
78 return *this;
79}
Hep3Vector & rotateZ(double)
Definition: ThreeVector.cc:107

Referenced by G4DiffractiveExcitation::ExciteParticipants().

◆ set() [1/8]

void CLHEP::HepLorentzVector::set ( const Hep3Vector v)
inline

◆ set() [2/8]

void CLHEP::HepLorentzVector::set ( const Hep3Vector v,
double  t 
)
inline

◆ set() [3/8]

void CLHEP::HepLorentzVector::set ( double  t)
inline

◆ set() [4/8]

void CLHEP::HepLorentzVector::set ( double  t,
const Hep3Vector v 
)
inline

◆ set() [5/8]

◆ set() [6/8]

void CLHEP::HepLorentzVector::set ( double  x,
double  y,
double  z,
Tcomponent  t 
)
inline

◆ set() [7/8]

void CLHEP::HepLorentzVector::set ( Tcomponent  t)
inline

◆ set() [8/8]

void CLHEP::HepLorentzVector::set ( Tcomponent  t,
double  x,
double  y,
double  z 
)
inline

◆ setE()

◆ setMetric()

ZMpvMetric_t CLHEP::HepLorentzVector::setMetric ( ZMpvMetric_t  met)
static

Definition at line 22 of file LorentzVectorK.cc.

22 {
23 ZMpvMetric_t oldMetric = (metric > 0) ? TimePositive : TimeNegative;
24 if ( a1 == TimeNegative ) {
25 metric = -1.0;
26 } else {
27 metric = 1.0;
28 }
29 return oldMetric;
30}

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

◆ setPerp()

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

◆ setPhi()

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

◆ setPx()

◆ setPy()

◆ setPz()

◆ setREtaPhi()

void CLHEP::HepLorentzVector::setREtaPhi ( double  r,
double  eta,
double  phi 
)
inline

◆ setRho()

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

◆ setRhoPhiZ()

void CLHEP::HepLorentzVector::setRhoPhiZ ( double  rho,
double  phi,
double  z 
)
inline

◆ setRThetaPhi()

void CLHEP::HepLorentzVector::setRThetaPhi ( double  r,
double  theta,
double  phi 
)
inline

◆ setT()

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

◆ setTheta()

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

◆ setTolerance()

double CLHEP::HepLorentzVector::setTolerance ( double  tol)
static

Definition at line 238 of file LorentzVector.cc.

238 {
239// Set the tolerance for two LorentzVectors to be considered near each other
240 double oldTolerance (tolerance);
241 tolerance = tol;
242 return oldTolerance;
243}

◆ setV() [1/2]

void CLHEP::HepLorentzVector::setV ( const Hep3Vector )
inline

◆ setV() [2/2]

void CLHEP::HepLorentzVector::setV ( double  x,
double  y,
double  z 
)
inline

◆ setVect()

◆ setVectM()

◆ setVectMag()

void CLHEP::HepLorentzVector::setVectMag ( const Hep3Vector spatial,
double  magnitude 
)
inline

◆ setX()

◆ setY()

◆ setZ()

◆ t()

◆ theta()

◆ transform() [1/2]

HepLorentzVector & CLHEP::HepLorentzVector::transform ( const HepLorentzRotation m1)

Definition at line 22 of file LorentzVectorL.cc.

22 {
23 return *this = m1.vectorMultiplication(*this);
24}

◆ transform() [2/2]

◆ v()

◆ vect()

Hep3Vector CLHEP::HepLorentzVector::vect ( ) const
inline

Referenced by G4ParticleHPChannelList::ApplyYourself(), G4WilsonAbrasionModel::ApplyYourself(), G4EMDissociation::ApplyYourself(), G4LENDElastic::ApplyYourself(), G4LENDInelastic::ApplyYourself(), G4LENDModel::ApplyYourself(), G4ElectroVDNuclearModel::ApplyYourself(), G4LEHadronProtonElastic::ApplyYourself(), G4NeutrinoElectronNcModel::ApplyYourself(), G4NeutronElectronElModel::ApplyYourself(), G4LFission::ApplyYourself(), G4ANuElNucleusCcModel::ApplyYourself(), G4ANuElNucleusNcModel::ApplyYourself(), G4ANuMuNucleusCcModel::ApplyYourself(), G4ANuMuNucleusNcModel::ApplyYourself(), G4MuonVDNuclearModel::ApplyYourself(), G4NeutrinoElectronCcModel::ApplyYourself(), G4NuElNucleusCcModel::ApplyYourself(), G4NuElNucleusNcModel::ApplyYourself(), G4NuMuNucleusCcModel::ApplyYourself(), G4NuMuNucleusNcModel::ApplyYourself(), G4RPGAntiOmegaMinusInelastic::ApplyYourself(), G4RPGAntiProtonInelastic::ApplyYourself(), G4RPGAntiSigmaMinusInelastic::ApplyYourself(), G4RPGAntiSigmaPlusInelastic::ApplyYourself(), G4RPGAntiXiMinusInelastic::ApplyYourself(), G4RPGKMinusInelastic::ApplyYourself(), G4RPGKPlusInelastic::ApplyYourself(), G4RPGOmegaMinusInelastic::ApplyYourself(), G4RPGPiMinusInelastic::ApplyYourself(), G4RPGPiPlusInelastic::ApplyYourself(), G4RPGProtonInelastic::ApplyYourself(), G4RPGSigmaMinusInelastic::ApplyYourself(), G4RPGSigmaPlusInelastic::ApplyYourself(), G4RPGXiMinusInelastic::ApplyYourself(), G4RPGXiZeroInelastic::ApplyYourself(), G4MuMinusCapturePrecompound::ApplyYourself(), G4MuonMinusBoundDecay::ApplyYourself(), G4NeutronRadCapture::ApplyYourself(), G4ChargeExchange::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4LEnp::ApplyYourself(), G4LEpp::ApplyYourself(), G4BinaryCascade::ApplyYourself(), G4BinaryLightIonReaction::ApplyYourself(), G4INCLXXInterface::ApplyYourself(), G4LMsdGenerator::ApplyYourself(), G4LowEIonFragmentation::ApplyYourself(), G4TheoFSGenerator::ApplyYourself(), G4FissionLibrary::ApplyYourself(), G4ParticleHPCaptureFS::ApplyYourself(), G4ParticleHPElasticFS::ApplyYourself(), G4ParticleHPFissionFS::ApplyYourself(), G4ParticleHPInelasticBaseFS::BaseApply(), G4Nucleon::Boost(), G4NucleiModel::boundaryTransition(), G4InuclEvaporation::BreakItUp(), G4UnstableFragmentBreakUp::BreakUpChain(), G4RPGInelastic::CalculateMomenta(), G4QMDCollision::CalKinematicsOfBinaryCollisions(), G4HadronicProcess::CheckEnergyMomentumConservation(), G4NucleiModel::choosePointAlongTraj(), G4NeutrinoNucleusModel::CoherentPion(), G4ParticleHPInelasticCompFS::CompositeApply(), G4DiffractiveExcitation::CreateStrings(), G4IntraNucleiCascader::decayTrappedParticle(), G4Fissioner::deExcite(), G4NonEquilibriumEvaporator::deExcite(), G4Fancy3DNucleus::DoLorentzContraction(), G4ElasticHNScattering::ElasticScattering(), G4QuarkExchange::ExciteParticipants(), G4SingleDiffractiveExcitation::ExciteParticipants(), G4QGSDiffractiveExcitation::ExciteParticipants(), G4LorentzConvertor::fillKinematics(), G4NeutrinoNucleusModel::FinalBarion(), G4NeutrinoNucleusModel::FinalMomentum(), G4ExcitedStringDecay::FragmentStrings(), G4FragmentingString::G4FragmentingString(), G4NucleiModel::generateInteractionPartners(), G4DiffuseElastic::GetInvCoulombElasticXsc(), G4NuclNuclDiffuseElastic::GetInvCoulombElasticXsc(), G4DiffuseElastic::GetInvElasticSumXsc(), G4NuclNuclDiffuseElastic::GetInvElasticSumXsc(), G4DiffuseElastic::GetInvElasticXsc(), G4NuclNuclDiffuseElastic::GetInvElasticXsc(), G4CascadParticle::getPathToTheNextZone(), G4RKPropagation::GetSphereIntersectionTimes(), G4ParticleHPThermalBoost::GetThermalEnergy(), G4Scatterer::GetTimeToInteraction(), G4NucleiModel::initializeCascad(), G4CascadeInterface::makeDynamicParticle(), G4CascadeDeexciteBase::makeFragment(), G4CascadeRecoilMaker::makeRecoilFragment(), G4ReactionProduct::operator=(), G4CascadeHistory::PrintEntry(), G4DecayStrongResonances::Propagate(), G4GeneratorPrecompoundInterface::Propagate(), G4CascadParticle::propagateAlongThePath(), G4GeneratorPrecompoundInterface::PropagateNuclNucl(), G4QuasiElRatios::RelDecayIn2(), G4LorentzConvertor::rotate(), G4ParticleHPEnAngCorrelation::Sample(), G4DiffuseElastic::SampleInvariantT(), G4DiffuseElasticV2::SampleInvariantT(), G4NuclNuclDiffuseElastic::SampleInvariantT(), G4AntiNuclElastic::SampleInvariantT(), G4eSingleCoulombScatteringModel::SampleSecondaries(), G4HeatedKleinNishinaCompton::SampleSecondaries(), G4IonCoulombScatteringModel::SampleSecondaries(), G4hCoulombScatteringModel::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4BetheHeitler5DModel::SampleSecondaries(), G4DiffuseElastic::SampleThetaLab(), G4NuclNuclDiffuseElastic::SampleThetaLab(), G4AntiNuclElastic::SampleThetaLab(), G4Scatterer::Scatter(), G4QuasiElasticChannel::Scatter(), G4DynamicParticle::Set4Momentum(), G4LorentzConvertor::setBullet(), G4InuclParticle::setMomentum(), G4CollisionOutput::setOnShell(), G4FragmentingString::SetPleft(), G4FragmentingString::SetPright(), G4LorentzConvertor::setTarget(), G4KineticTrack::SetTrackingMomentum(), G4DiffuseElastic::ThetaCMStoThetaLab(), G4DiffuseElasticV2::ThetaCMStoThetaLab(), G4NuclNuclDiffuseElastic::ThetaCMStoThetaLab(), G4DiffuseElastic::ThetaLabToThetaCMS(), G4DiffuseElasticV2::ThetaLabToThetaCMS(), G4NuclNuclDiffuseElastic::ThetaLabToThetaCMS(), G4LorentzConvertor::toTheCenterOfMass(), G4LorentzConvertor::toTheTargetRestFrame(), G4FragmentingString::TransformToAlignedCms(), G4FragmentingString::TransformToCenterOfMass(), G4RKPropagation::Transport(), G4KineticTrack::Update4Momentum(), and G4KineticTrack::UpdateTrackingMomentum().

◆ x()

◆ y()

◆ z()

Friends And Related Function Documentation

◆ boostOf [1/2]

HepLorentzVector boostOf ( const HepLorentzVector vec,
const Hep3Vector axis,
double  beta 
)
friend

◆ boostOf [2/2]

HepLorentzVector boostOf ( const HepLorentzVector vec,
const Hep3Vector betaVector 
)
friend

◆ boostXOf

HepLorentzVector boostXOf ( const HepLorentzVector vec,
double  beta 
)
friend

◆ boostYOf

HepLorentzVector boostYOf ( const HepLorentzVector vec,
double  beta 
)
friend

◆ boostZOf

HepLorentzVector boostZOf ( const HepLorentzVector vec,
double  beta 
)
friend

◆ rotationOf [1/4]

HepLorentzVector rotationOf ( const HepLorentzVector vec,
const Hep3Vector axis,
double  delta 
)
friend

Definition at line 43 of file LorentzVectorR.cc.

45 {
46 HepLorentzVector vv (vec);
47 return vv.rotate (aaxis, ddelta);
48}

◆ rotationOf [2/4]

HepLorentzVector rotationOf ( const HepLorentzVector vec,
const HepAxisAngle ax 
)
friend

Definition at line 50 of file LorentzVectorR.cc.

51 {
52 HepLorentzVector vv (vec);
53 return vv.rotate (ax);
54}

◆ rotationOf [3/4]

HepLorentzVector rotationOf ( const HepLorentzVector vec,
const HepEulerAngles e 
)
friend

Definition at line 56 of file LorentzVectorR.cc.

57 {
58 HepLorentzVector vv (vec);
59 return vv.rotate (e1);
60}

◆ rotationOf [4/4]

HepLorentzVector rotationOf ( const HepLorentzVector vec,
double  phi,
double  theta,
double  psi 
)
friend

Definition at line 62 of file LorentzVectorR.cc.

65 {
66 HepLorentzVector vv (vec);
67 return vv.rotate (phi1, theta1, psi1);
68}

◆ rotationXOf

HepLorentzVector rotationXOf ( const HepLorentzVector vec,
double  delta 
)
friend

Definition at line 25 of file LorentzVectorB.cc.

26 {
27 HepLorentzVector vv (vec);
28 return vv.rotateX (phi);
29}

◆ rotationYOf

HepLorentzVector rotationYOf ( const HepLorentzVector vec,
double  delta 
)
friend

Definition at line 31 of file LorentzVectorB.cc.

32 {
33 HepLorentzVector vv (vec);
34 return vv.rotateY (phi);
35}

◆ rotationZOf

HepLorentzVector rotationZOf ( const HepLorentzVector vec,
double  delta 
)
friend

Definition at line 37 of file LorentzVectorB.cc.

38 {
39 HepLorentzVector vv (vec);
40 return vv.rotateZ (phi);
41}

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