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 #ifndef G4HadProjectile_hh 00027 #define G4HadProjectile_hh 00028 00029 #include "globals.hh" 00030 #include "G4Material.hh" 00031 #include "G4ParticleDefinition.hh" 00032 #include "G4LorentzVector.hh" 00033 #include "G4LorentzVector.hh" 00034 #include "G4LorentzRotation.hh" 00035 00036 class G4Track; 00037 class G4DynamicParticle; 00038 00039 class G4HadProjectile 00040 { 00041 public: 00042 G4HadProjectile(); 00043 G4HadProjectile(const G4Track &aT); 00044 G4HadProjectile(const G4DynamicParticle &aT); 00045 ~G4HadProjectile(); 00046 00047 void Initialise(const G4Track &aT); 00048 00049 inline const G4Material * GetMaterial() const; 00050 inline const G4ParticleDefinition * GetDefinition() const; 00051 inline const G4LorentzVector & Get4Momentum() const; 00052 inline G4LorentzRotation & GetTrafoToLab(); 00053 inline G4double GetKineticEnergy() const; 00054 inline G4double GetTotalEnergy() const; 00055 inline G4double GetTotalMomentum() const; 00056 inline G4double GetGlobalTime() const; 00057 inline G4double GetBoundEnergy() const; 00058 inline void SetGlobalTime(G4double t); 00059 inline void SetBoundEnergy(G4double e); 00060 00061 private: 00062 00063 // hide assignment operator as private 00064 G4HadProjectile& operator=(const G4HadProjectile &right); 00065 G4HadProjectile(const G4HadProjectile& ); 00066 00067 const G4Material * theMat; 00068 G4LorentzVector theOrgMom; 00069 G4LorentzVector theMom; 00070 const G4ParticleDefinition * theDef; 00071 G4LorentzRotation toLabFrame; 00072 G4double theTime; 00073 G4double theBoundEnergy; 00074 }; 00075 00076 const G4Material * G4HadProjectile::GetMaterial() const 00077 { 00078 return theMat; 00079 } 00080 00081 const G4ParticleDefinition * G4HadProjectile::GetDefinition() const 00082 { 00083 return theDef; 00084 } 00085 00086 inline const G4LorentzVector& G4HadProjectile::Get4Momentum() const 00087 { 00088 return theMom; 00089 } 00090 00091 inline G4LorentzRotation& G4HadProjectile::GetTrafoToLab() 00092 { 00093 return toLabFrame; 00094 } 00095 00096 G4double G4HadProjectile::GetTotalEnergy() const 00097 { 00098 return Get4Momentum().e(); 00099 } 00100 00101 G4double G4HadProjectile::GetTotalMomentum() const 00102 { 00103 return Get4Momentum().vect().mag(); 00104 } 00105 00106 G4double G4HadProjectile::GetKineticEnergy() const 00107 { 00108 G4double ekin = GetTotalEnergy() - GetDefinition()->GetPDGMass(); 00109 if(ekin < 0.0) { ekin = 0.0; } 00110 return ekin; 00111 } 00112 00113 inline G4double G4HadProjectile::GetGlobalTime() const 00114 { 00115 return theTime; 00116 } 00117 00118 inline G4double G4HadProjectile::GetBoundEnergy() const 00119 { 00120 return theBoundEnergy; 00121 } 00122 00123 inline void G4HadProjectile::SetGlobalTime(G4double t) 00124 { 00125 theTime = t; 00126 } 00127 00128 inline void G4HadProjectile::SetBoundEnergy(G4double e) 00129 { 00130 theBoundEnergy = e; 00131 } 00132 00133 #endif