G4ParticleChangeForTransport Class Reference

#include <G4ParticleChangeForTransport.hh>

Inheritance diagram for G4ParticleChangeForTransport:

G4ParticleChange G4VParticleChange

Public Member Functions

 G4ParticleChangeForTransport ()
virtual ~G4ParticleChangeForTransport ()
virtual G4StepUpdateStepForAlongStep (G4Step *Step)
virtual G4StepUpdateStepForAtRest (G4Step *Step)
virtual G4StepUpdateStepForPostStep (G4Step *Step)
virtual void Initialize (const G4Track &)
const G4TouchableHandleGetTouchableHandle () const
void SetTouchableHandle (const G4TouchableHandle &fTouchable)
G4MaterialGetMaterialInTouchable () const
void SetMaterialInTouchable (G4Material *fMaterial)
const G4MaterialCutsCoupleGetMaterialCutsCoupleInTouchable () const
void SetMaterialCutsCoupleInTouchable (const G4MaterialCutsCouple *fMaterialCutsCouple)
G4VSensitiveDetectorGetSensitiveDetectorInTouchable () const
void SetSensitiveDetectorInTouchable (G4VSensitiveDetector *fSensitiveDetector)
G4bool GetMomentumChanged () const
void SetMomentumChanged (G4bool b)
virtual void DumpInfo () const
void SetPointerToVectorOfAuxiliaryPoints (std::vector< G4ThreeVector > *theNewVectorPointer)
std::vector< G4ThreeVector > * GetPointerToVectorOfAuxiliaryPoints () const

Protected Member Functions

 G4ParticleChangeForTransport (const G4ParticleChangeForTransport &right)
G4ParticleChangeForTransportoperator= (const G4ParticleChangeForTransport &right)

Protected Attributes

G4TouchableHandle theTouchableHandle

Detailed Description

Definition at line 55 of file G4ParticleChangeForTransport.hh.


Constructor & Destructor Documentation

G4ParticleChangeForTransport::G4ParticleChangeForTransport (  ) 

Definition at line 48 of file G4ParticleChangeForTransport.cc.

References G4cout, G4endl, and G4VParticleChange::verboseLevel.

00049   : G4ParticleChange(), isMomentumChanged(false), theMaterialChange(0),
00050     theMaterialCutsCoupleChange(0), theSensitiveDetectorChange(0),
00051     fpVectorOfAuxiliaryPointsPointer(0)
00052 {
00053   if (verboseLevel>2) {
00054     G4cout << "G4ParticleChangeForTransport::G4ParticleChangeForTransport() "
00055            << G4endl;
00056   }
00057 }

G4ParticleChangeForTransport::~G4ParticleChangeForTransport (  )  [virtual]

Definition at line 59 of file G4ParticleChangeForTransport.cc.

References G4cout, G4endl, and G4VParticleChange::verboseLevel.

00060 {
00061   if (verboseLevel>2) {
00062     G4cout << "G4ParticleChangeForTransport::~G4ParticleChangeForTransport() "
00063            << G4endl;
00064   }
00065 }

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

Definition at line 68 of file G4ParticleChangeForTransport.cc.

References G4cout, G4endl, isMomentumChanged, theMaterialChange, theMaterialCutsCoupleChange, theSensitiveDetectorChange, theTouchableHandle, and G4VParticleChange::verboseLevel.

00069   : G4ParticleChange(r),
00070     fpVectorOfAuxiliaryPointsPointer(0)
00071 {
00072   if (verboseLevel>0) {
00073     G4cout << "G4ParticleChangeForTransport::  copy constructor is called "
00074            << G4endl;
00075   }
00076   theTouchableHandle = r.theTouchableHandle;
00077   isMomentumChanged = r.isMomentumChanged;
00078   theMaterialChange = r.theMaterialChange;
00079   theMaterialCutsCoupleChange = r.theMaterialCutsCoupleChange;
00080   theSensitiveDetectorChange = r.theSensitiveDetectorChange;
00081 }


Member Function Documentation

void G4ParticleChangeForTransport::DumpInfo (  )  const [virtual]

Reimplemented from G4ParticleChange.

