G4Parton Class Reference

#include <G4Parton.hh>


Public Member Functions

 G4Parton ()
 G4Parton (G4int PDGencoding)
 G4Parton (const G4Parton &right)
 ~G4Parton ()
G4Partonoperator= (const G4Parton &right)
int operator== (const G4Parton &right) const
int operator!= (const G4Parton &right) const
G4int GetPDGcode () const
G4ParticleDefinitionGetDefinition ()
void DefineMomentumInZ (G4double aLightConeMomentum, G4bool aDirection)
void DefineMomentumInZ (G4double aLightConeMomentum, G4double aLightConeE, G4bool aDirection)
const G4ThreeVectorGetPosition () const
void SetPosition (const G4ThreeVector &aPosition)
const G4LorentzVectorGet4Momentum () const
void Set4Momentum (const G4LorentzVector &aMomentum)
void SetX (G4double anX)
G4double GetX ()
void SetColour (G4int aColour)
G4int GetColour ()
void SetIsoSpinZ (G4double anIsoSpinZ)
G4double GetIsoSpinZ ()
void SetSpinZ (G4double aSpinZ)
G4double GetSpinZ ()


Detailed Description

Definition at line 47 of file G4Parton.hh.


Constructor & Destructor Documentation

G4Parton::G4Parton (  )  [inline]

Definition at line 50 of file G4Parton.hh.

References G4UniformRand.

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       }

G4Parton::G4Parton ( G4int  PDGencoding  ) 

Definition at line 39 of file G4Parton.cc.

References G4ParticleTable::FindParticle(), G4cout, G4endl, G4UniformRand, G4ParticleTable::GetParticleTable(), G4ParticleDefinition::GetParticleType(), G4ParticleDefinition::GetPDGiIsospin(), G4ParticleDefinition::GetPDGIsospin3(), and G4ParticleDefinition::GetPDGiSpin().

00040 {
00041         PDGencoding=PDGcode;
00042         theX = 0;
00043         theDefinition=G4ParticleTable::GetParticleTable()->FindParticle(PDGencoding);
00044         if (theDefinition == NULL)
00045         {
00046           G4cout << "Encoding = "<<PDGencoding<<G4endl;
00047           G4String text = "G4Parton::GetDefinition(): Encoding not in particle table";
00048           throw G4HadronicException(__FILE__, __LINE__, text);
00049         }
00050         //
00051         // colour by random in (1,2,3)=(R,G,B) for quarks and 
00052         //                  in (-1,-2,-3)=(Rbar,Gbar,Bbar) for anti-quarks:
00053   //
00054         if (theDefinition->GetParticleType() == "quarks") {
00055                 theColour = ((G4int)(3.*G4UniformRand())+1)*(std::abs(PDGencoding)/PDGencoding) ;
00056         }
00057         //
00058         // colour by random in (-1,-2,-3)=(Rbar,Gbar,Bbar)=(GB,RB,RG) for di-quarks and
00059         //                  in (1,2,3)=(R,G,B)=(GB,RB,RG) for anti-di-quarks:
00060   //
00061         else if (theDefinition->GetParticleType() == "diquarks") {
00062                 theColour = -((G4int)(3.*G4UniformRand())+1)*(std::abs(PDGencoding)/PDGencoding);
00063         }
00064         //
00065         // colour by random in (-11,-12,...,-33)=(RRbar,RGbar,RBbar,...,BBbar) for gluons:
00066   //
00067         else if (theDefinition->GetParticleType() == "gluons") {
00068                 theColour = -(((G4int)(3.*G4UniformRand())+1)*10 + ((G4int)(3.*G4UniformRand())+1));
00069         }
00070         else {
00071           G4cout << "Encoding = "<<PDGencoding<<G4endl;
00072           G4String text = "G4Parton::GetDefinition(): Particle is not a parton";
00073           throw G4HadronicException(__FILE__, __LINE__, text);
00074         }
00075         //  
00076         // isospin-z from PDG-encoded isospin-z for 
00077         // quarks, anti-quarks, di-quarks, and anti-di-quarks:
00078   //
00079         if ((theDefinition->GetParticleType() == "quarks") || (theDefinition->GetParticleType() == "diquarks")){
00080                 theIsoSpinZ = theDefinition->GetPDGIsospin3();
00081         }
00082         //
00083   // isospin-z choosen at random from PDG-encoded isospin for gluons (should be zero):
00084         //
00085         else {
00086                 G4int thisPDGiIsospin=theDefinition->GetPDGiIsospin();
00087                 if (thisPDGiIsospin == 0) {
00088                         theIsoSpinZ = 0;
00089                 }
00090                 else {
00091                         theIsoSpinZ = ((G4int)((thisPDGiIsospin+1)*G4UniformRand()))-thisPDGiIsospin*0.5;
00092                 }
00093         }
00094         //
00095         // spin-z choosen at random from PDG-encoded spin:
00096         //
00097         G4int thisPDGiSpin=theDefinition->GetPDGiSpin();
00098         if (thisPDGiSpin == 0) {
00099                 theSpinZ = 0;
00100         }
00101         else {
00102                 G4int rand=((G4int)((thisPDGiSpin+1)*G4UniformRand()));
00103                 theSpinZ = rand-thisPDGiSpin*0.5;;
00104         }
00105 }

