Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4QParton Class Reference

#include <G4QParton.hh>

Public Member Functions

 G4QParton ()
 
 G4QParton (G4int aPGG)
 
 G4QParton (const G4QParton &right)
 
 G4QParton (const G4QParton *right)
 
 ~G4QParton ()
 
const G4QPartonoperator= (const G4QParton &right)
 
G4int operator== (const G4QParton &right) const
 
G4int operator!= (const G4QParton &right) const
 
void DefineEPz (G4LorentzVector hadr4Mom)
 
void DefineMomentumInZ (G4double aLightConeMomentum, G4bool aDirection)
 
void SetPDGCode (G4int aPDG)
 
void SetColour (G4int aColour)
 
void SetX (G4double anX)
 
void Set4Momentum (const G4LorentzVector &aMomentum)
 
void SetPosition (const G4ThreeVector &aPosition)
 
void SetSpinZ (G4double aSpinZ)
 
G4bool ReduceDiQADiQ (G4QParton *d1, G4QParton *d2)
 
G4int GetPDGCode () const
 
G4QContent GetQC () const
 
const G4ThreeVectorGetPosition () const
 
const G4LorentzVectorGet4Momentum () const
 
G4double GetX ()
 
G4int GetColour ()
 
G4double GetSpinZ ()
 
const G4intGetType () const
 

Detailed Description

Definition at line 52 of file G4QParton.hh.

Constructor & Destructor Documentation

◆ G4QParton() [1/4]

G4QParton::G4QParton ( )

Definition at line 46 of file G4QParton.cc.

47{
48 // CHIPS is working only with u, d, and s quarks (SU(3)xSU(3)) (no gluons! M.K.)
49 // Random Flavor/Colour/Spin definition for default constructor (with .3 s-suppresion)
50 PGGCode=(G4int)(2.3*G4UniformRand())+1; //@@ Additional parameter of s/u (M.K.)
51 theType=1;
52#ifdef debug
53 G4cout<<"....G4QParton::DefConstructer: PDG = "<<PGGCode<<", Type="<<theType<<G4endl;
54#endif
55 // random colour (1,2,3)=(R,G,B) for quarks and (-1,-2,-3)=(aR,aG,aB) for anti-quarks
56 theColour = (G4int)(3*G4UniformRand())+1;
57 if(theColour>3) theColour = 3; // Should never happend
58 theSpinZ = (G4int)(2*G4UniformRand()) - 0.5;
59 QCont = G4QContent(0,0,0,0,0,0);
60 // Default definition (initialization)
61 theX = 0.;
62 thePosition=G4ThreeVector(0.,0.,0.);
63 theMomentum=G4LorentzVector(0.,0.,0.,0.);
64}
CLHEP::HepLorentzVector G4LorentzVector
CLHEP::Hep3Vector G4ThreeVector
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:53

◆ G4QParton() [2/4]

G4QParton::G4QParton ( G4int  aPGG)

Definition at line 66 of file G4QParton.cc.

67{
68 SetPDGCode(PDG);
69 // Default definition (initialization)
70 theX = 0.;
71 thePosition=G4ThreeVector(0.,0.,0.);
72 theMomentum=G4LorentzVector(0.,0.,0.,0.);
73}
void SetPDGCode(G4int aPDG)
Definition: G4QParton.cc:130

◆ G4QParton() [3/4]

G4QParton::G4QParton ( const G4QParton right)

Definition at line 75 of file G4QParton.cc.

76{
77 PGGCode = right.PGGCode;
78 QCont = right.QCont;
79 theType = right.theType;
80 theMomentum = right.theMomentum;
81 thePosition = right.thePosition;
82 theX = right.theX;
83 theColour = right.theColour;
84 theSpinZ = right.theSpinZ;
85#ifdef debug
86 G4cout<<"G4QParton::RCopyConstructer: PDG="<<PGGCode<<", Col="<<theColour<<", Sz="
87 <<theSpinZ<<G4endl;
88#endif
89}

◆ G4QParton() [4/4]

G4QParton::G4QParton ( const G4QParton right)

Definition at line 91 of file G4QParton.cc.

92{
93 PGGCode = right->PGGCode;
94 QCont = right->QCont;
95 theType = right->theType;
96 theMomentum = right->theMomentum;
97 thePosition = right->thePosition;
98 theX = right->theX;
99 theColour = right->theColour;
100 theSpinZ = right->theSpinZ;
101#ifdef debug
102 G4cout<<"G4QParton::PCopyConstructer: PDG="<<PGGCode<<", Col="<<theColour<<", Sz="
103 <<theSpinZ<<G4endl;
104#endif
105}

◆ ~G4QParton()

G4QParton::~G4QParton ( )

