Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ParticleChangeForTransport Class Reference

#include <G4ParticleChangeForTransport.hh>

Inheritance diagram for G4ParticleChangeForTransport:
Collaboration diagram for G4ParticleChangeForTransport:

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
 
- Public Member Functions inherited from G4ParticleChange
 G4ParticleChange ()
 
virtual ~G4ParticleChange ()
 
G4bool operator== (const G4ParticleChange &right) const
 
G4bool operator!= (const G4ParticleChange &right) const
 
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 G4bool CheckIt (const G4Track &)
 
- Public Member Functions inherited from G4VParticleChange
 G4VParticleChange ()
 
virtual ~G4VParticleChange ()
 
G4bool operator== (const G4VParticleChange &right) const
 
G4bool operator!= (const G4VParticleChange &right) const
 
G4double GetTrueStepLength () const
 
void ProposeTrueStepLength (G4double truePathLength)
 
G4double GetLocalEnergyDeposit () const
 
void ProposeLocalEnergyDeposit (G4double anEnergyPart)
 
G4double GetNonIonizingEnergyDeposit () const
 
void ProposeNonIonizingEnergyDeposit (G4double anEnergyPart)
 
G4TrackStatus GetTrackStatus () const
 
void ProposeTrackStatus (G4TrackStatus status)
 
G4SteppingControl GetSteppingControl () const
 
void ProposeSteppingControl (G4SteppingControl StepControlFlag)
 
G4bool GetFirstStepInVolume () const
 
G4bool GetLastStepInVolume () const
 
void ProposeFirstStepInVolume (G4bool flag)
 
void ProposeLastStepInVolume (G4bool flag)
 
void Clear ()
 
void SetNumberOfSecondaries (G4int totSecondaries)
 
G4int GetNumberOfSecondaries () const
 
G4TrackGetSecondary (G4int anIndex) const
 
void AddSecondary (G4Track *aSecondary)
 
G4double GetWeight () const
 
G4double GetParentWeight () const
 
void ProposeWeight (G4double finalWeight)
 
void ProposeParentWeight (G4double finalWeight)
 
void SetSecondaryWeightByProcess (G4bool)
 
G4bool IsSecondaryWeightSetByProcess () const
 
void SetParentWeightByProcess (G4bool)
 
G4bool IsParentWeightSetByProcess () const
 
void SetVerboseLevel (G4int vLevel)
 
G4int GetVerboseLevel () const
 
void ClearDebugFlag ()
 
void SetDebugFlag ()
 
G4bool GetDebugFlag () const
 

Protected Member Functions

 G4ParticleChangeForTransport (const G4ParticleChangeForTransport &right)
 
G4ParticleChangeForTransportoperator= (const G4ParticleChangeForTransport &right)
 
- Protected Member Functions inherited from G4ParticleChange
 G4ParticleChange (const G4ParticleChange &right)
 
G4ParticleChangeoperator= (const G4ParticleChange &right)
 
G4StepUpdateStepInfo (G4Step *Step)
 
- Protected Member Functions inherited from G4VParticleChange
 G4VParticleChange (const G4VParticleChange &right)
 
G4VParticleChangeoperator= (const G4VParticleChange &right)
 
G4StepUpdateStepInfo (G4Step *Step)
 
void InitializeTrueStepLength (const G4Track &)
 
void InitializeLocalEnergyDeposit (const G4Track &)
 
void InitializeSteppingControl (const G4Track &)
 
void InitializeParentWeight (const G4Track &)
 
void InitializeParentGlobalTime (const G4Track &)
 
void InitializeStatusChange (const G4Track &)
 
void InitializeSecondaries (const G4Track &)
 
void InitializeStepInVolumeFlags (const G4Track &)
 
G4bool CheckSecondary (G4Track &)
 
G4double GetAccuracyForWarning () const
 
G4double GetAccuracyForException () const
 

Protected Attributes

G4TouchableHandle theTouchableHandle
 
- Protected Attributes inherited from G4ParticleChange
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
 
- Protected Attributes inherited from G4VParticleChange
G4TrackFastVectortheListOfSecondaries
 
G4int theNumberOfSecondaries
 
G4int theSizeOftheListOfSecondaries
 
G4TrackStatus theStatusChange
 
G4SteppingControl theSteppingControlFlag
 
G4double theLocalEnergyDeposit
 
G4double theNonIonizingEnergyDeposit
 
G4double theTrueStepLength
 
G4bool theFirstStepInVolume
 
G4bool theLastStepInVolume
 
G4double theParentWeight
 
G4bool isParentWeightProposed
 
G4bool fSetSecondaryWeightByProcess
 
G4double theParentGlobalTime
 
G4int verboseLevel
 
G4bool debugFlag
 

Additional Inherited Members

- Static Protected Attributes inherited from G4VParticleChange
static const G4double accuracyForWarning = 1.0e-9
 
static const G4double accuracyForException = 0.001
 

Detailed Description

Definition at line 55 of file G4ParticleChangeForTransport.hh.

Constructor & Destructor Documentation

G4ParticleChangeForTransport::G4ParticleChangeForTransport ( )

Definition at line 48 of file G4ParticleChangeForTransport.cc.

49  : G4ParticleChange(), isMomentumChanged(false), theMaterialChange(0),
50  theMaterialCutsCoupleChange(0), theSensitiveDetectorChange(0),
51  fpVectorOfAuxiliaryPointsPointer(0)
52 {
53  if (verboseLevel>2) {
54  G4cout << "G4ParticleChangeForTransport::G4ParticleChangeForTransport() "
55  << G4endl;
56  }
57 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4ParticleChangeForTransport::~G4ParticleChangeForTransport ( )
virtual

Definition at line 59 of file G4ParticleChangeForTransport.cc.

60 {
61  if (verboseLevel>2) {
62  G4cout << "G4ParticleChangeForTransport::~G4ParticleChangeForTransport() "
63  << G4endl;
64  }
65 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4ParticleChangeForTransport::G4ParticleChangeForTransport ( const G4ParticleChangeForTransport right)
protected

Definition at line 68 of file G4ParticleChangeForTransport.cc.

69  : G4ParticleChange(r),
70  fpVectorOfAuxiliaryPointsPointer(0)
71 {
72  if (verboseLevel>0) {
73  G4cout << "G4ParticleChangeForTransport:: copy constructor is called "
74  << G4endl;
75  }
76  theTouchableHandle = r.theTouchableHandle;
77  isMomentumChanged = r.isMomentumChanged;
78  theMaterialChange = r.theMaterialChange;
79  theMaterialCutsCoupleChange = r.theMaterialCutsCoupleChange;
80  theSensitiveDetectorChange = r.theSensitiveDetectorChange;
81 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Member Function Documentation

void G4ParticleChangeForTransport::DumpInfo ( ) const
virtual

Reimplemented from G4ParticleChange.

Definition at line 255 of file G4ParticleChangeForTransport.cc.

256 {
257 // use base-class DumpInfo
259 
260  G4int oldprc = G4cout.precision(3);
261  G4cout << " Touchable (pointer) : "
262  << std::setw(20) << theTouchableHandle() << G4endl;
263  G4cout.precision(oldprc);
264 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
virtual void DumpInfo() const
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

const G4MaterialCutsCouple* G4ParticleChangeForTransport::GetMaterialCutsCoupleInTouchable ( ) const
G4Material* G4ParticleChangeForTransport::GetMaterialInTouchable ( ) const
G4bool G4ParticleChangeForTransport::GetMomentumChanged ( ) const
std::vector<G4ThreeVector>* G4ParticleChangeForTransport::GetPointerToVectorOfAuxiliaryPoints ( ) const
inline
G4VSensitiveDetector* G4ParticleChangeForTransport::GetSensitiveDetectorInTouchable ( ) const
const G4TouchableHandle& G4ParticleChangeForTransport::GetTouchableHandle ( ) const
virtual void G4ParticleChangeForTransport::Initialize ( const G4Track )
virtual

Reimplemented from G4ParticleChange.

Here is the caller graph for this function:

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

Definition at line 85 of file G4ParticleChangeForTransport.cc.

86 {
87  if (verboseLevel>1) {
88  G4cout << "G4ParticleChangeForTransport:: assignment operator is called "
89  << G4endl;
90  }
91  if (this != &r)
92  {
93  theListOfSecondaries = r.theListOfSecondaries;
94  theSizeOftheListOfSecondaries = r.theSizeOftheListOfSecondaries;
95  theNumberOfSecondaries = r.theNumberOfSecondaries;
96  theStatusChange = r.theStatusChange;
97  theTouchableHandle = r.theTouchableHandle;
98  theMaterialChange = r.theMaterialChange;
99  theMaterialCutsCoupleChange = r.theMaterialCutsCoupleChange;
100  theSensitiveDetectorChange = r.theSensitiveDetectorChange;
101  theMomentumDirectionChange = r.theMomentumDirectionChange;
102  thePolarizationChange = r.thePolarizationChange;
103  thePositionChange = r.thePositionChange;
104  theTimeChange = r.theTimeChange;
105  theEnergyChange = r.theEnergyChange;
106  theVelocityChange = r.theVelocityChange;
107  theTrueStepLength = r.theTrueStepLength;
108  theLocalEnergyDeposit = r.theLocalEnergyDeposit;
109  theSteppingControlFlag = r.theSteppingControlFlag;
110  }
111  return *this;
112 }
G4TrackFastVector * theListOfSecondaries
G4ThreeVector thePositionChange
G4ThreeVector thePolarizationChange
G4GLOB_DLL std::ostream G4cout
G4SteppingControl theSteppingControlFlag
G4ThreeVector theMomentumDirectionChange
#define G4endl
Definition: G4ios.hh:61
G4TrackStatus theStatusChange
void G4ParticleChangeForTransport::SetMaterialCutsCoupleInTouchable ( const G4MaterialCutsCouple fMaterialCutsCouple)

Here is the caller graph for this function:

void G4ParticleChangeForTransport::SetMaterialInTouchable ( G4Material fMaterial)

Here is the caller graph for this function:

void G4ParticleChangeForTransport::SetMomentumChanged ( G4bool  b)

Here is the caller graph for this function:

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

Here is the caller graph for this function:

void G4ParticleChangeForTransport::SetSensitiveDetectorInTouchable ( G4VSensitiveDetector fSensitiveDetector)

Here is the caller graph for this function:

void G4ParticleChangeForTransport::SetTouchableHandle ( const G4TouchableHandle fTouchable)

Here is the caller graph for this function:

G4Step * G4ParticleChangeForTransport::UpdateStepForAlongStep ( G4Step Step)
virtual

Reimplemented from G4ParticleChange.

Definition at line 131 of file G4ParticleChangeForTransport.cc.

132 {
133  // Smooth curved tajectory representation: let the Step know about
134  // the auxiliary trajectory points (jacek 30/10/2002)
135  pStep->SetPointerToVectorOfAuxiliaryPoints(fpVectorOfAuxiliaryPointsPointer);
136 
137  // copy of G4ParticleChange::UpdateStepForAlongStep
138  // i.e. no effect for touchable
139 
140  // A physics process always calculates the final state of the
141  // particle relative to the initial state at the beginning
142  // of the Step, i.e., based on information of G4Track (or
143  // equivalently the PreStepPoint).
144  // So, the differences (delta) between these two states have to be
145  // calculated and be accumulated in PostStepPoint.
146 
147  // Take note that the return type of GetMomentumChange is a
148  // pointer to G4ThreeVector. Also it is a normalized
149  // momentum vector.
150 
151  G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
152  G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
153  G4Track* aTrack = pStep->GetTrack();
154  G4double mass = aTrack->GetDynamicParticle()->GetMass();
155 
156  // uodate kinetic energy
157  // now assume that no energy change in transportation
158  // However it is not true in electric fields
159  // Case for changing energy will be implemented in future
160 
161 
162  // update momentum direction and energy
163  if (isMomentumChanged) {
165  energy= pPostStepPoint->GetKineticEnergy()
166  + (theEnergyChange - pPreStepPoint->GetKineticEnergy());
167 
168  // calculate new momentum
169  G4ThreeVector pMomentum = pPostStepPoint->GetMomentum()
171  - pPreStepPoint->GetMomentum());
172  G4double tMomentum = pMomentum.mag();
173  G4ThreeVector direction(1.0,0.0,0.0);
174  if( tMomentum > 0. ){
175  G4double inv_Momentum= 1.0 / tMomentum;
176  direction= pMomentum * inv_Momentum;
177  }
178  pPostStepPoint->SetMomentumDirection(direction);
179  pPostStepPoint->SetKineticEnergy( energy );
180  }
181  if (isVelocityChanged) pPostStepPoint->SetVelocity(theVelocityChange);
182 
183  // stop case should not occur
184  //pPostStepPoint->SetMomentumDirection(G4ThreeVector(1., 0., 0.));
185 
186 
187  // update polarization
188  pPostStepPoint->AddPolarization( thePolarizationChange
189  - pPreStepPoint->GetPolarization());
190 
191  // update position and time
192  pPostStepPoint->AddPosition( thePositionChange
193  - pPreStepPoint->GetPosition() );
194  pPostStepPoint->AddGlobalTime( theTimeChange
195  - pPreStepPoint->GetLocalTime());
196  pPostStepPoint->AddLocalTime( theTimeChange
197  - pPreStepPoint->GetLocalTime());
198  pPostStepPoint->AddProperTime( theProperTimeChange
199  - pPreStepPoint->GetProperTime());
200 
201 #ifdef G4VERBOSE
202  if (debugFlag) CheckIt(*aTrack);
203 #endif
204 
205  // Update the G4Step specific attributes
206  //pStep->SetStepLength( theTrueStepLength );
207  // pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
208  pStep->SetControlFlag( theSteppingControlFlag );
209  return pStep;
210  // return UpdateStepInfo(pStep);
211 }
void AddGlobalTime(const G4double aValue)
G4double theProperTimeChange
void AddPosition(const G4ThreeVector &aValue)
const G4DynamicParticle * GetDynamicParticle() const
G4ThreeVector GetMomentum() const
G4ThreeVector CalcMomentum(G4double energy, G4ThreeVector direction, G4double mass) const
void AddLocalTime(const G4double aValue)
G4double GetLocalTime() const
void AddPolarization(const G4ThreeVector &aValue)
void SetMomentumDirection(const G4ThreeVector &aValue)
G4ThreeVector thePositionChange
G4ThreeVector thePolarizationChange
const G4ThreeVector & GetPosition() const
G4double GetMass() const
G4SteppingControl theSteppingControlFlag
virtual G4bool CheckIt(const G4Track &)
G4ThreeVector theMomentumDirectionChange
void SetVelocity(G4double v)
G4double energy(const ThreeVector &p, const G4double m)
G4double GetProperTime() const
G4double GetKineticEnergy() const
double G4double
Definition: G4Types.hh:76
void SetKineticEnergy(const G4double aValue)
double mag() const
const G4ThreeVector & GetPolarization() const
void AddProperTime(const G4double aValue)

Here is the call graph for this function:

G4Step * G4ParticleChangeForTransport::UpdateStepForAtRest ( G4Step Step)
virtual

Reimplemented from G4ParticleChange.

Definition at line 118 of file G4ParticleChangeForTransport.cc.

119 {
120  // Nothing happens for AtRestDoIt
121  if (verboseLevel>0) {
122  G4cout << "G4ParticleChangeForTransport::UpdateStepForAtRest() is called"
123  << G4endl;
124  G4cout << " Nothing happens for this method " << G4endl;
125  }
126  // Update the G4Step specific attributes
127  return UpdateStepInfo(pStep);
128 }
G4Step * UpdateStepInfo(G4Step *Step)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

G4Step * G4ParticleChangeForTransport::UpdateStepForPostStep ( G4Step Step)
virtual

Reimplemented from G4ParticleChange.

Definition at line 213 of file G4ParticleChangeForTransport.cc.

214 {
215  // A physics process always calculates the final state of the particle
216 
217  // Change volume only if some kinetic energy remains
218  G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
219  if(pPostStepPoint->GetKineticEnergy() > 0.0) {
220 
221  // update next touchable
222  // (touchable can be changed only at PostStepDoIt)
223  pPostStepPoint->SetTouchableHandle( theTouchableHandle );
224 
225  pPostStepPoint->SetMaterial( theMaterialChange );
226  pPostStepPoint->SetMaterialCutsCouple( theMaterialCutsCoupleChange );
227  pPostStepPoint->SetSensitiveDetector( theSensitiveDetectorChange );
228  }
229  if( this->GetFirstStepInVolume() ){
230  pStep->SetFirstStepFlag();
231  }else{
232  pStep->ClearFirstStepFlag();
233  }
234  if( this->GetLastStepInVolume() ){
235  pStep->SetLastStepFlag();
236  }else{
237  pStep->ClearLastStepFlag();
238  }
239  // It used to call base class's method
240  // - but this would copy uninitialised data members
241  // return G4ParticleChange::UpdateStepForPostStep(pStep);
242 
243  // Copying what the base class does would instead
244  // - also not useful
245  // return G4VParticleChange::UpdateStepInfo(pStep);
246 
247  return pStep;
248 }
G4bool GetLastStepInVolume() const
void SetSensitiveDetector(G4VSensitiveDetector *)
void SetMaterial(G4Material *)
G4double GetKineticEnergy() const
G4bool GetFirstStepInVolume() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
void SetMaterialCutsCouple(const G4MaterialCutsCouple *)

Here is the call graph for this function:

Member Data Documentation

G4TouchableHandle G4ParticleChangeForTransport::theTouchableHandle
protected

Definition at line 114 of file G4ParticleChangeForTransport.hh.


The documentation for this class was generated from the following files: