[819] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
[1196] | 27 | // $Id: G4QContent.hh,v 1.31 2009/07/24 16:37:03 mkossov Exp $ |
---|
[1340] | 28 | // GEANT4 tag $Name: hadr-chips-V09-03-08 $ |
---|
[819] | 29 | // |
---|
| 30 | // ---------------- G4QContent ---------------- |
---|
| 31 | // by Mikhail Kossov, Sept 1999. |
---|
| 32 | // class header for Quasmon initiated Contents used by the CHIPS Model |
---|
| 33 | // ---------------------------------------------------------------------- |
---|
[1055] | 34 | // Short description: This is the basic class of the CHIPS model. It |
---|
| 35 | // describes the quark content of the Quasmon, which is a generalized |
---|
| 36 | // hadronic state. All Quasmons are bags, characterized by the quark |
---|
| 37 | // Content (QContent), but the spin is not fixed and only light (u,d,s) |
---|
| 38 | // quarks are considered (SU(3)). The hadrons are the ground states for |
---|
| 39 | // the corresponding quasmons. The Chipolino (G4QChipolino) or nuclear |
---|
| 40 | // cluster are examples for another Quark Content. |
---|
| 41 | // -------------------------------------------------------------------- |
---|
| 42 | // @@ In future total spin & c,b,t of the Hadron can be added @@ M.K.@@ |
---|
| 43 | // -------------------------------------------------------------------- |
---|
[819] | 44 | |
---|
| 45 | #ifndef G4QContent_h |
---|
| 46 | #define G4QContent_h 1 |
---|
| 47 | |
---|
| 48 | #include <iostream> |
---|
| 49 | #include "globals.hh" |
---|
| 50 | #include "Randomize.hh" |
---|
| 51 | #include "G4QException.hh" |
---|
| 52 | |
---|
| 53 | class G4QContent |
---|
| 54 | { |
---|
| 55 | public: |
---|
| 56 | G4QContent(G4int d=0, G4int u=0, G4int s=0, G4int ad=0, G4int au=0, G4int as=0); |
---|
[1196] | 57 | G4QContent(std::pair<G4int,G4int> PP); // Create HadronQC from two partons |
---|
[819] | 58 | G4QContent(const G4QContent& rhs); // Copy constructor by value |
---|
| 59 | G4QContent(G4QContent* rhs); // Copy constructor by pointer |
---|
| 60 | |
---|
| 61 | ~G4QContent(); // Public Destructor |
---|
| 62 | |
---|
| 63 | // Overloaded operators |
---|
| 64 | const G4QContent& operator=(const G4QContent& rhs); |
---|
| 65 | G4bool operator==(const G4QContent& rhs) const; |
---|
| 66 | G4bool operator!=(const G4QContent& rhs) const; |
---|
| 67 | G4QContent operator+=(G4QContent& rhs); |
---|
| 68 | G4QContent operator-=(G4QContent& rhs); |
---|
| 69 | G4QContent operator*=(G4int& rhs); |
---|
| 70 | G4QContent operator+=(const G4QContent& rhs); |
---|
| 71 | G4QContent operator-=(const G4QContent& rhs); |
---|
| 72 | G4QContent operator*=(const G4int& rhs); |
---|
| 73 | |
---|
| 74 | // Selectors |
---|
| 75 | G4int GetCharge() const; |
---|
| 76 | G4int GetBaryonNumber() const; |
---|
| 77 | G4int GetStrangeness() const; |
---|
| 78 | G4int GetSPDGCode() const; |
---|
| 79 | G4int GetZNSPDGCode() const; |
---|
| 80 | G4int NOfCombinations(const G4QContent& rhs) const;//@@ can be an "operator/" |
---|
| 81 | G4int GetQ() const; |
---|
| 82 | G4int GetAQ() const; |
---|
| 83 | G4int GetTot() const; |
---|
| 84 | G4bool CheckNegative() const; |
---|
| 85 | |
---|
| 86 | G4int GetP() const; // A#of protons |
---|
| 87 | G4int GetN() const; // A#of neutrons |
---|
| 88 | G4int GetL() const; // A#of lambdas |
---|
| 89 | G4int GetAP() const; // A#of anti-protons |
---|
| 90 | G4int GetAN() const; // A#of anti-neutrons |
---|
| 91 | G4int GetAL() const; // A#of anti-lambdas |
---|
| 92 | |
---|
| 93 | G4int GetD() const; // A#of d-quarks |
---|
| 94 | G4int GetU() const; // A#of u-quarks |
---|
| 95 | G4int GetS() const; // A#of s-quarks |
---|
| 96 | G4int GetAD() const; // A#of anti-d-quarks |
---|
| 97 | G4int GetAU() const; // A#of anti-u-quarks |
---|
| 98 | G4int GetAS() const; // A#of anti-s-quarks |
---|
| 99 | |
---|
| 100 | G4int GetNetD() const; // A net#of d-quarks |
---|
| 101 | G4int GetNetU() const; // A net#of u-quarks |
---|
| 102 | G4int GetNetS() const; // A net#of s-quarks |
---|
| 103 | G4int GetNetAD() const; // A net#of anti-d-quarks |
---|
| 104 | G4int GetNetAU() const; // A net#of anti-u-quarks |
---|
| 105 | G4int GetNetAS() const; // A net#of anti-s-quarks |
---|
| 106 | |
---|
| 107 | G4int GetDD() const; // A#of dd-di-quarks |
---|
| 108 | G4int GetUU() const; // A#of uu-di-quarks |
---|
| 109 | G4int GetSS() const; // A#of ss-di-quarks |
---|
| 110 | G4int GetUD() const; // A#of ud-di-quarks |
---|
| 111 | G4int GetDS() const; // A#of ds-di-quarks |
---|
| 112 | G4int GetUS() const; // A#of us-di-quarks |
---|
| 113 | G4int GetADAD() const; // A#of anti-dd-di-quarks |
---|
| 114 | G4int GetAUAU() const; // A#of anti-uu-di-quarks |
---|
| 115 | G4int GetASAS() const; // A#of anti-ss-di-quarks |
---|
| 116 | G4int GetAUAD() const; // A#of anti-ud-di-quarks |
---|
| 117 | G4int GetADAS() const; // A#of anti-ds-di-quarks |
---|
| 118 | G4int GetAUAS() const; // A#of anti-us-di-quarks |
---|
| 119 | |
---|
[1196] | 120 | std::pair<G4int,G4int> MakePartonPair() const;// Make PDG's of PartonPairs for Mes&Baryon |
---|
| 121 | G4int AddParton(G4int pPDG) const; // Add parton with pPDG to the hadron with this QC |
---|
| 122 | |
---|
[819] | 123 | // Modifiers |
---|
| 124 | void Anti(); |
---|
| 125 | G4QContent IndQ (G4int ind=0); |
---|
| 126 | G4QContent IndAQ(G4int ind=0); |
---|
| 127 | G4QContent SplitChipo(G4double mQ); |
---|
| 128 | G4bool SubtractHadron(G4QContent h); |
---|
| 129 | G4bool SubtractPi0(); |
---|
| 130 | G4bool SubtractPion(); |
---|
| 131 | G4bool SubtractKaon(G4double mQ); |
---|
| 132 | |
---|
| 133 | void SetD (G4int n=0); |
---|
| 134 | void SetU (G4int n=0); |
---|
| 135 | void SetS (G4int n=0); |
---|
| 136 | void SetAD(G4int n=0); |
---|
| 137 | void SetAU(G4int n=0); |
---|
| 138 | void SetAS(G4int n=0); |
---|
| 139 | |
---|
| 140 | void IncD (G4int n=1); |
---|
| 141 | void IncU (G4int n=1); |
---|
| 142 | void IncS (G4int n=1); |
---|
| 143 | void IncAD(G4int n=1); |
---|
| 144 | void IncAU(G4int n=1); |
---|
| 145 | void IncAS(G4int n=1); |
---|
| 146 | void IncQAQ(const G4int& nQAQ=1, const G4double& sProb = 1.); |
---|
| 147 | |
---|
| 148 | void DecD (G4int n=1); |
---|
| 149 | void DecU (G4int n=1); |
---|
| 150 | void DecS (G4int n=1); |
---|
| 151 | void DecAD(G4int n=1); |
---|
| 152 | void DecAU(G4int n=1); |
---|
| 153 | void DecAS(G4int n=1); |
---|
| 154 | G4int DecQAQ(const G4int& nQAQ=1); |
---|
| 155 | |
---|
| 156 | private: |
---|
| 157 | G4QContent GetThis() const; |
---|
| 158 | |
---|
| 159 | // Body |
---|
| 160 | private: // C S |
---|
| 161 | G4int nD; // a#of d-quarks (-1/3)( 0) |
---|
| 162 | G4int nU; // a#of u-quarks (+2/3)( 0) |
---|
| 163 | G4int nS; // a#of s-quarks (-1/3)(+1) |
---|
| 164 | G4int nAD; // a#of anti-d-quarks (+1/3)( 0) |
---|
| 165 | G4int nAU; // a#of anti-u-quarks (-2/3)( 0) |
---|
| 166 | G4int nAS; // a#of anti-s-quarks (+1/3)(-1) |
---|
| 167 | }; |
---|
| 168 | |
---|
| 169 | // Not member operators |
---|
| 170 | std::ostream& operator<<(std::ostream& lhs, G4QContent& rhs); |
---|
| 171 | std::ostream& operator<<(std::ostream& lhs, const G4QContent& rhs); |
---|
| 172 | G4QContent operator+(const G4QContent& lhs, const G4QContent& rhs); |
---|
| 173 | G4QContent operator-(const G4QContent& lhs, const G4QContent& rhs); |
---|
| 174 | G4QContent operator*(const G4QContent& lhs, const G4int& rhs); |
---|
| 175 | G4QContent operator*(const G4int& lhs, const G4QContent& rhs); |
---|
| 176 | //G4int operator/(const G4QContent& lhs, const G4QContent& rhs); // Combinations |
---|
| 177 | // Not member functions |
---|
| 178 | //---------------------------------------------------------------------------------------- |
---|
| 179 | |
---|
| 180 | inline G4bool G4QContent::operator==(const G4QContent& rhs) const {return this==&rhs;} |
---|
| 181 | inline G4bool G4QContent::operator!=(const G4QContent& rhs) const {return this!=&rhs;} |
---|
| 182 | inline G4int G4QContent::GetQ() const {return nU+nD+nS;} |
---|
| 183 | inline G4int G4QContent::GetAQ() const {return nAU+nAD+nAS;} |
---|
| 184 | inline G4int G4QContent::GetTot() const {return nU+nD+nS+nAU+nAD+nAS;} |
---|
| 185 | inline G4int G4QContent::GetStrangeness() const {return nS-nAS;} |
---|
| 186 | // @@ Temporary for tests |
---|
| 187 | inline G4bool G4QContent::CheckNegative() const |
---|
| 188 | {return nU<0||nD<0||nS<0||nAU<0||nAD<0||nAS<0;} |
---|
| 189 | |
---|
| 190 | inline G4int G4QContent::GetU() const{return nU;} |
---|
| 191 | inline G4int G4QContent::GetD() const{return nD;} |
---|
| 192 | inline G4int G4QContent::GetS() const{return nS;} |
---|
| 193 | inline G4int G4QContent::GetAU() const{return nAU;} |
---|
| 194 | inline G4int G4QContent::GetAD() const{return nAD;} |
---|
| 195 | inline G4int G4QContent::GetAS() const{return nAS;} |
---|
| 196 | |
---|
| 197 | inline G4int G4QContent::GetNetU() const{return nU-nAU;} |
---|
| 198 | inline G4int G4QContent::GetNetD() const{return nD-nAD;} |
---|
| 199 | inline G4int G4QContent::GetNetS() const{return nS-nAS;} |
---|
| 200 | inline G4int G4QContent::GetNetAU() const{return nAU-nU;} |
---|
| 201 | inline G4int G4QContent::GetNetAD() const{return nAD-nD;} |
---|
| 202 | inline G4int G4QContent::GetNetAS() const{return nAS-nS;} |
---|
| 203 | |
---|
| 204 | inline G4int G4QContent::GetUU() const{return nU*(nU-1)/2;} |
---|
| 205 | inline G4int G4QContent::GetDD() const{return nD*(nD-1)/2;} |
---|
| 206 | inline G4int G4QContent::GetSS() const{return nS*(nS-1)/2;} |
---|
| 207 | inline G4int G4QContent::GetUD() const{return nU*nD;} |
---|
| 208 | inline G4int G4QContent::GetUS() const{return nU*nS;} |
---|
| 209 | inline G4int G4QContent::GetDS() const{return nD*nS;} |
---|
| 210 | inline G4int G4QContent::GetAUAU() const{return nAU*(nAU-1)/2;} |
---|
| 211 | inline G4int G4QContent::GetADAD() const{return nAD*(nAD-1)/2;} |
---|
| 212 | inline G4int G4QContent::GetASAS() const{return nAS*(nAS-1)/2;} |
---|
| 213 | inline G4int G4QContent::GetAUAD() const{return nAU*nAD;} |
---|
| 214 | inline G4int G4QContent::GetAUAS() const{return nAU*nAS;} |
---|
| 215 | inline G4int G4QContent::GetADAS() const{return nAD*nAS;} |
---|
| 216 | |
---|
| 217 | // Convert particle to anti-particle |
---|
| 218 | inline G4int G4QContent::GetZNSPDGCode() const |
---|
| 219 | { |
---|
| 220 | G4int kD=nD-nAD; // A net # of d quarks |
---|
| 221 | G4int kU=nU-nAU; // A net # of u quarks |
---|
| 222 | G4int kS=nS-nAS; // A net # of s quarks |
---|
| 223 | // if(kD>=0&&kU>=0&&kS>=0&&kD+kU+kS>0) // => "Normal nucleus" case |
---|
| 224 | //{ |
---|
| 225 | // G4int b=(kU+kD-kS-kS)/3; |
---|
| 226 | // G4int d=kU-kD; |
---|
| 227 | // G4int n=(b-d)/2; |
---|
| 228 | // return 90000000+1000*(1000*kS+n+d)+n; |
---|
| 229 | //} |
---|
| 230 | //else if(kD<=0&&kU<=0&&kS<=0&&kD+kU+kS<0) // => "Normal anti-nucleus" case |
---|
| 231 | //{ |
---|
| 232 | // G4int b=(kS+kS-kD-kU)/3; |
---|
| 233 | // G4int d=kD-kU; |
---|
| 234 | // G4int n=(b-d)/2; |
---|
| 235 | // return -90000000-1000*(1000*kS+n+d)-n; // @@ double notation for anti-nuclei |
---|
| 236 | //} |
---|
| 237 | //else |
---|
| 238 | //{ |
---|
| 239 | G4int b=(kU+kD-kS-kS)/3; // Baryon number-n*{LAMBDA=kS) |
---|
| 240 | if(!b && !kS) return GetSPDGCode(); // Not a nucleus |
---|
| 241 | G4int d=kU-kD; // Isotopic shift |
---|
| 242 | G4int n=(b-d)/2; // A#of neutrons |
---|
| 243 | return 90000000+1000*(1000*kS+n+d)+n; |
---|
| 244 | //} |
---|
| 245 | //return 0; |
---|
| 246 | } |
---|
| 247 | |
---|
| 248 | // Convert particle to anti-particle |
---|
| 249 | inline void G4QContent::Anti() |
---|
| 250 | { |
---|
| 251 | G4int r=nD; |
---|
| 252 | nD = nAD; |
---|
| 253 | nAD= r; |
---|
| 254 | r = nU; |
---|
| 255 | nU = nAU; |
---|
| 256 | nAU= r; |
---|
| 257 | r = nS; |
---|
| 258 | nS = nAS; |
---|
| 259 | nAS= r; |
---|
| 260 | } |
---|
| 261 | |
---|
| 262 | // Add Quark Content |
---|
| 263 | inline G4QContent G4QContent::operator+=(const G4QContent& rhs) |
---|
| 264 | // ======================================================= |
---|
| 265 | { |
---|
| 266 | nD += rhs.nD; |
---|
| 267 | nU += rhs.nU; |
---|
| 268 | nS += rhs.nS; |
---|
| 269 | nAD+= rhs.nAD; |
---|
| 270 | nAU+= rhs.nAU; |
---|
| 271 | nAS+= rhs.nAS; |
---|
| 272 | return *this; |
---|
| 273 | } |
---|
| 274 | |
---|
| 275 | // Add Quark Content |
---|
| 276 | inline G4QContent G4QContent::operator+=(G4QContent& rhs) |
---|
| 277 | // ======================================================= |
---|
| 278 | { |
---|
| 279 | nD += rhs.nD; |
---|
| 280 | nU += rhs.nU; |
---|
| 281 | nS += rhs.nS; |
---|
| 282 | nAD+= rhs.nAD; |
---|
| 283 | nAU+= rhs.nAU; |
---|
| 284 | nAS+= rhs.nAS; |
---|
| 285 | return *this; |
---|
| 286 | } |
---|
| 287 | |
---|
| 288 | // Multiply Quark Content by integer number |
---|
| 289 | inline G4QContent G4QContent::operator*=(const G4int& rhs) |
---|
| 290 | // =================================================== |
---|
| 291 | { |
---|
| 292 | nU *= rhs; |
---|
| 293 | nD *= rhs; |
---|
| 294 | nS *= rhs; |
---|
| 295 | nAU*= rhs; |
---|
| 296 | nAD*= rhs; |
---|
| 297 | nAS*= rhs; |
---|
| 298 | return *this; |
---|
| 299 | } |
---|
| 300 | |
---|
| 301 | // Multiply Quark Content by integer number |
---|
| 302 | inline G4QContent G4QContent::operator*=(G4int& rhs) |
---|
| 303 | // =================================================== |
---|
| 304 | { |
---|
| 305 | nU *= rhs; |
---|
| 306 | nD *= rhs; |
---|
| 307 | nS *= rhs; |
---|
| 308 | nAU*= rhs; |
---|
| 309 | nAD*= rhs; |
---|
| 310 | nAS*= rhs; |
---|
| 311 | return *this; |
---|
| 312 | } |
---|
| 313 | |
---|
| 314 | inline void G4QContent::SetU(G4int n) {nU=n;} |
---|
| 315 | inline void G4QContent::SetD(G4int n) {nD=n;} |
---|
| 316 | inline void G4QContent::SetS(G4int n) {nS=n;} |
---|
| 317 | inline void G4QContent::SetAU(G4int n){nAU=n;} |
---|
| 318 | inline void G4QContent::SetAD(G4int n){nAD=n;} |
---|
| 319 | inline void G4QContent::SetAS(G4int n){nAS=n;} |
---|
| 320 | |
---|
| 321 | inline void G4QContent::IncU(G4int n) {nU+=n;} |
---|
| 322 | inline void G4QContent::IncD(G4int n) {nD+=n;} |
---|
| 323 | inline void G4QContent::IncS(G4int n) {nS+=n;} |
---|
| 324 | inline void G4QContent::IncAU(G4int n){nAU+=n;} |
---|
| 325 | inline void G4QContent::IncAD(G4int n){nAD+=n;} |
---|
| 326 | inline void G4QContent::IncAS(G4int n){nAS+=n;} |
---|
| 327 | |
---|
| 328 | inline void G4QContent::DecU(G4int n) {nU-=n;} |
---|
| 329 | inline void G4QContent::DecD(G4int n) {nD-=n;} |
---|
| 330 | inline void G4QContent::DecS(G4int n) {nS-=n;} |
---|
| 331 | inline void G4QContent::DecAU(G4int n){nAU-=n;} |
---|
| 332 | inline void G4QContent::DecAD(G4int n){nAD-=n;} |
---|
| 333 | inline void G4QContent::DecAS(G4int n){nAS-=n;} |
---|
| 334 | |
---|
| 335 | // Private member functions |
---|
| 336 | inline G4QContent G4QContent::GetThis()const{return G4QContent(nD,nU,nS,nAD,nAU,nAS);} |
---|
| 337 | #endif |
---|