Definition at line 127 of file G4QParton.cc.

127{}

Member Function Documentation

◆ DefineEPz()

void G4QParton::DefineEPz ( G4LorentzVector  hadr4Mom)
inline

Definition at line 70 of file G4QParton.hh.

70{theMomentum+=hadr4Mom*theX;} // CHIPS solution

◆ DefineMomentumInZ()

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

Definition at line 234 of file G4QParton.cc.

235{
236 G4LorentzVector a4Momentum = Get4Momentum();
237 aLightConeMomentum*=theX;
238 G4double TransverseMass2 = sqr(a4Momentum.px()) + sqr(a4Momentum.py());
239 a4Momentum.setPz(0.5*(aLightConeMomentum - TransverseMass2/aLightConeMomentum) *
240 (aDirection? 1: -1));
241 a4Momentum.setE( 0.5*(aLightConeMomentum + TransverseMass2/aLightConeMomentum));
242 Set4Momentum(a4Momentum);
243}
double G4double
Definition: G4Types.hh:64
const G4LorentzVector & Get4Momentum() const
Definition: G4QParton.hh:84
void Set4Momentum(const G4LorentzVector &aMomentum)
Definition: G4QParton.hh:75
T sqr(const T &x)
Definition: templates.hh:145

◆ Get4Momentum()

◆ GetColour()

G4int G4QParton::GetColour ( )
inline

Definition at line 86 of file G4QParton.hh.

86{return theColour;}

Referenced by G4QHadron::SplitUp().

◆ GetPDGCode()

◆ GetPosition()

const G4ThreeVector & G4QParton::GetPosition ( ) const
inline

Definition at line 83 of file G4QParton.hh.

83{return thePosition;}

Referenced by G4QString::ExciteString(), and operator=().

◆ GetQC()

G4QContent G4QParton::GetQC ( ) const
inline

Definition at line 82 of file G4QParton.hh.

82{return QCont;}

Referenced by G4QFragmentation::G4QFragmentation(), G4QIonIonCollision::G4QIonIonCollision(), and G4QString::GetQC().

◆ GetSpinZ()

G4double G4QParton::GetSpinZ ( )
inline

Definition at line 87 of file G4QParton.hh.

87{return theSpinZ;}

Referenced by G4QHadron::SplitUp().

◆ GetType()

◆ GetX()

G4double G4QParton::GetX ( )
inline

Definition at line 85 of file G4QParton.hh.

85{return theX;}

◆ operator!=()

G4int G4QParton::operator!= ( const G4QParton right) const
inline

Definition at line 67 of file G4QParton.hh.

67{return this!=&right;}

◆ operator=()

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

Definition at line 107 of file G4QParton.cc.

108{
109 if(this != &right) // Beware of self assignment
110 {
111 PGGCode = right.GetPDGCode();
112 QCont = right.QCont;
113 theType = right.GetType();
114 theMomentum = right.Get4Momentum();
115 thePosition = right.GetPosition();
116 theX = right.theX;
117 theColour = right.theColour;
118 theSpinZ = right.theSpinZ;
119#ifdef debug
120 G4cout<<"G4QParton::=Constructer: PDG="<<PGGCode<<", Col="<<theColour<<", Sz="
121 <<theSpinZ<<G4endl;
122#endif
123 }
124 return *this;
125}
const G4ThreeVector & GetPosition() const
Definition: G4QParton.hh:83
const G4int & GetType() const
Definition: G4QParton.hh:88
G4int GetPDGCode() const
Definition: G4QParton.hh:81

◆ operator==()

G4int G4QParton::operator== ( const G4QParton right) const
inline

Definition at line 66 of file G4QParton.hh.

66{return this==&right;}

◆ ReduceDiQADiQ()

G4bool G4QParton::ReduceDiQADiQ ( G4QParton d1,
G4QParton d2 
)

Definition at line 246 of file G4QParton.cc.

247{
248 G4bool result=false;
249 G4int sPDG=d1->GetPDGCode();
250 G4int nPDG=d2->GetPDGCode();
251#ifdef debug
252 G4cout<<"G4QParton::ReduceDiQADiQ: **Called** LPDG="<<sPDG<<", RPDG="<<nPDG<<G4endl;
253#endif
254 G4int qPDG=sPDG;
255 if(qPDG<-99) qPDG=(-qPDG)/100;
256 else qPDG/=100;
257 G4int dPDG=nPDG;
258 if(dPDG<-99) dPDG=(-dPDG)/100;
259 else dPDG/=100;
260 G4int L1=qPDG/10;
261 G4int L2=qPDG%10;
262 G4int R1=dPDG/10;
263 G4int R2=dPDG%10;
264 if(L1==R1 || L1==R2 || L2==R1 || L2==R2) // Annihilation condition
265 {
266 if (L1==R1)
267 {
268 if(sPDG>0) sPDG=L2;
269 else sPDG=-L2;
270 if(nPDG>0) nPDG=R2;
271 else nPDG=-R2;
272#ifdef debug
273 G4cout<<"G4QParton::ReDiQADiQ:L2="<<L2<<",R2="<<R2<<",L="<<sPDG<<",R="<<nPDG<<G4endl;
274#endif
275 }
276 else if(L1==R2)
277 {
278 if(sPDG>0) sPDG=L2;
279 else sPDG=-L2;
280 if(nPDG>0) nPDG=R1;
281 else nPDG=-R1;
282#ifdef debug
283 G4cout<<"G4QParton::ReDiQADiQ:L2="<<L2<<",R1="<<R1<<",L="<<sPDG<<",R="<<nPDG<<G4endl;
284#endif
285 }
286 else if(L2==R1)
287 {
288 if(sPDG>0) sPDG=L1;
289 else sPDG=-L1;
290 if(nPDG>0) nPDG=R2;
291 else nPDG=-R2;
292#ifdef debug
293 G4cout<<"G4QParton::ReDiQADiQ:L1="<<L1<<",R2="<<R2<<",L="<<sPDG<<",R="<<nPDG<<G4endl;
294#endif
295 }
296 else //(L2==R2)
297 {
298 if(sPDG>0) sPDG=L1;
299 else sPDG=-L1;
300 if(nPDG>0) nPDG=R1;
301 else nPDG=-R1;
302#ifdef debug
303 G4cout<<"G4QParton::ReDiQADiQ:L1="<<L1<<",R1="<<R1<<",L="<<sPDG<<",R="<<nPDG<<G4endl;
304#endif
305 }
306 d1->SetPDGCode(sPDG); // Reset the left quark
307 d2->SetPDGCode(nPDG); // Reset the right quark
308 result=true;
309#ifdef debug
310 G4cout<<"G4QParton::ReduceDiQADiQ:AfterReduction,L="<<sPDG<<",R="<<nPDG<<G4endl;
311#endif
312 }
313#ifdef debug
314 else G4cout<<"-Warning-G4QParton::ReduceDiQADiQ:DQ-aDQ reduction to Q-aQ Failed"<<G4endl;
315#endif
316 return result;
317}
bool G4bool
Definition: G4Types.hh:67

Referenced by G4QFragmentation::Breeder(), G4QIonIonCollision::Breeder(), G4QFragmentation::G4QFragmentation(), and G4QIonIonCollision::G4QIonIonCollision().

◆ Set4Momentum()

◆ SetColour()

void G4QParton::SetColour ( G4int  aColour)
inline

Definition at line 73 of file G4QParton.hh.

73{theColour = aColour;}

Referenced by G4QHadron::SplitUp().

◆ SetPDGCode()

void G4QParton::SetPDGCode ( G4int  aPDG)

Definition at line 130 of file G4QParton.cc.

