G4ParticleChange Class Reference

#include <G4ParticleChange.hh>

Inheritance diagram for G4ParticleChange:

G4VParticleChange G4ParticleChangeForTransport

Public Member Functions

 G4ParticleChange ()
virtual ~G4ParticleChange ()
G4bool operator== (const G4ParticleChange &right) const
G4bool operator!= (const G4ParticleChange &right) const
virtual G4StepUpdateStepForAlongStep (G4Step *Step)
virtual G4StepUpdateStepForAtRest (G4Step *Step)
virtual G4StepUpdateStepForPostStep (G4Step *Step)
virtual void Initialize (const G4Track &)
const G4ThreeVectorGetMomentumDirection () const
void ProposeMomentumDirection (G4double Px, G4double Py, G4double Pz)
void ProposeMomentumDirection (const G4ThreeVector &Pfinal)
const G4ThreeVectorGetPolarization () const
void ProposePolarization (G4double Px, G4double Py, G4double Pz)
void ProposePolarization (const G4ThreeVector &finalPoralization)
G4double GetEnergy () const
void ProposeEnergy (G4double finalEnergy)
G4double GetVelocity () const
void ProposeVelocity (G4double finalVelocity)
G4double GetProperTime () const
void ProposeProperTime (G4double finalProperTime)
const G4ThreeVectorGetPosition () const
void ProposePosition (G4double x, G4double y, G4double z)
void ProposePosition (const G4ThreeVector &finalPosition)
void ProposeGlobalTime (G4double t)
void ProposeLocalTime (G4double t)
G4double GetGlobalTime (G4double timeDelay=0.0) const
G4double GetLocalTime (G4double timeDelay=0.0) const
G4double GetMass () const
void ProposeMass (G4double finalMass)
G4double GetCharge () const
void ProposeCharge (G4double finalCharge)
G4double GetMagneticMoment () const
void ProposeMagneticMoment (G4double finalMagneticMoment)
G4ThreeVector GetGlobalPosition (const G4ThreeVector &displacement) const
G4ThreeVector CalcMomentum (G4double energy, G4ThreeVector direction, G4double mass) const
void AddSecondary (G4Track *aSecondary)
void AddSecondary (G4DynamicParticle *aSecondary, G4bool IsGoodForTracking=false)
void AddSecondary (G4DynamicParticle *aSecondary, G4ThreeVector position, G4bool IsGoodForTracking=false)
void AddSecondary (G4DynamicParticle *aSecondary, G4double time, G4bool IsGoodForTracking=false)
virtual void DumpInfo () const
virtual G4bool CheckIt (const G4Track &)

Protected Member Functions

 G4ParticleChange (const G4ParticleChange &right)
G4ParticleChangeoperator= (const G4ParticleChange &right)
G4StepUpdateStepInfo (G4Step *Step)

Protected Attributes

G4ThreeVector theMomentumDirectionChange
G4ThreeVector thePolarizationChange
G4double theEnergyChange
G4double theVelocityChange
G4bool isVelocityChanged
G4ThreeVector thePositionChange
G4double theGlobalTime0
G4double theLocalTime0
G4double theTimeChange
G4double theProperTimeChange
G4double theMassChange
G4double theChargeChange
G4double theMagneticMomentChange
const G4TracktheCurrentTrack

Detailed Description

Definition at line 77 of file G4ParticleChange.hh.


Constructor & Destructor Documentation

G4ParticleChange::G4ParticleChange (  ) 

Definition at line 54 of file G4ParticleChange.cc.

G4ParticleChange::~G4ParticleChange (  )  [virtual]

Definition at line 68 of file G4ParticleChange.cc.

References G4cout, G4endl, and G4VParticleChange::verboseLevel.

00069 {
00070 #ifdef G4VERBOSE
00071   if (verboseLevel>2) {
00072     G4cout << "G4ParticleChange::~G4ParticleChange() " << G4endl;
00073   }
00074 #endif
00075 }

G4ParticleChange::G4ParticleChange ( const G4ParticleChange right  )  [protected]

Definition at line 78 of file G4ParticleChange.cc.

References G4cout, G4endl, isVelocityChanged, theChargeChange, theCurrentTrack, theEnergyChange, theGlobalTime0, theLocalTime0, theMagneticMomentChange, theMassChange, theMomentumDirectionChange, thePolarizationChange, thePositionChange, theProperTimeChange, theTimeChange, theVelocityChange, and G4VParticleChange::verboseLevel.

00079   : G4VParticleChange(right)
00080 {
00081    if (verboseLevel>1) {
00082     G4cout << "G4ParticleChange::  copy constructor is called " << G4endl;
00083    }
00084    theCurrentTrack = right.theCurrentTrack;
00085 
00086    theMomentumDirectionChange = right.theMomentumDirectionChange;
00087    thePolarizationChange = right.thePolarizationChange;
00088    thePositionChange   = right.thePositionChange;
00089    theGlobalTime0      = right.theGlobalTime0;
00090    theLocalTime0       = right.theLocalTime0;
00091    theTimeChange       = right.theTimeChange;
00092    theProperTimeChange = right.theProperTimeChange;
00093    theEnergyChange     = right.theEnergyChange;
00094    theVelocityChange   = right.theVelocityChange;
00095    isVelocityChanged   = true;
00096    theMassChange       = right.theMassChange;
00097    theChargeChange     = right.theChargeChange;
00098    theMagneticMomentChange = right.theMagneticMomentChange;
00099 }


Member Function Documentation

void G4ParticleChange::AddSecondary ( G4DynamicParticle aSecondary,
G4double  time,
G4bool  IsGoodForTracking = false 
)

Definition at line 201 of file G4ParticleChange.cc.

References G4VParticleChange::AddSecondary(), G4Track::GetTouchableHandle(), G4Track::SetGoodForTrackingFlag(), G4Track::SetTouchableHandle(), theCurrentTrack, and thePositionChange.

00204 {
00205   //  create track
00206   G4Track*  aTrack = new G4Track(aParticle, newTime, thePositionChange); 
00207 
00208   // set IsGoodGorTrackingFlag
00209   if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
00210  
00211   //   Touchable handle is copied to keep the pointer
00212   aTrack->SetTouchableHandle(theCurrentTrack->GetTouchableHandle());
00213 
00214   //  add a secondary
00215   G4VParticleChange::AddSecondary(aTrack);
00216 }

void G4ParticleChange::AddSecondary ( G4DynamicParticle aSecondary,
G4ThreeVector  position,
G4bool  IsGoodForTracking = false 
)

Definition at line 184 of file G4ParticleChange.cc.

References G4VParticleChange::AddSecondary(), GetGlobalTime(), G4Track::SetGoodForTrackingFlag(), and G4Track::SetTouchableHandle().

00187 {
00188   //  create track
00189   G4Track*  aTrack = new G4Track(aParticle, GetGlobalTime(), newPosition);
00190 
00191   // set IsGoodGorTrackingFlag
00192   if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
00193 
00194   //   Touchable is a temporary object, so you cannot keep the pointer
00195   aTrack->SetTouchableHandle((G4VTouchable*)0);
00196 
00197   //  add a secondary
00198   G4VParticleChange::AddSecondary(aTrack);
00199 }

void G4ParticleChange::AddSecondary ( G4DynamicParticle aSecondary,
G4bool  IsGoodForTracking = false 
)

Definition at line 168 of file G4ParticleChange.cc.

References G4VParticleChange::AddSecondary(), GetGlobalTime(), G4Track::GetTouchableHandle(), G4Track::SetGoodForTrackingFlag(), G4Track::SetTouchableHandle(), theCurrentTrack, and thePositionChange.

00170 {
00171   //  create track
00172   G4Track* aTrack = new G4Track(aParticle, GetGlobalTime(), thePositionChange);
00173 
00174   // set IsGoodGorTrackingFlag
00175   if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
00176 
00177   //   Touchable handle is copied to keep the pointer
00178   aTrack->SetTouchableHandle(theCurrentTrack->GetTouchableHandle());
00179  
00180  //  add a secondary
00181   G4VParticleChange::AddSecondary(aTrack);
00182 }

void G4ParticleChange::AddSecondary ( G4Track aSecondary  ) 

Reimplemented from G4VParticleChange.

Definition at line 218 of file G4ParticleChange.cc.

References G4VParticleChange::AddSecondary().

Referenced by G4QCaptureAtRest::AtRestDoIt(), G4PionMinusAbsorptionAtRest::AtRestDoIt(), G4PiMinusAbsorptionAtRest::AtRestDoIt(), G4NeutronCaptureAtRest::AtRestDoIt(), G4MuonMinusCaptureAtRest::AtRestDoIt(), G4KaonMinusAbsorption::AtRestDoIt(), G4HadronStoppingProcess::AtRestDoIt(), G4AntiProtonAnnihilationAtRest::AtRestDoIt(), G4AntiNeutronAnnihilationAtRest::AtRestDoIt(), G4HadronicProcess::FillResult(), G4WHadronElasticProcess::PostStepDoIt(), G4VXTRenergyLoss::PostStepDoIt(), G4SynchrotronRadiationInMat::PostStepDoIt(), G4SynchrotronRadiation::PostStepDoIt(), G4Scintillation::PostStepDoIt(), G4QSynchRad::PostStepDoIt(), G4QNGamma::PostStepDoIt(), G4QLowEnergy::PostStepDoIt(), G4QIonIonElastic::PostStepDoIt(), G4QInelastic::PostStepDoIt(), G4QElastic::PostStepDoIt(), G4QDiffraction::PostStepDoIt(), G4QCoherentChargeExchange::PostStepDoIt(), G4QAtomicElectronScattering::PostStepDoIt(), G4OpWLS::PostStepDoIt(), G4hImpactIonisation::PostStepDoIt(), G4HadronElasticProcess::PostStepDoIt(), G4GammaConversionToMuons::PostStepDoIt(), G4ForwardXrayTR::PostStepDoIt(), G4Cerenkov::PostStepDoIt(), G4AnnihiToMuPair::PostStepDoIt(), G4AdjointhIonisationModel::RapidSampleSecondaries(), G4AdjointComptonModel::RapidSampleSecondaries(), G4AdjointBremsstrahlungModel::RapidSampleSecondaries(), G4AdjointPhotoElectricModel::SampleSecondaries(), G4AdjointIonIonisationModel::SampleSecondaries(), G4AdjointhIonisationModel::SampleSecondaries(), G4AdjointeIonisationModel::SampleSecondaries(), G4AdjointComptonModel::SampleSecondaries(), and G4AdjointBremsstrahlungModel::SampleSecondaries().

00219 {
00220   //  add a secondary
00221   G4VParticleChange::AddSecondary(aTrack);
00222 }

G4ThreeVector G4ParticleChange::CalcMomentum ( G4double  energy,
G4ThreeVector  direction,
G4double  mass 
) const [inline]

Definition at line 210 of file G4ParticleChange.icc.

Referenced by G4ParticleChangeForTransport::UpdateStepForAlongStep(), and UpdateStepForAlongStep().

00214 {
00215   G4double tMomentum = std::sqrt(energy*energy + 2*energy*mass);
00216   return direction*tMomentum; 
00217 }

G4bool G4ParticleChange::CheckIt ( const G4Track  )  [virtual]

Reimplemented from G4VParticleChange.

Definition at line 506 of file G4ParticleChange.cc.

References G4VParticleChange::accuracyForException, G4VParticleChange::accuracyForWarning, G4VParticleChange::CheckIt(), DumpInfo(), EventMustBeAborted, fStopAndKill, G4cout, G4endl, G4Exception(), G4VParticleChange::GetTrackStatus(), ns, theEnergyChange, theMomentumDirectionChange, theProperTimeChange, theTimeChange, and theVelocityChange.

Referenced by G4ParticleChangeForTransport::UpdateStepForAlongStep(), UpdateStepForAlongStep(), UpdateStepForAtRest(), and UpdateStepForPostStep().

