G4HEVector.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 // G4 Gheisha friend class G4KinematicParticle  -- header file
00031 // J.L. Chuma, TRIUMF, 22-Feb-1996
00032 // last modified: H. Fesefeldt 18-November-1996
00033 
00034 #ifndef G4HEVector_hh
00035 #define G4HEVector_hh 1
00036 
00037 // Class description:
00038 // Instances of this class are used by the high energy parameterized models
00039 // to store particle type, charge, mass, energy and momentum, among other
00040 // things. Many operations are available with G4HEVectors, including 
00041 // addition, subtraction, and Lorentz boosting. 
00042 
00043 // Class Description - End
00044 
00045 #include "G4ParticleMomentum.hh"
00046 #include "Randomize.hh"
00047 #include "G4HadProjectile.hh"
00048 
00049 class G4HEVector
00050  {
00051   protected:
00052      G4double px;
00053      G4double py;
00054      G4double pz;
00055      G4double energy;
00056      G4double kineticEnergy;
00057      G4double mass;
00058      G4double charge;
00059      G4double timeOfFlight;
00060      G4int  side;
00061      G4bool flag;
00062      G4int  code;
00063      G4String particleName;
00064      G4String particleType;
00065      G4int    baryon;
00066      G4int    strangeness;
00067      enum {NumberOfQuarkFlavor = 8};
00068      G4int theQuarkContent[NumberOfQuarkFlavor];
00069      G4int theAntiQuarkContent[NumberOfQuarkFlavor];
00070 
00071   public:
00072 
00073   G4HEVector(const G4HadProjectile * aParticle);
00074   
00075   G4HEVector()
00076    {
00077      px               = 0.0;
00078      py               = 0.0;
00079      pz               = 0.0;
00080      energy           = 0.0;
00081      kineticEnergy    = 0.0;
00082      mass             = 0.0;
00083      charge           = 0.0;
00084      timeOfFlight     = 0.0;
00085      side             = 0;
00086      flag             = false;
00087      code             = 0;
00088      particleName     = "";
00089      particleType     = "";
00090      baryon           = 0;
00091      strangeness      = 0;
00092      for (G4int i = 0; i < NumberOfQuarkFlavor; i++) {
00093        theQuarkContent[i] = 0;
00094        theAntiQuarkContent[i] = 0;
00095      }
00096    }
00097 
00098 
00099   G4HEVector( const G4HEVector & p )
00100    {
00101      px            = p.px;
00102      py            = p.py;
00103      pz            = p.pz;
00104      energy        = p.energy;
00105      kineticEnergy = p.kineticEnergy;
00106      mass          = p.mass;
00107      charge        = p.charge;
00108      timeOfFlight  = p.timeOfFlight;
00109      side          = p.side;
00110      flag          = p.flag;
00111      code          = p.code;
00112      particleName  = p.particleName;
00113      particleType  = p.particleType;
00114      baryon        = p.baryon;
00115      strangeness   = p.strangeness;
00116    }
00117 
00118 
00119   G4HEVector & operator = ( const G4HEVector & p )
00120    {
00121      px            = p.px;
00122      py            = p.py;
00123      pz            = p.pz;
00124      energy        = p.energy;
00125      kineticEnergy = p.kineticEnergy;
00126      mass          = p.mass;
00127      charge        = p.charge;
00128      timeOfFlight  = p.timeOfFlight;
00129      side          = p.side;
00130      flag          = p.flag;
00131      code          = p.code;
00132      particleName  = p.particleName;
00133      particleType  = p.particleType;
00134      baryon        = p.baryon;
00135      strangeness   = p.strangeness;
00136      return *this;
00137    }
00138 
00139    ~G4HEVector(){ };
00140 
00141    G4double Amax(G4double a, G4double b);
00142 
00143    G4String getParticleName(G4int code, G4int baryon);
00144  
00145    void setMomentum( const G4ParticleMomentum mom ); 
00146 
00147    void setMomentum( const G4ParticleMomentum * mom ); 
00148 
00149    void setMomentumAndUpdate( const G4ParticleMomentum mom );
00150 
00151    void setMomentumAndUpdate( const G4ParticleMomentum * mom );
00152 
00153    const G4ParticleMomentum getMomentum() const ;
00154 
00155    G4double getTotalMomentum() const;
00156 
00157    void setMomentum( G4double x, G4double y, G4double z);
00158 
00159    void setMomentumAndUpdate( G4double x, G4double y, G4double z );
00160 
00161    void setMomentum( G4double x, G4double y );
00162 
00163    void setMomentumAndUpdate( G4double x, G4double y );
00164 
00165    void setMomentum( G4double z );
00166 
00167    void setMomentumAndUpdate( G4double z );
00168 
00169    void setEnergy( G4double e ); 
00170 
00171    void setEnergyAndUpdate( G4double e );
00172 
00173    void setKineticEnergy( G4double ekin ); 
00174 
00175    void setKineticEnergyAndUpdate(G4double ekin); 
00176 
00177    G4double getEnergy() const; 
00178 
00179    G4double getKineticEnergy() const; 
00180 
00181    void setMass( G4double m ); 
00182 
00183    void setMassAndUpdate( G4double m );
00184 
00185    G4double getMass() const; 
00186 
00187    void setCharge( G4double c ); 
00188 
00189    G4double getCharge() const; 
00190 
00191    void setTOF( G4double t ); 
00192 
00193    G4double getTOF(); 
00194 
00195    void setSide( G4int s ); 
00196 
00197    G4int getSide(); 
00198 
00199    void setFlag( G4bool f ); 
00200 
00201    G4bool getFlag(); 
00202 
00203    void setCode( G4int c ); 
00204 
00205    G4int getCode() const; 
00206 
00207    G4String getName() const;
00208 
00209    G4int getBaryonNumber() const;
00210 
00211    G4int getStrangenessNumber() const;
00212 
00213    G4int getQuarkContent(G4int flavor);
00214 
00215    G4int getAntiQuarkContent(G4int flavor);
00216 
00217    void setZero();
00218 
00219    G4String getType() const;
00220 
00221    void Add( const G4HEVector & p1, const G4HEVector & p2 );
00222 
00223    void Sub( const G4HEVector & p1, const G4HEVector & p2 );
00224 
00225    void Lor( const G4HEVector & p1, const G4HEVector & p2 );
00226 
00227    G4double CosAng(const G4HEVector& p) const;
00228 
00229    G4double Ang(const G4HEVector & p );
00230 
00231    G4double Dot4( const G4HEVector & p1, const G4HEVector & p2);
00232 
00233    G4double Impu( const G4HEVector & p1, const G4HEVector & p2);
00234 
00235    void Add3( const G4HEVector & p1, const G4HEVector & p2);
00236 
00237    void Sub3( const G4HEVector & p1, const G4HEVector & p2);
00238 
00239    void Cross( const G4HEVector & p1, const G4HEVector & p2);
00240 
00241    G4double Dot( const G4HEVector & p1, const G4HEVector & p2);
00242 
00243    void Smul( const G4HEVector & p, G4double h);
00244 
00245    void SmulAndUpdate( const G4HEVector & p, G4double h);
00246 
00247    void Norz( const G4HEVector & p );
00248 
00249    G4double Length() const;
00250 
00251    void Exch( G4HEVector & p1);
00252 
00253    void Defs1( const G4HEVector & p1, const G4HEVector & p2);
00254 
00255    void Defs( const G4HEVector & p1, const G4HEVector & p2,
00256                     G4HEVector & my,       G4HEVector & mz );
00257 
00258    void Trac( const G4HEVector & p1, const G4HEVector & mx,
00259               const G4HEVector & my, const G4HEVector & mz);
00260 
00261    void setDefinition(G4String name);
00262 
00263    G4int FillQuarkContent();
00264 
00265    void Print(G4int L) const;
00266 };
00267 
00268 #endif
00269 

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