56 theMomentumDirectionChange(),
57 thePolarizationChange(),
59 theVelocityChange(0.), isVelocityChanged(false),
61 theGlobalTime0(0.), theLocalTime0(0.),
62 theTimeChange(0.), theProperTimeChange(0.),
63 theMassChange(0.), theChargeChange(0.),
64 theMagneticMomentChange(0.), theCurrentTrack(0)
72 G4cout <<
"G4ParticleChange::~G4ParticleChange() " <<
G4endl;
82 G4cout <<
"G4ParticleChange:: copy constructor is called " <<
G4endl;
106 G4cout <<
"G4ParticleChange:: assignment operator is called " <<
G4endl;
113 G4cout <<
"G4ParticleChange: assignment operator Warning ";
114 G4cout <<
"theListOfSecondaries is not empty ";
169 G4bool IsGoodForTracking )
186 G4bool IsGoodForTracking )
203 G4bool IsGoodForTracking )
298 G4double tMomentum = pMomentum.mag();
300 if( tMomentum > 0. ){
301 G4double inv_Momentum= 1.0 / tMomentum;
302 direction= pMomentum * inv_Momentum;
452 G4cout <<
" Mass (GeV) : "
455 G4cout <<
" Charge (eplus) : "
458 G4cout <<
" MagneticMoment : "
460 G4cout <<
" : = " << std::setw(20)
464 G4cout <<
" Position - x (mm) : "
467 G4cout <<
" Position - y (mm) : "
470 G4cout <<
" Position - z (mm) : "
476 G4cout <<
" Proper Time (ns) : "
479 G4cout <<
" Momentum Direct - x : "
482 G4cout <<
" Momentum Direct - y : "
485 G4cout <<
" Momentum Direct - z : "
488 G4cout <<
" Kinetic Energy (MeV): "
491 G4cout <<
" Velocity (/c): "
494 G4cout <<
" Polarization - x : "
497 G4cout <<
" Polarization - y : "
500 G4cout <<
" Polarization - z : "
508 G4bool exitWithError =
false;
512 const G4int maxError = 30;
519 G4bool itsOKforMomentum =
true;
523 itsOKforMomentum =
false;
527 if (nError < maxError) {
528 G4cout <<
" G4ParticleChange::CheckIt : ";
529 G4cout <<
"the Momentum Change is not unit vector !!"
530 <<
" Difference: " << accuracy <<
G4endl;
543 G4bool itsOKforGlobalTime =
true;
546 itsOKforGlobalTime =
false;
550 if (nError < maxError) {
551 G4cout <<
" G4ParticleChange::CheckIt : ";
552 G4cout <<
"the local time goes back !!"
553 <<
" Difference: " << accuracy <<
"[ns] " <<
G4endl;
567 G4bool itsOKforProperTime =
true;
570 itsOKforProperTime =
false;
574 if (nError < maxError) {
575 G4cout <<
" G4ParticleChange::CheckIt : ";
576 G4cout <<
"the proper time goes back !!"
577 <<
" Difference: " << accuracy <<
"[ns] " <<
G4endl;
592 G4bool itsOKforEnergy =
true;
595 itsOKforEnergy =
false;
599 if (nError < maxError) {
600 G4cout <<
" G4ParticleChange::CheckIt : ";
601 G4cout <<
"the kinetic energy is negative !!"
602 <<
" Difference: " << accuracy <<
"[MeV] " <<
G4endl;
614 G4bool itsOKforVelocity =
true;
616 itsOKforVelocity =
false;
618 exitWithError =
true;
620 if (nError < maxError) {
621 G4cout <<
" G4ParticleChange::CheckIt : ";
622 G4cout <<
"the velocity is negative !!"
636 itsOKforVelocity =
false;
640 if (nError < maxError) {
641 G4cout <<
" G4ParticleChange::CheckIt : ";
642 G4cout <<
"the velocity is greater than c_light !!" <<
G4endl;
654 G4bool itsOK = itsOKforMomentum && itsOKforEnergy && itsOKforVelocity && itsOKforProperTime && itsOKforGlobalTime;
666 "momentum, energy, and/or time was illegal");
669 if (!itsOKforMomentum) {
673 if (!itsOKforGlobalTime) {
676 if (!itsOKforProperTime) {
679 if (!itsOKforEnergy) {
682 if (!itsOKforVelocity) {
G4ParticleDefinition * GetDefinition() const
void AddGlobalTime(const G4double aValue)
virtual void Initialize(const G4Track &)
G4double theProperTimeChange
void SetElement(G4int anIndex, Type *anElement)
void AddPosition(const G4ThreeVector &aValue)
void SetPosition(const G4ThreeVector &aValue)
G4Step * UpdateStepInfo(G4Step *Step)
G4double GetLocalTime() const
static constexpr double mm
G4double GetProperTime() const
G4double GetKineticEnergy() const
CLHEP::Hep3Vector G4ThreeVector
G4double GetVelocity() const
const G4DynamicParticle * GetDynamicParticle() const
void SetMagneticMoment(G4double value)
G4double GetProperTime() const
const G4ThreeVector & GetPosition() const
G4TrackFastVector * theListOfSecondaries
void SetWeight(G4double aValue)
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4ThreeVector GetMomentum() const
virtual void DumpInfo() const
G4double GetGlobalTime(G4double timeDelay=0.0) const
virtual ~G4ParticleChange()
G4ThreeVector CalcMomentum(G4double energy, G4ThreeVector direction, G4double mass) const
void AddLocalTime(const G4double aValue)
const G4String & GetParticleName() const
static const G4double accuracyForException
void AddPolarization(const G4ThreeVector &aValue)
void SetMomentumDirection(const G4ThreeVector &aValue)
G4StepPoint * GetPreStepPoint() const
void SetLocalTime(const G4double aValue)
virtual G4bool CheckIt(const G4Track &)
G4double theMagneticMomentChange
G4ThreeVector thePositionChange
G4ThreeVector thePolarizationChange
G4double GetKineticEnergy() const
void SetPolarization(const G4ThreeVector &aValue)
G4GLOB_DLL std::ostream G4cout
virtual G4Step * UpdateStepForPostStep(G4Step *Step)
static constexpr double m
const G4ThreeVector & GetPosition() const
G4double theTrueStepLength
G4ParticleChange & operator=(const G4ParticleChange &right)
const G4ThreeVector & GetMomentumDirection() const
G4SteppingControl theSteppingControlFlag
G4bool isParentWeightProposed
G4double theLocalEnergyDeposit
G4double GetCharge() const
static constexpr double eplus
G4bool operator==(const G4ParticleChange &right) const
virtual G4Step * UpdateStepForAlongStep(G4Step *Step)
G4int theNumberOfSecondaries
G4double GetGlobalTime() const
G4double CalculateVelocity() const
void AddSecondary(G4Track *aSecondary)
G4bool operator!=(const G4ParticleChange &right) const
const G4TouchableHandle & GetTouchableHandle() const
void SetProperTime(const G4double aValue)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual G4bool CheckIt(const G4Track &)
G4ThreeVector theMomentumDirectionChange
virtual void Initialize(const G4Track &)
void SetVelocity(G4double v)
virtual void DumpInfo() const
virtual G4Step * UpdateStepForAtRest(G4Step *Step)
G4FastVector< G4Track, G4TrackFastVectorSize > G4TrackFastVector
G4double energy(const ThreeVector &p, const G4double m)
void SetCharge(G4double value)
G4StepPoint * GetPostStepPoint() const
G4double theVelocityChange
const G4ThreeVector & GetPolarization() const
static constexpr double GeV
const G4Track * theCurrentTrack
G4double GetProperTime() const
void AddSecondary(G4Track *aSecondary)
void SetMass(G4double value)
static constexpr double MeV
G4TrackStatus GetTrackStatus() const
G4TrackStatus theStatusChange
void SetKineticEnergy(const G4double aValue)
G4double GetKineticEnergy() const
static const G4double accuracyForWarning
void SetKineticEnergy(const G4double aValue)
G4Track * GetTrack() const
G4double GetMagneticMoment() const
const G4ThreeVector & GetPolarization() const
void SetGoodForTrackingFlag(G4bool value=true)
void AddProperTime(const G4double aValue)