diff --git a/NPLib/Physics/NPParticle.cxx b/NPLib/Physics/NPParticle.cxx index c34b283b7af0ce0ea58342de7ea3c9c0a383a12e..255dba7acea0881680bfa08f403ecfaadf8de262 100644 --- a/NPLib/Physics/NPParticle.cxx +++ b/NPLib/Physics/NPParticle.cxx @@ -509,6 +509,13 @@ void Particle::EnergyToBrho(double Q){ fBrho = 3.107*GetA()/Q*fBeta*fGamma; } +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +void Particle::EnergyToEnergyImpulsion(double energy, double ThetaLab, double PhiLab){ + double p = sqrt(pow(energy,2) + 2*Mass()*energy); + TVector3 Impulsion = TVector3(p*sin(ThetaLab)*cos(PhiLab), p*sin(ThetaLab)*sin(PhiLab), p*cos(ThetaLab)); + + fEnergyImpulsion = TLorentzVector(Impulsion, energy+Mass()); +} //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... void Particle::EnergyToTof(){ diff --git a/NPLib/Physics/NPParticle.h b/NPLib/Physics/NPParticle.h index 0f31c179bf0023a6dcaafb621e13f2fdbb9695f5..c4caec7c479448b9770525844ae87c0dd76b71cd 100644 --- a/NPLib/Physics/NPParticle.h +++ b/NPLib/Physics/NPParticle.h @@ -93,6 +93,7 @@ namespace NPL { void TofToEnergy(); void TofToBrho(){TofToEnergy(); EnergyToBrho();} void EnergyToBeta(); + void EnergyToEnergyImpulsion(double, double, double); void BetaToEnergy(); void BetaToGamma(); double DopplerCorrection(double EnergyLabGamma, double ThetaLabGamma); @@ -130,13 +131,15 @@ namespace NPL { void SetParity(const char* parity) {fParity = parity;} void SetLifeTime(double LifeTime) {fLifeTime=LifeTime;} void SetLifeTimeError(double LifeTimeErr) {fLifeTimeErr=LifeTimeErr;} - void SetKineticEnergy(double energy){ + void SetKineticEnergy(double energy, double ThetaLab=0, double PhiLab=0){ fKineticEnergy = energy; EnergyToBrho(); EnergyToTof(); EnergyToBeta(); BetaToGamma(); - BetaToVelocity();} + BetaToVelocity(); + EnergyToEnergyImpulsion(energy,ThetaLab,PhiLab); + } void SetBrho(double brho){ fBrho = brho; BrhoToEnergy();