G4Parton::G4Parton ( const G4Parton right  ) 

Definition at line 107 of file G4Parton.cc.

References PDGencoding, theColour, theDefinition, theIsoSpinZ, theMomentum, thePosition, theSpinZ, and theX.

00108 {
00109         PDGencoding = right.PDGencoding;
00110         theMomentum = right.theMomentum;
00111         thePosition = right.thePosition;
00112         theX = right.theX;
00113         theDefinition = right.theDefinition;
00114         theColour = right.theColour;
00115         theIsoSpinZ = right.theIsoSpinZ;
00116         theSpinZ = right.theSpinZ;
00117 }

G4Parton::~G4Parton (  ) 

Definition at line 136 of file G4Parton.cc.

00137 {
00138 //  cout << "G4Parton::~G4Parton(): this = "<<this <<endl;
00139 //  cout << "break here"<<this <<endl;
00140 }


Member Function Documentation

void G4Parton::DefineMomentumInZ ( G4double  aLightConeMomentum,
G4double  aLightConeE,
G4bool  aDirection 
)

Definition at line 153 of file G4Parton.cc.

References Get4Momentum(), Set4Momentum(), and sqr().

00154 {
00155         G4double Mass = GetMass();
00156         G4LorentzVector a4Momentum = Get4Momentum();
00157         aLightConeMomentum*=theX;
00158         aLightConeE*=theX;
00159         G4double TransverseMass2 = sqr(a4Momentum.px()) + sqr(a4Momentum.py()) + sqr(Mass);
00160         a4Momentum.setPz(0.5*(aLightConeMomentum - aLightConeE - TransverseMass2/aLightConeMomentum)*(aDirection? 1: -1)); 
00161         a4Momentum.setE( 0.5*(aLightConeMomentum + aLightConeE + TransverseMass2/aLightConeMomentum));
00162         Set4Momentum(a4Momentum);
00163 }  

void G4Parton::DefineMomentumInZ ( G4double  aLightConeMomentum,
G4bool  aDirection 
)

Definition at line 142 of file G4Parton.cc.

References Get4Momentum(), Set4Momentum(), and sqr().

00143 {
00144         G4double Mass = GetMass();
00145         G4LorentzVector a4Momentum = Get4Momentum();
00146         aLightConeMomentum*=theX;
00147         G4double TransverseMass2 = sqr(a4Momentum.px()) + sqr(a4Momentum.py()) + sqr(Mass);
00148         a4Momentum.setPz(0.5*(aLightConeMomentum - TransverseMass2/aLightConeMomentum)*(aDirection? 1: -1)); 
00149         a4Momentum.setE( 0.5*(aLightConeMomentum + TransverseMass2/aLightConeMomentum));
00150         Set4Momentum(a4Momentum);
00151 }  

const G4LorentzVector & G4Parton::Get4Momentum (  )  const [inline]

Definition at line 140 of file G4Parton.hh.

Referenced by G4SoftStringBuilder::BuildString(), G4DiffractiveExcitation::CreateStrings(), DefineMomentumInZ(), G4VKinkyStringDecay::FragmentString(), G4FragmentingString::G4FragmentingString(), G4PartonPair::G4PartonPair(), operator=(), G4QGSParticipants::PerformDiffractiveCollisions(), G4QGSParticipants::PerformSoftCollisions(), and G4QGSDiffractiveExcitation::String().

00141 {
00142         return theMomentum;
00143 }

G4int G4Parton::GetColour (  )  [inline]

Definition at line 89 of file G4Parton.hh.

Referenced by G4PartonPair::G4PartonPair().