Definition at line 250 of file G4ParticleChangeForTransport.cc.

References G4ParticleChange::DumpInfo(), G4cout, G4endl, and theTouchableHandle.

00251 {
00252 // use base-class DumpInfo
00253   G4ParticleChange::DumpInfo();
00254 
00255   G4int oldprc = G4cout.precision(3);
00256   G4cout << "        Touchable (pointer) : " 
00257          << std::setw(20) << theTouchableHandle() << G4endl; 
00258   G4cout.precision(oldprc);
00259 }

const G4MaterialCutsCouple * G4ParticleChangeForTransport::GetMaterialCutsCoupleInTouchable (  )  const [inline]

Definition at line 63 of file G4ParticleChangeForTransport.icc.

00064 {
00065   return theMaterialCutsCoupleChange;
00066 }

G4Material * G4ParticleChangeForTransport::GetMaterialInTouchable (  )  const [inline]

Definition at line 51 of file G4ParticleChangeForTransport.icc.

00052 {
00053   return theMaterialChange;
00054 }

G4bool G4ParticleChangeForTransport::GetMomentumChanged (  )  const [inline]

Definition at line 81 of file G4ParticleChangeForTransport.icc.

00082 {
00083   return isMomentumChanged;
00084 }

std::vector< G4ThreeVector > * G4ParticleChangeForTransport::GetPointerToVectorOfAuxiliaryPoints (  )  const [inline]

Definition at line 145 of file G4ParticleChangeForTransport.icc.

00146 {
00147   return fpVectorOfAuxiliaryPointsPointer;
00148 }

G4VSensitiveDetector * G4ParticleChangeForTransport::GetSensitiveDetectorInTouchable (  )  const [inline]

Definition at line 75 of file G4ParticleChangeForTransport.icc.

00076 {
00077   return theSensitiveDetectorChange;
00078 }

const G4TouchableHandle & G4ParticleChangeForTransport::GetTouchableHandle (  )  const [inline]

Definition at line 38 of file G4ParticleChangeForTransport.icc.

References theTouchableHandle.

00039 {
00040   return theTouchableHandle;
00041 }

void G4ParticleChangeForTransport::Initialize ( const G4Track  )  [inline, virtual]

Reimplemented from G4ParticleChange.

Definition at line 96 of file G4ParticleChangeForTransport.icc.

References G4Track::GetDynamicParticle(), G4Track::GetGlobalTime(), G4Track::GetLocalTime(), G4DynamicParticle::GetPolarization(), G4Track::GetVelocity(), G4VParticleChange::InitializeStatusChange(), G4VParticleChange::InitializeSteppingControl(), G4ParticleChange::isVelocityChanged, G4ParticleChange::theGlobalTime0, G4ParticleChange::theLocalTime0, G4ParticleChange::thePolarizationChange, G4ParticleChange::theTimeChange, and G4ParticleChange::theVelocityChange.

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

00097 {
00098   // use base class's method at first
00099   InitializeStatusChange(track);
00100 //  InitializeLocalEnergyDeposit(track);
00101   InitializeSteppingControl(track);
00102 //  InitializeTrueStepLength(track);
00103 //  InitializeSecondaries(track);
00104 
00105   // set Energy/Momentum etc. equal to those of the parent particle
00106   const G4DynamicParticle*  pParticle = track.GetDynamicParticle();
00107 //  theEnergyChange          = pParticle->GetKineticEnergy();
00108 //  theMomentumChange        = pParticle->GetMomentumDirection();
00109     theVelocityChange          = track.GetVelocity();
00110     isVelocityChanged          = false;
00111     thePolarizationChange    = pParticle->GetPolarization();
00112 //  theProperTimeChange      = pParticle->GetProperTime();
00113 
00114   // set Position/Time etc. equal to those of the parent track
00115   //  thePositionChange      = track.GetPosition();
00116   // set TimeChange equal to local time of the parent track
00117   theTimeChange                = track.GetLocalTime();
00118   // set initial Local/Global time of the parent track
00119   theLocalTime0           = track.GetLocalTime();
00120   theGlobalTime0          = track.GetGlobalTime();
00121 
00122   // set touchable equal to the next touchable of the parent track
00123   // not set as for now
00124   //theTouchableChange     = track.GetNextTouchable();
00125 
00126 // So almost nothing is initialized here.
00127 // theMomentumChange, theProperTimeChange, thePositionChange and theTimeChange
00128 // are set by G4Transportation::AlongStepDoIt;
00129 // the others are not needed.
00130 // Take care when implementing the PostStep related things!
00131 // (P. Urban)
00132 }

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

