G4DynamicParticle.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // 
00030 // ------------------------------------------------------------
00031 //      GEANT 4 class header file 
00032 //
00033 //      History: first implementation, based on object model of
00034 //      2nd December 1995, G.Cosmo
00035 //      ---------------- G4DynamicParticle  ----------------
00036 //      first implementation by Makoto Asai, 29 January 1996
00037 //      revised by G.Cosmo, 29 February 1996
00038 //      revised by Hisaya Kurashige, 24 July 1996
00039 //      revised by Hisaya Kurashige, 19 Oct 1996
00040 //      revised by Hisaya Kurashige, 19 Feb 1997
00041 //                ------------------------
00042 //      Add theDynamicCharge and theElectronOccupancy
00043 //                             17 AUg. 1999   H.Kurashige  
00044 //      Add thePreAssignedDecayTime   18 Jan. 2001 H.Kurashige
00045 //      Added  MagneticMoment               Mar. 2007
00046 // ------------------------------------------------------------
00047 
00048 #ifndef G4DynamicParticle_h
00049 #define G4DynamicParticle_h 1
00050 
00051 #include <cmath>
00052 #include <CLHEP/Units/SystemOfUnits.h>
00053 
00054 #include "globals.hh"
00055 #include "G4ios.hh"
00056 
00057 #include "G4ParticleDefinition.hh"
00058 #include "G4Allocator.hh"
00059 #include "G4LorentzVector.hh"
00060 
00061 #include "G4ParticleMomentum.hh"
00062 //  G4ParticleMomentum is "momentum direction" not "momentum vector"
00063 //  The name is miss-leading so you should not use G4ParticleMomentum
00064 //  and you are recommended to use G4ThreeVector instead
00065 
00066 #include "G4ElectronOccupancy.hh"
00067 
00068 
00069 class G4PrimaryParticle;
00070 class  G4VProcess;
00071 class  G4DecayProducts;
00072 
00073 class G4DynamicParticle 
00074 {
00075   // Class Description
00076   //  The dynamic particle is a class which contains the purely
00077   //  dynamic aspects of a moving particle. It also has a
00078   //  pointer to a G4ParticleDefinition object, which holds
00079   //  all the static information.
00080   //
00081 
00082   public: // With Description
00083   //- constructors 
00084      G4DynamicParticle();
00085 
00086      G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
00087                         const G4ThreeVector& aMomentumDirection,
00088                         G4double aKineticEnergy);
00089      G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
00090                         const G4ThreeVector& aParticleMomentum);
00091      G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
00092                         const G4LorentzVector    &aParticleMomentum);
00093      G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
00094                         G4double aTotalEnergy,
00095                         const G4ThreeVector &aParticleMomentum);
00096 
00097      G4DynamicParticle(const G4DynamicParticle &right);
00098 
00099   //- destructor
00100      ~G4DynamicParticle();
00101 
00102   //- operators
00103      G4DynamicParticle & operator=(const G4DynamicParticle &right);
00104      G4int operator==(const G4DynamicParticle &right) const;
00105      G4int operator!=(const G4DynamicParticle &right) const;
00106 
00107   //  new/delete operators are oberloded to use G4Allocator
00108      inline void *operator new(size_t);
00109      inline void operator delete(void *aDynamicParticle);
00110 
00111   //- Set/Get methods
00112  
00113      const G4ThreeVector& GetMomentumDirection() const;
00114       //  Returns the normalized direction of the momentum
00115      void SetMomentumDirection(const G4ThreeVector &aDirection);
00116       //  Sets the normalized direction of the momentum
00117      void SetMomentumDirection(G4double px, G4double py, G4double pz);
00118       //  Sets the normalized direction of the momentum by coordinates
00119 
00120      G4ThreeVector GetMomentum() const;
00121       //  Returns the current particle momentum vector
00122      void SetMomentum( const G4ThreeVector &momentum);
00123       //  set the current particle momentum vector
00124 
00125      G4LorentzVector Get4Momentum() const;
00126       //  Returns the current particle energy-momentum 4vector
00127      void Set4Momentum( const G4LorentzVector &momentum);
00128       //  Set the current particle energy-momentum 4vector
00129 
00130 
00131      G4double GetTotalMomentum() const;
00132       //  Returns the module of the momentum vector
00133      G4double GetTotalEnergy() const;
00134       //  Returns the total energy of the particle
00135 
00136      G4double GetKineticEnergy() const;
00137       //  Returns the kinetic energy of a particle
00138      void SetKineticEnergy(G4double aEnergy);
00139       //  Sets the kinetic energy of a particle
00140 
00141 
00142      G4double GetProperTime() const;
00143       //  Returns the current particle proper time
00144      void SetProperTime( G4double );
00145       //  Set the current particle Proper Time
00146 
00147 
00148      const G4ThreeVector& GetPolarization() const;
00149      void SetPolarization(G4double polX, G4double polY, G4double polZ);
00150       //   Set/Get polarization vector       
00151 
00152 
00153      G4double GetMass() const;
00154      void     SetMass(G4double mass);
00155      // set/get dynamical mass
00156      // the dynamical mass is set to PDG mass in default
00157 
00158 
00159      G4double GetCharge() const;
00160      void     SetCharge(G4double charge);
00161      void     SetCharge(G4int    chargeInUnitOfEplus);
00162      // set/get dynamical charge 
00163      // the dynamical mass is set to PDG charge in default
00164 
00165      G4double GetSpin() const;
00166      void     SetSpin(G4double spin);
00167      void     SetSpin(G4int    spinInUnitOfHalfInteger);
00168      // set/get dynamical spin
00169      // the dynamical spin is set to PDG spin in default
00170 
00171      G4double GetMagneticMoment() const;
00172      void     SetMagneticMoment(G4double magneticMoment);
00173      // set/get dynamical MagneticMoment  
00174      // the dynamical mass is set to PDG MagneticMoment in default
00175 
00176 
00177      const G4ElectronOccupancy* GetElectronOccupancy() const;
00178      // Get electron occupancy 
00179      // ElectronOccupancy is valid only if the particle is ion
00180      G4int  GetTotalOccupancy() const;
00181      G4int  GetOccupancy(G4int orbit) const;
00182      void   AddElectron(G4int orbit, G4int number = 1);
00183      void   RemoveElectron(G4int orbit, G4int number = 1);
00184  
00185  
00186      const G4ParticleDefinition* GetParticleDefinition() const;
00187      void SetDefinition(const G4ParticleDefinition * aParticleDefinition);
00188      //   Set/Get particle definition  
00189      //  following method of GetDefinition remains 
00190      //  because of backward compatiblity. It will be removed in future 
00191      G4ParticleDefinition* GetDefinition() const;
00192  
00193      
00194      const G4DecayProducts *GetPreAssignedDecayProducts() const;
00195      void SetPreAssignedDecayProducts(G4DecayProducts *aDecayProducts);
00196       //   Set/Get pre-assigned decay channel
00197 
00198      G4double GetPreAssignedDecayProperTime() const;
00199      void SetPreAssignedDecayProperTime(G4double);
00200       //   Set/Get pre-assigned proper time when the particle will decay
00201  
00202    
00203   //- print out information
00204      void DumpInfo(G4int mode= 0) const;
00205      //    mode 0 : default )(minimum)
00206      //    mode 1 : 0 + electron occupancy
00207 
00208    protected:
00209      void      AllocateElectronOccupancy(); 
00210      G4double  GetElectronMass() const;
00211 
00212    protected:
00213      G4ThreeVector theMomentumDirection;
00214       //  The normalized momentum vector
00215 
00216      const G4ParticleDefinition *theParticleDefinition;
00217       //  Contains the static information of this particle.
00218 
00219      G4ThreeVector thePolarization;
00220 
00221      G4double theKineticEnergy;
00222 
00223      G4double theProperTime;
00224 
00225      G4double theDynamicalMass;
00226 
00227      G4double theDynamicalCharge;
00228 
00229      G4double theDynamicalSpin;
00230 
00231      G4double theDynamicalMagneticMoment;
00232 
00233      G4ElectronOccupancy* theElectronOccupancy;          
00234   
00235      G4DecayProducts *thePreAssignedDecayProducts;
00236 
00237      G4double thePreAssignedDecayTime;
00238 
00239  protected:
00240    G4int verboseLevel;
00241  
00242  public:  // With Description
00243    void  SetVerboseLevel(G4int value);
00244    G4int GetVerboseLevel() const;
00245    // Set/Get controle flag for output message
00246    //  0: Silent
00247    //  1: Warning message
00248    //  2: More
00249 
00250  protected:
00251    G4PrimaryParticle* primaryParticle;
00252    // This void pointer is used by G4EventManager to maintain the
00253    // link between pre-assigned decay products and corresponding
00254    // primary particle.
00255 
00256  public:
00257    void SetPrimaryParticle(G4PrimaryParticle* p);
00258    void SetPDGcode(G4int c);
00259 
00260  public: // With Description
00261    G4PrimaryParticle* GetPrimaryParticle() const;
00262    // Return the pointer to the corresponding G4PrimaryParticle object
00263    // if this particle is a primary particle OR is defined as a pre-assigned
00264    // decay product. Otherwise return null.
00265 
00266    G4int GetPDGcode() const;
00267    // Return the PDG code of this particle. If the particle is known to Geant4
00268    // its PDG code defined in G4ParticleDefinition is returned. If it is unknown
00269    // (i.e. PDG code in G4ParticleDefinition is 0), PDG code defined in the
00270    // corresponding primary particle or pre-assigned decay product will be
00271    // returned if available. Otherwise (e.g. for geantino) returns 0.
00272 
00273  protected:
00274    G4int thePDGcode;
00275 };
00276 
00277 #include "G4DynamicParticle.icc"
00278 
00279 #endif

Generated on Mon May 27 17:48:04 2013 for Geant4 by  doxygen 1.4.7