Geant4  10.02.p03
G4Parton Class Reference

#include <G4Parton.hh>

Collaboration diagram for G4Parton:

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 ()
 

Private Member Functions

G4double GetMass ()
 

Private Attributes

G4int PDGencoding
 
G4ParticleDefinitiontheDefinition
 
G4LorentzVector theMomentum
 
G4ThreeVector thePosition
 
G4int theColour
 
G4double theIsoSpinZ
 
G4double theSpinZ
 
G4double theX
 

Detailed Description

Definition at line 47 of file G4Parton.hh.

Constructor & Destructor Documentation

◆ G4Parton() [1/3]

G4Parton::G4Parton ( )
inline

Definition at line 50 of file G4Parton.hh.

51  {
52  // CAUTION:
53  // this is a preliminary definition yielding u and d quarks only!
54  //
56  theColour = (G4int)(3.*G4UniformRand())+1;
57  theIsoSpinZ = ((G4int)(G4UniformRand()))-0.5;
58  theSpinZ = ((G4int)(G4UniformRand()))-0.5;
59  }
G4double theIsoSpinZ
Definition: G4Parton.hh:107
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:97
G4int theColour
Definition: G4Parton.hh:106
G4double theSpinZ
Definition: G4Parton.hh:108
G4int PDGencoding
Definition: G4Parton.hh:101
Here is the call graph for this function:

◆ G4Parton() [2/3]

G4Parton::G4Parton ( G4int  PDGencoding)

Definition at line 39 of file G4Parton.cc.

