00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 #ifndef G4ParticleChangeForLoss_h
00052 #define G4ParticleChangeForLoss_h 1
00053
00054 #include "globals.hh"
00055 #include "G4ios.hh"
00056 #include "G4VParticleChange.hh"
00057
00058 class G4DynamicParticle;
00059
00060 class G4ParticleChangeForLoss: public G4VParticleChange
00061 {
00062 public:
00063
00064 G4ParticleChangeForLoss();
00065
00066
00067 virtual ~G4ParticleChangeForLoss();
00068
00069
00070
00071
00072
00073 G4Step* UpdateStepForAlongStep(G4Step* Step);
00074 G4Step* UpdateStepForPostStep(G4Step* Step);
00075
00076
00077
00078 void InitializeForAlongStep(const G4Track&);
00079 void InitializeForPostStep(const G4Track&);
00080
00081
00082 void AddSecondary(G4DynamicParticle* aParticle);
00083
00084
00085 G4double GetProposedCharge() const;
00086 void SetProposedCharge(G4double theCharge);
00087
00088
00089 G4double GetCharge() const;
00090 void ProposeCharge(G4double finalCharge);
00091
00092
00093 G4double GetProposedKineticEnergy() const;
00094 void SetProposedKineticEnergy(G4double proposedKinEnergy);
00095
00096
00097 const G4ThreeVector& GetProposedMomentumDirection() const;
00098 void SetProposedMomentumDirection(const G4ThreeVector& dir);
00099 const G4ThreeVector& GetMomentumDirection() const;
00100 void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz);
00101 void ProposeMomentumDirection(const G4ThreeVector& Pfinal);
00102
00103
00104 const G4ThreeVector& GetProposedPolarization() const;
00105 void ProposePolarization(const G4ThreeVector& dir);
00106 void ProposePolarization(G4double Px, G4double Py, G4double Pz);
00107
00108 const G4Track* GetCurrentTrack() const;
00109
00110 void SetLowEnergyLimit(G4double elimit);
00111
00112 virtual void DumpInfo() const;
00113
00114
00115 virtual G4bool CheckIt(const G4Track&);
00116
00117 protected:
00118
00119 G4ParticleChangeForLoss(const G4ParticleChangeForLoss &right);
00120 G4ParticleChangeForLoss & operator=(const G4ParticleChangeForLoss &right);
00121
00122 private:
00123
00124 const G4Track* currentTrack;
00125
00126
00127 G4double proposedKinEnergy;
00128
00129
00130 G4double lowEnergyLimit;
00131
00132
00133 G4double currentCharge;
00134
00135
00136 G4ThreeVector proposedMomentumDirection;
00137
00138
00139 G4ThreeVector proposedPolarization;
00140
00141 };
00142
00143
00144
00145 inline G4double G4ParticleChangeForLoss::GetProposedKineticEnergy() const
00146 {
00147 return proposedKinEnergy;
00148 }
00149
00150 inline void G4ParticleChangeForLoss::SetProposedKineticEnergy(G4double energy)
00151 {
00152 proposedKinEnergy = energy;
00153 }
00154
00155 inline G4double G4ParticleChangeForLoss::GetProposedCharge() const
00156 {
00157 return currentCharge;
00158 }
00159
00160 inline G4double G4ParticleChangeForLoss::GetCharge() const
00161 {
00162 return currentCharge;
00163 }
00164
00165 inline void G4ParticleChangeForLoss::SetProposedCharge(G4double theCharge)
00166 {
00167 currentCharge = theCharge;
00168 }
00169
00170 inline void G4ParticleChangeForLoss::ProposeCharge(G4double theCharge)
00171 {
00172 currentCharge = theCharge;
00173 }
00174
00175 inline
00176 const G4ThreeVector& G4ParticleChangeForLoss::GetProposedMomentumDirection() const
00177 {
00178 return proposedMomentumDirection;
00179 }
00180
00181 inline
00182 const G4ThreeVector& G4ParticleChangeForLoss::GetMomentumDirection() const
00183 {
00184 return proposedMomentumDirection;
00185 }
00186
00187 inline
00188 void G4ParticleChangeForLoss::ProposeMomentumDirection(const G4ThreeVector& dir)
00189 {
00190 proposedMomentumDirection = dir;
00191 }
00192
00193 inline
00194 void G4ParticleChangeForLoss::SetProposedMomentumDirection(const G4ThreeVector& dir)
00195 {
00196 proposedMomentumDirection = dir;
00197 }
00198
00199 inline
00200 void G4ParticleChangeForLoss::ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
00201 {
00202 proposedMomentumDirection.setX(Px);
00203 proposedMomentumDirection.setY(Py);
00204 proposedMomentumDirection.setZ(Pz);
00205 }
00206
00207 inline const G4Track* G4ParticleChangeForLoss::GetCurrentTrack() const
00208 {
00209 return currentTrack;
00210 }
00211
00212 inline
00213 const G4ThreeVector& G4ParticleChangeForLoss::GetProposedPolarization() const
00214 {
00215 return proposedPolarization;
00216 }
00217
00218 inline
00219 void G4ParticleChangeForLoss::ProposePolarization(const G4ThreeVector& dir)
00220 {
00221 proposedPolarization = dir;
00222 }
00223
00224 inline
00225 void G4ParticleChangeForLoss::ProposePolarization(G4double Px, G4double Py, G4double Pz)
00226 {
00227 proposedPolarization.setX(Px);
00228 proposedPolarization.setY(Py);
00229 proposedPolarization.setZ(Pz);
00230 }
00231
00232 inline void G4ParticleChangeForLoss::InitializeForAlongStep(const G4Track& track)
00233 {
00234 theStatusChange = track.GetTrackStatus();
00235 theLocalEnergyDeposit = 0.0;
00236 theNonIonizingEnergyDeposit = 0.0;
00237 InitializeSecondaries(track);
00238 theParentWeight = track.GetWeight();
00239 isParentWeightProposed = false;
00240 proposedKinEnergy = track.GetKineticEnergy();
00241 currentCharge = track.GetDynamicParticle()->GetCharge();
00242 }
00243
00244 inline void G4ParticleChangeForLoss::InitializeForPostStep(const G4Track& track)
00245 {
00246 theStatusChange = track.GetTrackStatus();
00247 theLocalEnergyDeposit = 0.0;
00248 theNonIonizingEnergyDeposit = 0.0;
00249 InitializeSecondaries(track);
00250 theParentWeight = track.GetWeight();
00251 isParentWeightProposed = false;
00252 proposedKinEnergy = track.GetKineticEnergy();
00253 currentCharge = track.GetDynamicParticle()->GetCharge();
00254 proposedMomentumDirection = track.GetMomentumDirection();
00255 proposedPolarization = track.GetPolarization();
00256 currentTrack = &track;
00257 }
00258
00259
00260 inline void G4ParticleChangeForLoss::AddSecondary(G4DynamicParticle* aParticle)
00261 {
00262
00263 G4Track* aTrack = new G4Track(aParticle, currentTrack->GetGlobalTime(),
00264 currentTrack->GetPosition());
00265
00266
00267 aTrack->SetTouchableHandle(currentTrack->GetTouchableHandle());
00268
00269
00270 G4VParticleChange::AddSecondary(aTrack);
00271 }
00272
00273 inline void G4ParticleChangeForLoss::SetLowEnergyLimit(G4double elimit)
00274 {
00275 lowEnergyLimit = elimit;
00276 }
00277
00278 #endif
00279