File indexing completed on 2025-01-18 09:58:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #ifndef G4ParticleChangeForGamma_hh
0037 #define G4ParticleChangeForGamma_hh 1
0038
0039 #include "globals.hh"
0040 #include "G4ios.hh"
0041 #include "G4VParticleChange.hh"
0042
0043 class G4DynamicParticle;
0044
0045 class G4ParticleChangeForGamma final : public G4VParticleChange
0046 {
0047 public:
0048
0049 G4ParticleChangeForGamma();
0050
0051 ~G4ParticleChangeForGamma() override = default;
0052
0053 G4ParticleChangeForGamma(const G4ParticleChangeForGamma& right) = delete;
0054 G4ParticleChangeForGamma& operator=(const G4ParticleChangeForGamma& right) = delete;
0055
0056
0057
0058 G4Step* UpdateStepForAtRest(G4Step* pStep) final;
0059 G4Step* UpdateStepForPostStep(G4Step* Step) final;
0060
0061
0062
0063 inline void InitializeForPostStep(const G4Track&);
0064
0065
0066 void AddSecondary(G4DynamicParticle* aParticle);
0067
0068
0069 inline G4double GetProposedKineticEnergy() const;
0070 inline void SetProposedKineticEnergy(G4double proposedKinEnergy);
0071
0072
0073 inline const G4ThreeVector& GetProposedMomentumDirection() const;
0074 inline void ProposeMomentumDirection(const G4ThreeVector& Pfinal);
0075
0076
0077 inline const G4ThreeVector& GetProposedPolarization() const;
0078 inline void ProposePolarization(const G4ThreeVector& dir);
0079 inline void ProposePolarization(G4double Px, G4double Py, G4double Pz);
0080
0081 void DumpInfo() const override;
0082
0083 private:
0084
0085 G4double proposedKinEnergy = 0.0;
0086
0087
0088 G4ThreeVector proposedMomentumDirection;
0089
0090
0091 G4ThreeVector proposedPolarization;
0092
0093 };
0094
0095
0096
0097
0098
0099 inline
0100 G4double G4ParticleChangeForGamma::GetProposedKineticEnergy() const
0101 {
0102 return proposedKinEnergy;
0103 }
0104
0105 inline
0106 void G4ParticleChangeForGamma::SetProposedKineticEnergy(G4double energy)
0107 {
0108 proposedKinEnergy = energy;
0109 }
0110
0111 inline
0112 const G4ThreeVector& G4ParticleChangeForGamma::
0113 GetProposedMomentumDirection() const
0114 {
0115 return proposedMomentumDirection;
0116 }
0117
0118 inline
0119 void G4ParticleChangeForGamma::
0120 ProposeMomentumDirection(const G4ThreeVector& dir)
0121 {
0122 proposedMomentumDirection = dir;
0123 }
0124
0125 inline
0126 const G4ThreeVector& G4ParticleChangeForGamma::GetProposedPolarization() const
0127 {
0128 return proposedPolarization;
0129 }
0130
0131 inline
0132 void G4ParticleChangeForGamma::ProposePolarization(const G4ThreeVector& dir)
0133 {
0134 proposedPolarization = dir;
0135 }
0136
0137 inline
0138 void G4ParticleChangeForGamma::ProposePolarization(G4double Px,
0139 G4double Py,
0140 G4double Pz)
0141 {
0142 proposedPolarization.setX(Px);
0143 proposedPolarization.setY(Py);
0144 proposedPolarization.setZ(Pz);
0145 }
0146
0147 inline
0148 void G4ParticleChangeForGamma::InitializeForPostStep(const G4Track& track)
0149 {
0150 InitializeSecondaries();
0151 InitializeLocalEnergyDeposit();
0152 InitializeParentWeight(track);
0153 InitializeStatusChange(track);
0154 proposedKinEnergy = track.GetKineticEnergy();
0155 proposedMomentumDirection = track.GetMomentumDirection();
0156 proposedPolarization = track.GetPolarization();
0157 }
0158
0159 #endif