| 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of *
|
|---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and *
|
|---|
| 7 | // * conditions of the Geant4 Software License, included in the file *
|
|---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These *
|
|---|
| 9 | // * include a list of copyright holders. *
|
|---|
| 10 | // * *
|
|---|
| 11 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 12 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 13 | // * work make any representation or warranty, express or implied, *
|
|---|
| 14 | // * regarding this software system or assume any liability for its *
|
|---|
| 15 | // * use. Please see the license in the file LICENSE and URL above *
|
|---|
| 16 | // * for the full disclaimer and the limitation of liability. *
|
|---|
| 17 | // * *
|
|---|
| 18 | // * This code implementation is the result of the scientific and *
|
|---|
| 19 | // * technical work of the GEANT4 collaboration. *
|
|---|
| 20 | // * By using, copying, modifying or distributing the software (or *
|
|---|
| 21 | // * any work based on the software) you agree to acknowledge its *
|
|---|
| 22 | // * use in resulting scientific publications, and indicate your *
|
|---|
| 23 | // * acceptance of all terms of the Geant4 Software license. *
|
|---|
| 24 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | //
|
|---|
| 27 | // $Id: G4ParticleChange.hh,v 1.13 2007/03/11 07:19:06 kurasige Exp $
|
|---|
| 28 | // GEANT4 tag $Name: geant4-09-02-ref-02 $
|
|---|
| 29 | //
|
|---|
| 30 | //
|
|---|
| 31 | // ------------------------------------------------------------
|
|---|
| 32 | // GEANT 4 class header file
|
|---|
| 33 | //
|
|---|
| 34 | //
|
|---|
| 35 | // ------------------------------------------------------------
|
|---|
| 36 | // Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
|---|
| 37 | //
|
|---|
| 38 | // Class Description
|
|---|
| 39 | // This class is a concrete class for ParticleChange which
|
|---|
| 40 | // has all functionality in old scheme.
|
|---|
| 41 | //-
|
|---|
| 42 | // This class contains the results after invocation of a physics process.
|
|---|
| 43 | // This includes final states of parent particle (momentum, energy,
|
|---|
| 44 | // etc) and secondary particles generated by the interaction.
|
|---|
| 45 | // The tracking assumes that all the values of energy and
|
|---|
| 46 | // momentum are in global reference system, therefore all the
|
|---|
| 47 | // needed Lorentz transformations must have been already Done
|
|---|
| 48 | // when filling the data-members of this class.
|
|---|
| 49 | //-
|
|---|
| 50 | // ---------------------------------------------------------------
|
|---|
| 51 | // IMPORTANT NOTE: Although the name of the class and methods are
|
|---|
| 52 | // "Change", what it stores (and returns in get) are the "FINAL"
|
|---|
| 53 | // values of the Position, Momentum, etc.
|
|---|
| 54 | //
|
|---|
| 55 | // ------------------------------------------------------------
|
|---|
| 56 | // modify AddSecondary methods for "GoodForTracking" flag
|
|---|
| 57 | // 8 June 1998 H.Kurashige
|
|---|
| 58 | // Add Track weight 12 Nov. 1998 H.Kurashige
|
|---|
| 59 | // Add Get/SetMomentumDirectionChange 6 Feb. 1999 H.Kurashige
|
|---|
| 60 | // Add Get/SetDynamicMass 5 Oct. 1999 H.Kurashige
|
|---|
| 61 | // Add Get/SetDynamicCharge 5 Oct. 1999 H.Kurashige
|
|---|
| 62 | // Rename SetXXX methods to ProposeXXX DynamicCharge Oct. 2005 H.Kurashige
|
|---|
| 63 | // Add get/ProposeMagneticMoment Mar 2007 H.Kurashige
|
|---|
| 64 | // Fix treatment of weight Mar 2007 H.Kurashige
|
|---|
| 65 | // -------------------------------------------------------------
|
|---|
| 66 |
|
|---|
| 67 | #ifndef G4ParticleChange_h
|
|---|
| 68 | #define G4ParticleChange_h 1
|
|---|
| 69 |
|
|---|
| 70 | #include "globals.hh"
|
|---|
| 71 | #include "G4ios.hh"
|
|---|
| 72 | #include "G4ThreeVector.hh"
|
|---|
| 73 | #include "G4ThreeVector.hh"
|
|---|
| 74 | class G4DynamicParticle;
|
|---|
| 75 | #include "G4VParticleChange.hh"
|
|---|
| 76 |
|
|---|
| 77 | class G4ParticleChange: public G4VParticleChange
|
|---|
| 78 | {
|
|---|
| 79 | public:
|
|---|
| 80 | // default constructor
|
|---|
| 81 | G4ParticleChange();
|
|---|
| 82 | // G4ParticleChange(G4bool useEB);
|
|---|
| 83 |
|
|---|
| 84 | // destructor
|
|---|
| 85 | virtual ~G4ParticleChange();
|
|---|
| 86 |
|
|---|
| 87 | protected:
|
|---|
| 88 | // hide copy constructor and assignment operaor as protected
|
|---|
| 89 | G4ParticleChange(const G4ParticleChange &right);
|
|---|
| 90 | G4ParticleChange & operator=(const G4ParticleChange &right);
|
|---|
| 91 |
|
|---|
| 92 | public:
|
|---|
| 93 | // equal/unequal operator
|
|---|
| 94 | G4bool operator==(const G4ParticleChange &right) const;
|
|---|
| 95 | G4bool operator!=(const G4ParticleChange &right) const;
|
|---|
| 96 |
|
|---|
| 97 | public: // with description
|
|---|
| 98 | // ----------------------------------------------------
|
|---|
| 99 | // --- the following methods are for updating G4Step -----
|
|---|
| 100 | // Return the pointer to the G4Step after updating the Step information
|
|---|
| 101 | // by using final state information of the track given by a physics
|
|---|
| 102 | // process
|
|---|
| 103 | virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
|---|
| 104 | // A physics process gives the final state of the particle
|
|---|
| 105 | // relative to the initial state at the beginning of the Step,
|
|---|
| 106 | // i.e., based on information of G4Track (or equivalently
|
|---|
| 107 | // the PreStepPoint)
|
|---|
| 108 | // In this method, the differences (delta) between these two states
|
|---|
| 109 | // are calculated, and are accumulated in PostStepPoint.
|
|---|
| 110 | // Take note that the return type of GetMomentumChange is a
|
|---|
| 111 | // pointer to G4ParticleMometum. Also it is a normalized
|
|---|
| 112 | // momentum vector.
|
|---|
| 113 | virtual G4Step* UpdateStepForAtRest(G4Step* Step);
|
|---|
| 114 | virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
|---|
| 115 | // A physics process gives the final state of the particle
|
|---|
| 116 | // based on information of G4Track (or equivalently the PreStepPoint)
|
|---|
| 117 |
|
|---|
| 118 | virtual void Initialize(const G4Track&);
|
|---|
| 119 | // Initialize all propoerties by using G4Track information
|
|---|
| 120 |
|
|---|
| 121 | protected: // with description
|
|---|
| 122 | G4Step* UpdateStepInfo(G4Step* Step);
|
|---|
| 123 | // Update the G4Step specific attributes
|
|---|
| 124 | // (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
|
|---|
| 125 |
|
|---|
| 126 | public: // with description
|
|---|
| 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 GetProperTime() const;
|
|---|
| 149 | void ProposeProperTime(G4double finalProperTime);
|
|---|
| 150 | // Get/Propose th final eProperTime
|
|---|
| 151 |
|
|---|
| 152 | const G4ThreeVector* GetPosition() const;
|
|---|
| 153 | void ProposePosition(G4double x, G4double y, G4double z);
|
|---|
| 154 | void ProposePosition(const G4ThreeVector& finalPosition);
|
|---|
| 155 | // Get/Propose the final position of the current particle.
|
|---|
| 156 |
|
|---|
| 157 | G4double GetGlobalTime() const;
|
|---|
| 158 | void ProposeGlobalTime(G4double finalGlobalTime);
|
|---|
| 159 | // Get/Propose the final GlobalTime
|
|---|
| 160 |
|
|---|
| 161 | G4double GetMass() const;
|
|---|
| 162 | void ProposeMass(G4double finalMass);
|
|---|
| 163 | // Get/Propose the final dynamical Mass in G4DynamicParticle
|
|---|
| 164 |
|
|---|
| 165 | G4double GetCharge() const;
|
|---|
| 166 | void ProposeCharge(G4double finalCharge);
|
|---|
| 167 | // Get/Propose the final dynamical Charge in G4DynamicParticle
|
|---|
| 168 |
|
|---|
| 169 | G4double GetMagneticMoment() const;
|
|---|
| 170 | void ProposeMagneticMoment(G4double finalMagneticMoment);
|
|---|
| 171 | // Get/Propose the final MagneticMoment in G4DynamicParticle
|
|---|
| 172 |
|
|---|
| 173 | G4double GetWeight() const;
|
|---|
| 174 | void ProposeWeight(G4double finalWeight);
|
|---|
| 175 | // Get/Propose the final Weight of the parent particle
|
|---|
| 176 |
|
|---|
| 177 | // -- Utility functions --
|
|---|
| 178 | G4ThreeVector GetGlobalPosition(const G4ThreeVector& displacement) const;
|
|---|
| 179 | // Convert the position displacement to the global position.
|
|---|
| 180 |
|
|---|
| 181 | G4double GetGlobalTime(G4double timeDelay) const;
|
|---|
| 182 | // Convert the time delay to the global time.
|
|---|
| 183 |
|
|---|
| 184 | G4ThreeVector CalcMomentum(G4double energy,
|
|---|
| 185 | G4ThreeVector direction,
|
|---|
| 186 | G4double mass ) const;
|
|---|
| 187 | // Calculate momentum by using Energy, Momentum Direction, and Mass
|
|---|
| 188 | // ----------------------------------------------------
|
|---|
| 189 |
|
|---|
| 190 |
|
|---|
| 191 | // ----------------------------------------------------
|
|---|
| 192 | // --- methods for adding secondaries
|
|---|
| 193 | void AddSecondary(G4Track* aSecondary);
|
|---|
| 194 | // Add a secondary particle to theListOfSecondaries.
|
|---|
| 195 |
|
|---|
| 196 | void AddSecondary(G4DynamicParticle* aSecondary,
|
|---|
| 197 | G4bool IsGoodForTracking = false );
|
|---|
| 198 | // Add a secondary particle to theListOfSecondaries.
|
|---|
| 199 | // position and time are same as thePositionChange and theTimeChange
|
|---|
| 200 |
|
|---|
| 201 | void AddSecondary(G4DynamicParticle* aSecondary,
|
|---|
| 202 | G4ThreeVector position,
|
|---|
| 203 | G4bool IsGoodForTracking = false );
|
|---|
| 204 | // Add a secondary particle to theListOfSecondaries.
|
|---|
| 205 | // global time are same as theTimeChange and theTimeChange
|
|---|
| 206 |
|
|---|
| 207 | void AddSecondary(G4DynamicParticle* aSecondary,
|
|---|
| 208 | G4double time,
|
|---|
| 209 | G4bool IsGoodForTracking = false );
|
|---|
| 210 | // Add a secondary particle to theListOfSecondaries.
|
|---|
| 211 | // position and are same as thePositionChange
|
|---|
| 212 | // ----------------------------------------------------
|
|---|
| 213 |
|
|---|
| 214 | public:
|
|---|
| 215 | virtual void DumpInfo() const;
|
|---|
| 216 |
|
|---|
| 217 | protected:
|
|---|
| 218 | G4ThreeVector theMomentumDirectionChange;
|
|---|
| 219 | // It is the vector containing the final momentum direction
|
|---|
| 220 | // after the invoked process. The application of the change
|
|---|
| 221 | // of the momentum direction of the particle is not Done here.
|
|---|
| 222 | // The responsibility to apply the change is up the entity
|
|---|
| 223 | // which invoked the process.
|
|---|
| 224 |
|
|---|
| 225 | G4ThreeVector thePolarizationChange;
|
|---|
| 226 | // The changed (final) polarization of a given track
|
|---|
| 227 |
|
|---|
| 228 | G4double theEnergyChange;
|
|---|
| 229 | // The final kinetic energy of the current track
|
|---|
| 230 |
|
|---|
| 231 | G4ThreeVector thePositionChange;
|
|---|
| 232 | // The changed (final) position of a given track
|
|---|
| 233 |
|
|---|
| 234 | G4double theTimeChange;
|
|---|
| 235 | // The changed (final) global time of a given track
|
|---|
| 236 |
|
|---|
| 237 | G4double theProperTimeChange;
|
|---|
| 238 | // The changed (final) proper time of a given track
|
|---|
| 239 |
|
|---|
| 240 | // Obsolete Mar 2007
|
|---|
| 241 | // G4double theWeightChange;
|
|---|
| 242 | // The Changed (final) weight of a given track
|
|---|
| 243 |
|
|---|
| 244 | G4double theMassChange;
|
|---|
| 245 | // The Changed (final) mass of a given track
|
|---|
| 246 |
|
|---|
| 247 | G4double theChargeChange;
|
|---|
| 248 | // The Changed (final) charge of a given track
|
|---|
| 249 |
|
|---|
| 250 | G4double theMagneticMomentChange;
|
|---|
| 251 | // The Changed (final) MagneticMoment of a given track
|
|---|
| 252 |
|
|---|
| 253 | const G4Track* theCurrentTrack;
|
|---|
| 254 |
|
|---|
| 255 | public:
|
|---|
| 256 | // for Debug
|
|---|
| 257 | virtual G4bool CheckIt(const G4Track&);
|
|---|
| 258 | };
|
|---|
| 259 |
|
|---|
| 260 | #include "G4ParticleChange.icc"
|
|---|
| 261 |
|
|---|
| 262 | #endif
|
|---|
| 263 |
|
|---|
| 264 |
|
|---|
| 265 |
|
|---|
| 266 |
|
|---|
| 267 |
|
|---|
| 268 |
|
|---|
| 269 |
|
|---|
| 270 |
|
|---|
| 271 |
|
|---|
| 272 |
|
|---|
| 273 |
|
|---|
| 274 |
|
|---|
| 275 |
|
|---|
| 276 |
|
|---|
| 277 |
|
|---|
| 278 |
|
|---|