00507 {
00508   G4bool    exitWithError = false;
00509   G4double  accuracy;
00510   static G4int nError = 0;
00511 #ifdef G4VERBOSE
00512   const  G4int maxError = 30;
00513 #endif
00514 
00515   // No check in case of "fStopAndKill" 
00516   if (GetTrackStatus() ==   fStopAndKill )  return G4VParticleChange::CheckIt(aTrack);
00517 
00518   // MomentumDirection should be unit vector
00519   G4bool itsOKforMomentum = true;  
00520   if ( theEnergyChange >0.) {
00521     accuracy = std::fabs(theMomentumDirectionChange.mag2()-1.0);
00522     if (accuracy > accuracyForWarning) {
00523       itsOKforMomentum = false;
00524       nError += 1;
00525       exitWithError = exitWithError || (accuracy > accuracyForException);
00526 #ifdef G4VERBOSE
00527       if (nError < maxError) {
00528         G4cout << "  G4ParticleChange::CheckIt  : ";
00529         G4cout << "the Momentum Change is not unit vector !!" 
00530                << "  Difference:  " << accuracy << G4endl;
00531         G4cout << aTrack.GetDefinition()->GetParticleName()
00532                << " E=" << aTrack.GetKineticEnergy()/MeV
00533                << " pos=" << aTrack.GetPosition().x()/m
00534                << ", " << aTrack.GetPosition().y()/m
00535                << ", " << aTrack.GetPosition().z()/m
00536                <<G4endl;
00537       }
00538 #endif
00539     }
00540   }
00541 
00542   // Both global and proper time should not go back
00543   G4bool itsOKforGlobalTime = true;  
00544   accuracy = (aTrack.GetLocalTime()- theTimeChange)/ns;
00545   if (accuracy > accuracyForWarning) {
00546     itsOKforGlobalTime = false;
00547     nError += 1;
00548     exitWithError = exitWithError || (accuracy > accuracyForException);
00549 #ifdef G4VERBOSE
00550     if (nError < maxError) {
00551       G4cout << "  G4ParticleChange::CheckIt    : ";
00552       G4cout << "the local time goes back  !!" 
00553              << "  Difference:  " << accuracy  << "[ns] " <<G4endl;
00554       G4cout << aTrack.GetDefinition()->GetParticleName()
00555              << " E=" << aTrack.GetKineticEnergy()/MeV
00556              << " pos=" << aTrack.GetPosition().x()/m
00557              << ", " << aTrack.GetPosition().y()/m
00558              << ", " << aTrack.GetPosition().z()/m
00559              << " global time=" << aTrack.GetGlobalTime()/ns
00560              << " local time=" << aTrack.GetLocalTime()/ns
00561              << " proper time=" << aTrack.GetProperTime()/ns
00562              << G4endl;
00563     }
00564 #endif
00565   }
00566 
00567   G4bool itsOKforProperTime = true;
00568   accuracy = (aTrack.GetProperTime() - theProperTimeChange )/ns;
00569   if (accuracy > accuracyForWarning) {
00570     itsOKforProperTime = false;
00571     nError += 1;
00572     exitWithError = exitWithError ||  (accuracy > accuracyForException);
00573 #ifdef G4VERBOSE
00574     if (nError < maxError) {
00575       G4cout << "  G4ParticleChange::CheckIt    : ";
00576       G4cout << "the proper time goes back  !!" 
00577              << "  Difference:  " << accuracy  << "[ns] " <<G4endl;
00578       G4cout << aTrack.GetDefinition()->GetParticleName()
00579              << " E=" << aTrack.GetKineticEnergy()/MeV
00580              << " pos=" << aTrack.GetPosition().x()/m
00581              << ", " << aTrack.GetPosition().y()/m
00582              << ", " << aTrack.GetPosition().z()/m
00583              << " global time=" << aTrack.GetGlobalTime()/ns
00584              << " local time=" << aTrack.GetLocalTime()/ns
00585              << " proper time=" << aTrack.GetProperTime()/ns
00586              <<G4endl;
00587     }
00588 #endif
00589   }
00590 
00591   // Kinetic Energy should not be negative
00592   G4bool itsOKforEnergy = true;
00593   accuracy = -1.0*theEnergyChange/MeV;
00594   if (accuracy > accuracyForWarning) {
00595     itsOKforEnergy = false;
00596     nError += 1;
00597     exitWithError = exitWithError ||   (accuracy > accuracyForException);
00598 #ifdef G4VERBOSE
00599     if (nError < maxError) {
00600       G4cout << "  G4ParticleChange::CheckIt    : ";
00601       G4cout << "the kinetic energy is negative  !!" 
00602              << "  Difference:  " << accuracy  << "[MeV] " <<G4endl;
00603       G4cout << aTrack.GetDefinition()->GetParticleName()
00604              << " E=" << aTrack.GetKineticEnergy()/MeV
00605              << " pos=" << aTrack.GetPosition().x()/m
00606              << ", " << aTrack.GetPosition().y()/m
00607              << ", " << aTrack.GetPosition().z()/m
00608              <<G4endl;
00609     }
00610 #endif
00611   }
00612 
00613   // Velocity  should not be less than c_light
00614   G4bool itsOKforVelocity = true;
00615   if (theVelocityChange < 0.) {
00616     itsOKforVelocity = false;
00617     nError += 1;
00618     exitWithError = true;
00619 #ifdef G4VERBOSE
00620     if (nError < maxError) {
00621       G4cout << "  G4ParticleChange::CheckIt    : ";
00622       G4cout << "the velocity is negative  !!" 
00623              << "  Velocity:  " << theVelocityChange/c_light  <<G4endl;
00624       G4cout << aTrack.GetDefinition()->GetParticleName()
00625              << " E=" << aTrack.GetKineticEnergy()/MeV
00626              << " pos=" << aTrack.GetPosition().x()/m
00627              << ", " << aTrack.GetPosition().y()/m
00628              << ", " << aTrack.GetPosition().z()/m
00629              <<G4endl;
00630     }
00631 #endif
00632   }
00633 
00634   accuracy = theVelocityChange/c_light - 1.0;
00635   if (accuracy > accuracyForWarning) {
00636     itsOKforVelocity = false;
00637     nError += 1;
00638     exitWithError = exitWithError ||  (accuracy > accuracyForException);
00639 #ifdef G4VERBOSE
00640     if (nError < maxError) {
00641       G4cout << "  G4ParticleChange::CheckIt    : ";
00642       G4cout << "the velocity is greater than c_light  !!" << G4endl;
00643       G4cout << "  Velocity:  " << theVelocityChange/c_light  <<G4endl;
00644       G4cout << aTrack.GetDefinition()->GetParticleName()
00645              << " E=" << aTrack.GetKineticEnergy()/MeV
00646              << " pos=" << aTrack.GetPosition().x()/m
00647              << ", " << aTrack.GetPosition().y()/m
00648              << ", " << aTrack.GetPosition().z()/m
00649              <<G4endl;
00650     }
00651 #endif
00652   }
00653 
00654   G4bool itsOK = itsOKforMomentum && itsOKforEnergy && itsOKforVelocity && itsOKforProperTime && itsOKforGlobalTime;
00655   // dump out information of this particle change
00656 #ifdef G4VERBOSE
00657   if (!itsOK) { 
00658     DumpInfo();
00659   }
00660 #endif
00661 
00662   // Exit with error
00663   if (exitWithError) {
00664     G4Exception("G4ParticleChange::CheckIt",
00665                 "TRACK003", EventMustBeAborted,
00666                 "momentum, energy, and/or time was illegal");
00667   }
00668   //correction
00669   if (!itsOKforMomentum) {
00670     G4double vmag = theMomentumDirectionChange.mag();
00671     theMomentumDirectionChange = (1./vmag)*theMomentumDirectionChange;
00672   }
00673   if (!itsOKforGlobalTime) {
00674     theTimeChange = aTrack.GetLocalTime();
00675   }
00676   if (!itsOKforProperTime) {
00677     theProperTimeChange = aTrack.GetProperTime();
00678   }
00679   if (!itsOKforEnergy) {
00680     theEnergyChange = 0.0;
00681   }
00682   if (!itsOKforVelocity) {
00683     theVelocityChange = c_light;
00684   }
00685 
00686   itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
00687   return itsOK;
00688 }

void G4ParticleChange::DumpInfo (  )  const [virtual]

Reimplemented from G4VParticleChange.

Reimplemented in G4ParticleChangeForTransport.

Definition at line 445 of file G4ParticleChange.cc.

References G4VParticleChange::DumpInfo(), G4cout, G4endl, ns, theChargeChange, theEnergyChange, theMagneticMomentChange, theMassChange, theMomentumDirectionChange, thePolarizationChange, thePositionChange, theProperTimeChange, theTimeChange, and theVelocityChange.

Referenced by CheckIt(), and G4ParticleChangeForTransport::DumpInfo().

00446 {
00447 // use base-class DumpInfo
00448   G4VParticleChange::DumpInfo();
00449 
00450   G4int oldprc = G4cout.precision(3);
00451 
00452   G4cout << "        Mass (GeV)   : " 
00453        << std::setw(20) << theMassChange/GeV
00454        << G4endl; 
00455   G4cout << "        Charge (eplus)   : " 
00456        << std::setw(20) << theChargeChange/eplus
00457        << G4endl; 
00458   G4cout << "        MagneticMoment   : " 
00459          << std::setw(20) << theMagneticMomentChange << G4endl;
00460   G4cout << "                :  = " << std::setw(20) 
00461          << theMagneticMomentChange*2.*theMassChange/c_squared/eplus/hbar_Planck 
00462          <<  "*[e hbar]/[2 m]" 
00463          << G4endl; 
00464   G4cout << "        Position - x (mm)   : " 
00465        << std::setw(20) << thePositionChange.x()/mm
00466        << G4endl; 
00467   G4cout << "        Position - y (mm)   : " 
00468        << std::setw(20) << thePositionChange.y()/mm
00469        << G4endl; 
00470   G4cout << "        Position - z (mm)   : " 
00471        << std::setw(20) << thePositionChange.z()/mm
00472        << G4endl;
00473   G4cout << "        Time (ns)           : " 
00474        << std::setw(20) << theTimeChange/ns
00475        << G4endl;
00476   G4cout << "        Proper Time (ns)    : " 
00477        << std::setw(20) << theProperTimeChange/ns
00478        << G4endl;
00479   G4cout << "        Momentum Direct - x : " 
00480        << std::setw(20) << theMomentumDirectionChange.x()
00481        << G4endl;
00482   G4cout << "        Momentum Direct - y : " 
00483        << std::setw(20) << theMomentumDirectionChange.y()
00484        << G4endl;
00485   G4cout << "        Momentum Direct - z : " 
00486        << std::setw(20) << theMomentumDirectionChange.z()
00487        << G4endl;
00488   G4cout << "        Kinetic Energy (MeV): " 
00489        << std::setw(20) << theEnergyChange/MeV
00490        << G4endl;
00491   G4cout << "        Velocity  (/c): " 
00492        << std::setw(20) << theVelocityChange/c_light
00493        << G4endl;
00494   G4cout << "        Polarization - x    : " 
00495        << std::setw(20) << thePolarizationChange.x()
00496        << G4endl;
00497   G4cout << "        Polarization - y    : " 
00498        << std::setw(20) << thePolarizationChange.y()
00499        << G4endl;
00500   G4cout << "        Polarization - z    : " 
00501        << std::setw(20) <<  thePolarizationChange.z()
00502        << G4endl;
00503   G4cout.precision(oldprc);
00504 }