00089 {return theColour;}

G4ParticleDefinition * G4Parton::GetDefinition (  )  [inline]

Definition at line 158 of file G4Parton.hh.

Referenced by G4DiffractiveExcitation::CreateStrings(), G4FragmentingString::G4FragmentingString(), and G4PartonPair::G4PartonPair().

00159 {
00160         return theDefinition;
00161 }

G4double G4Parton::GetIsoSpinZ (  )  [inline]

Definition at line 92 of file G4Parton.hh.

00092 {return theIsoSpinZ;}

G4int G4Parton::GetPDGcode (  )  const [inline]

Definition at line 124 of file G4Parton.hh.

Referenced by G4SoftStringBuilder::BuildString(), G4DiffractiveExcitation::CreateStrings(), G4ExcitedString::GetAntiColorParton(), G4ExcitedString::GetColorParton(), operator=(), G4QGSParticipants::PerformDiffractiveCollisions(), G4QGSParticipants::PerformSoftCollisions(), and G4QGSDiffractiveExcitation::String().

00125 {
00126         return PDGencoding;
00127 }

const G4ThreeVector & G4Parton::GetPosition (  )  const [inline]

Definition at line 129 of file G4Parton.hh.

Referenced by G4VKinkyStringDecay::FragmentString(), G4ExcitedString::G4ExcitedString(), and operator=().

00130 {
00131         return thePosition;
00132 }

G4double G4Parton::GetSpinZ (  )  [inline]

Definition at line 95 of file G4Parton.hh.

Referenced by G4PartonPair::G4PartonPair().

00095 {return theSpinZ;}

G4double G4Parton::GetX (  )  [inline]

Definition at line 86 of file G4Parton.hh.

Referenced by G4SoftStringBuilder::BuildString(), G4QGSParticipants::PerformDiffractiveCollisions(), and G4QGSParticipants::PerformSoftCollisions().

00086 {return theX;}

int G4Parton::operator!= ( const G4Parton right  )  const [inline]

Definition at line 119 of file G4Parton.hh.

00120 {
00121         return this!=&right;
00122 }

G4Parton & G4Parton::operator= ( const G4Parton right  ) 

Definition at line 119 of file G4Parton.cc.

References Get4Momentum(), GetPDGcode(), GetPosition(), theColour, theDefinition, theIsoSpinZ, theSpinZ, and theX.

00120 {
00121    if (this != &right)
00122    {
00123       PDGencoding=right.GetPDGcode();
00124       theMomentum=right.Get4Momentum();
00125       thePosition=right.GetPosition();
00126       theX = right.theX;
00127       theDefinition = right.theDefinition;
00128       theColour = right.theColour;
00129       theIsoSpinZ = right.theIsoSpinZ;
00130       theSpinZ = right.theSpinZ;
00131    }
00132 
00133         return *this;
00134 }

int G4Parton::operator== ( const G4Parton right  )  const [inline]

Definition at line 114 of file G4Parton.hh.

00115 {
00116         return this==&right;
00117 }       

void G4Parton::Set4Momentum ( const G4LorentzVector aMomentum  )  [inline]

Definition at line 145 of file G4Parton.hh.

Referenced by G4DiffractiveExcitation::CreateStrings(), DefineMomentumInZ(), G4VKinkyStringDecay::FragmentString(), and G4QGSDiffractiveExcitation::String().

00146 {
00147         theMomentum=aMomentum;
00148 }

void G4Parton::SetColour ( G4int  aColour  )  [inline]

Definition at line 88 of file G4Parton.hh.

00088 {theColour = aColour;}

void G4Parton::SetIsoSpinZ ( G4double  anIsoSpinZ  )  [inline]

Definition at line 91 of file G4Parton.hh.

00091 {theIsoSpinZ = anIsoSpinZ;}

void G4Parton::SetPosition ( const G4ThreeVector aPosition  )  [inline]

Definition at line 134 of file G4Parton.hh.

Referenced by G4VKinkyStringDecay::FragmentString().

00135 {
00136         thePosition=aPosition;
00137 }

void G4Parton::SetSpinZ ( G4double  aSpinZ  )  [inline]

Definition at line 94 of file G4Parton.hh.

00094 {theSpinZ = aSpinZ;}

void G4Parton::SetX ( G4double  anX  )  [inline]

Definition at line 85 of file G4Parton.hh.

00085 { theX = anX; }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:51 2013 for Geant4 by  doxygen 1.4.7