Definition at line 85 of file G4ParticleChangeForTransport.cc.

References G4cout, G4endl, G4ParticleChange::theEnergyChange, G4VParticleChange::theListOfSecondaries, G4VParticleChange::theLocalEnergyDeposit, theMaterialChange, theMaterialCutsCoupleChange, G4ParticleChange::theMomentumDirectionChange, G4VParticleChange::theNumberOfSecondaries, G4ParticleChange::thePolarizationChange, G4ParticleChange::thePositionChange, theSensitiveDetectorChange, G4VParticleChange::theSizeOftheListOfSecondaries, G4VParticleChange::theStatusChange, G4VParticleChange::theSteppingControlFlag, G4ParticleChange::theTimeChange, theTouchableHandle, G4VParticleChange::theTrueStepLength, G4ParticleChange::theVelocityChange, and G4VParticleChange::verboseLevel.

00086 {
00087    if (verboseLevel>1) {
00088     G4cout << "G4ParticleChangeForTransport:: assignment operator is called "
00089            << G4endl;
00090    }
00091    if (this != &r)
00092    {
00093       theListOfSecondaries = r.theListOfSecondaries;
00094       theSizeOftheListOfSecondaries = r.theSizeOftheListOfSecondaries;
00095       theNumberOfSecondaries = r.theNumberOfSecondaries;
00096       theStatusChange = r.theStatusChange;
00097       theTouchableHandle = r.theTouchableHandle;
00098       theMaterialChange = r.theMaterialChange;
00099       theMaterialCutsCoupleChange = r.theMaterialCutsCoupleChange;
00100       theSensitiveDetectorChange = r.theSensitiveDetectorChange;
00101       theMomentumDirectionChange = r.theMomentumDirectionChange;
00102       thePolarizationChange = r.thePolarizationChange;
00103       thePositionChange = r.thePositionChange;
00104       theTimeChange = r.theTimeChange;
00105       theEnergyChange = r.theEnergyChange;
00106       theVelocityChange        = r.theVelocityChange;
00107       theTrueStepLength = r.theTrueStepLength;
00108       theLocalEnergyDeposit = r.theLocalEnergyDeposit;
00109       theSteppingControlFlag = r.theSteppingControlFlag;
00110    }
00111    return *this;
00112 }

void G4ParticleChangeForTransport::SetMaterialCutsCoupleInTouchable ( const G4MaterialCutsCouple fMaterialCutsCouple  )  [inline]

Definition at line 57 of file G4ParticleChangeForTransport.icc.

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

00058 {
00059   theMaterialCutsCoupleChange =   fMaterialCutsCouple;
00060 }

void G4ParticleChangeForTransport::SetMaterialInTouchable ( G4Material fMaterial  )  [inline]

Definition at line 45 of file G4ParticleChangeForTransport.icc.

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

00046 {
00047   theMaterialChange =   fMaterial;
00048 }

void G4ParticleChangeForTransport::SetMomentumChanged ( G4bool  b  )  [inline]

Definition at line 87 of file G4ParticleChangeForTransport.icc.

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

00088 {
00089   isMomentumChanged= b;
00090 }

void G4ParticleChangeForTransport::SetPointerToVectorOfAuxiliaryPoints ( std::vector< G4ThreeVector > *  theNewVectorPointer  )  [inline]

Definition at line 138 of file G4ParticleChangeForTransport.icc.

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

00140 {
00141   fpVectorOfAuxiliaryPointsPointer = theNewVectorPointer;
00142 }

void G4ParticleChangeForTransport::SetSensitiveDetectorInTouchable ( G4VSensitiveDetector fSensitiveDetector  )  [inline]

Definition at line 69 of file G4ParticleChangeForTransport.icc.

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