G4double G4ParticleChange::GetCharge (  )  const [inline]

Definition at line 185 of file G4ParticleChange.icc.

References theChargeChange.

00186 {
00187   return  theChargeChange;
00188 }

G4double G4ParticleChange::GetEnergy (  )  const [inline]

Definition at line 37 of file G4ParticleChange.icc.

References theEnergyChange.

Referenced by G4HadronicProcess::CheckEnergyMomentumConservation(), and G4QInelastic::PostStepDoIt().

00038 {
00039   return theEnergyChange;
00040 }

G4ThreeVector G4ParticleChange::GetGlobalPosition ( const G4ThreeVector displacement  )  const [inline]

Definition at line 141 of file G4ParticleChange.icc.

References thePositionChange.

00142 {
00143   return thePositionChange + displacement;
00144 }

G4double G4ParticleChange::GetGlobalTime ( G4double  timeDelay = 0.0  )  const [inline]

Definition at line 153 of file G4ParticleChange.icc.

References theGlobalTime0, theLocalTime0, and theTimeChange.

Referenced by AddSecondary(), and G4PiMinusAbsorptionAtRest::AtRestDoIt().

00154 {
00155   //  Convert the time delay to the global time.
00156   return theGlobalTime0 + (theTimeChange-theLocalTime0) + timeDelay;
00157 }

G4double G4ParticleChange::GetLocalTime ( G4double  timeDelay = 0.0  )  const [inline]

Definition at line 166 of file G4ParticleChange.icc.

References theTimeChange.

00167 {
00168   //  Convert the time delay to the local time.
00169   return theTimeChange + timeDelay;
00170 }

G4double G4ParticleChange::GetMagneticMoment (  )  const [inline]

Definition at line 198 of file G4ParticleChange.icc.

References theMagneticMomentChange.

00199 {
00200   return theMagneticMomentChange;
00201 }

G4double G4ParticleChange::GetMass (  )  const [inline]

Definition at line 173 of file G4ParticleChange.icc.

References theMassChange.

00174 {
00175   return  theMassChange;
00176 }

const G4ThreeVector * G4ParticleChange::GetMomentumDirection (  )  const [inline]

Definition at line 62 of file G4ParticleChange.icc.

References theMomentumDirectionChange.

Referenced by G4HadronicProcess::CheckEnergyMomentumConservation(), G4QInelastic::PostStepDoIt(), G4OpRayleigh::PostStepDoIt(), and G4OpMieHG::PostStepDoIt().

00063 {
00064   return &theMomentumDirectionChange;
00065 }

const G4ThreeVector * G4ParticleChange::GetPolarization (  )  const [inline]

Definition at line 86 of file G4ParticleChange.icc.

References thePolarizationChange.

Referenced by G4OpRayleigh::PostStepDoIt(), and G4OpMieHG::PostStepDoIt().

00087 {
00088   return &thePolarizationChange;
00089 }

const G4ThreeVector * G4ParticleChange::GetPosition (  )  const [inline]

Definition at line 109 of file G4ParticleChange.icc.

References thePositionChange.

00110 {
00111   return &thePositionChange;
00112 }

G4double G4ParticleChange::GetProperTime (  )  const [inline]

Definition at line 129 of file G4ParticleChange.icc.

References theProperTimeChange.

00130 {
00131   return  theProperTimeChange;
00132 }

G4double G4ParticleChange::GetVelocity (  )  const [inline]

Definition at line 49 of file G4ParticleChange.icc.

References theVelocityChange.

00050 {
00051    return theVelocityChange;
00052 }

void G4ParticleChange::Initialize ( const G4Track  )  [virtual]

Reimplemented from G4VParticleChange.

Reimplemented in G4ParticleChangeForTransport.

Definition at line 228 of file G4ParticleChange.cc.

References G4DynamicParticle::GetCharge(), G4Track::GetDynamicParticle(), G4Track::GetGlobalTime(), G4DynamicParticle::GetKineticEnergy(), G4Track::GetLocalTime(), G4DynamicParticle::GetMagneticMoment(), G4DynamicParticle::GetMass(), G4DynamicParticle::GetMomentumDirection(), G4DynamicParticle::GetPolarization(), G4Track::GetPosition(), G4DynamicParticle::GetProperTime(), G4Track::GetVelocity(), G4VParticleChange::Initialize(), isVelocityChanged, theChargeChange, theCurrentTrack, theEnergyChange, theGlobalTime0, theLocalTime0, theMagneticMomentChange, theMassChange, theMomentumDirectionChange, thePolarizationChange, thePositionChange, theProperTimeChange, theTimeChange, and theVelocityChange.

Referenced by G4hImpactIonisation::AlongStepDoIt(), G4ErrorEnergyLoss::AlongStepDoIt(), G4ContinuousGainOfEnergy::AlongStepDoIt(), G4AdjointAlongStepWeightCorrection::AlongStepDoIt(), G4QCaptureAtRest::AtRestDoIt(), G4PionMinusAbsorptionAtRest::AtRestDoIt(), G4PiMinusAbsorptionAtRest::AtRestDoIt(), G4NeutronCaptureAtRest::AtRestDoIt(), G4MuonMinusCaptureAtRest::AtRestDoIt(), G4KaonMinusAbsorption::AtRestDoIt(), G4HadronStoppingProcess::AtRestDoIt(), G4AntiProtonAnnihilationAtRest::AtRestDoIt(), G4AntiNeutronAnnihilationAtRest::AtRestDoIt(), G4DNAMolecularDecay::DecayIt(), SpecialCuts::PostStepDoIt(), G4WHadronElasticProcess::PostStepDoIt(), G4WeightWindowProcess::PostStepDoIt(), G4WeightCutOffProcess::PostStepDoIt(), G4VXTRenergyLoss::PostStepDoIt(), G4VAdjointReverseReaction::PostStepDoIt(), G4UserSpecialCuts::PostStepDoIt(), G4SynchrotronRadiationInMat::PostStepDoIt(), G4SynchrotronRadiation::PostStepDoIt(), G4StepLimiter::PostStepDoIt(), G4Scintillation::PostStepDoIt(), G4QSynchRad::PostStepDoIt(), G4QNGamma::PostStepDoIt(), G4QLowEnergy::PostStepDoIt(), G4QIonIonElastic::PostStepDoIt(), G4QInelastic::PostStepDoIt(), G4QElastic::PostStepDoIt(), G4QDiffraction::PostStepDoIt(), G4QCoherentChargeExchange::PostStepDoIt(), G4QAtomicElectronScattering::PostStepDoIt(), G4OpWLS::PostStepDoIt(), G4OpRayleigh::PostStepDoIt(), G4OpMieHG::PostStepDoIt(), G4OpBoundaryProcess::PostStepDoIt(), G4OpAbsorption::PostStepDoIt(), G4ImportanceProcess::PostStepDoIt(), G4hImpactIonisation::PostStepDoIt(), G4HadronicProcess::PostStepDoIt(), G4HadronElasticProcess::PostStepDoIt(), G4GammaConversionToMuons::PostStepDoIt(), G4ForwardXrayTR::PostStepDoIt(), G4DNASecondOrderReaction::PostStepDoIt(), G4Cerenkov::PostStepDoIt(), and G4AnnihiToMuPair::PostStepDoIt().

