Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4QContent.hh
Go to the documentation of this file.
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 //
27 // $Id$
28 //
29 // ---------------- G4QContent ----------------
30 // by Mikhail Kossov, Sept 1999.
31 // class header for Quasmon initiated Contents used by the CHIPS Model
32 // ----------------------------------------------------------------------
33 // Short description: This is the basic class of the CHIPS model. It
34 // describes the quark content of the Quasmon, which is a generalized
35 // hadronic state. All Quasmons are bags, characterized by the quark
36 // Content (QContent), but the spin is not fixed and only light (u,d,s)
37 // quarks are considered (SU(3)). The hadrons are the ground states for
38 // the corresponding quasmons. The Chipolino (G4QChipolino) or nuclear
39 // cluster are examples for another Quark Content.
40 // --------------------------------------------------------------------
41 // @@ In future total spin & c,b,t of the Hadron can be added @@ M.K.@@
42 // --------------------------------------------------------------------
43 
44 #ifndef G4QContent_h
45 #define G4QContent_h 1
46 
47 #include <iostream>
48 #include "globals.hh"
49 #include "Randomize.hh"
50 #include "G4QException.hh"
51 
53 {
54 public:
55  G4QContent(G4int d=0, G4int u=0, G4int s=0, G4int ad=0, G4int au=0, G4int as=0);
56  G4QContent(std::pair<G4int,G4int> PP); // Create HadronQC from two partons
57  G4QContent(const G4QContent& rhs); // Copy constructor by value
58  G4QContent(G4QContent* rhs); // Copy constructor by pointer
59 
60  ~G4QContent(); // Public Destructor
61 
62  // Overloaded operators
63  const G4QContent& operator=(const G4QContent& rhs);
64  G4bool operator==(const G4QContent& rhs) const;
65  G4bool operator!=(const G4QContent& rhs) const;
69  G4QContent operator+=(const G4QContent& rhs);
70  G4QContent operator-=(const G4QContent& rhs);
71  G4QContent operator*=(const G4int& rhs);
72 
73  // Selectors
74  G4int GetCharge() const;
75  G4int GetBaryonNumber() const;
76  G4int GetStrangeness() const;
77  G4int GetSPDGCode() const;
78  G4int GetZNSPDGCode() const;
79  G4int NOfCombinations(const G4QContent& rhs) const;//@@ can be an "operator/"
80  G4int GetQ() const;
81  G4int GetAQ() const;
82  G4int GetTot() const;
83  G4bool CheckNegative() const;
84 
85  G4int GetP() const; // A#of protons
86  G4int GetN() const; // A#of neutrons
87  G4int GetL() const; // A#of lambdas
88  G4int GetAP() const; // A#of anti-protons
89  G4int GetAN() const; // A#of anti-neutrons
90  G4int GetAL() const; // A#of anti-lambdas
91 
92  G4int GetD() const; // A#of d-quarks
93  G4int GetU() const; // A#of u-quarks
94  G4int GetS() const; // A#of s-quarks
95  G4int GetAD() const; // A#of anti-d-quarks
96  G4int GetAU() const; // A#of anti-u-quarks
97  G4int GetAS() const; // A#of anti-s-quarks
98 
99  G4int GetNetD() const; // A net#of d-quarks
100  G4int GetNetU() const; // A net#of u-quarks
101  G4int GetNetS() const; // A net#of s-quarks
102  G4int GetNetAD() const; // A net#of anti-d-quarks
103  G4int GetNetAU() const; // A net#of anti-u-quarks
104  G4int GetNetAS() const; // A net#of anti-s-quarks
105 
106  G4int GetDD() const; // A#of dd-di-quarks
107  G4int GetUU() const; // A#of uu-di-quarks
108  G4int GetSS() const; // A#of ss-di-quarks
109  G4int GetUD() const; // A#of ud-di-quarks
110  G4int GetDS() const; // A#of ds-di-quarks
111  G4int GetUS() const; // A#of us-di-quarks
112  G4int GetADAD() const; // A#of anti-dd-di-quarks
113  G4int GetAUAU() const; // A#of anti-uu-di-quarks
114  G4int GetASAS() const; // A#of anti-ss-di-quarks
115  G4int GetAUAD() const; // A#of anti-ud-di-quarks
116  G4int GetADAS() const; // A#of anti-ds-di-quarks
117  G4int GetAUAS() const; // A#of anti-us-di-quarks
118 
119  std::pair<G4int,G4int> MakePartonPair() const;// Make PDG's of PartonPairs for Mes&Baryon
120  G4int AddParton(G4int pPDG) const; // Add parton with pPDG to the hadron with this QC
121 
122  // Modifiers
123  void Anti();
124  G4QContent IndQ (G4int ind=0);
125  G4QContent IndAQ(G4int ind=0);
131 
132  void SetD (G4int n=0);
133  void SetU (G4int n=0);
134  void SetS (G4int n=0);
135  void SetAD(G4int n=0);
136  void SetAU(G4int n=0);
137  void SetAS(G4int n=0);
138 
139  void IncD (G4int n=1);
140  void IncU (G4int n=1);
141  void IncS (G4int n=1);
142  void IncAD(G4int n=1);
143  void IncAU(G4int n=1);
144  void IncAS(G4int n=1);
145  void IncQAQ(const G4int& nQAQ=1, const G4double& sProb = 1.);
146 
147  void DecD (G4int n=1);
148  void DecU (G4int n=1);
149  void DecS (G4int n=1);
150  void DecAD(G4int n=1);
151  void DecAU(G4int n=1);
152  void DecAS(G4int n=1);
153  G4int DecQAQ(const G4int& nQAQ=1);
154 
155 private:
156  G4QContent GetThis() const;
157 
158  // Body
159 private: // C S
160  G4int nD; // a#of d-quarks (-1/3)( 0)
161  G4int nU; // a#of u-quarks (+2/3)( 0)
162  G4int nS; // a#of s-quarks (-1/3)(+1)
163  G4int nAD; // a#of anti-d-quarks (+1/3)( 0)
164  G4int nAU; // a#of anti-u-quarks (-2/3)( 0)
165  G4int nAS; // a#of anti-s-quarks (+1/3)(-1)
166 };
167 
168 // Not member operators
169 std::ostream& operator<<(std::ostream& lhs, G4QContent& rhs);
170 std::ostream& operator<<(std::ostream& lhs, const G4QContent& rhs);
171 G4QContent operator+(const G4QContent& lhs, const G4QContent& rhs);
172 G4QContent operator-(const G4QContent& lhs, const G4QContent& rhs);
173 G4QContent operator*(const G4QContent& lhs, const G4int& rhs);
174 G4QContent operator*(const G4int& lhs, const G4QContent& rhs);
175 //G4int operator/(const G4QContent& lhs, const G4QContent& rhs); // Combinations
176 // Not member functions
177 //----------------------------------------------------------------------------------------
178 
179 inline G4bool G4QContent::operator==(const G4QContent& rhs) const {return this==&rhs;}
180 inline G4bool G4QContent::operator!=(const G4QContent& rhs) const {return this!=&rhs;}
181 inline G4int G4QContent::GetQ() const {return nU+nD+nS;}
182 inline G4int G4QContent::GetAQ() const {return nAU+nAD+nAS;}
183 inline G4int G4QContent::GetTot() const {return nU+nD+nS+nAU+nAD+nAS;}
184 inline G4int G4QContent::GetStrangeness() const {return nS-nAS;}
185 // @@ Temporary for tests
187  {return nU<0||nD<0||nS<0||nAU<0||nAD<0||nAS<0;}
188 
189 inline G4int G4QContent::GetU() const{return nU;}
190 inline G4int G4QContent::GetD() const{return nD;}
191 inline G4int G4QContent::GetS() const{return nS;}
192 inline G4int G4QContent::GetAU() const{return nAU;}
193 inline G4int G4QContent::GetAD() const{return nAD;}
194 inline G4int G4QContent::GetAS() const{return nAS;}
195 
196 inline G4int G4QContent::GetNetU() const{return nU-nAU;}
197 inline G4int G4QContent::GetNetD() const{return nD-nAD;}
198 inline G4int G4QContent::GetNetS() const{return nS-nAS;}
199 inline G4int G4QContent::GetNetAU() const{return nAU-nU;}
200 inline G4int G4QContent::GetNetAD() const{return nAD-nD;}
201 inline G4int G4QContent::GetNetAS() const{return nAS-nS;}
202 
203 inline G4int G4QContent::GetUU() const{return nU*(nU-1)/2;}
204 inline G4int G4QContent::GetDD() const{return nD*(nD-1)/2;}
205 inline G4int G4QContent::GetSS() const{return nS*(nS-1)/2;}
206 inline G4int G4QContent::GetUD() const{return nU*nD;}
207 inline G4int G4QContent::GetUS() const{return nU*nS;}
208 inline G4int G4QContent::GetDS() const{return nD*nS;}
209 inline G4int G4QContent::GetAUAU() const{return nAU*(nAU-1)/2;}
210 inline G4int G4QContent::GetADAD() const{return nAD*(nAD-1)/2;}
211 inline G4int G4QContent::GetASAS() const{return nAS*(nAS-1)/2;}
212 inline G4int G4QContent::GetAUAD() const{return nAU*nAD;}
213 inline G4int G4QContent::GetAUAS() const{return nAU*nAS;}
214 inline G4int G4QContent::GetADAS() const{return nAD*nAS;}
215 
216 // Convert particle to anti-particle
218 {
219  G4int kD=nD-nAD; // A net # of d quarks
220  G4int kU=nU-nAU; // A net # of u quarks
221  G4int kS=nS-nAS; // A net # of s quarks
222  // if(kD>=0&&kU>=0&&kS>=0&&kD+kU+kS>0) // => "Normal nucleus" case
223  //{
224  // G4int b=(kU+kD-kS-kS)/3;
225  // G4int d=kU-kD;
226  // G4int n=(b-d)/2;
227  // return 90000000+1000*(1000*kS+n+d)+n;
228  //}
229  //else if(kD<=0&&kU<=0&&kS<=0&&kD+kU+kS<0) // => "Normal anti-nucleus" case
230  //{
231  // G4int b=(kS+kS-kD-kU)/3;
232  // G4int d=kD-kU;
233  // G4int n=(b-d)/2;
234  // return -90000000-1000*(1000*kS+n+d)-n; // @@ double notation for anti-nuclei
235  //}
236  //else
237  //{
238  G4int b=(kU+kD-kS-kS)/3; // Baryon number-n*{LAMBDA=kS)
239  if(!b && !kS) return GetSPDGCode(); // Not a nucleus
240  G4int d=kU-kD; // Isotopic shift
241  G4int n=(b-d)/2; // A#of neutrons
242  return 90000000+1000*(1000*kS+n+d)+n;
243  //}
244  //return 0;
245 }
246 
247 // Convert particle to anti-particle
248 inline void G4QContent::Anti()
249 {
250  G4int r=nD;
251  nD = nAD;
252  nAD= r;
253  r = nU;
254  nU = nAU;
255  nAU= r;
256  r = nS;
257  nS = nAS;
258  nAS= r;
259 }
260 
261 // Add Quark Content
263 {
264  nD += rhs.nD;
265  nU += rhs.nU;
266  nS += rhs.nS;
267  nAD+= rhs.nAD;
268  nAU+= rhs.nAU;
269  nAS+= rhs.nAS;
270  return *this;
271 }
272 
273 // Add Quark Content
275 {
276  nD += rhs.nD;
277  nU += rhs.nU;
278  nS += rhs.nS;
279  nAD+= rhs.nAD;
280  nAU+= rhs.nAU;
281  nAS+= rhs.nAS;
282  return *this;
283 }
284 
285 // Multiply Quark Content by integer number
287 {
288  nU *= rhs;
289  nD *= rhs;
290  nS *= rhs;
291  nAU*= rhs;
292  nAD*= rhs;
293  nAS*= rhs;
294  return *this;
295 }
296 
297 // Multiply Quark Content by integer number
299 {
300  nU *= rhs;
301  nD *= rhs;
302  nS *= rhs;
303  nAU*= rhs;
304  nAD*= rhs;
305  nAS*= rhs;
306  return *this;
307 }
308 
309 inline void G4QContent::SetU(G4int n) {nU=n;}
310 inline void G4QContent::SetD(G4int n) {nD=n;}
311 inline void G4QContent::SetS(G4int n) {nS=n;}
312 inline void G4QContent::SetAU(G4int n){nAU=n;}
313 inline void G4QContent::SetAD(G4int n){nAD=n;}
314 inline void G4QContent::SetAS(G4int n){nAS=n;}
315 
316 inline void G4QContent::IncU(G4int n) {nU+=n;}
317 inline void G4QContent::IncD(G4int n) {nD+=n;}
318 inline void G4QContent::IncS(G4int n) {nS+=n;}
319 inline void G4QContent::IncAU(G4int n){nAU+=n;}
320 inline void G4QContent::IncAD(G4int n){nAD+=n;}
321 inline void G4QContent::IncAS(G4int n){nAS+=n;}
322 
323 inline void G4QContent::DecU(G4int n) {nU-=n;}
324 inline void G4QContent::DecD(G4int n) {nD-=n;}
325 inline void G4QContent::DecS(G4int n) {nS-=n;}
326 inline void G4QContent::DecAU(G4int n){nAU-=n;}
327 inline void G4QContent::DecAD(G4int n){nAD-=n;}
328 inline void G4QContent::DecAS(G4int n){nAS-=n;}
329 
330 // Private member functions
331 inline G4QContent G4QContent::GetThis()const{return G4QContent(nD,nU,nS,nAD,nAU,nAS);}
332 #endif