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