00229 {
00230   // use base class's method at first
00231   G4VParticleChange::Initialize(track);
00232   theCurrentTrack= &track;
00233 
00234   // set Energy/Momentum etc. equal to those of the parent particle
00235   const G4DynamicParticle*  pParticle = track.GetDynamicParticle();
00236   theEnergyChange            = pParticle->GetKineticEnergy();
00237   theVelocityChange          = track.GetVelocity();
00238   isVelocityChanged          = false;
00239   theMomentumDirectionChange = pParticle->GetMomentumDirection();
00240   thePolarizationChange      = pParticle->GetPolarization();
00241   theProperTimeChange        = pParticle->GetProperTime();
00242 
00243   // Set mass/charge/MagneticMoment  of DynamicParticle
00244   theMassChange = pParticle->GetMass();
00245   theChargeChange = pParticle->GetCharge();
00246   theMagneticMomentChange = pParticle->GetMagneticMoment();
00247 
00248   // set Position  equal to those of the parent track
00249   thePositionChange      = track.GetPosition();
00250 
00251   // set TimeChange equal to local time of the parent track
00252   theTimeChange                = track.GetLocalTime();
00253 
00254   // set initial Local/Global time of the parent track
00255   theLocalTime0           = track.GetLocalTime();
00256   theGlobalTime0          = track.GetGlobalTime();
00257 
00258 }

G4bool G4ParticleChange::operator!= ( const G4ParticleChange right  )  const

Definition at line 158 of file G4ParticleChange.cc.

00159 {
00160    return ((G4VParticleChange *)this != (G4VParticleChange *) &right);
00161 }

G4ParticleChange & G4ParticleChange::operator= ( const G4ParticleChange right  )  [protected]

Definition at line 102 of file G4ParticleChange.cc.

References G4cout, G4endl, isVelocityChanged, G4FastVector< Type, N >::SetElement(), theChargeChange, theCurrentTrack, theEnergyChange, theGlobalTime0, G4VParticleChange::theListOfSecondaries, G4VParticleChange::theLocalEnergyDeposit, theLocalTime0, theMagneticMomentChange, theMassChange, theMomentumDirectionChange, G4VParticleChange::theNumberOfSecondaries, thePolarizationChange, thePositionChange, theProperTimeChange, G4VParticleChange::theStatusChange, G4VParticleChange::theSteppingControlFlag, theTimeChange, G4VParticleChange::theTrueStepLength, theVelocityChange, and G4VParticleChange::verboseLevel.

00103 {
00104 #ifdef G4VERBOSE
00105    if (verboseLevel>1) {
00106     G4cout << "G4ParticleChange:: assignment operator is called " << G4endl;
00107    }
00108 #endif
00109    if (this != &right){
00110      if (theNumberOfSecondaries>0) {
00111 #ifdef G4VERBOSE
00112        if (verboseLevel>0) {
00113          G4cout << "G4ParticleChange: assignment operator Warning  ";
00114          G4cout << "theListOfSecondaries is not empty ";
00115        }
00116 #endif
00117        for (G4int index= 0; index<theNumberOfSecondaries; index++){
00118          if ( (*theListOfSecondaries)[index] ) delete (*theListOfSecondaries)[index] ;
00119        }
00120      }
00121      delete theListOfSecondaries; 
00122      
00123     theListOfSecondaries =  new G4TrackFastVector();
00124     theNumberOfSecondaries = right.theNumberOfSecondaries;
00125     for (G4int index = 0; index<theNumberOfSecondaries; index++){
00126       G4Track* newTrack =  new G4Track(*((*right.theListOfSecondaries)[index] ));
00127       theListOfSecondaries->SetElement(index, newTrack);                            }
00128 
00129      theStatusChange = right.theStatusChange;
00130      theCurrentTrack = right.theCurrentTrack;
00131      
00132      theMomentumDirectionChange = right.theMomentumDirectionChange;
00133      thePolarizationChange = right.thePolarizationChange;
00134      thePositionChange = right.thePositionChange;
00135      theGlobalTime0      = right.theGlobalTime0;
00136      theLocalTime0       = right.theLocalTime0;
00137      theTimeChange       = right.theTimeChange;
00138      theProperTimeChange = right.theProperTimeChange;
00139      theEnergyChange     = right.theEnergyChange;
00140      theVelocityChange   = right.theVelocityChange;
00141      isVelocityChanged   = true;
00142      theMassChange       = right.theMassChange;
00143      theChargeChange     = right.theChargeChange;
00144      theMagneticMomentChange = right.theMagneticMomentChange;
00145      
00146      theTrueStepLength = right.theTrueStepLength;
00147      theLocalEnergyDeposit = right.theLocalEnergyDeposit;
00148      theSteppingControlFlag = right.theSteppingControlFlag;
00149    }
00150    return *this;
00151 }

G4bool G4ParticleChange::operator== ( const G4ParticleChange right  )  const

Definition at line 153 of file G4ParticleChange.cc.

00154 {
00155    return ((G4VParticleChange *)this == (G4VParticleChange *) &right);
00156 }

void G4ParticleChange::ProposeCharge ( G4double  finalCharge  )  [inline]

Definition at line 191 of file G4ParticleChange.icc.

References theChargeChange.

00192 {
00193   theChargeChange = t;
00194 }

void G4ParticleChange::ProposeEnergy ( G4double  finalEnergy  )  [inline]

Definition at line 43 of file G4ParticleChange.icc.

References theEnergyChange.

Referenced by G4Transportation::AlongStepDoIt(), G4ITTransportation::AlongStepDoIt(), G4hImpactIonisation::AlongStepDoIt(), G4ErrorEnergyLoss::AlongStepDoIt(), G4CoupledTransportation::AlongStepDoIt(), G4ContinuousGainOfEnergy::AlongStepDoIt(), G4DNABrownianTransportation::Diffusion(), G4HadronicProcess::FillResult(), SpecialCuts::PostStepDoIt(), G4WHadronElasticProcess::PostStepDoIt(), G4VXTRenergyLoss::PostStepDoIt(), G4UserSpecialCuts::PostStepDoIt(), G4SynchrotronRadiationInMat::PostStepDoIt(), G4SynchrotronRadiation::PostStepDoIt(), G4QSynchRad::PostStepDoIt(), G4QNGamma::PostStepDoIt(), G4QLowEnergy::PostStepDoIt(), G4QIonIonElastic::PostStepDoIt(), G4QInelastic::PostStepDoIt(), G4QElastic::PostStepDoIt(), G4QDiffraction::PostStepDoIt(), G4QCoherentChargeExchange::PostStepDoIt(), G4QAtomicElectronScattering::PostStepDoIt(), G4hImpactIonisation::PostStepDoIt(), G4HadronElasticProcess::PostStepDoIt(), G4GammaConversionToMuons::PostStepDoIt(), G4ForwardXrayTR::PostStepDoIt(), G4AnnihiToMuPair::PostStepDoIt(), G4AdjointhIonisationModel::RapidSampleSecondaries(), G4AdjointComptonModel::RapidSampleSecondaries(), G4AdjointBremsstrahlungModel::RapidSampleSecondaries(), G4AdjointIonIonisationModel::SampleSecondaries(), G4AdjointhIonisationModel::SampleSecondaries(), G4AdjointeIonisationModel::SampleSecondaries(), G4AdjointComptonModel::SampleSecondaries(), and G4AdjointBremsstrahlungModel::SampleSecondaries().

00044 {
00045   theEnergyChange = finalEnergy;
00046 }

void G4ParticleChange::ProposeGlobalTime ( G4double  t  )  [inline]

Definition at line 147 of file G4ParticleChange.icc.

References theGlobalTime0, theLocalTime0, and theTimeChange.

Referenced by G4Transportation::AlongStepDoIt(), G4ITTransportation::AlongStepDoIt(), and G4CoupledTransportation::AlongStepDoIt().

00148 {
00149   theTimeChange = (t-theGlobalTime0) + theLocalTime0;
00150 }

void G4ParticleChange::ProposeLocalTime ( G4double  t  )  [inline]

Definition at line 160 of file G4ParticleChange.icc.

References theTimeChange.

Referenced by G4Transportation::AlongStepDoIt(), G4ITTransportation::AlongStepDoIt(), and G4CoupledTransportation::AlongStepDoIt().

00161 {
00162   theTimeChange = t;
00163 }

void G4ParticleChange::ProposeMagneticMoment ( G4double  finalMagneticMoment  )  [inline]

