source: trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/include/G4QContent.hh @ 1055

Last change on this file since 1055 was 1055, checked in by garnier, 15 years ago

maj sur la beta de geant 4.9.3

File size: 12.6 KB
Line 
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: G4QContent.hh,v 1.29 2009/02/23 09:49:24 mkossov Exp $
28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
29//
30//      ---------------- G4QContent ----------------
31//             by Mikhail Kossov, Sept 1999.
32//  class header for Quasmon initiated Contents used by the CHIPS Model
33// ----------------------------------------------------------------------
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// --------------------------------------------------------------------
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
53class G4QContent
54{
55public:
56  G4QContent(G4int d=0, G4int u=0, G4int s=0, G4int ad=0, G4int au=0, G4int as=0);
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;
66  G4QContent        operator+=(G4QContent& rhs);
67  G4QContent        operator-=(G4QContent& rhs);
68  G4QContent        operator*=(G4int& rhs);
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  // Modifiers
120  void              Anti();
121  G4QContent        IndQ (G4int ind=0);
122  G4QContent        IndAQ(G4int ind=0);
123  G4QContent        SplitChipo(G4double mQ);
124  G4bool            SubtractHadron(G4QContent h);
125  G4bool            SubtractPi0();
126  G4bool            SubtractPion();
127  G4bool            SubtractKaon(G4double mQ);
128
129  void SetD (G4int n=0);
130  void SetU (G4int n=0);
131  void SetS (G4int n=0);
132  void SetAD(G4int n=0);
133  void SetAU(G4int n=0);
134  void SetAS(G4int n=0);
135
136  void IncD (G4int n=1);
137  void IncU (G4int n=1);
138  void IncS (G4int n=1);
139  void IncAD(G4int n=1);
140  void IncAU(G4int n=1);
141  void IncAS(G4int n=1);
142  void IncQAQ(const G4int& nQAQ=1, const G4double& sProb = 1.);
143
144  void DecD (G4int n=1);
145  void DecU (G4int n=1);
146  void DecS (G4int n=1);
147  void DecAD(G4int n=1);
148  void DecAU(G4int n=1);
149  void DecAS(G4int n=1);
150  G4int DecQAQ(const G4int& nQAQ=1);
151
152private:
153  G4QContent        GetThis() const;
154
155  // Body
156private:            //                       C    S
157  G4int nD;         // a#of      d-quarks (-1/3)( 0)
158  G4int nU;         // a#of      u-quarks (+2/3)( 0)
159  G4int nS;         // a#of      s-quarks (-1/3)(+1)
160  G4int nAD;        // a#of anti-d-quarks (+1/3)( 0)
161  G4int nAU;        // a#of anti-u-quarks (-2/3)( 0)
162  G4int nAS;        // a#of anti-s-quarks (+1/3)(-1)
163};
164
165// Not member operators
166std::ostream&   operator<<(std::ostream& lhs, G4QContent& rhs);
167std::ostream&   operator<<(std::ostream& lhs, const G4QContent& rhs);
168G4QContent operator+(const G4QContent& lhs, const G4QContent& rhs);
169G4QContent operator-(const G4QContent& lhs, const G4QContent& rhs);
170G4QContent operator*(const G4QContent& lhs, const G4int&      rhs);
171G4QContent operator*(const G4int&      lhs, const G4QContent& rhs);
172//G4int      operator/(const G4QContent& lhs, const G4QContent& rhs); // Combinations
173// Not member functions
174//----------------------------------------------------------------------------------------
175
176inline G4bool     G4QContent::operator==(const G4QContent& rhs) const {return this==&rhs;}
177inline G4bool     G4QContent::operator!=(const G4QContent& rhs) const {return this!=&rhs;}
178inline G4int      G4QContent::GetQ() const {return nU+nD+nS;}
179inline G4int      G4QContent::GetAQ() const {return nAU+nAD+nAS;}
180inline G4int      G4QContent::GetTot() const {return nU+nD+nS+nAU+nAD+nAS;}
181inline G4int      G4QContent::GetStrangeness() const {return nS-nAS;}
182// @@ Temporary for tests
183inline G4bool G4QContent::CheckNegative() const
184                                            {return nU<0||nD<0||nS<0||nAU<0||nAD<0||nAS<0;}
185
186inline G4int G4QContent::GetU() const{return nU;}
187inline G4int G4QContent::GetD() const{return nD;}
188inline G4int G4QContent::GetS() const{return nS;}
189inline G4int G4QContent::GetAU() const{return nAU;}
190inline G4int G4QContent::GetAD() const{return nAD;}
191inline G4int G4QContent::GetAS() const{return nAS;}
192
193inline G4int G4QContent::GetNetU() const{return nU-nAU;}
194inline G4int G4QContent::GetNetD() const{return nD-nAD;}
195inline G4int G4QContent::GetNetS() const{return nS-nAS;}
196inline G4int G4QContent::GetNetAU() const{return nAU-nU;}
197inline G4int G4QContent::GetNetAD() const{return nAD-nD;}
198inline G4int G4QContent::GetNetAS() const{return nAS-nS;}
199
200inline G4int G4QContent::GetUU() const{return nU*(nU-1)/2;}
201inline G4int G4QContent::GetDD() const{return nD*(nD-1)/2;}
202inline G4int G4QContent::GetSS() const{return nS*(nS-1)/2;}
203inline G4int G4QContent::GetUD() const{return nU*nD;}
204inline G4int G4QContent::GetUS() const{return nU*nS;}
205inline G4int G4QContent::GetDS() const{return nD*nS;}
206inline G4int G4QContent::GetAUAU() const{return nAU*(nAU-1)/2;}
207inline G4int G4QContent::GetADAD() const{return nAD*(nAD-1)/2;}
208inline G4int G4QContent::GetASAS() const{return nAS*(nAS-1)/2;}
209inline G4int G4QContent::GetAUAD() const{return nAU*nAD;}
210inline G4int G4QContent::GetAUAS() const{return nAU*nAS;}
211inline G4int G4QContent::GetADAS() const{return nAD*nAS;}
212
213// Convert particle to anti-particle
214inline G4int G4QContent::GetZNSPDGCode() const
215{
216  G4int kD=nD-nAD;                           // A net # of d quarks
217  G4int kU=nU-nAU;                           // A net # of u quarks
218  G4int kS=nS-nAS;                           // A net # of s quarks
219  // if(kD>=0&&kU>=0&&kS>=0&&kD+kU+kS>0)        // => "Normal nucleus" case
220  //{
221  //  G4int b=(kU+kD-kS-kS)/3;
222  //  G4int d=kU-kD;
223  //  G4int n=(b-d)/2;
224  //  return 90000000+1000*(1000*kS+n+d)+n;
225  //}
226  //else if(kD<=0&&kU<=0&&kS<=0&&kD+kU+kS<0)   // => "Normal anti-nucleus" case
227  //{
228  //  G4int b=(kS+kS-kD-kU)/3;
229  //  G4int d=kD-kU;
230  //  G4int n=(b-d)/2;
231  //  return -90000000-1000*(1000*kS+n+d)-n;   // @@ double notation for anti-nuclei
232  //}
233  //else
234  //{
235    G4int b=(kU+kD-kS-kS)/3;                 // Baryon number-n*{LAMBDA=kS)
236    if(!b && !kS) return GetSPDGCode();      // Not a nucleus
237    G4int d=kU-kD;                           // Isotopic shift
238    G4int n=(b-d)/2;                         // A#of neutrons
239    return 90000000+1000*(1000*kS+n+d)+n;
240  //}
241  //return 0;
242}
243
244// Convert particle to anti-particle
245inline void G4QContent::Anti()
246{
247  G4int r=nD;
248  nD = nAD;
249  nAD= r;
250  r  = nU;
251  nU = nAU;
252  nAU= r;
253  r  = nS;
254  nS = nAS;
255  nAS= r;
256}
257
258// Add Quark Content
259inline G4QContent G4QContent::operator+=(const G4QContent& rhs)
260//     =======================================================
261{
262  nD += rhs.nD;
263  nU += rhs.nU;
264  nS += rhs.nS;
265  nAD+= rhs.nAD;
266  nAU+= rhs.nAU;
267  nAS+= rhs.nAS;
268  return *this;
269} 
270
271// Add Quark Content
272inline G4QContent G4QContent::operator+=(G4QContent& rhs)
273//     =======================================================
274{
275  nD += rhs.nD;
276  nU += rhs.nU;
277  nS += rhs.nS;
278  nAD+= rhs.nAD;
279  nAU+= rhs.nAU;
280  nAS+= rhs.nAS;
281  return *this;
282} 
283
284// Multiply Quark Content by integer number
285inline G4QContent G4QContent::operator*=(const G4int& rhs)
286//     ===================================================
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
298inline G4QContent G4QContent::operator*=(G4int& rhs)
299//     ===================================================
300{
301  nU *= rhs;
302  nD *= rhs;
303  nS *= rhs;
304  nAU*= rhs;
305  nAD*= rhs;
306  nAS*= rhs;
307  return *this;
308} 
309
310inline void  G4QContent::SetU(G4int n) {nU=n;}
311inline void  G4QContent::SetD(G4int n) {nD=n;}
312inline void  G4QContent::SetS(G4int n) {nS=n;}
313inline void  G4QContent::SetAU(G4int n){nAU=n;}
314inline void  G4QContent::SetAD(G4int n){nAD=n;}
315inline void  G4QContent::SetAS(G4int n){nAS=n;}
316
317inline void  G4QContent::IncU(G4int n) {nU+=n;}
318inline void  G4QContent::IncD(G4int n) {nD+=n;}
319inline void  G4QContent::IncS(G4int n) {nS+=n;}
320inline void  G4QContent::IncAU(G4int n){nAU+=n;}
321inline void  G4QContent::IncAD(G4int n){nAD+=n;}
322inline void  G4QContent::IncAS(G4int n){nAS+=n;}
323
324inline void  G4QContent::DecU(G4int n) {nU-=n;}
325inline void  G4QContent::DecD(G4int n) {nD-=n;}
326inline void  G4QContent::DecS(G4int n) {nS-=n;}
327inline void  G4QContent::DecAU(G4int n){nAU-=n;}
328inline void  G4QContent::DecAD(G4int n){nAD-=n;}
329inline void  G4QContent::DecAS(G4int n){nAS-=n;}
330
331// Private member functions
332inline G4QContent G4QContent::GetThis()const{return G4QContent(nD,nU,nS,nAD,nAU,nAS);}
333#endif
Note: See TracBrowser for help on using the repository browser.