131{
132 PGGCode=PDG;
133 G4int aPDG=std::abs(PDG);
134 if(aPDG < 3304 && aPDG > 1100 && aPDG%100 < 4) // di-quark
135 {
136 theType=2;
137 G4int cPDG=aPDG/100;
138 if(PDG>0)
139 {
140 if (cPDG==11) QCont=G4QContent(2,0,0,0,0,0); // dd
141 else if(cPDG==21) QCont=G4QContent(1,1,0,0,0,0); // ud
142 else if(cPDG==22) QCont=G4QContent(0,2,0,0,0,0); // uu
143 else if(cPDG==31) QCont=G4QContent(1,0,1,0,0,0); // sd
144 else if(cPDG==32) QCont=G4QContent(0,1,1,0,0,0); // su
145 else if(cPDG==33) QCont=G4QContent(0,0,2,0,0,0); // ss
146 else
147 {
148 G4cerr<<"***G4QParton::SetPDGCode: bad di-quark PDG="<<PDG<<G4endl;
149 G4Exception("G4QParton::SetPDGCode:","72",FatalException,"Not SU(3) DiQuark");
150 }
151 }
152 else
153 {
154 if (cPDG==11) QCont=G4QContent(0,0,0,2,0,0); // anti-dd
155 else if(cPDG==21) QCont=G4QContent(0,0,0,1,1,0); // anti-ud
156 else if(cPDG==22) QCont=G4QContent(0,0,0,0,2,0); // anti-uu
157 else if(cPDG==31) QCont=G4QContent(0,0,0,1,0,1); // anti-sd
158 else if(cPDG==32) QCont=G4QContent(0,0,0,0,1,1); // anti-su
159 else if(cPDG==33) QCont=G4QContent(0,0,0,0,0,2); // anti-ss
160 else
161 {
162 G4cerr<<"***G4QParton::SetPDGCode: bad anti-di-quark PDG="<<PDG<<G4endl;
163 G4Exception("G4QParton::SetPDGCode:","72",FatalException,"Not SU(3) AntiDiQuark");
164 }
165 }
166 }
167 else if(aPDG && aPDG<4) // quark
168 {
169 theType=1;
170 if(PDG>0)
171 {
172 if (PDG==1) QCont=G4QContent(1,0,0,0,0,0); // d
173 else if(PDG==2) QCont=G4QContent(0,1,0,0,0,0); // u
174 else if(PDG==3) QCont=G4QContent(0,0,1,0,0,0); // s
175 else
176 {
177 G4cerr<<"***G4QParton::SetPDGCode: bad quark PDG="<<PDG<<G4endl;
178 G4Exception("G4QParton::SetPDGCode:","72",FatalException,"Not SU(3) Quark");
179 }
180 }
181 else
182 {
183 if (PDG==-1) QCont=G4QContent(0,0,0,1,0,0); // anti-d
184 else if(PDG==-2) QCont=G4QContent(0,0,0,0,1,0); // anti-u
185 else if(PDG==-3) QCont=G4QContent(0,0,0,0,0,1); // anti-s
186 else
187 {
188 G4cerr<<"***G4QParton::SetPDGCode: bad anti-quark PDG="<<PDG<<G4endl;
189 G4Exception("G4QParton::SetPDGCode:","72",FatalException,"Not SU(3) Anti-Quark");
190 }
191 }
192 }
193 else if(aPDG==9 || aPDG==21) // gluon
194 {
195 theType=0;
196 QCont=G4QContent(0,0,0,0,0,0);
197 }
198 else
199 {
200 G4cerr<<"***G4QParton::SetPDGCode: wrong gluon/quark/diquark PDG="<<PDG<<G4endl;
201 G4Exception("G4QParton::SetPDGCode:","72",FatalException,"WrongPartonPDG");
202 }
203#ifdef debug
204 G4cout<<"....G4QParton::SetPDGCode: PDG = "<<PDG<<", Type="<<theType<<G4endl;
205#endif
206 //
207 // colour by random in (1,2,3)=(R,G,B) for quarks and
208 // in (-1,-2,-3)=(Rbar,Gbar,Bbar) for anti-quarks:
209 G4int RGB=(G4int)(3*G4UniformRand())+1;
210 if(theType==1)
211 {
212 if(PDG>0) theColour = RGB;
213 else theColour =-RGB;
214 }
215 // colour by random in (-1,-2,-3)=(Rbar,Gbar,Bbar)=(GB,RB,RG) for di-quarks and
216 // in (1,2,3)=(R,G,B)=(GB,RB,RG) for anti-di-quarks:
217 else if(theType==2)
218 {
219 if(PDG>0) theColour =-RGB;
220 else theColour = RGB;
221 }
222 // ColourByRandom (-11,-12,-13,-21,...,-33)=(RRbar,RGbar,RBbar,...,BBbar) for gluons
223 else theColour = -(RGB*10 + (G4int)(3*G4UniformRand())+1);
224 //
225 // spin-z choosen at random from PDG-encoded spin:
226 //
227 G4double dPDGSpin=1.; // Quark 2S
228 if (theType==0) dPDGSpin=2.; // Gluon 2S
229 else if(theType==2) dPDGSpin=aPDG%10-1; // Di-quark 2S
230 theSpinZ = (G4int)((dPDGSpin+1)*G4UniformRand())-dPDGSpin/2;
231}
@ FatalException
G4DLLIMPORT std::ostream G4cerr
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Referenced by G4QFragmentation::Breeder(), G4QIonIonCollision::Breeder(), G4QString::FragmentString(), G4QFragmentation::G4QFragmentation(), G4QIonIonCollision::G4QIonIonCollision(), G4QParton(), and ReduceDiQADiQ().

◆ SetPosition()

void G4QParton::SetPosition ( const G4ThreeVector aPosition)
inline

Definition at line 76 of file G4QParton.hh.

76{thePosition=aPosition;}

Referenced by G4QHadron::SplitUp().

◆ SetSpinZ()

void G4QParton::SetSpinZ ( G4double  aSpinZ)
inline

Definition at line 77 of file G4QParton.hh.

77{theSpinZ = aSpinZ;}

Referenced by G4QHadron::SplitUp().

◆ SetX()

void G4QParton::SetX ( G4double  anX)
inline

Definition at line 74 of file G4QParton.hh.

74{theX = anX;}

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