Definition at line 204 of file G4ParticleChange.icc.

References theMagneticMomentChange.

00205 {
00206   theMagneticMomentChange = finalMagneticMoment;
00207 }

void G4ParticleChange::ProposeMass ( G4double  finalMass  )  [inline]

Definition at line 179 of file G4ParticleChange.icc.

References theMassChange.

00180 {
00181   theMassChange = t;
00182 }

void G4ParticleChange::ProposeMomentumDirection ( const G4ThreeVector Pfinal  )  [inline]

Definition at line 79 of file G4ParticleChange.icc.

References theMomentumDirectionChange.

00080 {
00081   theMomentumDirectionChange = P;
00082 }

void G4ParticleChange::ProposeMomentumDirection ( G4double  Px,
G4double  Py,
G4double  Pz 
) [inline]

Definition at line 68 of file G4ParticleChange.icc.

References theMomentumDirectionChange.

Referenced by G4Transportation::AlongStepDoIt(), G4ITTransportation::AlongStepDoIt(), G4CoupledTransportation::AlongStepDoIt(), G4DNABrownianTransportation::Diffusion(), G4HadronicProcess::FillResult(), G4WHadronElasticProcess::PostStepDoIt(), G4SynchrotronRadiationInMat::PostStepDoIt(), G4SynchrotronRadiation::PostStepDoIt(), G4QNGamma::PostStepDoIt(), G4QLowEnergy::PostStepDoIt(), G4QIonIonElastic::PostStepDoIt(), G4QInelastic::PostStepDoIt(), G4QElastic::PostStepDoIt(), G4QDiffraction::PostStepDoIt(), G4QCoherentChargeExchange::PostStepDoIt(), G4QAtomicElectronScattering::PostStepDoIt(), G4OpRayleigh::PostStepDoIt(), G4OpMieHG::PostStepDoIt(), G4OpBoundaryProcess::PostStepDoIt(), G4hImpactIonisation::PostStepDoIt(), G4HadronElasticProcess::PostStepDoIt(), G4GammaConversionToMuons::PostStepDoIt(), G4AdjointhIonisationModel::RapidSampleSecondaries(), G4AdjointComptonModel::RapidSampleSecondaries(), G4AdjointBremsstrahlungModel::RapidSampleSecondaries(), G4AdjointIonIonisationModel::SampleSecondaries(), G4AdjointhIonisationModel::SampleSecondaries(), G4AdjointeIonisationModel::SampleSecondaries(), G4AdjointComptonModel::SampleSecondaries(), and G4AdjointBremsstrahlungModel::SampleSecondaries().

00072 {
00073   theMomentumDirectionChange.setX(Px);
00074   theMomentumDirectionChange.setY(Py);
00075   theMomentumDirectionChange.setZ(Pz);
00076 }

void G4ParticleChange::ProposePolarization ( const G4ThreeVector finalPoralization  )  [inline]

Definition at line 92 of file G4ParticleChange.icc.

References thePolarizationChange.

00093 {
00094   thePolarizationChange = finalPoralization;
00095 }

void G4ParticleChange::ProposePolarization ( G4double  Px,
G4double  Py,
G4double  Pz 
) [inline]

Definition at line 98 of file G4ParticleChange.icc.

References thePolarizationChange.

Referenced by G4Transportation::AlongStepDoIt(), G4ITTransportation::AlongStepDoIt(), G4CoupledTransportation::AlongStepDoIt(), G4OpRayleigh::PostStepDoIt(), G4OpMieHG::PostStepDoIt(), and G4OpBoundaryProcess::PostStepDoIt().

00102 {
00103   thePolarizationChange.setX(Px);
00104   thePolarizationChange.setY(Py);
00105   thePolarizationChange.setZ(Pz);
00106 }

void G4ParticleChange::ProposePosition ( const G4ThreeVector finalPosition  )  [inline]

Definition at line 115 of file G4ParticleChange.icc.

References thePositionChange.

00116 {
00117   thePositionChange= finalPosition;
00118 }

void G4ParticleChange::ProposePosition ( G4double  x,
G4double  y,
G4double  z 
) [inline]

Definition at line 121 of file G4ParticleChange.icc.

References thePositionChange.

Referenced by G4Transportation::AlongStepDoIt(), G4ITTransportation::AlongStepDoIt(), and G4CoupledTransportation::AlongStepDoIt().

00122 {
00123   thePositionChange.setX(x);
00124   thePositionChange.setY(y);
00125   thePositionChange.setZ(z);
00126 }

void G4ParticleChange::ProposeProperTime ( G4double  finalProperTime  )  [inline]

Definition at line 135 of file G4ParticleChange.icc.

References theProperTimeChange.

Referenced by G4Transportation::AlongStepDoIt(), and G4CoupledTransportation::AlongStepDoIt().

00136 {
00137   theProperTimeChange = tau;
00138 }

void G4ParticleChange::ProposeVelocity ( G4double  finalVelocity  )  [inline]

Definition at line 55 of file G4ParticleChange.icc.

References isVelocityChanged, and theVelocityChange.

Referenced by G4ITTransportation::AlongStepDoIt(), G4ITTransportation::ComputeStep(), and G4OpBoundaryProcess::PostStepDoIt().

00056 {
00057    theVelocityChange = finalVelocity;
00058    isVelocityChanged = true;
00059 }

G4Step * G4ParticleChange::UpdateStepForAlongStep ( G4Step Step  )  [virtual]

Reimplemented from G4VParticleChange.

Reimplemented in G4ParticleChangeForTransport.

Definition at line 264 of file G4ParticleChange.cc.

