Files
geant4/source/track/include/G4ParticleChange.icc
T
2016-06-09 11:11:55 +02:00

198 lines
4.7 KiB
Plaintext

//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParticleChange.icc,v 1.12 2004/12/02 06:38:00 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
//
//
inline
G4Step* G4ParticleChange::UpdateStepInfo(G4Step* pStep)
{
return G4VParticleChange::UpdateStepInfo(pStep);
}
inline
G4double G4ParticleChange::GetEnergy() const
{
return theEnergyChange;
}
inline
void G4ParticleChange::ProposeEnergy(G4double finalEnergy)
{
theEnergyChange = finalEnergy;
}
inline
const G4ThreeVector* G4ParticleChange::GetMomentumDirection() const
{
return &theMomentumDirectionChange;
}
inline
void G4ParticleChange::ProposeMomentumDirection(
G4double Px,
G4double Py,
G4double Pz )
{
theMomentumDirectionChange.setX(Px);
theMomentumDirectionChange.setY(Py);
theMomentumDirectionChange.setZ(Pz);
}
inline
void G4ParticleChange::ProposeMomentumDirection(const G4ThreeVector& P)
{
theMomentumDirectionChange = P;
}
inline
const G4ThreeVector* G4ParticleChange::GetPolarization() const
{
return &thePolarizationChange;
}
inline
void G4ParticleChange::ProposePolarization( const G4ThreeVector& finalPoralization)
{
thePolarizationChange = finalPoralization;
}
inline
void G4ParticleChange::ProposePolarization(
G4double Px,
G4double Py,
G4double Pz )
{
thePolarizationChange.setX(Px);
thePolarizationChange.setY(Py);
thePolarizationChange.setZ(Pz);
}
inline
const G4ThreeVector* G4ParticleChange::GetPosition() const
{
return &thePositionChange;
}
inline
void G4ParticleChange::ProposePosition(const G4ThreeVector& finalPosition)
{
thePositionChange= finalPosition;
}
inline
void G4ParticleChange::ProposePosition(G4double x,G4double y, G4double z)
{
thePositionChange.setX(x);
thePositionChange.setY(y);
thePositionChange.setZ(z);
}
inline
G4double G4ParticleChange::GetProperTime() const
{
return theProperTimeChange;
}
inline
void G4ParticleChange::ProposeProperTime(G4double tau)
{
theProperTimeChange = tau;
}
inline
G4ThreeVector G4ParticleChange::GetGlobalPosition(const G4ThreeVector& displacement) const
{
return thePositionChange + displacement;
}
inline
G4double G4ParticleChange::GetGlobalTime(G4double timeDelay) const
{
// Convert the time delay to the global time.
return theTimeChange + timeDelay;
}
inline
G4double G4ParticleChange::GetGlobalTime() const
{
return theTimeChange;
}
inline
void G4ParticleChange::ProposeGlobalTime(G4double t)
{
theTimeChange = t;
}
inline
G4double G4ParticleChange::GetMass() const
{
return theMassChange;
}
inline
void G4ParticleChange::ProposeMass(G4double t)
{
theMassChange = t;
}
inline
G4double G4ParticleChange::GetCharge() const
{
return theChargeChange;
}
inline
void G4ParticleChange::ProposeCharge(G4double t)
{
theChargeChange = t;
}
inline
G4double G4ParticleChange::GetWeight() const
{
return theWeightChange;
}
inline
void G4ParticleChange::ProposeWeight(G4double w)
{
theWeightChange = w;
theParentWeight = w;
}
inline
G4ThreeVector G4ParticleChange::CalcMomentum(G4double energy,
G4ThreeVector direction,
G4double mass
) const
{
G4double tMomentum = std::sqrt(energy*energy + 2*energy*mass);
return direction*tMomentum;
}