40 {
41  PDGencoding=PDGcode;
42  theX = 0;
44  if (theDefinition == NULL)
45  {
46  G4cout << "Encoding = "<<PDGencoding<<G4endl;
47  G4String text = "G4Parton::GetDefinition(): Encoding not in particle table";
48  throw G4HadronicException(__FILE__, __LINE__, text);
49  }
50  //
51  // colour by random in (1,2,3)=(R,G,B) for quarks and
52  // in (-1,-2,-3)=(Rbar,Gbar,Bbar) for anti-quarks:
53  //
54  if (theDefinition->GetParticleType() == "quarks") {
55  theColour = ((G4int)(3.*G4UniformRand())+1)*(std::abs(PDGencoding)/PDGencoding) ;
56  }
57  //
58  // colour by random in (-1,-2,-3)=(Rbar,Gbar,Bbar)=(GB,RB,RG) for di-quarks and
59  // in (1,2,3)=(R,G,B)=(GB,RB,RG) for anti-di-quarks:
60  //
61  else if (theDefinition->GetParticleType() == "diquarks") {
62  theColour = -((G4int)(3.*G4UniformRand())+1)*(std::abs(PDGencoding)/PDGencoding);
63  }
64  //
65  // colour by random in (-11,-12,...,-33)=(RRbar,RGbar,RBbar,...,BBbar) for gluons:
66  //
67  else if (theDefinition->GetParticleType() == "gluons") {
68  theColour = -(((G4int)(3.*G4UniformRand())+1)*10 + ((G4int)(3.*G4UniformRand())+1));
69  }
70  else {
71  G4cout << "Encoding = "<<PDGencoding<<G4endl;
72  G4String text = "G4Parton::GetDefinition(): Particle is not a parton";
73  throw G4HadronicException(__FILE__, __LINE__, text);
74  }
75  //
76  // isospin-z from PDG-encoded isospin-z for
77  // quarks, anti-quarks, di-quarks, and anti-di-quarks:
78  //
79  if ((theDefinition->GetParticleType() == "quarks") || (theDefinition->GetParticleType() == "diquarks")){
81  }
82  //
83  // isospin-z choosen at random from PDG-encoded isospin for gluons (should be zero):
84  //
85  else {
86  G4int thisPDGiIsospin=theDefinition->GetPDGiIsospin();
87  if (thisPDGiIsospin == 0) {
88  theIsoSpinZ = 0;
89  }
90  else {
91  theIsoSpinZ = ((G4int)((thisPDGiIsospin+1)*G4UniformRand()))-thisPDGiIsospin*0.5;
92  }
93  }
94  //
95  // spin-z choosen at random from PDG-encoded spin:
96  //
97  G4int thisPDGiSpin=theDefinition->GetPDGiSpin();
98  if (thisPDGiSpin == 0) {
99  theSpinZ = 0;
100  }
101  else {
102  G4int rand=((G4int)((thisPDGiSpin+1)*G4UniformRand()));
103  theSpinZ = rand-thisPDGiSpin*0.5;;
104  }
105 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
const G4String & GetParticleType() const
G4double theIsoSpinZ
Definition: G4Parton.hh:107
int G4int
Definition: G4Types.hh:78
G4double GetPDGIsospin3() const
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
G4double theX
Definition: G4Parton.hh:110
G4int theColour
Definition: G4Parton.hh:106
G4ParticleDefinition * theDefinition
Definition: G4Parton.hh:102
G4double theSpinZ
Definition: G4Parton.hh:108
static G4ParticleTable * GetParticleTable()
G4int PDGencoding
Definition: G4Parton.hh:101
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:

◆ G4Parton() [3/3]

G4Parton::G4Parton ( const G4Parton right)

Definition at line 107 of file G4Parton.cc.

108 {
109  PDGencoding = right.PDGencoding;
110  theMomentum = right.theMomentum;
111  thePosition = right.thePosition;
112  theX = right.theX;
114  theColour = right.theColour;
115  theIsoSpinZ = right.theIsoSpinZ;
116  theSpinZ = right.theSpinZ;
117 }
G4ThreeVector thePosition
Definition: G4Parton.hh:104
G4double theIsoSpinZ
Definition: G4Parton.hh:107
G4double theX
Definition: G4Parton.hh:110
G4int theColour
Definition: G4Parton.hh:106
G4ParticleDefinition * theDefinition
Definition: G4Parton.hh:102
G4double theSpinZ
Definition: G4Parton.hh:108
G4int PDGencoding
Definition: G4Parton.hh:101
G4LorentzVector theMomentum
Definition: G4Parton.hh:103

◆ ~G4Parton()

G4Parton::~G4Parton ( )

Definition at line 136 of file G4Parton.cc.

137 {
138 // cout << "G4Parton::~G4Parton(): this = "<<this <<endl;
139 // cout << "break here"<<this <<endl;
140 }
Here is the caller graph for this function:

Member Function Documentation

◆ DefineMomentumInZ() [1/2]

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

Definition at line 142 of file G4Parton.cc.

143 {
144  G4double Mass = GetMass();
145  G4LorentzVector a4Momentum = Get4Momentum();
146  aLightConeMomentum*=theX;
147  G4double TransverseMass2 = sqr(a4Momentum.px()) + sqr(a4Momentum.py()) + sqr(Mass);
148  a4Momentum.setPz(0.5*(aLightConeMomentum - TransverseMass2/aLightConeMomentum)*(aDirection? 1: -1));
149  a4Momentum.setE( 0.5*(aLightConeMomentum + TransverseMass2/aLightConeMomentum));
150  Set4Momentum(a4Momentum);
151 }
const G4LorentzVector & Get4Momentum() const
Definition: G4Parton.hh:140
void Set4Momentum(const G4LorentzVector &aMomentum)
Definition: G4Parton.hh:145
G4double theX
Definition: G4Parton.hh:110
G4double GetMass()
Definition: G4Parton.hh:152
T sqr(const T &x)
Definition: templates.hh:145
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DefineMomentumInZ() [2/2]

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

Definition at line 153 of file G4Parton.cc.

154 {
155  G4double Mass = GetMass();
156  G4LorentzVector a4Momentum = Get4Momentum();
157  aLightConeMomentum*=theX;
158  aLightConeE*=theX;
159  G4double TransverseMass2 = sqr(a4Momentum.px()) + sqr(a4Momentum.py()) + sqr(Mass);
160  a4Momentum.setPz(0.5*(aLightConeMomentum - aLightConeE - TransverseMass2/aLightConeMomentum)*(aDirection? 1: -1));
161  a4Momentum.setE( 0.5*(aLightConeMomentum + aLightConeE + TransverseMass2/aLightConeMomentum));
162  Set4Momentum(a4Momentum);
163 }
const G4LorentzVector & Get4Momentum() const
Definition: G4Parton.hh:140
void Set4Momentum(const G4LorentzVector &aMomentum)
Definition: G4Parton.hh:145
G4double theX
Definition: G4Parton.hh:110
G4double GetMass()
Definition: G4Parton.hh:152
T sqr(const T &x)
Definition: templates.hh:145
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ Get4Momentum()

const G4LorentzVector & G4Parton::Get4Momentum ( ) const
inline

Definition at line 140 of file G4Parton.hh.

141 {
142  return theMomentum;
143 }
G4LorentzVector theMomentum
Definition: G4Parton.hh:103
Here is the caller graph for this function:

◆ GetColour()

G4int G4Parton::GetColour ( )
inline

Definition at line 89 of file G4Parton.hh.

89 {return theColour;}
G4int theColour
Definition: G4Parton.hh:106
Here is the caller graph for this function:

◆ GetDefinition()

G4ParticleDefinition * G4Parton::GetDefinition ( )
inline

Definition at line 158 of file G4Parton.hh.

159 {
160  return theDefinition;
161 }
G4ParticleDefinition * theDefinition
Definition: G4Parton.hh:102
Here is the caller graph for this function:

◆ GetIsoSpinZ()

G4double G4Parton::GetIsoSpinZ ( )
inline

Definition at line 92 of file G4Parton.hh.

92 {return theIsoSpinZ;}
G4double theIsoSpinZ
Definition: G4Parton.hh:107

◆ GetMass()

G4double G4Parton::GetMass ( )
inlineprivate

Definition at line 152 of file G4Parton.hh.

153 {
154  return theDefinition->GetPDGMass();
155 }
G4ParticleDefinition * theDefinition
Definition: G4Parton.hh:102
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPDGcode()

G4int G4Parton::GetPDGcode ( ) const
inline

Definition at line 124 of file G4Parton.hh.

125 {
126  return PDGencoding;
127 }
G4int PDGencoding
Definition: G4Parton.hh:101
Here is the caller graph for this function:

◆ GetPosition()

const G4ThreeVector & G4Parton::GetPosition ( void  ) const
inline

Definition at line 129 of file G4Parton.hh.

130 {
131  return thePosition;
132 }
G4ThreeVector thePosition
Definition: G4Parton.hh:104
Here is the caller graph for this function:

◆ GetSpinZ()

G4double G4Parton::GetSpinZ ( )
inline

Definition at line 95 of file G4Parton.hh.

95 {return theSpinZ;}
G4double theSpinZ
Definition: G4Parton.hh:108
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetX()

G4double G4Parton::GetX ( )
inline

Definition at line 86 of file G4Parton.hh.

86 {return theX;}
G4double theX
Definition: G4Parton.hh:110
Here is the caller graph for this function:

◆ operator!=()

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

Definition at line 119 of file G4Parton.hh.

120 {
121  return this!=&right;
122 }
Here is the caller graph for this function:

◆ operator=()

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

Definition at line 119 of file G4Parton.cc.

120 {
121  if (this != &right)
122  {
123  PDGencoding=right.GetPDGcode();
124  theMomentum=right.Get4Momentum();
125  thePosition=right.GetPosition();
126  theX = right.theX;
128  theColour = right.theColour;
129  theIsoSpinZ = right.theIsoSpinZ;
130  theSpinZ = right.theSpinZ;
131  }
132 
133  return *this;
134 }
G4ThreeVector thePosition
Definition: G4Parton.hh:104
const G4LorentzVector & Get4Momentum() const
Definition: G4Parton.hh:140
G4double theIsoSpinZ
Definition: G4Parton.hh:107
G4double theX
Definition: G4Parton.hh:110
G4int theColour
Definition: G4Parton.hh:106
G4ParticleDefinition * theDefinition
Definition: G4Parton.hh:102
const G4ThreeVector & GetPosition() const
Definition: G4Parton.hh:129
G4double theSpinZ
Definition: G4Parton.hh:108
G4int PDGencoding
Definition: G4Parton.hh:101
G4int GetPDGcode() const
Definition: G4Parton.hh:124
G4LorentzVector theMomentum
Definition: G4Parton.hh:103
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator==()

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

Definition at line 114 of file G4Parton.hh.

115 {
116  return this==&right;
117 }
Here is the caller graph for this function:

◆ Set4Momentum()

void G4Parton::Set4Momentum ( const G4LorentzVector aMomentum)
inline

Definition at line 145 of file G4Parton.hh.

146 {
147  theMomentum=aMomentum;
148 }
G4LorentzVector theMomentum
Definition: G4Parton.hh:103
Here is the caller graph for this function:

◆ SetColour()

void G4Parton::SetColour ( G4int  aColour)
inline

Definition at line 88 of file G4Parton.hh.

88 {theColour = aColour;}
G4int theColour
Definition: G4Parton.hh:106
Here is the caller graph for this function:

◆ SetIsoSpinZ()

void G4Parton::SetIsoSpinZ ( G4double  anIsoSpinZ)
inline

Definition at line 91 of file G4Parton.hh.

91 {theIsoSpinZ = anIsoSpinZ;}
G4double theIsoSpinZ
Definition: G4Parton.hh:107

◆ SetPosition()

void G4Parton::SetPosition ( const G4ThreeVector aPosition)
inline

Definition at line 134 of file G4Parton.hh.

135 {
136  thePosition=aPosition;
137 }
G4ThreeVector thePosition
Definition: G4Parton.hh:104
Here is the caller graph for this function:

◆ SetSpinZ()

void G4Parton::SetSpinZ ( G4double  aSpinZ)
inline

Definition at line 94 of file G4Parton.hh.

94 {theSpinZ = aSpinZ;}
G4double theSpinZ
Definition: G4Parton.hh:108
Here is the caller graph for this function:

◆ SetX()

void G4Parton::SetX ( G4double  anX)
inline

Definition at line 85 of file G4Parton.hh.

85 { theX = anX; }
G4double theX
Definition: G4Parton.hh:110

Member Data Documentation

◆ PDGencoding

G4int G4Parton::PDGencoding
private

Definition at line 101 of file G4Parton.hh.

◆ theColour

G4int G4Parton::theColour
private

Definition at line 106 of file G4Parton.hh.

◆ theDefinition

G4ParticleDefinition* G4Parton::theDefinition
private

Definition at line 102 of file G4Parton.hh.

◆ theIsoSpinZ

G4double G4Parton::theIsoSpinZ
private

Definition at line 107 of file G4Parton.hh.

◆ theMomentum

G4LorentzVector G4Parton::theMomentum
private

Definition at line 103 of file G4Parton.hh.

◆ thePosition

G4ThreeVector G4Parton::thePosition
private

Definition at line 104 of file G4Parton.hh.

◆ theSpinZ

G4double G4Parton::theSpinZ
private

Definition at line 108 of file G4Parton.hh.

◆ theX

G4double G4Parton::theX
private

Definition at line 110 of file G4Parton.hh.


The documentation for this class was generated from the following files: