Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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{
54public:
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;
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
155private:
156 G4QContent GetThis() const;
157
158 // Body
159private: // 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
169std::ostream& operator<<(std::ostream& lhs, G4QContent& rhs);
170std::ostream& operator<<(std::ostream& lhs, const G4QContent& rhs);
171G4QContent operator+(const G4QContent& lhs, const G4QContent& rhs);
172G4QContent operator-(const G4QContent& lhs, const G4QContent& rhs);
173G4QContent operator*(const G4QContent& lhs, const G4int& rhs);
174G4QContent operator*(const G4int& lhs, const G4QContent& rhs);
175//G4int operator/(const G4QContent& lhs, const G4QContent& rhs); // Combinations
176// Not member functions
177//----------------------------------------------------------------------------------------
178
179inline G4bool G4QContent::operator==(const G4QContent& rhs) const {return this==&rhs;}
180inline G4bool G4QContent::operator!=(const G4QContent& rhs) const {return this!=&rhs;}
181inline G4int G4QContent::GetQ() const {return nU+nD+nS;}
182inline G4int G4QContent::GetAQ() const {return nAU+nAD+nAS;}
183inline G4int G4QContent::GetTot() const {return nU+nD+nS+nAU+nAD+nAS;}
184inline 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
189inline G4int G4QContent::GetU() const{return nU;}
190inline G4int G4QContent::GetD() const{return nD;}
191inline G4int G4QContent::GetS() const{return nS;}
192inline G4int G4QContent::GetAU() const{return nAU;}
193inline G4int G4QContent::GetAD() const{return nAD;}
194inline G4int G4QContent::GetAS() const{return nAS;}
195
196inline G4int G4QContent::GetNetU() const{return nU-nAU;}
197inline G4int G4QContent::GetNetD() const{return nD-nAD;}
198inline G4int G4QContent::GetNetS() const{return nS-nAS;}
199inline G4int G4QContent::GetNetAU() const{return nAU-nU;}
200inline G4int G4QContent::GetNetAD() const{return nAD-nD;}
201inline G4int G4QContent::GetNetAS() const{return nAS-nS;}
202
203inline G4int G4QContent::GetUU() const{return nU*(nU-1)/2;}
204inline G4int G4QContent::GetDD() const{return nD*(nD-1)/2;}
205inline G4int G4QContent::GetSS() const{return nS*(nS-1)/2;}
206inline G4int G4QContent::GetUD() const{return nU*nD;}
207inline G4int G4QContent::GetUS() const{return nU*nS;}
208inline G4int G4QContent::GetDS() const{return nD*nS;}
209inline G4int G4QContent::GetAUAU() const{return nAU*(nAU-1)/2;}
210inline G4int G4QContent::GetADAD() const{return nAD*(nAD-1)/2;}
211inline G4int G4QContent::GetASAS() const{return nAS*(nAS-1)/2;}
212inline G4int G4QContent::GetAUAD() const{return nAU*nAD;}
213inline G4int G4QContent::GetAUAS() const{return nAU*nAS;}
214inline 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
248inline 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
309inline void G4QContent::SetU(G4int n) {nU=n;}
310inline void G4QContent::SetD(G4int n) {nD=n;}
311inline void G4QContent::SetS(G4int n) {nS=n;}
312inline void G4QContent::SetAU(G4int n){nAU=n;}
313inline void G4QContent::SetAD(G4int n){nAD=n;}
314inline void G4QContent::SetAS(G4int n){nAS=n;}
315
316inline void G4QContent::IncU(G4int n) {nU+=n;}
317inline void G4QContent::IncD(G4int n) {nD+=n;}
318inline void G4QContent::IncS(G4int n) {nS+=n;}
319inline void G4QContent::IncAU(G4int n){nAU+=n;}
320inline void G4QContent::IncAD(G4int n){nAD+=n;}
321inline void G4QContent::IncAS(G4int n){nAS+=n;}
322
323inline void G4QContent::DecU(G4int n) {nU-=n;}
324inline void G4QContent::DecD(G4int n) {nD-=n;}
325inline void G4QContent::DecS(G4int n) {nS-=n;}
326inline void G4QContent::DecAU(G4int n){nAU-=n;}
327inline void G4QContent::DecAD(G4int n){nAD-=n;}
328inline void G4QContent::DecAS(G4int n){nAS-=n;}
329
330// Private member functions
331inline G4QContent G4QContent::GetThis()const{return G4QContent(nD,nU,nS,nAD,nAU,nAS);}
332#endif
G4QContent operator-(const G4QContent &lhs, const G4QContent &rhs)
Definition: G4QContent.cc:517
G4QContent operator*(const G4QContent &lhs, const G4int &rhs)
Definition: G4QContent.cc:524
std::ostream & operator<<(std::ostream &lhs, G4QContent &rhs)
Definition: G4QContent.cc:253
G4QContent operator+(const G4QContent &lhs, const G4QContent &rhs)
Definition: G4QContent.cc:510
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
G4int GetNetAU() const
Definition: G4QContent.hh:199
G4int GetAD() const
Definition: G4QContent.hh:193
G4int GetCharge() const
Definition: G4QContent.cc:1159
G4QContent operator*=(G4int &rhs)
Definition: G4QContent.hh:298
G4int GetUS() const
Definition: G4QContent.hh:207
G4int GetUD() const
Definition: G4QContent.hh:206
G4QContent operator-=(G4QContent &rhs)
Definition: G4QContent.cc:391
void IncAS(G4int n=1)
Definition: G4QContent.hh:321
G4int GetAUAU() const
Definition: G4QContent.hh:209
G4int DecQAQ(const G4int &nQAQ=1)
Definition: G4QContent.cc:904
void DecAS(G4int n=1)
Definition: G4QContent.hh:328
G4int GetNetU() const
Definition: G4QContent.hh:196
G4int GetNetS() const
Definition: G4QContent.hh:198
G4int GetAUAS() const
Definition: G4QContent.hh:213
G4int GetL() const
Definition: G4QContent.cc:1123
G4int GetNetAS() const
Definition: G4QContent.hh:201
void SetS(G4int n=0)
Definition: G4QContent.hh:311
G4int GetN() const
Definition: G4QContent.cc:1112
G4int GetNetD() const
Definition: G4QContent.hh:197
G4int GetBaryonNumber() const
Definition: G4QContent.cc:1182
G4bool SubtractPi0()
Definition: G4QContent.cc:541
G4int GetStrangeness() const
Definition: G4QContent.hh:184
G4int GetADAD() const
Definition: G4QContent.hh:210
G4bool operator!=(const G4QContent &rhs) const
Definition: G4QContent.hh:180
void IncAD(G4int n=1)
Definition: G4QContent.hh:320
G4int GetAP() const
Definition: G4QContent.cc:1130
G4int GetAUAD() const
Definition: G4QContent.hh:212
G4int GetU() const
Definition: G4QContent.hh:189
G4int GetAN() const
Definition: G4QContent.cc:1141
G4int GetUU() const
Definition: G4QContent.hh:203
G4int GetS() const
Definition: G4QContent.hh:191
G4int GetSPDGCode() const
Definition: G4QContent.cc:1204
G4bool operator==(const G4QContent &rhs) const
Definition: G4QContent.hh:179
G4QContent IndQ(G4int ind=0)
Definition: G4QContent.cc:872
void SetAU(G4int n=0)
Definition: G4QContent.hh:312
G4int GetNetAD() const
Definition: G4QContent.hh:200
G4int GetSS() const
Definition: G4QContent.hh:205
void IncQAQ(const G4int &nQAQ=1, const G4double &sProb=1.)
Definition: G4QContent.cc:1036
G4int GetDD() const
Definition: G4QContent.hh:204
void SetAS(G4int n=0)
Definition: G4QContent.hh:314
G4int GetZNSPDGCode() const
Definition: G4QContent.hh:217
G4bool SubtractKaon(G4double mQ)
Definition: G4QContent.cc:604
void IncS(G4int n=1)
Definition: G4QContent.hh:318
G4int GetQ() const
Definition: G4QContent.hh:181
G4int GetAL() const
Definition: G4QContent.cc:1152
G4bool CheckNegative() const
Definition: G4QContent.hh:186
G4int NOfCombinations(const G4QContent &rhs) const
Definition: G4QContent.cc:1474
void DecAU(G4int n=1)
Definition: G4QContent.hh:326
G4int GetAS() const
Definition: G4QContent.hh:194
void DecS(G4int n=1)
Definition: G4QContent.hh:325
G4bool SubtractPion()
Definition: G4QContent.cc:567
void SetAD(G4int n=0)
Definition: G4QContent.hh:313
void IncD(G4int n=1)
Definition: G4QContent.hh:317
void SetD(G4int n=0)
Definition: G4QContent.hh:310
G4int GetD() const
Definition: G4QContent.hh:190
G4int GetAQ() const
Definition: G4QContent.hh:182
G4QContent IndAQ(G4int ind=0)
Definition: G4QContent.cc:888
G4QContent SplitChipo(G4double mQ)
Definition: G4QContent.cc:636
G4int GetTot() const
Definition: G4QContent.hh:183
void Anti()
Definition: G4QContent.hh:248
G4QContent operator+=(G4QContent &rhs)
Definition: G4QContent.hh:274
void SetU(G4int n=0)
Definition: G4QContent.hh:309
void IncAU(G4int n=1)
Definition: G4QContent.hh:319
G4int GetASAS() const
Definition: G4QContent.hh:211
void DecAD(G4int n=1)
Definition: G4QContent.hh:327
G4int GetDS() const
Definition: G4QContent.hh:208
G4int GetADAS() const
Definition: G4QContent.hh:214
G4int GetAU() const
Definition: G4QContent.hh:192
G4int AddParton(G4int pPDG) const
Definition: G4QContent.cc:1655
std::pair< G4int, G4int > MakePartonPair() const
Definition: G4QContent.cc:1561
const G4QContent & operator=(const G4QContent &rhs)
Definition: G4QContent.cc:238
G4bool SubtractHadron(G4QContent h)
Definition: G4QContent.cc:593
void IncU(G4int n=1)
Definition: G4QContent.hh:316
void DecU(G4int n=1)
Definition: G4QContent.hh:323
void DecD(G4int n=1)
Definition: G4QContent.hh:324
G4int GetP() const
Definition: G4QContent.cc:1101