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
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifndef G4QContent_h
00045 #define G4QContent_h 1
00046
00047 #include <iostream>
00048 #include "globals.hh"
00049 #include "Randomize.hh"
00050 #include "G4QException.hh"
00051
00052 class G4QContent
00053 {
00054 public:
00055 G4QContent(G4int d=0, G4int u=0, G4int s=0, G4int ad=0, G4int au=0, G4int as=0);
00056 G4QContent(std::pair<G4int,G4int> PP);
00057 G4QContent(const G4QContent& rhs);
00058 G4QContent(G4QContent* rhs);
00059
00060 ~G4QContent();
00061
00062
00063 const G4QContent& operator=(const G4QContent& rhs);
00064 G4bool operator==(const G4QContent& rhs) const;
00065 G4bool operator!=(const G4QContent& rhs) const;
00066 G4QContent operator+=(G4QContent& rhs);
00067 G4QContent operator-=(G4QContent& rhs);
00068 G4QContent operator*=(G4int& rhs);
00069 G4QContent operator+=(const G4QContent& rhs);
00070 G4QContent operator-=(const G4QContent& rhs);
00071 G4QContent operator*=(const G4int& rhs);
00072
00073
00074 G4int GetCharge() const;
00075 G4int GetBaryonNumber() const;
00076 G4int GetStrangeness() const;
00077 G4int GetSPDGCode() const;
00078 G4int GetZNSPDGCode() const;
00079 G4int NOfCombinations(const G4QContent& rhs) const;
00080 G4int GetQ() const;
00081 G4int GetAQ() const;
00082 G4int GetTot() const;
00083 G4bool CheckNegative() const;
00084
00085 G4int GetP() const;
00086 G4int GetN() const;
00087 G4int GetL() const;
00088 G4int GetAP() const;
00089 G4int GetAN() const;
00090 G4int GetAL() const;
00091
00092 G4int GetD() const;
00093 G4int GetU() const;
00094 G4int GetS() const;
00095 G4int GetAD() const;
00096 G4int GetAU() const;
00097 G4int GetAS() const;
00098
00099 G4int GetNetD() const;
00100 G4int GetNetU() const;
00101 G4int GetNetS() const;
00102 G4int GetNetAD() const;
00103 G4int GetNetAU() const;
00104 G4int GetNetAS() const;
00105
00106 G4int GetDD() const;
00107 G4int GetUU() const;
00108 G4int GetSS() const;
00109 G4int GetUD() const;
00110 G4int GetDS() const;
00111 G4int GetUS() const;
00112 G4int GetADAD() const;
00113 G4int GetAUAU() const;
00114 G4int GetASAS() const;
00115 G4int GetAUAD() const;
00116 G4int GetADAS() const;
00117 G4int GetAUAS() const;
00118
00119 std::pair<G4int,G4int> MakePartonPair() const;
00120 G4int AddParton(G4int pPDG) const;
00121
00122
00123 void Anti();
00124 G4QContent IndQ (G4int ind=0);
00125 G4QContent IndAQ(G4int ind=0);
00126 G4QContent SplitChipo(G4double mQ);
00127 G4bool SubtractHadron(G4QContent h);
00128 G4bool SubtractPi0();
00129 G4bool SubtractPion();
00130 G4bool SubtractKaon(G4double mQ);
00131
00132 void SetD (G4int n=0);
00133 void SetU (G4int n=0);
00134 void SetS (G4int n=0);
00135 void SetAD(G4int n=0);
00136 void SetAU(G4int n=0);
00137 void SetAS(G4int n=0);
00138
00139 void IncD (G4int n=1);
00140 void IncU (G4int n=1);
00141 void IncS (G4int n=1);
00142 void IncAD(G4int n=1);
00143 void IncAU(G4int n=1);
00144 void IncAS(G4int n=1);
00145 void IncQAQ(const G4int& nQAQ=1, const G4double& sProb = 1.);
00146
00147 void DecD (G4int n=1);
00148 void DecU (G4int n=1);
00149 void DecS (G4int n=1);
00150 void DecAD(G4int n=1);
00151 void DecAU(G4int n=1);
00152 void DecAS(G4int n=1);
00153 G4int DecQAQ(const G4int& nQAQ=1);
00154
00155 private:
00156 G4QContent GetThis() const;
00157
00158
00159 private:
00160 G4int nD;
00161 G4int nU;
00162 G4int nS;
00163 G4int nAD;
00164 G4int nAU;
00165 G4int nAS;
00166 };
00167
00168
00169 std::ostream& operator<<(std::ostream& lhs, G4QContent& rhs);
00170 std::ostream& operator<<(std::ostream& lhs, const G4QContent& rhs);
00171 G4QContent operator+(const G4QContent& lhs, const G4QContent& rhs);
00172 G4QContent operator-(const G4QContent& lhs, const G4QContent& rhs);
00173 G4QContent operator*(const G4QContent& lhs, const G4int& rhs);
00174 G4QContent operator*(const G4int& lhs, const G4QContent& rhs);
00175
00176
00177
00178
00179 inline G4bool G4QContent::operator==(const G4QContent& rhs) const {return this==&rhs;}
00180 inline G4bool G4QContent::operator!=(const G4QContent& rhs) const {return this!=&rhs;}
00181 inline G4int G4QContent::GetQ() const {return nU+nD+nS;}
00182 inline G4int G4QContent::GetAQ() const {return nAU+nAD+nAS;}
00183 inline G4int G4QContent::GetTot() const {return nU+nD+nS+nAU+nAD+nAS;}
00184 inline G4int G4QContent::GetStrangeness() const {return nS-nAS;}
00185
00186 inline G4bool G4QContent::CheckNegative() const
00187 {return nU<0||nD<0||nS<0||nAU<0||nAD<0||nAS<0;}
00188
00189 inline G4int G4QContent::GetU() const{return nU;}
00190 inline G4int G4QContent::GetD() const{return nD;}
00191 inline G4int G4QContent::GetS() const{return nS;}
00192 inline G4int G4QContent::GetAU() const{return nAU;}
00193 inline G4int G4QContent::GetAD() const{return nAD;}
00194 inline G4int G4QContent::GetAS() const{return nAS;}
00195
00196 inline G4int G4QContent::GetNetU() const{return nU-nAU;}
00197 inline G4int G4QContent::GetNetD() const{return nD-nAD;}
00198 inline G4int G4QContent::GetNetS() const{return nS-nAS;}
00199 inline G4int G4QContent::GetNetAU() const{return nAU-nU;}
00200 inline G4int G4QContent::GetNetAD() const{return nAD-nD;}
00201 inline G4int G4QContent::GetNetAS() const{return nAS-nS;}
00202
00203 inline G4int G4QContent::GetUU() const{return nU*(nU-1)/2;}
00204 inline G4int G4QContent::GetDD() const{return nD*(nD-1)/2;}
00205 inline G4int G4QContent::GetSS() const{return nS*(nS-1)/2;}
00206 inline G4int G4QContent::GetUD() const{return nU*nD;}
00207 inline G4int G4QContent::GetUS() const{return nU*nS;}
00208 inline G4int G4QContent::GetDS() const{return nD*nS;}
00209 inline G4int G4QContent::GetAUAU() const{return nAU*(nAU-1)/2;}
00210 inline G4int G4QContent::GetADAD() const{return nAD*(nAD-1)/2;}
00211 inline G4int G4QContent::GetASAS() const{return nAS*(nAS-1)/2;}
00212 inline G4int G4QContent::GetAUAD() const{return nAU*nAD;}
00213 inline G4int G4QContent::GetAUAS() const{return nAU*nAS;}
00214 inline G4int G4QContent::GetADAS() const{return nAD*nAS;}
00215
00216
00217 inline G4int G4QContent::GetZNSPDGCode() const
00218 {
00219 G4int kD=nD-nAD;
00220 G4int kU=nU-nAU;
00221 G4int kS=nS-nAS;
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238 G4int b=(kU+kD-kS-kS)/3;
00239 if(!b && !kS) return GetSPDGCode();
00240 G4int d=kU-kD;
00241 G4int n=(b-d)/2;
00242 return 90000000+1000*(1000*kS+n+d)+n;
00243
00244
00245 }
00246
00247
00248 inline void G4QContent::Anti()
00249 {
00250 G4int r=nD;
00251 nD = nAD;
00252 nAD= r;
00253 r = nU;
00254 nU = nAU;
00255 nAU= r;
00256 r = nS;
00257 nS = nAS;
00258 nAS= r;
00259 }
00260
00261
00262 inline G4QContent G4QContent::operator+=(const G4QContent& rhs)
00263 {
00264 nD += rhs.nD;
00265 nU += rhs.nU;
00266 nS += rhs.nS;
00267 nAD+= rhs.nAD;
00268 nAU+= rhs.nAU;
00269 nAS+= rhs.nAS;
00270 return *this;
00271 }
00272
00273
00274 inline G4QContent G4QContent::operator+=(G4QContent& rhs)
00275 {
00276 nD += rhs.nD;
00277 nU += rhs.nU;
00278 nS += rhs.nS;
00279 nAD+= rhs.nAD;
00280 nAU+= rhs.nAU;
00281 nAS+= rhs.nAS;
00282 return *this;
00283 }
00284
00285
00286 inline G4QContent G4QContent::operator*=(const G4int& rhs)
00287 {
00288 nU *= rhs;
00289 nD *= rhs;
00290 nS *= rhs;
00291 nAU*= rhs;
00292 nAD*= rhs;
00293 nAS*= rhs;
00294 return *this;
00295 }
00296
00297
00298 inline G4QContent G4QContent::operator*=(G4int& rhs)
00299 {
00300 nU *= rhs;
00301 nD *= rhs;
00302 nS *= rhs;
00303 nAU*= rhs;
00304 nAD*= rhs;
00305 nAS*= rhs;
00306 return *this;
00307 }
00308
00309 inline void G4QContent::SetU(G4int n) {nU=n;}
00310 inline void G4QContent::SetD(G4int n) {nD=n;}
00311 inline void G4QContent::SetS(G4int n) {nS=n;}
00312 inline void G4QContent::SetAU(G4int n){nAU=n;}
00313 inline void G4QContent::SetAD(G4int n){nAD=n;}
00314 inline void G4QContent::SetAS(G4int n){nAS=n;}
00315
00316 inline void G4QContent::IncU(G4int n) {nU+=n;}
00317 inline void G4QContent::IncD(G4int n) {nD+=n;}
00318 inline void G4QContent::IncS(G4int n) {nS+=n;}
00319 inline void G4QContent::IncAU(G4int n){nAU+=n;}
00320 inline void G4QContent::IncAD(G4int n){nAD+=n;}
00321 inline void G4QContent::IncAS(G4int n){nAS+=n;}
00322
00323 inline void G4QContent::DecU(G4int n) {nU-=n;}
00324 inline void G4QContent::DecD(G4int n) {nD-=n;}
00325 inline void G4QContent::DecS(G4int n) {nS-=n;}
00326 inline void G4QContent::DecAU(G4int n){nAU-=n;}
00327 inline void G4QContent::DecAD(G4int n){nAD-=n;}
00328 inline void G4QContent::DecAS(G4int n){nAS-=n;}
00329
00330
00331 inline G4QContent G4QContent::GetThis()const{return G4QContent(nD,nU,nS,nAD,nAU,nAS);}
00332 #endif