[824] | 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: G4DynamicParticle.hh,v 1.18 2007/03/11 07:17:35 kurasige Exp $ |
---|
[850] | 28 | // GEANT4 tag $Name: HEAD $ |
---|
[824] | 29 | // |
---|
| 30 | // |
---|
| 31 | // ------------------------------------------------------------ |
---|
| 32 | // GEANT 4 class header file |
---|
| 33 | // |
---|
| 34 | // History: first implementation, based on object model of |
---|
| 35 | // 2nd December 1995, G.Cosmo |
---|
| 36 | // ---------------- G4DynamicParticle ---------------- |
---|
| 37 | // first implementation by Makoto Asai, 29 January 1996 |
---|
| 38 | // revised by G.Cosmo, 29 February 1996 |
---|
| 39 | // revised by Hisaya Kurashige, 24 July 1996 |
---|
| 40 | // revised by Hisaya Kurashige, 19 Oct 1996 |
---|
| 41 | // revised by Hisaya Kurashige, 19 Feb 1997 |
---|
| 42 | // ------------------------ |
---|
| 43 | // Add theDynamicCharge and theElectronOccupancy |
---|
| 44 | // 17 AUg. 1999 H.Kurashige |
---|
| 45 | // Add thePreAssignedDecayTime 18 Jan. 2001 H.Kurashige |
---|
| 46 | // Added MagneticMoment Mar. 2007 |
---|
| 47 | // ------------------------------------------------------------ |
---|
| 48 | |
---|
| 49 | #ifndef G4DynamicParticle_h |
---|
| 50 | #define G4DynamicParticle_h 1 |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | #include "globals.hh" |
---|
| 54 | #include <cmath> |
---|
| 55 | #include "G4ios.hh" |
---|
| 56 | |
---|
| 57 | #include "G4ParticleDefinition.hh" |
---|
| 58 | #include "G4Allocator.hh" |
---|
| 59 | #include "G4LorentzVector.hh" |
---|
| 60 | |
---|
| 61 | #include "G4ParticleMomentum.hh" |
---|
| 62 | // G4ParticleMomentum is "momentum direction" not "momentum vector" |
---|
| 63 | // The name is miss-leading so you should not use G4ParticleMomentum |
---|
| 64 | // and you are recommended to use G4ThreeVector instead |
---|
| 65 | |
---|
| 66 | #include "G4ElectronOccupancy.hh" |
---|
| 67 | #include "G4PrimaryParticle.hh" |
---|
| 68 | |
---|
| 69 | class G4VProcess; |
---|
| 70 | class G4DecayProducts; |
---|
| 71 | |
---|
| 72 | class G4DynamicParticle |
---|
| 73 | { |
---|
| 74 | // Class Description |
---|
| 75 | // The dynamic particle is a class which contains the purely |
---|
| 76 | // dynamic aspects of a moving particle. It also has a |
---|
| 77 | // pointer to a G4ParticleDefinition object, which holds |
---|
| 78 | // all the static information. |
---|
| 79 | // |
---|
| 80 | |
---|
| 81 | public: // With Description |
---|
| 82 | //- constructors |
---|
| 83 | G4DynamicParticle(); |
---|
| 84 | |
---|
| 85 | G4DynamicParticle(G4ParticleDefinition * aParticleDefinition, |
---|
| 86 | const G4ThreeVector& aMomentumDirection, |
---|
| 87 | G4double aKineticEnergy); |
---|
| 88 | G4DynamicParticle(G4ParticleDefinition * aParticleDefinition, |
---|
| 89 | const G4ThreeVector& aParticleMomentum); |
---|
| 90 | G4DynamicParticle(G4ParticleDefinition * aParticleDefinition, |
---|
| 91 | const G4LorentzVector &aParticleMomentum); |
---|
| 92 | G4DynamicParticle(G4ParticleDefinition * aParticleDefinition, |
---|
| 93 | G4double aTotalEnergy, |
---|
| 94 | const G4ThreeVector &aParticleMomentum); |
---|
| 95 | |
---|
| 96 | G4DynamicParticle(const G4DynamicParticle &right); |
---|
| 97 | |
---|
| 98 | //- destructor |
---|
| 99 | ~G4DynamicParticle(); |
---|
| 100 | |
---|
| 101 | //- operators |
---|
| 102 | G4DynamicParticle & operator=(const G4DynamicParticle &right); |
---|
| 103 | G4int operator==(const G4DynamicParticle &right) const; |
---|
| 104 | G4int operator!=(const G4DynamicParticle &right) const; |
---|
| 105 | |
---|
| 106 | // new/delete operators are oberloded to use G4Allocator |
---|
| 107 | inline void *operator new(size_t); |
---|
| 108 | inline void operator delete(void *aDynamicParticle); |
---|
| 109 | |
---|
| 110 | //- Set/Get methods |
---|
| 111 | |
---|
| 112 | const G4ThreeVector& GetMomentumDirection() const; |
---|
| 113 | // Returns the normalized direction of the momentum |
---|
| 114 | void SetMomentumDirection(const G4ThreeVector &aDirection); |
---|
| 115 | // Sets the normalized direction of the momentum |
---|
| 116 | void SetMomentumDirection(G4double px, G4double py, G4double pz); |
---|
| 117 | // Sets the normalized direction of the momentum by coordinates |
---|
| 118 | |
---|
| 119 | G4ThreeVector GetMomentum() const; |
---|
| 120 | // Returns the current particle momentum vector |
---|
| 121 | void SetMomentum( const G4ThreeVector &momentum); |
---|
| 122 | // set the current particle momentum vector |
---|
| 123 | |
---|
| 124 | G4LorentzVector Get4Momentum() const; |
---|
| 125 | // Returns the current particle energy-momentum 4vector |
---|
| 126 | void Set4Momentum( const G4LorentzVector &momentum); |
---|
| 127 | // Set the current particle energy-momentum 4vector |
---|
| 128 | |
---|
| 129 | |
---|
| 130 | G4double GetTotalMomentum() const; |
---|
| 131 | // Returns the module of the momentum vector |
---|
| 132 | G4double GetTotalEnergy() const; |
---|
| 133 | // Returns the total energy of the particle |
---|
| 134 | |
---|
| 135 | G4double GetKineticEnergy() const; |
---|
| 136 | // Returns the kinetic energy of a particle |
---|
| 137 | void SetKineticEnergy(G4double aEnergy); |
---|
| 138 | // Sets the kinetic energy of a particle |
---|
| 139 | |
---|
| 140 | |
---|
| 141 | G4double GetProperTime() const; |
---|
| 142 | // Returns the current particle proper time |
---|
| 143 | void SetProperTime( G4double ); |
---|
| 144 | // Set the current particle Proper Time |
---|
| 145 | |
---|
| 146 | |
---|
| 147 | const G4ThreeVector& GetPolarization() const; |
---|
| 148 | void SetPolarization(G4double polX, G4double polY, G4double polZ); |
---|
| 149 | // Set/Get polarization vector |
---|
| 150 | |
---|
| 151 | |
---|
| 152 | G4double GetMass() const; |
---|
| 153 | void SetMass(G4double mass); |
---|
| 154 | // set/get dynamical mass |
---|
| 155 | // the dynamical mass is set to PDG mass in default |
---|
| 156 | |
---|
| 157 | |
---|
| 158 | G4double GetCharge() const; |
---|
| 159 | void SetCharge(G4double charge); |
---|
| 160 | void SetCharge(G4int chargeInUnitOfEplus); |
---|
| 161 | // set/get dynamical charge |
---|
| 162 | // the dynamical mass is set to PDG charge in default |
---|
| 163 | |
---|
| 164 | G4double GetSpin() const; |
---|
| 165 | void SetSpin(G4double spin); |
---|
| 166 | void SetSpin(G4int spinInUnitOfHalfInteger); |
---|
| 167 | // set/get dynamical spin |
---|
| 168 | // the dynamical spin is set to PDG spin in default |
---|
| 169 | |
---|
| 170 | G4double GetMagneticMoment() const; |
---|
| 171 | void SetMagneticMoment(G4double magneticMoment); |
---|
| 172 | // set/get dynamical MagneticMoment |
---|
| 173 | // the dynamical mass is set to PDG MagneticMoment in default |
---|
| 174 | |
---|
| 175 | |
---|
| 176 | const G4ElectronOccupancy* GetElectronOccupancy() const; |
---|
| 177 | // Get electron occupancy |
---|
| 178 | // ElectronOccupancy is valid only if the particle is ion |
---|
| 179 | G4int GetTotalOccupancy() const; |
---|
| 180 | G4int GetOccupancy(G4int orbit) const; |
---|
| 181 | void AddElectron(G4int orbit, G4int number = 1); |
---|
| 182 | void RemoveElectron(G4int orbit, G4int number = 1); |
---|
| 183 | |
---|
| 184 | G4ParticleDefinition* GetDefinition() const; |
---|
| 185 | void SetDefinition(G4ParticleDefinition * aParticleDefinition); |
---|
| 186 | // Set/Get particle definition |
---|
| 187 | |
---|
| 188 | |
---|
| 189 | const G4DecayProducts *GetPreAssignedDecayProducts() const; |
---|
| 190 | void SetPreAssignedDecayProducts(G4DecayProducts *aDecayProducts); |
---|
| 191 | // Set/Get pre-assigned decay channel |
---|
| 192 | |
---|
| 193 | G4double GetPreAssignedDecayProperTime() const; |
---|
| 194 | void SetPreAssignedDecayProperTime(G4double); |
---|
| 195 | // Set/Get pre-assigned proper time when the particle will decay |
---|
| 196 | |
---|
| 197 | |
---|
| 198 | //- print out information |
---|
| 199 | void DumpInfo(G4int mode= 0) const; |
---|
| 200 | // mode 0 : default )(minimum) |
---|
| 201 | // mode 1 : 0 + electron occupancy |
---|
| 202 | |
---|
| 203 | private: |
---|
| 204 | void AllocateElectronOccupancy(); |
---|
| 205 | G4double GetElectronMass() const; |
---|
| 206 | |
---|
| 207 | private: |
---|
| 208 | G4ThreeVector theMomentumDirection; |
---|
| 209 | // The normalized momentum vector |
---|
| 210 | |
---|
| 211 | G4ParticleDefinition *theParticleDefinition; |
---|
| 212 | // Contains the static information of this particle. |
---|
| 213 | |
---|
| 214 | G4ThreeVector thePolarization; |
---|
| 215 | |
---|
| 216 | G4double theKineticEnergy; |
---|
| 217 | |
---|
| 218 | G4double theProperTime; |
---|
| 219 | |
---|
| 220 | G4double theDynamicalMass; |
---|
| 221 | |
---|
| 222 | G4double theDynamicalCharge; |
---|
| 223 | |
---|
| 224 | G4double theDynamicalSpin; |
---|
| 225 | |
---|
| 226 | G4double theDynamicalMagneticMoment; |
---|
| 227 | |
---|
| 228 | G4ElectronOccupancy* theElectronOccupancy; |
---|
| 229 | |
---|
| 230 | G4DecayProducts *thePreAssignedDecayProducts; |
---|
| 231 | |
---|
| 232 | G4double thePreAssignedDecayTime; |
---|
| 233 | |
---|
| 234 | private: |
---|
| 235 | G4int verboseLevel; |
---|
| 236 | |
---|
| 237 | public: // With Description |
---|
| 238 | void SetVerboseLevel(G4int value); |
---|
| 239 | G4int GetVerboseLevel() const; |
---|
| 240 | // Set/Get controle flag for output message |
---|
| 241 | // 0: Silent |
---|
| 242 | // 1: Warning message |
---|
| 243 | // 2: More |
---|
| 244 | |
---|
| 245 | private: |
---|
| 246 | G4PrimaryParticle* primaryParticle; |
---|
| 247 | // This void pointer is used by G4EventManager to maintain the |
---|
| 248 | // link between pre-assigned decay products and corresponding |
---|
| 249 | // primary particle. |
---|
| 250 | |
---|
| 251 | public: |
---|
| 252 | void SetPrimaryParticle(G4PrimaryParticle* p); |
---|
| 253 | void SetPDGcode(G4int c); |
---|
| 254 | |
---|
| 255 | public: // With Description |
---|
| 256 | G4PrimaryParticle* GetPrimaryParticle() const; |
---|
| 257 | // Return the pointer to the corresponding G4PrimaryParticle object |
---|
| 258 | // if this particle is a primary particle OR is defined as a pre-assigned |
---|
| 259 | // decay product. Otherwise return null. |
---|
| 260 | |
---|
| 261 | G4int GetPDGcode() const; |
---|
| 262 | // Return the PDG code of this particle. If the particle is known to Geant4 |
---|
| 263 | // its PDG code defined in G4ParticleDefinition is returned. If it is unknown |
---|
| 264 | // (i.e. PDG code in G4ParticleDefinition is 0), PDG code defined in the |
---|
| 265 | // corresponding primary particle or pre-assigned decay product will be |
---|
| 266 | // returned if available. Otherwise (e.g. for geantino) returns 0. |
---|
| 267 | |
---|
| 268 | private: |
---|
| 269 | G4int thePDGcode; |
---|
| 270 | }; |
---|
| 271 | |
---|
| 272 | #include "G4DynamicParticle.icc" |
---|
| 273 | |
---|
| 274 | #endif |
---|