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: G4QParticle.hh,v 1.25 2009/02/23 09:49:24 mkossov Exp $ |
---|
28 | // GEANT4 tag $Name: hadr-chips-V09-03-08 $ |
---|
29 | // |
---|
30 | // ---------------- G4QParticle ---------------- |
---|
31 | // by Mikhail Kossov, Sept 1999. |
---|
32 | // class header for Particles in the CHIPS Model |
---|
33 | // --------------------------------------------------- |
---|
34 | // Short description: The G4QParticle is a part of the CHIPS World. It is |
---|
35 | // characterized by the quark content, spin, mass, width and a vector of |
---|
36 | // the decay channels (G4QDecayCannelVector). |
---|
37 | // ----------------------------------------------------------------------- |
---|
38 | |
---|
39 | #ifndef G4QParticle_h |
---|
40 | #define G4QParticle_h 1 |
---|
41 | |
---|
42 | #include <iostream> |
---|
43 | #include "globals.hh" |
---|
44 | #include "G4QDecayChanVector.hh" |
---|
45 | |
---|
46 | class G4QParticle |
---|
47 | { |
---|
48 | public: |
---|
49 | // Constructors |
---|
50 | G4QParticle(); // Default Constructor |
---|
51 | G4QParticle(G4bool f, G4int theQCode); // QCode Constructor, f-verbose |
---|
52 | G4QParticle(G4int thePDG); // PDGCode Constructor |
---|
53 | G4QParticle(const G4QParticle& right); // Copy Constructor by value |
---|
54 | G4QParticle(G4QParticle* right); // Copy Constructor by pointer |
---|
55 | |
---|
56 | ~G4QParticle(); // Public Destructor |
---|
57 | |
---|
58 | // Operators |
---|
59 | const G4QParticle& operator=(const G4QParticle& right); |
---|
60 | G4bool operator==(const G4QParticle& rhs) const; |
---|
61 | G4bool operator!=(const G4QParticle& rhs) const; |
---|
62 | |
---|
63 | // Selectors |
---|
64 | G4QPDGCode GetQPDG() const; // Get a PDG-Particle of the Particle |
---|
65 | G4int GetPDGCode() const; // Get a PDG Code of the Particle |
---|
66 | G4int GetQCode() const; // Get a Q Code of the Particle |
---|
67 | G4int GetSpin() const; // Get 2s+1 of the Particle |
---|
68 | G4int GetCharge() const; // Get a Charge of the Particle |
---|
69 | G4int GetStrange() const; // Get a Strangeness of the Particle |
---|
70 | G4int GetBaryNum() const; // Get a Baryon Number of the Particle |
---|
71 | G4QContent GetQContent(); // Get Quark Content of the Particle |
---|
72 | G4QDecayChanVector GetDecayVector(); // Get a Decay Vector for the Particle |
---|
73 | G4double GetMass(); // Get a mass value for the Particle |
---|
74 | G4double GetWidth(); // Get a width value for the Particle |
---|
75 | |
---|
76 | // Modifiers |
---|
77 | G4QDecayChanVector InitDecayVector(G4int Q);// Init DecayVector in theCHIPSWorld by QCode |
---|
78 | void InitPDGParticle(G4int thePDGCode); |
---|
79 | void InitQParticle(G4int theQCode); |
---|
80 | |
---|
81 | // General |
---|
82 | G4double MinMassOfFragm(); // Minimal mass of decaing fragments |
---|
83 | |
---|
84 | private: |
---|
85 | // Encapsulated functions |
---|
86 | |
---|
87 | private: |
---|
88 | // the Body |
---|
89 | G4QPDGCode aQPDG; |
---|
90 | G4QDecayChanVector aDecay; |
---|
91 | G4QContent aQuarkCont; // @@ Secondary (added for acceleration - check) |
---|
92 | }; |
---|
93 | |
---|
94 | // Not member operators |
---|
95 | std::ostream& operator<<(std::ostream& lhs, G4QParticle& rhs); |
---|
96 | // Not member functions |
---|
97 | //---------------------------------------------------------------------------------------- |
---|
98 | |
---|
99 | inline G4bool G4QParticle::operator==(const G4QParticle& rhs) const {return this==&rhs;} |
---|
100 | inline G4bool G4QParticle::operator!=(const G4QParticle& rhs) const {return this!=&rhs;} |
---|
101 | |
---|
102 | inline G4QPDGCode G4QParticle::GetQPDG() const {return aQPDG;} |
---|
103 | inline G4int G4QParticle::GetQCode() const {return aQPDG.GetQCode();} |
---|
104 | inline G4int G4QParticle::GetPDGCode() const {return aQPDG.GetPDGCode();} |
---|
105 | inline G4int G4QParticle::GetSpin() const {return aQPDG.GetSpin();} |
---|
106 | inline G4int G4QParticle::GetCharge() const {return aQuarkCont.GetCharge();} |
---|
107 | inline G4int G4QParticle::GetStrange() const {return aQuarkCont.GetStrangeness();} |
---|
108 | inline G4int G4QParticle::GetBaryNum() const {return aQuarkCont.GetBaryonNumber();} |
---|
109 | inline G4QContent G4QParticle::GetQContent() {return aQuarkCont;} |
---|
110 | inline G4QDecayChanVector G4QParticle::GetDecayVector() {return aDecay;} |
---|
111 | inline G4double G4QParticle::GetMass() {return aQPDG.GetMass();} |
---|
112 | inline G4double G4QParticle::GetWidth() {return aQPDG.GetWidth();} |
---|
113 | |
---|
114 | inline G4double G4QParticle::MinMassOfFragm() |
---|
115 | { |
---|
116 | G4int nCh=aDecay.size(); |
---|
117 | G4double m=GetMass(); |
---|
118 | G4double min=m; |
---|
119 | if(nCh) |
---|
120 | { |
---|
121 | min=aDecay[0]->GetMinMass(); |
---|
122 | if(nCh>1) for(G4int j=1; j<nCh; j++) |
---|
123 | { |
---|
124 | G4double next=aDecay[j]->GetMinMass(); |
---|
125 | if(next<min) min=next; |
---|
126 | } |
---|
127 | } |
---|
128 | G4double w=GetWidth(); |
---|
129 | G4double lim=m+.001; |
---|
130 | if(w) lim-=1.5*w; |
---|
131 | if(min<lim) min=lim; |
---|
132 | return min; |
---|
133 | } |
---|
134 | |
---|
135 | #endif |
---|
136 | |
---|
137 | |
---|
138 | |
---|