00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // 00030 // ------------------------------------------------------------ 00031 // GEANT 4 class header file 00032 // 00033 // 00034 // ------------------------------------------------------------ 00035 // 15 April 2005 V.Ivanchenko for gamma EM processes 00036 // 00037 // Modified: 00038 // 30.05.05 : add UpdateStepForAtRest (V.Ivanchenko) 00039 // 04.12.05 : apply UpdateStepForPostStep in any case (mma) 00040 // 26.08.06 : Add->Set polarization; 00041 // add const method to access track; 00042 // add weight modification (V.Ivanchenko) 00043 // 00044 // ------------------------------------------------------------ 00045 // 00046 // Class Description 00047 // This class is a concrete class for ParticleChange for gamma processes 00048 // 00049 #ifndef G4ParticleChangeForGamma_h 00050 #define G4ParticleChangeForGamma_h 1 00051 00052 #include "globals.hh" 00053 #include "G4ios.hh" 00054 #include "G4VParticleChange.hh" 00055 00056 class G4DynamicParticle; 00057 00058 class G4ParticleChangeForGamma: public G4VParticleChange 00059 { 00060 public: 00061 // default constructor 00062 G4ParticleChangeForGamma(); 00063 00064 // destructor 00065 virtual ~G4ParticleChangeForGamma(); 00066 00067 // with description 00068 // ---------------------------------------------------- 00069 // --- the following methods are for updating G4Step ----- 00070 00071 G4Step* UpdateStepForAtRest(G4Step* pStep); 00072 G4Step* UpdateStepForPostStep(G4Step* Step); 00073 // A physics process gives the final state of the particle 00074 // based on information of G4Track 00075 00076 void InitializeForPostStep(const G4Track&); 00077 //Initialize all propoerties by using G4Track information 00078 00079 void AddSecondary(G4DynamicParticle* aParticle); 00080 // Add next secondary 00081 00082 G4double GetProposedKineticEnergy() const; 00083 void SetProposedKineticEnergy(G4double proposedKinEnergy); 00084 // Get/Set the final kinetic energy of the current particle. 00085 00086 const G4ThreeVector& GetProposedMomentumDirection() const; 00087 void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz); 00088 void ProposeMomentumDirection(const G4ThreeVector& Pfinal); 00089 // Get/Propose the MomentumDirection vector: it is the final momentum direction. 00090 00091 const G4ThreeVector& GetProposedPolarization() const; 00092 void ProposePolarization(const G4ThreeVector& dir); 00093 void ProposePolarization(G4double Px, G4double Py, G4double Pz); 00094 00095 const G4Track* GetCurrentTrack() const; 00096 00097 virtual void DumpInfo() const; 00098 00099 // for Debug 00100 virtual G4bool CheckIt(const G4Track&); 00101 00102 protected: 00103 // hide copy constructor and assignment operaor as protected 00104 G4ParticleChangeForGamma(const G4ParticleChangeForGamma &right); 00105 G4ParticleChangeForGamma & operator=(const G4ParticleChangeForGamma &right); 00106 00107 private: 00108 00109 const G4Track* currentTrack; 00110 // The pointer to G4Track 00111 00112 G4double proposedKinEnergy; 00113 // The final kinetic energy of the current particle. 00114 00115 G4ThreeVector proposedMomentumDirection; 00116 // The final momentum direction of the current particle. 00117 00118 G4ThreeVector proposedPolarization; 00119 // The final polarization of the current particle. 00120 }; 00121 00122 // ------------------------------------------------------------ 00123 00124 inline G4double G4ParticleChangeForGamma::GetProposedKineticEnergy() const 00125 { 00126 return proposedKinEnergy; 00127 } 00128 00129 inline void G4ParticleChangeForGamma::SetProposedKineticEnergy(G4double energy) 00130 { 00131 proposedKinEnergy = energy; 00132 } 00133 00134 inline 00135 const G4ThreeVector& G4ParticleChangeForGamma::GetProposedMomentumDirection() const 00136 { 00137 return proposedMomentumDirection; 00138 } 00139 00140 inline 00141 void G4ParticleChangeForGamma::ProposeMomentumDirection(const G4ThreeVector& dir) 00142 { 00143 proposedMomentumDirection = dir; 00144 } 00145 00146 inline 00147 void G4ParticleChangeForGamma::ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz) 00148 { 00149 proposedMomentumDirection.setX(Px); 00150 proposedMomentumDirection.setY(Py); 00151 proposedMomentumDirection.setZ(Pz); 00152 } 00153 00154 inline const G4Track* G4ParticleChangeForGamma::GetCurrentTrack() const 00155 { 00156 return currentTrack; 00157 } 00158 00159 inline 00160 const G4ThreeVector& G4ParticleChangeForGamma::GetProposedPolarization() const 00161 { 00162 return proposedPolarization; 00163 } 00164 00165 inline 00166 void G4ParticleChangeForGamma::ProposePolarization(const G4ThreeVector& dir) 00167 { 00168 proposedPolarization = dir; 00169 } 00170 00171 inline 00172 void G4ParticleChangeForGamma::ProposePolarization(G4double Px, G4double Py, G4double Pz) 00173 { 00174 proposedPolarization.setX(Px); 00175 proposedPolarization.setY(Py); 00176 proposedPolarization.setZ(Pz); 00177 } 00178 00179 inline void G4ParticleChangeForGamma::InitializeForPostStep(const G4Track& track) 00180 { 00181 theStatusChange = track.GetTrackStatus(); 00182 theLocalEnergyDeposit = 0.0; 00183 theNonIonizingEnergyDeposit = 0.0; 00184 InitializeSecondaries(track); 00185 theParentWeight = track.GetWeight(); 00186 isParentWeightProposed = false; 00187 proposedKinEnergy = track.GetKineticEnergy(); 00188 proposedMomentumDirection = track.GetMomentumDirection(); 00189 proposedPolarization = track.GetPolarization(); 00190 currentTrack = &track; 00191 } 00192 00193 #endif 00194