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