00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef G4QString_h
00031 #define G4QString_h 1
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #include "G4ios.hh"
00056 #include "globals.hh"
00057 #include "G4ThreeVector.hh"
00058 #include "G4LorentzVector.hh"
00059 #include "G4LorentzRotation.hh"
00060 #include "G4QHadronVector.hh"
00061 #include "G4QPartonPair.hh"
00062 #include "G4QPartonVector.hh"
00063 #include <algorithm>
00064
00065 class G4QString
00066 {
00067 public:
00068
00069 enum {PROJECTILE = 1, TARGET = -1};
00070
00071 G4QString();
00072 G4QString(G4QParton* Color,G4QParton* Gluon, G4QParton* AntiColor, G4int Dir=PROJECTILE);
00073 G4QString(G4QParton* Col, G4QParton* AntiCol, G4int Dir=PROJECTILE);
00074 G4QString(G4QPartonPair* ColAntiCol);
00075 G4QString(const G4QString &right);
00076 G4QString(const G4QString &old, G4QParton* newdecay, const G4LorentzVector *momentum);
00077 G4QString(const G4QString &old, G4QParton* newdecay);
00078 G4QString(G4QParton* newdecay, const G4LorentzVector* momentum);
00079
00080 ~G4QString();
00081
00082
00083 G4int operator==(const G4QString &right) const {return this == &right;}
00084 G4int operator!=(const G4QString &right) const {return this != &right;}
00085 const G4ThreeVector& GetPosition() const {return thePosition;}
00086 const G4QPartonVector* GetPartonList() const {return &thePartons;}
00087 G4QParton* GetLeftParton() const {return *thePartons.begin();}
00088 G4QParton* GetRightParton() const {return *(thePartons.end()-1);}
00089 G4int GetDirection() const {return theDirection;}
00090 G4LorentzVector Get4Momentum() const;
00091 G4QContent GetQC() const {return GetLeftParton()->GetQC()+GetRightParton()->GetQC();}
00092 G4int GetCharge() const {return GetQC().GetCharge();}
00093 G4int GetBaryonNumber() const {return GetQC().GetBaryonNumber();}
00094 G4int GetStrangeness() const {return GetQC().GetStrangeness();}
00095 G4int GetDecayDirection() const;
00096 G4bool DecayIsQuark() const {return theDecayParton->GetType()==1;}
00097 G4bool StableIsQuark() const {return theStableParton->GetType()==1;}
00098 G4ThreeVector DecayPt();
00099 G4double Mass2() const { return Pplus*Pminus-(Ptleft+Ptright).mag2();}
00100 G4double Mass() const
00101 {
00102 G4double mass2=Mass2();
00103 if(mass2>0) return std::sqrt(Mass2());
00104 else return 0.;
00105 }
00106 G4bool StopFragmentation()
00107 {
00108 G4LorentzVector mom(Ptleft+Ptright, 0.5*(Pplus+Pminus));
00109 mom.setPz(0.5*(Pplus-Pminus));
00110 return FragmentationMass(1) + MassCut > mom.mag();
00111 }
00112 G4bool IsFragmentable() {return FragmentationMass() + MassCut < Mass();}
00113 G4ThreeVector SampleQuarkPt();
00114 G4QHadron* CreateHadron(G4QParton* black, G4QParton* white);
00115 G4QHadron* CreateLowSpinHadron(G4QParton* black, G4QParton* white);
00116 G4QHadron* CreateHighSpinHadron(G4QParton* black, G4QParton* white);
00117
00118
00119 void SetPosition(const G4ThreeVector& aPosition){thePosition= aPosition;}
00120 void SetDirection(G4int dir) {if(dir==1 || dir==-1) theDirection=dir;}
00121 void SetLeftParton(G4QParton* LP) {thePartons[0]=LP;}
00122 void SetRightParton(G4QParton* RP) {thePartons.pop_back(); thePartons.push_back(RP);}
00123 void KillString() {theDirection=0;}
00124 void LorentzRotate(const G4LorentzRotation& rotation);
00125
00126 void Boost(G4ThreeVector& Velocity);
00127 G4LorentzRotation TransformToAlignedCms();
00128
00129 void ExciteString(G4QParton* Col,G4QParton* AntiCol, G4int Dir);
00130 G4QHadronVector* FragmentString(G4bool QL);
00131 G4QHadronVector* LightFragmentationTest();
00132 G4double FragmentationMass(G4int HighSpin = 0, G4QHadronPair* pdefs = 0);
00133 void SetLeftPartonStable();
00134 void SetRightPartonStable();
00135 G4QHadron* Splitup(G4bool QL);
00136 G4LorentzVector* SplitEandP(G4QHadron* pHadron, G4bool QL);
00137 G4QPartonPair CreatePartonPair(G4int NeedParticle, G4bool AllowDiquarks=true);
00138 G4QHadron* QuarkSplitup(G4QParton* decay, G4QParton* &created);
00139 G4QHadron* DiQuarkSplitup(G4QParton* decay, G4QParton* &created);
00140 G4int SampleQuarkFlavor() {return (1+G4int(G4UniformRand()/StrangeSuppress));}
00141
00142
00143 static void SetParameters(G4double mCut, G4double sigQT, G4double DQSup, G4double DQBU,
00144 G4double smPar, G4double SSup, G4double SigPt);
00145
00146 private:
00147 enum Spin {SpinZero=1, SpinHalf=2, SpinOne=3, SpinThreeHalf=4};
00148
00149 G4QHadron* CreateMeson(G4QParton* black, G4QParton* white, Spin spin);
00150 G4QHadron* CreateBaryon(G4QParton* black,G4QParton* white, Spin spin);
00151 G4ThreeVector GaussianPt(G4double widthSquare, G4double maxPtSquare) const;
00152 G4double GetLundLightConeZ(G4double zmin, G4double zmax, G4int PartonEncoding,
00153 G4QHadron* pHadron, G4double Px, G4double Py);
00154 G4double GetQGSMLightConeZ(G4double zmin, G4double zmax, G4int PartonEncoding,
00155 G4QHadron* pHadron, G4double Px, G4double Py);
00156
00157
00158
00159 static G4double MassCut;
00160 static G4double SigmaQT;
00161 static G4double DiquarkSuppress;
00162 static G4double DiquarkBreakProb;
00163 static G4double SmoothParam;
00164 static G4double StrangeSuppress;
00165 static G4double widthOfPtSquare;
00166
00167
00168 G4int theDirection;
00169 G4ThreeVector thePosition;
00170 G4QPartonVector thePartons;
00171 G4ThreeVector Ptleft,Ptright;
00172 G4double Pplus, Pminus;
00173 G4QParton* theStableParton;
00174 G4QParton* theDecayParton;
00175 enum DecaySide {None, Left, Right};
00176 DecaySide decaying;
00177 G4int SideOfDecay;
00178 };
00179
00180 #endif