G4QParton Class Reference

#include <G4QParton.hh>


Public Member Functions

 G4QParton ()
 G4QParton (G4int aPGG)
 G4QParton (const G4QParton &right)
 G4QParton (const G4QParton *right)
 ~G4QParton ()
const G4QParton & operator= (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 G4ThreeVector & GetPosition () const
const G4LorentzVector & Get4Momentum () const
G4double GetX ()
G4int GetColour ()
G4double GetSpinZ ()
const G4int & GetType () const


Detailed Description

Definition at line 52 of file G4QParton.hh.


Constructor & Destructor Documentation

G4QParton::G4QParton (  ) 

Definition at line 46 of file G4QParton.cc.

References G4cout, G4endl, and G4UniformRand.

00047 {
00048   // CHIPS is working only with u, d, and s quarks (SU(3)xSU(3)) (no gluons! M.K.)
00049   // Random Flavor/Colour/Spin definition for default constructor (with .3 s-suppresion)
00050   PGGCode=(G4int)(2.3*G4UniformRand())+1; //@@ Additional parameter of s/u (M.K.)
00051   theType=1;
00052 #ifdef debug
00053   G4cout<<"....G4QParton::DefConstructer: PDG = "<<PGGCode<<", Type="<<theType<<G4endl;
00054 #endif
00055   // random colour (1,2,3)=(R,G,B) for quarks and (-1,-2,-3)=(aR,aG,aB) for anti-quarks
00056   theColour = (G4int)(3*G4UniformRand())+1;
00057   if(theColour>3) theColour = 3;                   // Should never happend
00058   theSpinZ = (G4int)(2*G4UniformRand()) - 0.5;
00059   QCont = G4QContent(0,0,0,0,0,0);  
00060   // Default definition (initialization)
00061   theX = 0.;
00062   thePosition=G4ThreeVector(0.,0.,0.);
00063   theMomentum=G4LorentzVector(0.,0.,0.,0.);
00064 }

G4QParton::G4QParton ( G4int  aPGG  ) 

Definition at line 66 of file G4QParton.cc.

References SetPDGCode().

00067 {
00068   SetPDGCode(PDG);
00069   // Default definition (initialization)
00070   theX = 0.;
00071   thePosition=G4ThreeVector(0.,0.,0.);
00072   theMomentum=G4LorentzVector(0.,0.,0.,0.);
00073 }

G4QParton::G4QParton ( const G4QParton &  right  ) 

Definition at line 75 of file G4QParton.cc.

References G4cout, G4endl, PGGCode, QCont, theColour, theMomentum, thePosition, theSpinZ, theType, and theX.

00076 {
00077   PGGCode     = right.PGGCode;
00078   QCont       = right.QCont;
00079   theType     = right.theType;
00080   theMomentum = right.theMomentum;
00081   thePosition = right.thePosition;
00082   theX        = right.theX;
00083   theColour   = right.theColour;
00084   theSpinZ    = right.theSpinZ;
00085 #ifdef debug
00086   G4cout<<"G4QParton::RCopyConstructer: PDG="<<PGGCode<<", Col="<<theColour<<", Sz="
00087         <<theSpinZ<<G4endl;
00088 #endif
00089 }

G4QParton::G4QParton ( const G4QParton *  right  ) 

Definition at line 91 of file G4QParton.cc.

References G4cout, G4endl, PGGCode, QCont, theColour, theMomentum, thePosition, theSpinZ, theType, and theX.

00092 {
00093   PGGCode       = right->PGGCode;
00094   QCont         = right->QCont;
00095   theType       = right->theType;
00096   theMomentum   = right->theMomentum;
00097   thePosition   = right->thePosition;
00098   theX          = right->theX;
00099   theColour     = right->theColour;
00100   theSpinZ      = right->theSpinZ;
00101 #ifdef debug
00102   G4cout<<"G4QParton::PCopyConstructer: PDG="<<PGGCode<<", Col="<<theColour<<", Sz="
00103         <<theSpinZ<<G4endl;
00104 #endif
00105 }

G4QParton::~G4QParton (  ) 

Definition at line 127 of file G4QParton.cc.

00127 {}


Member Function Documentation

void G4QParton::DefineEPz ( G4LorentzVector  hadr4Mom  )  [inline]

Definition at line 70 of file G4QParton.hh.

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

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

Definition at line 234 of file G4QParton.cc.

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

00235 {
00236   G4LorentzVector a4Momentum = Get4Momentum();
00237   aLightConeMomentum*=theX;
00238   G4double TransverseMass2 = sqr(a4Momentum.px()) + sqr(a4Momentum.py());
00239   a4Momentum.setPz(0.5*(aLightConeMomentum - TransverseMass2/aLightConeMomentum) *
00240                                                                       (aDirection? 1: -1));
00241   a4Momentum.setE( 0.5*(aLightConeMomentum + TransverseMass2/aLightConeMomentum));
00242   Set4Momentum(a4Momentum);
00243 }  

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

Definition at line 84 of file G4QParton.hh.

Referenced by G4QIonIonCollision::Breeder(), G4QFragmentation::Breeder(), DefineMomentumInZ(), G4QString::ExciteString(), G4QString::FragmentString(), G4QFragmentation::G4QFragmentation(), G4QIonIonCollision::G4QIonIonCollision(), G4QString::G4QString(), operator=(), G4QString::Splitup(), G4QHadron::SplitUp(), G4QIonIonCollision::SwapPartons(), and G4QFragmentation::SwapPartons().

00084 {return theMomentum;} 

G4int G4QParton::GetColour (  )  [inline]

Definition at line 86 of file G4QParton.hh.

Referenced by G4QHadron::SplitUp().

00086 {return theColour;}    

G4int G4QParton::GetPDGCode (  )  const [inline]

Definition at line 81 of file G4QParton.hh.

Referenced by G4QIonIonCollision::Breeder(), G4QFragmentation::Breeder(), G4QString::CreateHadron(), G4QString::CreateHighSpinHadron(), G4QString::CreateLowSpinHadron(), G4QString::DiQuarkSplitup(), G4QString::ExciteString(), G4QString::FragmentationMass(), G4QString::FragmentString(), G4QFragmentation::G4QFragmentation(), G4QIonIonCollision::G4QIonIonCollision(), operator=(), G4QString::QuarkSplitup(), ReduceDiQADiQ(), G4QString::SplitEandP(), G4QString::Splitup(), G4QHadron::SplitUp(), G4QIonIonCollision::SwapPartons(), and G4QFragmentation::SwapPartons().

00081 {return PGGCode;}

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

Definition at line 83 of file G4QParton.hh.

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

00083 {return thePosition;}

G4QContent G4QParton::GetQC (  )  const [inline]

Definition at line 82 of file G4QParton.hh.

Referenced by G4QString::GetQC().

00082 {return QCont;}

G4double G4QParton::GetSpinZ (  )  [inline]

Definition at line 87 of file G4QParton.hh.

Referenced by G4QHadron::SplitUp().

00087 {return theSpinZ;}

const G4int& G4QParton::GetType ( void   )  const [inline]

Definition at line 88 of file G4QParton.hh.

Referenced by G4QIonIonCollision::Breeder(), G4QFragmentation::Breeder(), G4QString::CreateHadron(), G4QString::CreateHighSpinHadron(), G4QString::CreateLowSpinHadron(), G4QString::DecayIsQuark(), G4QString::FragmentationMass(), G4QFragmentation::G4QFragmentation(), G4QIonIonCollision::G4QIonIonCollision(), operator=(), G4QString::StableIsQuark(), G4QIonIonCollision::SwapPartons(), and G4QFragmentation::SwapPartons().

00088 {return theType;}

G4double G4QParton::GetX (  )  [inline]

Definition at line 85 of file G4QParton.hh.

00085 {return theX;}    

G4int G4QParton::operator!= ( const G4QParton &  right  )  const [inline]

Definition at line 67 of file G4QParton.hh.

00067 {return this!=&right;} 

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

Definition at line 107 of file G4QParton.cc.

References G4cout, G4endl, Get4Momentum(), GetPDGCode(), GetPosition(), GetType(), QCont, theColour, theSpinZ, and theX.

00108 {
00109   if(this != &right)                          // Beware of self assignment
00110   {
00111     PGGCode     = right.GetPDGCode();
00112     QCont       = right.QCont;
00113     theType     = right.GetType();
00114     theMomentum = right.Get4Momentum();
00115     thePosition = right.GetPosition();
00116     theX        = right.theX;
00117     theColour   = right.theColour;
00118     theSpinZ    = right.theSpinZ; 
00119 #ifdef debug
00120     G4cout<<"G4QParton::=Constructer: PDG="<<PGGCode<<", Col="<<theColour<<", Sz="
00121           <<theSpinZ<<G4endl;
00122 #endif
00123   }
00124   return *this;
00125 }

G4int G4QParton::operator== ( const G4QParton &  right  )  const [inline]

Definition at line 66 of file G4QParton.hh.

00066 {return this==&right;} 

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

Definition at line 246 of file G4QParton.cc.

References G4cout, G4endl, GetPDGCode(), and SetPDGCode().

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

00247 {
00248   G4bool result=false;
00249   G4int sPDG=d1->GetPDGCode();
00250   G4int nPDG=d2->GetPDGCode();
00251 #ifdef debug
00252   G4cout<<"G4QParton::ReduceDiQADiQ: **Called** LPDG="<<sPDG<<", RPDG="<<nPDG<<G4endl;
00253 #endif
00254   G4int        qPDG=sPDG;
00255   if(qPDG<-99) qPDG=(-qPDG)/100;
00256   else         qPDG/=100;
00257   G4int        dPDG=nPDG;
00258   if(dPDG<-99) dPDG=(-dPDG)/100;
00259   else         dPDG/=100;
00260   G4int L1=qPDG/10;
00261   G4int L2=qPDG%10;
00262   G4int R1=dPDG/10;
00263   G4int R2=dPDG%10;
00264   if(L1==R1 || L1==R2 || L2==R1 || L2==R2) // Annihilation condition
00265   {
00266     if     (L1==R1)
00267     {
00268       if(sPDG>0) sPDG=L2;
00269       else       sPDG=-L2;
00270       if(nPDG>0) nPDG=R2;
00271       else       nPDG=-R2;
00272 #ifdef debug
00273       G4cout<<"G4QParton::ReDiQADiQ:L2="<<L2<<",R2="<<R2<<",L="<<sPDG<<",R="<<nPDG<<G4endl;
00274 #endif
00275     }
00276     else if(L1==R2)
00277     {
00278       if(sPDG>0) sPDG=L2;
00279       else       sPDG=-L2;
00280       if(nPDG>0) nPDG=R1;
00281       else       nPDG=-R1;
00282 #ifdef debug
00283       G4cout<<"G4QParton::ReDiQADiQ:L2="<<L2<<",R1="<<R1<<",L="<<sPDG<<",R="<<nPDG<<G4endl;
00284 #endif
00285     }
00286     else if(L2==R1)
00287     {
00288       if(sPDG>0) sPDG=L1;
00289       else       sPDG=-L1;
00290       if(nPDG>0) nPDG=R2;
00291       else       nPDG=-R2;
00292 #ifdef debug
00293       G4cout<<"G4QParton::ReDiQADiQ:L1="<<L1<<",R2="<<R2<<",L="<<sPDG<<",R="<<nPDG<<G4endl;
00294 #endif
00295     }
00296     else //(L2==R2)
00297     {
00298       if(sPDG>0) sPDG=L1;
00299       else       sPDG=-L1;
00300       if(nPDG>0) nPDG=R1;
00301       else       nPDG=-R1;
00302 #ifdef debug
00303       G4cout<<"G4QParton::ReDiQADiQ:L1="<<L1<<",R1="<<R1<<",L="<<sPDG<<",R="<<nPDG<<G4endl;
00304 #endif
00305     }
00306     d1->SetPDGCode(sPDG);             // Reset the left quark
00307     d2->SetPDGCode(nPDG);            // Reset the right quark
00308     result=true;
00309 #ifdef debug
00310     G4cout<<"G4QParton::ReduceDiQADiQ:AfterReduction,L="<<sPDG<<",R="<<nPDG<<G4endl;
00311 #endif
00312   }
00313 #ifdef debug
00314   else G4cout<<"-Warning-G4QParton::ReduceDiQADiQ:DQ-aDQ reduction to Q-aQ Failed"<<G4endl;
00315 #endif
00316   return result;
00317 }

void G4QParton::Set4Momentum ( const G4LorentzVector &  aMomentum  )  [inline]

Definition at line 75 of file G4QParton.hh.

Referenced by G4QIonIonCollision::Breeder(), G4QFragmentation::Breeder(), DefineMomentumInZ(), G4QString::FragmentString(), G4QFragmentation::G4QFragmentation(), G4QIonIonCollision::G4QIonIonCollision(), G4QString::Splitup(), G4QHadron::SplitUp(), and G4QFragmentation::SwapPartons().

00075 {theMomentum=aMomentum;}

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

Definition at line 73 of file G4QParton.hh.

Referenced by G4QHadron::SplitUp().

00073 {theColour = aColour;}

void G4QParton::SetPDGCode ( G4int  aPDG  ) 

Definition at line 130 of file G4QParton.cc.

References FatalException, G4cerr, G4cout, G4endl, G4Exception(), and G4UniformRand.

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

00131 {
00132   PGGCode=PDG;
00133   G4int aPDG=std::abs(PDG);
00134   if(aPDG < 3304 && aPDG > 1100 && aPDG%100 < 4) // di-quark
00135   {
00136     theType=2;
00137     G4int cPDG=aPDG/100;
00138     if(PDG>0)
00139     {
00140       if     (cPDG==11) QCont=G4QContent(2,0,0,0,0,0);   // dd
00141       else if(cPDG==21) QCont=G4QContent(1,1,0,0,0,0);   // ud
00142       else if(cPDG==22) QCont=G4QContent(0,2,0,0,0,0);   // uu
00143       else if(cPDG==31) QCont=G4QContent(1,0,1,0,0,0);   // sd
00144       else if(cPDG==32) QCont=G4QContent(0,1,1,0,0,0);   // su
00145       else if(cPDG==33) QCont=G4QContent(0,0,2,0,0,0);   // ss
00146       else
00147       {
00148         G4cerr<<"***G4QParton::SetPDGCode: bad di-quark PDG="<<PDG<<G4endl;
00149         G4Exception("G4QParton::SetPDGCode:","72",FatalException,"Not SU(3) DiQuark");
00150       }
00151     }
00152     else
00153     {
00154       if     (cPDG==11) QCont=G4QContent(0,0,0,2,0,0);   // anti-dd
00155       else if(cPDG==21) QCont=G4QContent(0,0,0,1,1,0);   // anti-ud
00156       else if(cPDG==22) QCont=G4QContent(0,0,0,0,2,0);   // anti-uu
00157       else if(cPDG==31) QCont=G4QContent(0,0,0,1,0,1);   // anti-sd
00158       else if(cPDG==32) QCont=G4QContent(0,0,0,0,1,1);   // anti-su
00159       else if(cPDG==33) QCont=G4QContent(0,0,0,0,0,2);   // anti-ss
00160       else
00161       {
00162         G4cerr<<"***G4QParton::SetPDGCode: bad anti-di-quark PDG="<<PDG<<G4endl;
00163         G4Exception("G4QParton::SetPDGCode:","72",FatalException,"Not SU(3) AntiDiQuark");
00164       }
00165     }
00166   }
00167   else if(aPDG && aPDG<4)                        // quark
00168   {
00169     theType=1;
00170     if(PDG>0)
00171     {
00172       if     (PDG==1) QCont=G4QContent(1,0,0,0,0,0);   // d
00173       else if(PDG==2) QCont=G4QContent(0,1,0,0,0,0);   // u
00174       else if(PDG==3) QCont=G4QContent(0,0,1,0,0,0);   // s
00175       else
00176       {
00177         G4cerr<<"***G4QParton::SetPDGCode: bad quark PDG="<<PDG<<G4endl;
00178         G4Exception("G4QParton::SetPDGCode:","72",FatalException,"Not SU(3) Quark");
00179       }
00180     }
00181     else
00182     {
00183       if     (PDG==-1) QCont=G4QContent(0,0,0,1,0,0);  // anti-d
00184       else if(PDG==-2) QCont=G4QContent(0,0,0,0,1,0);  // anti-u
00185       else if(PDG==-3) QCont=G4QContent(0,0,0,0,0,1);  // anti-s
00186       else
00187       {
00188         G4cerr<<"***G4QParton::SetPDGCode: bad anti-quark PDG="<<PDG<<G4endl;
00189         G4Exception("G4QParton::SetPDGCode:","72",FatalException,"Not SU(3) Anti-Quark");
00190       }
00191     }
00192   }
00193   else if(aPDG==9 || aPDG==21)                   // gluon
00194   {
00195     theType=0;
00196     QCont=G4QContent(0,0,0,0,0,0);
00197   }
00198   else
00199   {
00200     G4cerr<<"***G4QParton::SetPDGCode: wrong gluon/quark/diquark PDG="<<PDG<<G4endl;
00201     G4Exception("G4QParton::SetPDGCode:","72",FatalException,"WrongPartonPDG");
00202   }
00203 #ifdef debug
00204   G4cout<<"....G4QParton::SetPDGCode: PDG = "<<PDG<<", Type="<<theType<<G4endl;
00205 #endif
00206   //
00207   // colour by random in (1,2,3)=(R,G,B) for quarks and 
00208   //                  in (-1,-2,-3)=(Rbar,Gbar,Bbar) for anti-quarks:
00209   G4int RGB=(G4int)(3*G4UniformRand())+1;
00210   if(theType==1)
00211   {
00212     if(PDG>0) theColour = RGB;
00213     else      theColour =-RGB;
00214   }
00215   // colour by random in (-1,-2,-3)=(Rbar,Gbar,Bbar)=(GB,RB,RG) for di-quarks and
00216   //                  in (1,2,3)=(R,G,B)=(GB,RB,RG) for anti-di-quarks:
00217   else if(theType==2)
00218   {
00219     if(PDG>0) theColour =-RGB;
00220     else      theColour = RGB;
00221   }
00222   // ColourByRandom (-11,-12,-13,-21,...,-33)=(RRbar,RGbar,RBbar,...,BBbar) for gluons
00223   else theColour = -(RGB*10 + (G4int)(3*G4UniformRand())+1);
00224   //
00225   // spin-z choosen at random from PDG-encoded spin:
00226   //
00227   G4double            dPDGSpin=1.;        // Quark 2S
00228   if     (theType==0) dPDGSpin=2.;        // Gluon 2S
00229   else if(theType==2) dPDGSpin=aPDG%10-1; // Di-quark 2S
00230   theSpinZ = (G4int)((dPDGSpin+1)*G4UniformRand())-dPDGSpin/2;
00231 }

void G4QParton::SetPosition ( const G4ThreeVector &  aPosition  )  [inline]

Definition at line 76 of file G4QParton.hh.

Referenced by G4QHadron::SplitUp().

00076 {thePosition=aPosition;}

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

Definition at line 77 of file G4QParton.hh.

Referenced by G4QHadron::SplitUp().

00077 {theSpinZ = aSpinZ;}

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

Definition at line 74 of file G4QParton.hh.

00074 {theX = anX;}


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