00070 {
00071   theSensitiveDetectorChange =   fSensitiveDetector;
00072 }

void G4ParticleChangeForTransport::SetTouchableHandle ( const G4TouchableHandle fTouchable  )  [inline]

Definition at line 31 of file G4ParticleChangeForTransport.icc.

References theTouchableHandle.

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

00033 {
00034   theTouchableHandle =   fTouchable;
00035 }

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

Reimplemented from G4ParticleChange.

Definition at line 131 of file G4ParticleChangeForTransport.cc.

References G4StepPoint::AddGlobalTime(), G4StepPoint::AddLocalTime(), G4StepPoint::AddPolarization(), G4StepPoint::AddPosition(), G4StepPoint::AddProperTime(), G4ParticleChange::CalcMomentum(), G4ParticleChange::CheckIt(), G4VParticleChange::debugFlag, G4Track::GetDynamicParticle(), G4StepPoint::GetKineticEnergy(), G4StepPoint::GetLocalTime(), G4DynamicParticle::GetMass(), G4StepPoint::GetMomentum(), G4StepPoint::GetPolarization(), G4StepPoint::GetPosition(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4StepPoint::GetProperTime(), G4Step::GetTrack(), G4ParticleChange::isVelocityChanged, G4Step::SetControlFlag(), G4StepPoint::SetKineticEnergy(), G4StepPoint::SetMomentumDirection(), G4Step::SetPointerToVectorOfAuxiliaryPoints(), G4StepPoint::SetVelocity(), G4ParticleChange::theEnergyChange, G4ParticleChange::theMomentumDirectionChange, G4ParticleChange::thePolarizationChange, G4ParticleChange::thePositionChange, G4ParticleChange::theProperTimeChange, G4VParticleChange::theSteppingControlFlag, G4ParticleChange::theTimeChange, and G4ParticleChange::theVelocityChange.

00132 {
00133   // Smooth curved tajectory representation: let the Step know about
00134   // the auxiliary trajectory points (jacek 30/10/2002)
00135   pStep->SetPointerToVectorOfAuxiliaryPoints(fpVectorOfAuxiliaryPointsPointer);
00136 
00137   // copy of G4ParticleChange::UpdateStepForAlongStep
00138   //  i.e. no effect for touchable
00139 
00140   // A physics process always calculates the final state of the
00141   // particle relative to the initial state at the beginning
00142   // of the Step, i.e., based on information of G4Track (or
00143   // equivalently the PreStepPoint).
00144   // So, the differences (delta) between these two states have to be
00145   // calculated and be accumulated in PostStepPoint.
00146 
00147   // Take note that the return type of GetMomentumChange is a
00148   // pointer to G4ThreeVector. Also it is a normalized
00149   // momentum vector.
00150 
00151   G4StepPoint* pPreStepPoint  = pStep->GetPreStepPoint();
00152   G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
00153   G4Track*     aTrack  = pStep->GetTrack();
00154   G4double     mass = aTrack->GetDynamicParticle()->GetMass();
00155 
00156   // uodate kinetic energy
00157   //  now assume that no energy change in transportation
00158   //  However it is not true in electric fields
00159   //  Case for changing energy will be implemented in future
00160 
00161 
00162   // update momentum direction and energy
00163   if (isMomentumChanged) {
00164     G4double energy;
00165     energy= pPostStepPoint->GetKineticEnergy()
00166                  + (theEnergyChange - pPreStepPoint->GetKineticEnergy());
00167 
00168     // calculate new momentum
00169     G4ThreeVector pMomentum =  pPostStepPoint->GetMomentum()
00170                      + ( CalcMomentum(theEnergyChange, theMomentumDirectionChange, mass)
00171                           - pPreStepPoint->GetMomentum());
00172     G4double      tMomentum = pMomentum.mag();
00173     G4ThreeVector direction(1.0,0.0,0.0);
00174     if( tMomentum > 0. ){
00175       G4double  inv_Momentum= 1.0 / tMomentum;
00176       direction= pMomentum * inv_Momentum;
00177     }
00178     pPostStepPoint->SetMomentumDirection(direction);
00179     pPostStepPoint->SetKineticEnergy( energy );
00180   }
00181   if (isVelocityChanged)  pPostStepPoint->SetVelocity(theVelocityChange);
00182 
00183   // stop case should not occur
00184   //pPostStepPoint->SetMomentumDirection(G4ThreeVector(1., 0., 0.));
00185 
00186 
00187   // update polarization
00188   pPostStepPoint->AddPolarization( thePolarizationChange
00189                                    - pPreStepPoint->GetPolarization());
00190 
00191   // update position and time
00192   pPostStepPoint->AddPosition( thePositionChange
00193                                - pPreStepPoint->GetPosition() );
00194   pPostStepPoint->AddGlobalTime( theTimeChange
00195                                  - pPreStepPoint->GetLocalTime());
00196   pPostStepPoint->AddLocalTime( theTimeChange
00197                                  - pPreStepPoint->GetLocalTime());
00198   pPostStepPoint->AddProperTime( theProperTimeChange
00199                                  - pPreStepPoint->GetProperTime());
00200 
00201 #ifdef G4VERBOSE
00202   if (debugFlag) CheckIt(*aTrack);
00203 #endif
00204 
00205   //  Update the G4Step specific attributes
00206   //pStep->SetStepLength( theTrueStepLength );
00207   //  pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
00208   pStep->SetControlFlag( theSteppingControlFlag );
00209   return pStep;
00210   //  return UpdateStepInfo(pStep);
00211 }

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

Reimplemented from G4ParticleChange.

Definition at line 118 of file G4ParticleChangeForTransport.cc.

References G4cout, G4endl, G4ParticleChange::UpdateStepInfo(), and G4VParticleChange::verboseLevel.

00119 {
00120   // Nothing happens for AtRestDoIt
00121   if (verboseLevel>0) {
00122     G4cout << "G4ParticleChangeForTransport::UpdateStepForAtRest() is called"
00123            << G4endl;
00124     G4cout << " Nothing happens for this method " << G4endl;
00125   }
00126   //  Update the G4Step specific attributes
00127   return UpdateStepInfo(pStep);
00128 }

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

Reimplemented from G4ParticleChange.

Definition at line 213 of file G4ParticleChangeForTransport.cc.

References G4Step::ClearLastStepFlag(), G4StepPoint::GetKineticEnergy(), G4Step::GetPostStepPoint(), G4Step::SetLastStepFlag(), G4StepPoint::SetMaterial(), G4StepPoint::SetMaterialCutsCouple(), G4StepPoint::SetSensitiveDetector(), G4StepPoint::SetTouchableHandle(), and theTouchableHandle.

00214 {
00215   // A physics process always calculates the final state of the particle
00216 
00217   // Change volume only if some kinetic energy remains
00218   G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
00219   if(pPostStepPoint->GetKineticEnergy() > 0.0) {
00220 
00221     // update next touchable
00222     // (touchable can be changed only at PostStepDoIt)
00223     pPostStepPoint->SetTouchableHandle( theTouchableHandle );
00224 
00225     pPostStepPoint->SetMaterial( theMaterialChange );
00226     pPostStepPoint->SetMaterialCutsCouple( theMaterialCutsCoupleChange );
00227     pPostStepPoint->SetSensitiveDetector( theSensitiveDetectorChange );
00228   }
00229   if( this->GetLastStepInVolume() ){
00230     pStep->SetLastStepFlag();
00231   }else{
00232     pStep->ClearLastStepFlag(); 
00233   }
00234   // It used to call base class's method
00235   //   - but this would copy uninitialised data members
00236   // return G4ParticleChange::UpdateStepForPostStep(pStep);
00237 
00238   // Copying what the base class does would instead
00239   //   - also not useful
00240   // return G4VParticleChange::UpdateStepInfo(pStep);
00241 
00242   return pStep;
00243 }


Field Documentation

G4TouchableHandle G4ParticleChangeForTransport::theTouchableHandle [protected]

Definition at line 114 of file G4ParticleChangeForTransport.hh.

Referenced by DumpInfo(), G4ParticleChangeForTransport(), GetTouchableHandle(), operator=(), SetTouchableHandle(), 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