References G4StepPoint::AddGlobalTime(), G4StepPoint::AddLocalTime(), G4StepPoint::AddPolarization(), G4StepPoint::AddPosition(), G4StepPoint::AddProperTime(), CalcMomentum(), G4Track::CalculateVelocity(), CheckIt(), G4VParticleChange::debugFlag, G4StepPoint::GetKineticEnergy(), G4StepPoint::GetMomentum(), G4StepPoint::GetPolarization(), G4StepPoint::GetPosition(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4StepPoint::GetProperTime(), G4Step::GetTrack(), G4VParticleChange::isParentWeightProposed, isVelocityChanged, G4StepPoint::SetCharge(), G4Track::SetKineticEnergy(), G4StepPoint::SetKineticEnergy(), G4StepPoint::SetMagneticMoment(), G4StepPoint::SetMass(), G4StepPoint::SetMomentumDirection(), G4StepPoint::SetVelocity(), G4StepPoint::SetWeight(), theChargeChange, theEnergyChange, theLocalTime0, theMagneticMomentChange, theMassChange, theMomentumDirectionChange, G4VParticleChange::theParentWeight, thePolarizationChange, thePositionChange, theProperTimeChange, theTimeChange, theVelocityChange, and UpdateStepInfo().

00265 {
00266   // A physics process always calculates the final state of the
00267   // particle relative to the initial state at the beginning
00268   // of the Step, i.e., based on information of G4Track (or
00269   // equivalently the PreStepPoint). 
00270   // So, the differences (delta) between these two states have to be
00271   // calculated and be accumulated in PostStepPoint. 
00272   
00273   // Take note that the return type of GetMomentumDirectionChange is a
00274   // pointer to G4ParticleMometum. Also it is a normalized 
00275   // momentum vector.
00276 
00277   G4StepPoint* pPreStepPoint  = pStep->GetPreStepPoint(); 
00278   G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint(); 
00279   G4Track* pTrack = pStep->GetTrack();
00280   G4double     mass = theMassChange;
00281 
00282   // Set Mass/Charge/MagneticMoment 
00283   pPostStepPoint->SetMass(theMassChange);
00284   pPostStepPoint->SetCharge(theChargeChange);  
00285   pPostStepPoint->SetMagneticMoment(theMagneticMomentChange);  
00286  
00287   // calculate new kinetic energy
00288   G4double preEnergy = pPreStepPoint->GetKineticEnergy();
00289   G4double energy = pPostStepPoint->GetKineticEnergy() 
00290                     + (theEnergyChange - preEnergy); 
00291 
00292   // update kinetic energy and momentum direction
00293   if (energy > 0.0) {
00294     // calculate new momentum
00295     G4ThreeVector pMomentum =  pPostStepPoint->GetMomentum() 
00296                 + ( CalcMomentum(theEnergyChange, theMomentumDirectionChange, mass)
00297                     - pPreStepPoint->GetMomentum());
00298     G4double      tMomentum = pMomentum.mag();
00299     G4ThreeVector direction(1.0,0.0,0.0); 
00300     if( tMomentum > 0. ){
00301       G4double  inv_Momentum= 1.0 / tMomentum; 
00302       direction= pMomentum * inv_Momentum;
00303     }
00304     pPostStepPoint->SetMomentumDirection(direction);
00305     pPostStepPoint->SetKineticEnergy( energy );
00306   } else {
00307     // stop case
00308     //pPostStepPoint->SetMomentumDirection(G4ThreeVector(1., 0., 0.));
00309     pPostStepPoint->SetKineticEnergy(0.0);
00310   }
00311   // calculate velocity
00312   if (!isVelocityChanged) {
00313     if(energy > 0.0) {
00314       pTrack->SetKineticEnergy(energy);
00315       theVelocityChange = pTrack->CalculateVelocity();
00316       pTrack->SetKineticEnergy(preEnergy);
00317     } else if(theMassChange > 0.0) {
00318       theVelocityChange = 0.0;
00319     }
00320   }
00321   pPostStepPoint->SetVelocity(theVelocityChange);
00322 
00323   // update polarization
00324   pPostStepPoint->AddPolarization( thePolarizationChange
00325                                    - pPreStepPoint->GetPolarization());
00326       
00327   // update position and time
00328   pPostStepPoint->AddPosition( thePositionChange 
00329                                - pPreStepPoint->GetPosition() );
00330   pPostStepPoint->AddGlobalTime(theTimeChange - theLocalTime0);
00331   pPostStepPoint->AddLocalTime( theTimeChange - theLocalTime0 );               
00332   pPostStepPoint->AddProperTime( theProperTimeChange 
00333                                  - pPreStepPoint->GetProperTime());
00334 
00335   if (isParentWeightProposed ){
00336     pPostStepPoint->SetWeight( theParentWeight );
00337   }
00338 
00339 #ifdef G4VERBOSE
00340   G4Track*     aTrack  = pStep->GetTrack();
00341   if (debugFlag) CheckIt(*aTrack);
00342 #endif
00343 
00344   //  Update the G4Step specific attributes 
00345   return UpdateStepInfo(pStep);
00346 }

G4Step * G4ParticleChange::UpdateStepForAtRest ( G4Step Step  )  [virtual]

Reimplemented from G4VParticleChange.

Reimplemented in G4ParticleChangeForTransport.

Definition at line 402 of file G4ParticleChange.cc.

References G4StepPoint::AddGlobalTime(), G4Track::CalculateVelocity(), CheckIt(), G4VParticleChange::debugFlag, G4Step::GetPostStepPoint(), G4Step::GetTrack(), G4VParticleChange::isParentWeightProposed, isVelocityChanged, G4StepPoint::SetCharge(), G4StepPoint::SetKineticEnergy(), G4StepPoint::SetLocalTime(), G4StepPoint::SetMagneticMoment(), G4StepPoint::SetMass(), G4StepPoint::SetMomentumDirection(), G4StepPoint::SetPolarization(), G4StepPoint::SetPosition(), G4StepPoint::SetProperTime(), G4StepPoint::SetVelocity(), G4StepPoint::SetWeight(), theChargeChange, theEnergyChange, theLocalTime0, theMagneticMomentChange, theMassChange, theMomentumDirectionChange, G4VParticleChange::theParentWeight, thePolarizationChange, thePositionChange, theProperTimeChange, theTimeChange, theVelocityChange, and UpdateStepInfo().

00403 { 
00404   // A physics process always calculates the final state of the particle
00405 
00406   G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint(); 
00407 
00408   // Set Mass/Charge
00409   pPostStepPoint->SetMass(theMassChange);
00410   pPostStepPoint->SetCharge(theChargeChange);  
00411   pPostStepPoint->SetMagneticMoment(theMagneticMomentChange);  
00412  
00413   // update kinetic energy and momentum direction
00414   pPostStepPoint->SetMomentumDirection(theMomentumDirectionChange);
00415   pPostStepPoint->SetKineticEnergy( theEnergyChange );
00416   if (!isVelocityChanged) theVelocityChange = pStep->GetTrack()->CalculateVelocity();
00417   pPostStepPoint->SetVelocity(theVelocityChange);
00418 
00419   // update polarization
00420   pPostStepPoint->SetPolarization( thePolarizationChange );
00421       
00422   // update position and time
00423   pPostStepPoint->SetPosition( thePositionChange  );
00424   pPostStepPoint->AddGlobalTime(theTimeChange - theLocalTime0);
00425   pPostStepPoint->SetLocalTime( theTimeChange );               
00426   pPostStepPoint->SetProperTime( theProperTimeChange  );
00427 
00428   if (isParentWeightProposed ){
00429     pPostStepPoint->SetWeight( theParentWeight );
00430   }
00431 
00432 #ifdef G4VERBOSE
00433   G4Track*     aTrack  = pStep->GetTrack();
00434   if (debugFlag) CheckIt(*aTrack);
00435 #endif
00436 
00437   //  Update the G4Step specific attributes 
00438   return UpdateStepInfo(pStep);
00439 }

G4Step * G4ParticleChange::UpdateStepForPostStep ( G4Step Step  )  [virtual]

Reimplemented from G4VParticleChange.

Reimplemented in G4ParticleChangeForTransport.

Definition at line 348 of file G4ParticleChange.cc.

References G4StepPoint::AddGlobalTime(), G4Track::CalculateVelocity(), CheckIt(), G4VParticleChange::debugFlag, G4Step::GetPostStepPoint(), G4Step::GetTrack(), G4VParticleChange::isParentWeightProposed, isVelocityChanged, G4StepPoint::SetCharge(), G4Track::SetKineticEnergy(), G4StepPoint::SetKineticEnergy(), G4StepPoint::SetLocalTime(), G4StepPoint::SetMagneticMoment(), G4StepPoint::SetMass(), G4StepPoint::SetMomentumDirection(), G4StepPoint::SetPolarization(), G4StepPoint::SetPosition(), G4StepPoint::SetProperTime(), G4StepPoint::SetVelocity(), G4StepPoint::SetWeight(), theChargeChange, theEnergyChange, theLocalTime0, theMagneticMomentChange, theMassChange, theMomentumDirectionChange, G4VParticleChange::theParentWeight, thePolarizationChange, thePositionChange, theProperTimeChange, theTimeChange, theVelocityChange, and UpdateStepInfo().

00349 { 
00350   // A physics process always calculates the final state of the particle
00351 
00352   // Take note that the return type of GetMomentumChange is a
00353   // pointer to G4ParticleMometum. Also it is a normalized 
00354   // momentum vector.
00355 
00356   G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint(); 
00357   G4Track* pTrack = pStep->GetTrack();
00358 
00359   // Set Mass/Charge
00360   pPostStepPoint->SetMass(theMassChange);
00361   pPostStepPoint->SetCharge(theChargeChange);  
00362   pPostStepPoint->SetMagneticMoment(theMagneticMomentChange);  
00363  
00364   // update kinetic energy and momentum direction
00365   pPostStepPoint->SetMomentumDirection(theMomentumDirectionChange);
00366   pPostStepPoint->SetKineticEnergy( theEnergyChange );
00367 
00368   // calculate velocity
00369   pTrack->SetKineticEnergy( theEnergyChange );
00370   if (!isVelocityChanged) {
00371     if(theEnergyChange > 0.0) {
00372       theVelocityChange = pTrack->CalculateVelocity();
00373     } else if(theMassChange > 0.0) {
00374       theVelocityChange = 0.0;
00375     }
00376   }
00377   pPostStepPoint->SetVelocity(theVelocityChange);
00378  
00379    // update polarization
00380   pPostStepPoint->SetPolarization( thePolarizationChange );
00381       
00382   // update position and time
00383   pPostStepPoint->SetPosition( thePositionChange  );
00384   pPostStepPoint->AddGlobalTime(theTimeChange - theLocalTime0);
00385   pPostStepPoint->SetLocalTime( theTimeChange );               
00386   pPostStepPoint->SetProperTime( theProperTimeChange  );
00387 
00388   if (isParentWeightProposed ){
00389     pPostStepPoint->SetWeight( theParentWeight );
00390   }
00391 
00392 #ifdef G4VERBOSE
00393   G4Track*     aTrack  = pStep->GetTrack();
00394   if (debugFlag) CheckIt(*aTrack);
00395 #endif
00396 
00397   //  Update the G4Step specific attributes 
00398   return UpdateStepInfo(pStep);
00399 }

G4Step * G4ParticleChange::UpdateStepInfo ( G4Step Step  )  [inline, protected]

Reimplemented from G4VParticleChange.

Definition at line 31 of file G4ParticleChange.icc.

References G4VParticleChange::UpdateStepInfo().

Referenced by UpdateStepForAlongStep(), G4ParticleChangeForTransport::UpdateStepForAtRest(), UpdateStepForAtRest(), and UpdateStepForPostStep().

00032 {
00033   return G4VParticleChange::UpdateStepInfo(pStep);
00034 }


Field Documentation

G4bool G4ParticleChange::isVelocityChanged [protected]

Definition at line 235 of file G4ParticleChange.hh.

Referenced by G4ParticleChange(), G4ParticleChangeForTransport::Initialize(), Initialize(), operator=(), ProposeVelocity(), G4ParticleChangeForTransport::UpdateStepForAlongStep(), UpdateStepForAlongStep(), UpdateStepForAtRest(), and UpdateStepForPostStep().

G4double G4ParticleChange::theChargeChange [protected]

Definition at line 255 of file G4ParticleChange.hh.

Referenced by DumpInfo(), G4ParticleChange(), GetCharge(), Initialize(), operator=(), ProposeCharge(), UpdateStepForAlongStep(), UpdateStepForAtRest(), and UpdateStepForPostStep().

const G4Track* G4ParticleChange::theCurrentTrack [protected]

Definition at line 261 of file G4ParticleChange.hh.

Referenced by AddSecondary(), G4ParticleChange(), Initialize(), and operator=().

G4double G4ParticleChange::theEnergyChange [protected]

Definition at line 231 of file G4ParticleChange.hh.

Referenced by CheckIt(), DumpInfo(), G4ParticleChange(), GetEnergy(), Initialize(), G4ParticleChangeForTransport::operator=(), operator=(), ProposeEnergy(), G4ParticleChangeForTransport::UpdateStepForAlongStep(), UpdateStepForAlongStep(), UpdateStepForAtRest(), and UpdateStepForPostStep().

G4double G4ParticleChange::theGlobalTime0 [protected]

Definition at line 241 of file G4ParticleChange.hh.

Referenced by G4ParticleChange(), GetGlobalTime(), G4ParticleChangeForTransport::Initialize(), Initialize(), operator=(), and ProposeGlobalTime().

G4double G4ParticleChange::theLocalTime0 [protected]

Definition at line 243 of file G4ParticleChange.hh.

Referenced by G4ParticleChange(), GetGlobalTime(), G4ParticleChangeForTransport::Initialize(), Initialize(), operator=(), ProposeGlobalTime(), UpdateStepForAlongStep(), UpdateStepForAtRest(), and UpdateStepForPostStep().

G4double G4ParticleChange::theMagneticMomentChange [protected]

Definition at line 258 of file G4ParticleChange.hh.

Referenced by DumpInfo(), G4ParticleChange(), GetMagneticMoment(), Initialize(), operator=(), ProposeMagneticMoment(), UpdateStepForAlongStep(), UpdateStepForAtRest(), and UpdateStepForPostStep().

G4double G4ParticleChange::theMassChange [protected]

Definition at line 252 of file G4ParticleChange.hh.

Referenced by DumpInfo(), G4ParticleChange(), GetMass(), Initialize(), operator=(), ProposeMass(), UpdateStepForAlongStep(), UpdateStepForAtRest(), and UpdateStepForPostStep().

G4ThreeVector G4ParticleChange::theMomentumDirectionChange [protected]

Definition at line 221 of file G4ParticleChange.hh.

Referenced by CheckIt(), DumpInfo(), G4ParticleChange(), GetMomentumDirection(), Initialize(), G4ParticleChangeForTransport::operator=(), operator=(), ProposeMomentumDirection(), G4ParticleChangeForTransport::UpdateStepForAlongStep(), UpdateStepForAlongStep(), UpdateStepForAtRest(), and UpdateStepForPostStep().

G4ThreeVector G4ParticleChange::thePolarizationChange [protected]

Definition at line 228 of file G4ParticleChange.hh.

Referenced by DumpInfo(), G4ParticleChange(), GetPolarization(), G4ParticleChangeForTransport::Initialize(), Initialize(), G4ParticleChangeForTransport::operator=(), operator=(), ProposePolarization(), G4ParticleChangeForTransport::UpdateStepForAlongStep(), UpdateStepForAlongStep(), UpdateStepForAtRest(), and UpdateStepForPostStep().

G4ThreeVector G4ParticleChange::thePositionChange [protected]

Definition at line 238 of file G4ParticleChange.hh.

Referenced by AddSecondary(), DumpInfo(), G4ParticleChange(), GetGlobalPosition(), GetPosition(), Initialize(), G4ParticleChangeForTransport::operator=(), operator=(), ProposePosition(), G4ParticleChangeForTransport::UpdateStepForAlongStep(), UpdateStepForAlongStep(), UpdateStepForAtRest(), and UpdateStepForPostStep().

G4double G4ParticleChange::theProperTimeChange [protected]

Definition at line 249 of file G4ParticleChange.hh.

Referenced by CheckIt(), DumpInfo(), G4ParticleChange(), GetProperTime(), Initialize(), operator=(), ProposeProperTime(), G4ParticleChangeForTransport::UpdateStepForAlongStep(), UpdateStepForAlongStep(), UpdateStepForAtRest(), and UpdateStepForPostStep().

G4double G4ParticleChange::theTimeChange [protected]

Definition at line 246 of file G4ParticleChange.hh.

Referenced by CheckIt(), DumpInfo(), G4ParticleChange(), GetGlobalTime(), GetLocalTime(), G4ParticleChangeForTransport::Initialize(), Initialize(), G4ParticleChangeForTransport::operator=(), operator=(), ProposeGlobalTime(), ProposeLocalTime(), G4ParticleChangeForTransport::UpdateStepForAlongStep(), UpdateStepForAlongStep(), UpdateStepForAtRest(), and UpdateStepForPostStep().

G4double G4ParticleChange::theVelocityChange [protected]

Definition at line 234 of file G4ParticleChange.hh.

Referenced by CheckIt(), DumpInfo(), G4ParticleChange(), GetVelocity(), G4ParticleChangeForTransport::Initialize(), Initialize(), G4ParticleChangeForTransport::operator=(), operator=(), ProposeVelocity(), G4ParticleChangeForTransport::UpdateStepForAlongStep(), UpdateStepForAlongStep(), UpdateStepForAtRest(), and UpdateStepForPostStep().


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:50 2013 for Geant4 by  doxygen 1.4.7