Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

GeoSwimParticle.cxx

Go to the documentation of this file.
00001 
00002 //
00003 // GeoSwimParticle
00004 //
00005 // Adapted from example particle class provided with geant4_vmc package. 
00006 // January 20, 2006  M.Ishitsuka First version for GeoSwimmer
00007 //                   ref. SwimPartile.cxx
00009 #include <iostream>
00010 using namespace std;
00011 
00012 #include <TParticle.h>
00013 #include <TObjArray.h>
00014 #include <TMCProcess.h>
00015 
00016 #include "GeoSwimmer/GeoSwimParticle.h"
00017 
00018 ClassImp(GeoSwimParticle)
00019 
00020 //__________________________________________________________
00021 GeoSwimParticle::GeoSwimParticle(Int_t pdg, TParticle* particle) :
00022   fPDG(pdg),fS(0),fRange(0),fParticle(particle)
00023 { 
00024 }
00025 
00026 //__________________________________________________________
00027 GeoSwimParticle::GeoSwimParticle(const TVector3 position,
00028                                        const TVector3 momentum,
00029                                        Double_t       charge,
00030                                        Int_t          pdg,
00031                                        Double_t       mass) :
00032   fInitPosition(position),fPosition(position),fMomentum(momentum),
00033   fMass(mass),fCharge(charge),fPDG(pdg),fS(0),fRange(0),fParticle(0)
00034 { 
00035 }
00036 
00037 //_________________________________________________________
00038 GeoSwimParticle::GeoSwimParticle() : 
00039   fPDG(-1),fS(0),fRange(0),fParticle(0)
00040 {
00041 }
00042 
00043 //__________________________________________________________
00044 GeoSwimParticle::~GeoSwimParticle() {
00045 // Destructor
00046 }
00047 
00048 //_________________________________________________________
00049 
00050 const TVector3 GeoSwimParticle::GetInitPosition() const
00051 {
00052   return fInitPosition;
00053 } 
00054 
00055 //_________________________________________________________
00056 
00057 const TVector3 GeoSwimParticle::GetPosition() const
00058 {
00059   return fPosition;
00060 } 
00061 
00062 //_________________________________________________________
00063 
00064 const TVector3 GeoSwimParticle::GetMomentum() const
00065 {
00066   return fMomentum;
00067 } 
00068 
00069 //_________________________________________________________
00070 
00071 TVector3 GeoSwimParticle::GetDirection() const
00072 {
00073   double modulus = GeoSwimParticle::GetMomentumModulus();  
00074   if (modulus!=0.0) return fMomentum.Unit();
00075   else return TVector3(0.0,0.0,0.0);
00076 }
00077 
00078 //_________________________________________________________
00079 
00080 double GeoSwimParticle::GetMomentumModulus() const
00081 {
00082   return fMomentum.Mag();
00083 } 
00084 
00085 //_________________________________________________________
00086 
00087 double GeoSwimParticle::GetEnergy() const
00088 {
00089   return sqrt(fMass*fMass + fMomentum.Mag2());
00090 }
00091 
00092 //_________________________________________________________
00093 
00094 double GeoSwimParticle::GetMass() const 
00095 { 
00096   return fMass; 
00097 } 
00098 
00099 //_________________________________________________________
00100 
00101 double GeoSwimParticle::GetCharge() const 
00102 { 
00103   return fCharge; 
00104 } 
00105 
00106 //__________________________________________________________
00107 Int_t GeoSwimParticle:: GetID() const {
00108   return fPDG;
00109 }  
00110 
00111 //__________________________________________________________
00112 
00113 double GeoSwimParticle::GetS() const 
00114 { 
00115   return fS; 
00116 } 
00117 
00118 //__________________________________________________________
00119 
00120 double GeoSwimParticle::GetRange() const 
00121 { 
00122   return fRange; 
00123 } 
00124 
00125 //__________________________________________________________
00126 TParticle*  GeoSwimParticle::GetParticle() const {
00127   return fParticle;
00128 }  
00129 
00130 //......................................................................
00131 
00132 void GeoSwimParticle::SetPosition(const TVector3 position) 
00133 { 
00134   fPosition = position;
00135 }
00136 
00137 //......................................................................
00138 
00139 void GeoSwimParticle::SetMomentum(const TVector3 momentum)
00140 {
00141   fMomentum = momentum;
00142 }
00143 
00144 //......................................................................
00145 
00146 void GeoSwimParticle::SetMass(double mass)
00147 {
00148   fMass = mass;
00149 }
00150 
00151 //......................................................................
00152 
00153 void GeoSwimParticle::SetCharge(double charge)
00154 {
00155   fCharge = charge;
00156 }
00157 
00158 //......................................................................
00159 
00160 void GeoSwimParticle::SetID(int pdg)
00161 {
00162   fPDG = pdg;
00163 }
00164 
00165 //......................................................................
00166 
00167 void GeoSwimParticle::SetS(double s)
00168 {
00169   fS = s;
00170 }
00171 
00172 //......................................................................
00173 
00174 void GeoSwimParticle::SetRange(double range)
00175 {
00176   fRange = range;
00177 }

Generated on Mon Feb 15 11:06:45 2010 for loon by  doxygen 1.3.9.1