G4Parton.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 //
00028 
00029 #ifndef G4Parton_h
00030 #define G4Parton_h 1
00031 
00032 // ------------------------------------------------------------
00033 //      GEANT 4 class header file
00034 //
00035 //      ---------------- G4Parton ----------------
00036 //             by Gunter Folger, June 1998.
00037 //       class for Parton (inside a string) used by Parton String Models
00038 // ------------------------------------------------------------
00039 
00040 #include "globals.hh"
00041 #include "G4ThreeVector.hh"
00042 #include "G4LorentzVector.hh"
00043 #include <iostream>
00044 #include "G4ParticleTable.hh"
00045 #include "Randomize.hh"
00046 
00047 class G4Parton
00048 {
00049    public:
00050       G4Parton()
00051       {
00052         // CAUTION: 
00053         // this is a preliminary definition yielding u and d quarks only!
00054         //
00055         PDGencoding=(G4int)(2.*G4UniformRand()); 
00056         theColour = (G4int)(3.*G4UniformRand())+1;
00057         theIsoSpinZ = ((G4int)(G4UniformRand()))-0.5;
00058         theSpinZ = ((G4int)(G4UniformRand()))-0.5;
00059       }
00060       
00061       G4Parton(G4int PDGencoding);
00062       G4Parton(const G4Parton &right);
00063 
00064       ~G4Parton();
00065 
00066       G4Parton & operator=(const G4Parton &right);
00067 
00068       int operator==(const G4Parton &right) const;
00069 
00070       int operator!=(const G4Parton &right) const;
00071       
00072       G4int GetPDGcode() const;
00073       
00074       G4ParticleDefinition * GetDefinition();
00075 
00076       void DefineMomentumInZ(G4double aLightConeMomentum, G4bool aDirection);      
00077       void DefineMomentumInZ(G4double aLightConeMomentum,G4double aLightConeE, G4bool aDirection);      
00078       
00079       const G4ThreeVector & GetPosition()const;
00080       void SetPosition(const G4ThreeVector &aPosition);
00081 
00082       const G4LorentzVector & Get4Momentum() const; 
00083       void Set4Momentum(const G4LorentzVector & aMomentum);
00084       
00085       void SetX(G4double anX) { theX = anX; }
00086       G4double GetX() {return theX;}
00087       
00088       void SetColour(G4int aColour) {theColour = aColour;}
00089       G4int GetColour() {return theColour;}
00090       
00091       void SetIsoSpinZ(G4double anIsoSpinZ) {theIsoSpinZ = anIsoSpinZ;}
00092       G4double GetIsoSpinZ() {return theIsoSpinZ;}
00093 
00094       void SetSpinZ(G4double aSpinZ) {theSpinZ = aSpinZ;}
00095       G4double GetSpinZ() {return theSpinZ;}
00096       
00097    private:
00098       G4double GetMass();
00099       
00100     private:  
00101       G4int PDGencoding;
00102       G4ParticleDefinition * theDefinition;
00103       G4LorentzVector theMomentum;
00104       G4ThreeVector   thePosition;
00105       
00106       G4int theColour;
00107       G4double theIsoSpinZ;
00108       G4double theSpinZ;
00109       
00110       G4double theX;
00111       
00112 };
00113 
00114 inline int G4Parton::operator==(const G4Parton &right) const
00115 {
00116         return this==&right;
00117 }       
00118 
00119 inline int G4Parton::operator!=(const G4Parton &right) const
00120 {
00121         return this!=&right;
00122 }
00123 
00124 inline G4int G4Parton::GetPDGcode() const
00125 {
00126         return PDGencoding;
00127 }
00128         
00129 inline const G4ThreeVector & G4Parton::GetPosition() const
00130 {
00131         return thePosition;
00132 }
00133 
00134 inline void G4Parton::SetPosition(const G4ThreeVector &aPosition)
00135 {
00136         thePosition=aPosition;
00137 }
00138 
00139 
00140 inline const G4LorentzVector & G4Parton::Get4Momentum() const
00141 {
00142         return theMomentum;
00143 }
00144 
00145 inline void G4Parton::Set4Momentum(const G4LorentzVector & aMomentum)
00146 {
00147         theMomentum=aMomentum;
00148 }
00149 
00150 
00151 inline
00152 G4double G4Parton::GetMass()
00153 {
00154         return theDefinition->GetPDGMass();
00155 }
00156 
00157 inline
00158 G4ParticleDefinition * G4Parton::GetDefinition()
00159 {
00160         return theDefinition;
00161 }
00162 
00163 
00164 #endif

Generated on Mon May 27 17:49:16 2013 for Geant4 by  doxygen 1.4.7