Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // G4ParticleChange << 27 // 26 // 28 // Class description: << 27 // $Id: G4ParticleChange.hh 68795 2013-04-05 13:24:46Z gcosmo $ 29 // 28 // 30 // Concrete class for ParticleChange containin << 29 // 31 // invocation of a physics process. << 30 // ------------------------------------------------------------ 32 // This includes final states of parent partic << 31 // GEANT 4 class header file 33 // etc) and secondary particles generated by t << 34 // The tracking assumes that all the values of << 35 // are in global reference system, therefore a << 36 // transformations must have been already comp << 37 // data-members of this class. << 38 // 32 // 39 // IMPORTANT NOTE: Despite the name, what this << 33 // 40 // through its methods, are the "FINAL" values << 34 // ------------------------------------------------------------ 41 // Momentum, etc. << 35 // Implemented for the new scheme 23 Mar. 1998 H.Kurahige 42 << 36 // 43 // Author: Hisaya Kurashige, 23 March 1998 << 37 // Class Description 44 // ------------------------------------------- << 38 // This class is a concrete class for ParticleChange which 45 #ifndef G4ParticleChange_hh << 39 // has all functionality in old scheme. 46 #define G4ParticleChange_hh 1 << 40 //- >> 41 // This class contains the results after invocation of a physics process. >> 42 // This includes final states of parent particle (momentum, energy, >> 43 // etc) and secondary particles generated by the interaction. >> 44 // The tracking assumes that all the values of energy and >> 45 // momentum are in global reference system, therefore all the >> 46 // needed Lorentz transformations must have been already Done >> 47 // when filling the data-members of this class. >> 48 //- >> 49 // --------------------------------------------------------------- >> 50 // IMPORTANT NOTE: Although the name of the class and methods are >> 51 // "Change", what it stores (and returns in get) are the "FINAL" >> 52 // values of the Position, Momentum, etc. >> 53 // >> 54 // ------------------------------------------------------------ >> 55 // modify AddSecondary methods for "GoodForTracking" flag >> 56 // 8 June 1998 H.Kurashige >> 57 // Add Track weight 12 Nov. 1998 H.Kurashige >> 58 // Add Get/SetMomentumDirectionChange 6 Feb. 1999 H.Kurashige >> 59 // Add Get/SetDynamicMass 5 Oct. 1999 H.Kurashige >> 60 // Add Get/SetDynamicCharge 5 Oct. 1999 H.Kurashige >> 61 // Rename SetXXX methods to ProposeXXX DynamicCharge Oct. 2005 H.Kurashige >> 62 // Add get/ProposeMagneticMoment Mar 2007 H.Kurashige >> 63 // Fix treatment of weight Mar 2007 H.Kurashige >> 64 // Add Get/ProposeVelocity Apr 2011 H.Kurashige >> 65 // ------------------------------------------------------------- >> 66 >> 67 #ifndef G4ParticleChange_h >> 68 #define G4ParticleChange_h 1 47 69 48 #include "globals.hh" 70 #include "globals.hh" 49 #include "G4ios.hh" 71 #include "G4ios.hh" 50 #include "G4ThreeVector.hh" 72 #include "G4ThreeVector.hh" 51 #include "G4VParticleChange.hh" << 73 #include "G4ThreeVector.hh" 52 << 53 class G4DynamicParticle; 74 class G4DynamicParticle; >> 75 #include "G4VParticleChange.hh" 54 76 55 class G4ParticleChange : public G4VParticleCha << 77 class G4ParticleChange: public G4VParticleChange 56 { << 78 { 57 public: 79 public: 58 << 80 // default constructor 59 G4ParticleChange(); 81 G4ParticleChange(); 60 // Default constructor << 82 // G4ParticleChange(G4bool useEB); 61 83 62 ~G4ParticleChange() override = default; << 84 // destructor 63 // Destructor << 85 virtual ~G4ParticleChange(); 64 86 65 G4ParticleChange(const G4ParticleChange& r << 87 protected: 66 G4ParticleChange& operator=(const G4Partic << 88 // hide copy constructor and assignment operaor as protected >> 89 G4ParticleChange(const G4ParticleChange &right); >> 90 G4ParticleChange & operator=(const G4ParticleChange &right); 67 91 68 // --- the following methods are for updatin << 92 public: 69 // Return the pointer to G4Step after updati << 93 // equal/unequal operator 70 // by using final state of the track given b << 94 G4bool operator==(const G4ParticleChange &right) const; 71 << 95 G4bool operator!=(const G4ParticleChange &right) const; 72 G4Step* UpdateStepForAlongStep(G4Step* Ste << 96 73 // A physics process gives the final sta << 97 public: // with description 74 // relative to the initial state at the << 98 // ---------------------------------------------------- 75 // i.e., based on information of G4Track << 99 // --- the following methods are for updating G4Step ----- 76 // the PreStepPoint). << 100 // Return the pointer to the G4Step after updating the Step information 77 // In this method, the differences (delt << 101 // by using final state information of the track given by a physics 78 // are calculated, and are accumulated i << 102 // process 79 // Take note that the return type of Get << 103 virtual G4Step* UpdateStepForAlongStep(G4Step* Step); 80 // pointer to G4ParticleMomentum. Also i << 104 // A physics process gives the final state of the particle 81 // momentum vector << 105 // relative to the initial state at the beginning of the Step, 82 << 106 // i.e., based on information of G4Track (or equivalently 83 G4Step* UpdateStepForAtRest(G4Step* Step) << 107 // the PreStepPoint) 84 G4Step* UpdateStepForPostStep(G4Step* Step << 108 // In this method, the differences (delta) between these two states 85 // A physics process gives the final sta << 109 // are calculated, and are accumulated in PostStepPoint. 86 // based on information of G4Track (or e << 110 // Take note that the return type of GetMomentumChange is a 87 << 111 // pointer to G4ParticleMometum. Also it is a normalized 88 void Initialize(const G4Track&) override; << 112 // momentum vector. 89 // Initialize all propoerties by using G << 113 virtual G4Step* UpdateStepForAtRest(G4Step* Step); 90 << 114 virtual G4Step* UpdateStepForPostStep(G4Step* Step); 91 // --- methods to keep information of the fi << 115 // A physics process gives the final state of the particle 92 // << 116 // based on information of G4Track (or equivalently the PreStepPoint) 93 // The ProposeXXX methods store (and return << 117 94 // the "FINAL" values of the Position, Mome << 118 virtual void Initialize(const G4Track&); 95 << 119 // Initialize all propoerties by using G4Track information 96 inline const G4ThreeVector* GetMomentumDir << 97 inline void ProposeMomentumDirection(G4dou << 98 inline void ProposeMomentumDirection(const << 99 // Get/Propose the MomentumDirection vec << 100 // direction << 101 << 102 inline const G4ThreeVector* GetPolarizatio << 103 inline void ProposePolarization(G4double P << 104 inline void ProposePolarization(const G4Th << 105 // Get/Propose the final Polarization ve << 106 << 107 inline G4double GetEnergy() const; << 108 inline void ProposeEnergy(G4double finalEn << 109 // Get/Propose the final kinetic energy << 110 << 111 inline G4double GetVelocity() const; << 112 inline void ProposeVelocity(G4double final << 113 // Get/Propose the final velocity of the << 114 << 115 inline G4double GetProperTime() const; << 116 inline void ProposeProperTime(G4double fin << 117 // Get/Propose the final ProperTime << 118 << 119 inline const G4ThreeVector* GetPosition() << 120 inline void ProposePosition(G4double x, G4 << 121 inline void ProposePosition(const G4ThreeV << 122 // Get/Propose the final position of the << 123 << 124 inline void ProposeGlobalTime(G4double t); << 125 inline void ProposeLocalTime(G4double t); << 126 // Get/Propose the final global/local Ti << 127 // NOTE: DO NOT INVOKE both methods in a << 128 // Each method affects both local << 129 << 130 inline G4double GetGlobalTime(G4double tim << 131 inline G4double GetLocalTime(G4double time << 132 // Convert the time delay to the glocbal << 133 // Can get the final global/local time w << 134 << 135 inline G4double GetMass() const; << 136 inline void ProposeMass(G4double finalMass << 137 // Get/Propose the final dynamical mass << 138 << 139 inline G4double GetCharge() const; << 140 inline void ProposeCharge(G4double finalCh << 141 // Get/Propose the final dynamical charg << 142 << 143 inline G4double GetMagneticMoment() const; << 144 inline void ProposeMagneticMoment(G4double << 145 // Get/Propose the final MagneticMoment << 146 << 147 inline G4ThreeVector << 148 GetGlobalPosition(const G4ThreeVector& dis << 149 // Convert the position displacement to << 150 << 151 inline G4ThreeVector CalcMomentum(G4double << 152 G4double << 153 // Calculate momentum by using Energy, M << 154 120 155 // --- methods for adding secondaries --- << 121 protected: // with description >> 122 G4Step* UpdateStepInfo(G4Step* Step); >> 123 // Update the G4Step specific attributes >> 124 // (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength) 156 125 157 void AddSecondary(G4Track* aSecondary); << 126 public: // with description 158 // Add a secondary particle to theListOf << 127 >> 128 // ---------------------------------------------------- >> 129 //--- methods to keep information of the final state-- >> 130 // IMPORTANT NOTE: >> 131 // These ProposeXXX methods stores (and returns in GetXXX methods) >> 132 // the "FINAL" values of the Position, Momentum, etc. >> 133 >> 134 const G4ThreeVector* GetMomentumDirection() const; >> 135 void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz); >> 136 void ProposeMomentumDirection(const G4ThreeVector& Pfinal); >> 137 // Get/Propose the MomentumDirection vector: it is the final momentum direction. >> 138 >> 139 const G4ThreeVector* GetPolarization() const; >> 140 void ProposePolarization(G4double Px, G4double Py, G4double Pz); >> 141 void ProposePolarization(const G4ThreeVector& finalPoralization); >> 142 // Get/Propose the final Polarization vector. >> 143 >> 144 G4double GetEnergy() const; >> 145 void ProposeEnergy(G4double finalEnergy); >> 146 // Get/Propose the final kinetic energy of the current particle. >> 147 >> 148 G4double GetVelocity() const; >> 149 void ProposeVelocity(G4double finalVelocity); >> 150 // Get/Propose the final velocity of the current particle. >> 151 >> 152 G4double GetProperTime() const; >> 153 void ProposeProperTime(G4double finalProperTime); >> 154 // Get/Propose th final ProperTime >> 155 >> 156 const G4ThreeVector* GetPosition() const; >> 157 void ProposePosition(G4double x, G4double y, G4double z); >> 158 void ProposePosition(const G4ThreeVector& finalPosition); >> 159 // Get/Propose the final position of the current particle. >> 160 >> 161 void ProposeGlobalTime(G4double t); >> 162 void ProposeLocalTime(G4double t); >> 163 // Get/Propose the final global/local Time >> 164 // NOTE: DO NOT INVOKE both methods in a step >> 165 // Each method affects both local and global time >> 166 >> 167 G4double GetGlobalTime(G4double timeDelay=0.0) const; >> 168 G4double GetLocalTime(G4double timeDelay=0.0) const; >> 169 // Convert the time delay to the glocbal/local time. >> 170 // Can get the final global/local Time without argument >> 171 >> 172 G4double GetMass() const; >> 173 void ProposeMass(G4double finalMass); >> 174 // Get/Propose the final dynamical Mass in G4DynamicParticle >> 175 >> 176 G4double GetCharge() const; >> 177 void ProposeCharge(G4double finalCharge); >> 178 // Get/Propose the final dynamical Charge in G4DynamicParticle >> 179 >> 180 G4double GetMagneticMoment() const; >> 181 void ProposeMagneticMoment(G4double finalMagneticMoment); >> 182 // Get/Propose the final MagneticMoment in G4DynamicParticle >> 183 >> 184 G4ThreeVector GetGlobalPosition(const G4ThreeVector& displacement) const; >> 185 // Convert the position displacement to the global position. >> 186 >> 187 G4ThreeVector CalcMomentum(G4double energy, >> 188 G4ThreeVector direction, >> 189 G4double mass ) const; >> 190 // Calculate momentum by using Energy, Momentum Direction, and Mass 159 191 160 void AddSecondary(G4DynamicParticle* aSeco << 161 G4bool IsGoodForTracking << 162 // Add a secondary particle to theListOf << 163 // Position and time are same as thePosi << 164 << 165 void AddSecondary(G4DynamicParticle* aSeco << 166 G4bool IsGoodForTracking << 167 // Add a secondary particle to theListOf << 168 // Global time are same as theTimeChange << 169 << 170 void AddSecondary(G4DynamicParticle* aSeco << 171 G4bool IsGoodForTracking << 172 // Add a secondary particle to theListOf << 173 // Position and are same as thePositionC << 174 192 175 // --- Dump and debug methods --- << 176 193 177 void DumpInfo() const override; << 194 // ---------------------------------------------------- >> 195 // --- methods for adding secondaries >> 196 void AddSecondary(G4Track* aSecondary); >> 197 // Add a secondary particle to theListOfSecondaries. 178 198 179 protected: << 199 void AddSecondary(G4DynamicParticle* aSecondary, >> 200 G4bool IsGoodForTracking = false ); >> 201 // Add a secondary particle to theListOfSecondaries. >> 202 // position and time are same as thePositionChange and theTimeChange >> 203 >> 204 void AddSecondary(G4DynamicParticle* aSecondary, >> 205 G4ThreeVector position, >> 206 G4bool IsGoodForTracking = false ); >> 207 // Add a secondary particle to theListOfSecondaries. >> 208 // global time are same as theTimeChange and theTimeChange >> 209 >> 210 void AddSecondary(G4DynamicParticle* aSecondary, >> 211 G4double time, >> 212 G4bool IsGoodForTracking = false ); >> 213 // Add a secondary particle to theListOfSecondaries. >> 214 // position and are same as thePositionChange >> 215 // ---------------------------------------------------- 180 216 181 G4Step* UpdateStepInfo(G4Step* Step); << 217 public: 182 // Update the G4Step specific attributes << 218 virtual void DumpInfo() const; 183 // (i.e. SteppingControl, LocalEnergyDep << 184 219 >> 220 protected: 185 G4ThreeVector theMomentumDirectionChange; 221 G4ThreeVector theMomentumDirectionChange; 186 // It is the vector containing the final << 222 // It is the vector containing the final momentum direction 187 // after the invoked process. The applic << 223 // after the invoked process. The application of the change 188 // of the momentum direction of the part << 224 // of the momentum direction of the particle is not Done here. 189 // The responsibility to apply the chang << 225 // The responsibility to apply the change is up the entity 190 // which invoked the process << 226 // which invoked the process. 191 227 192 G4ThreeVector thePolarizationChange; 228 G4ThreeVector thePolarizationChange; 193 // The changed (final) polarization of a << 229 // The changed (final) polarization of a given track >> 230 >> 231 G4double theEnergyChange; >> 232 // The final kinetic energy of the current track >> 233 >> 234 G4double theVelocityChange; >> 235 G4bool isVelocityChanged; >> 236 // The final velocity of the current track >> 237 >> 238 G4ThreeVector thePositionChange; >> 239 // The changed (final) position of a given track >> 240 >> 241 G4double theGlobalTime0; >> 242 // The global time at Initial. >> 243 G4double theLocalTime0; >> 244 // The local time at Initial. >> 245 >> 246 G4double theTimeChange; >> 247 // The change of local time of a given particle. >> 248 >> 249 G4double theProperTimeChange; >> 250 // The changed (final) proper time of a given track >> 251 >> 252 G4double theMassChange; >> 253 // The Changed (final) mass of a given track >> 254 >> 255 G4double theChargeChange; >> 256 // The Changed (final) charge of a given track >> 257 >> 258 G4double theMagneticMomentChange; >> 259 // The Changed (final) MagneticMoment of a given track >> 260 >> 261 const G4Track* theCurrentTrack; >> 262 >> 263 public: >> 264 // for Debug >> 265 virtual G4bool CheckIt(const G4Track&); >> 266 }; >> 267 >> 268 #include "G4ParticleChange.icc" >> 269 >> 270 #endif >> 271 >> 272 >> 273 >> 274 >> 275 194 276 195 G4double theEnergyChange = 0.0; << 196 // The final kinetic energy of the curre << 197 277 198 G4double theVelocityChange = 0.0; << 199 G4bool isVelocityChanged = false; << 200 // The final velocity of the current tra << 201 278 202 G4ThreeVector thePositionChange; << 203 // The changed (final) position of a giv << 204 279 205 G4double theGlobalTime0 = 0.0; << 206 // The global time at Initial << 207 G4double theLocalTime0 = 0.0; << 208 // The local time at Initial << 209 280 210 G4double theTimeChange = 0.0; << 211 // The change of local time of a given p << 212 281 213 G4double theProperTimeChange = 0.0; << 214 // The changed (final) proper time of a << 215 282 216 G4double theMassChange = 0.0; << 217 // The Changed (final) mass of a given t << 218 283 219 G4double theChargeChange = 0.0; << 220 // The Changed (final) charge of a given << 221 284 222 G4double theMagneticMomentChange = 0.0; << 223 // The Changed (final) MagneticMoment of << 224 }; << 225 285 226 #include "G4ParticleChange.icc" << 227 286 228 #endif << 229 287