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: G4HEVector.hh,v 1.12 2006/06/29 20:29:48 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-03 $ |
---|
29 | // |
---|
30 | // |
---|
31 | // G4 Gheisha friend class G4KinematicParticle -- header file |
---|
32 | // J.L. Chuma, TRIUMF, 22-Feb-1996 |
---|
33 | // last modified: H. Fesefeldt 18-November-1996 |
---|
34 | |
---|
35 | #ifndef G4HEVector_hh |
---|
36 | #define G4HEVector_hh 1 |
---|
37 | |
---|
38 | // Class description: |
---|
39 | // Instances of this class are used by the high energy parameterized models |
---|
40 | // to store particle type, charge, mass, energy and momentum, among other |
---|
41 | // things. Many operations are available with G4HEVectors, including |
---|
42 | // addition, subtraction, and Lorentz boosting. |
---|
43 | |
---|
44 | // Class Description - End |
---|
45 | |
---|
46 | #include "G4ParticleMomentum.hh" |
---|
47 | #include "Randomize.hh" |
---|
48 | #include "G4HadProjectile.hh" |
---|
49 | |
---|
50 | class G4HEVector |
---|
51 | { |
---|
52 | protected: |
---|
53 | G4double px; |
---|
54 | G4double py; |
---|
55 | G4double pz; |
---|
56 | G4double energy; |
---|
57 | G4double kineticEnergy; |
---|
58 | G4double mass; |
---|
59 | G4double charge; |
---|
60 | G4double timeOfFlight; |
---|
61 | G4int side; |
---|
62 | G4bool flag; |
---|
63 | G4int code; |
---|
64 | G4String particleName; |
---|
65 | G4String particleType; |
---|
66 | G4int baryon; |
---|
67 | G4int strangeness; |
---|
68 | enum {NumberOfQuarkFlavor = 8}; |
---|
69 | G4int theQuarkContent[NumberOfQuarkFlavor]; |
---|
70 | G4int theAntiQuarkContent[NumberOfQuarkFlavor]; |
---|
71 | |
---|
72 | public: |
---|
73 | |
---|
74 | G4HEVector(const G4HadProjectile * aParticle); |
---|
75 | |
---|
76 | G4HEVector() |
---|
77 | { |
---|
78 | px = 0.0; |
---|
79 | py = 0.0; |
---|
80 | pz = 0.0; |
---|
81 | energy = 0.0; |
---|
82 | kineticEnergy = 0.0; |
---|
83 | mass = 0.0; |
---|
84 | charge = 0.0; |
---|
85 | timeOfFlight = 0.0; |
---|
86 | side = 0; |
---|
87 | flag = false; |
---|
88 | code = 0; |
---|
89 | particleName = ""; |
---|
90 | particleType = ""; |
---|
91 | baryon = 0; |
---|
92 | strangeness = 0; |
---|
93 | } |
---|
94 | |
---|
95 | |
---|
96 | G4HEVector( const G4HEVector & p ) |
---|
97 | { |
---|
98 | px = p.px; |
---|
99 | py = p.py; |
---|
100 | pz = p.pz; |
---|
101 | energy = p.energy; |
---|
102 | kineticEnergy = p.kineticEnergy; |
---|
103 | mass = p.mass; |
---|
104 | charge = p.charge; |
---|
105 | timeOfFlight = p.timeOfFlight; |
---|
106 | side = p.side; |
---|
107 | flag = p.flag; |
---|
108 | code = p.code; |
---|
109 | particleName = p.particleName; |
---|
110 | particleType = p.particleType; |
---|
111 | baryon = p.baryon; |
---|
112 | strangeness = p.strangeness; |
---|
113 | } |
---|
114 | |
---|
115 | |
---|
116 | G4HEVector & operator = ( const G4HEVector & p ) |
---|
117 | { |
---|
118 | px = p.px; |
---|
119 | py = p.py; |
---|
120 | pz = p.pz; |
---|
121 | energy = p.energy; |
---|
122 | kineticEnergy = p.kineticEnergy; |
---|
123 | mass = p.mass; |
---|
124 | charge = p.charge; |
---|
125 | timeOfFlight = p.timeOfFlight; |
---|
126 | side = p.side; |
---|
127 | flag = p.flag; |
---|
128 | code = p.code; |
---|
129 | particleName = p.particleName; |
---|
130 | particleType = p.particleType; |
---|
131 | baryon = p.baryon; |
---|
132 | strangeness = p.strangeness; |
---|
133 | return *this; |
---|
134 | } |
---|
135 | |
---|
136 | ~G4HEVector(){ }; |
---|
137 | |
---|
138 | G4double Amax(G4double a, G4double b); |
---|
139 | |
---|
140 | G4String getParticleName(G4int code, G4int baryon); |
---|
141 | |
---|
142 | void setMomentum( const G4ParticleMomentum mom ); |
---|
143 | |
---|
144 | void setMomentum( const G4ParticleMomentum * mom ); |
---|
145 | |
---|
146 | void setMomentumAndUpdate( const G4ParticleMomentum mom ); |
---|
147 | |
---|
148 | void setMomentumAndUpdate( const G4ParticleMomentum * mom ); |
---|
149 | |
---|
150 | const G4ParticleMomentum getMomentum() const ; |
---|
151 | |
---|
152 | G4double getTotalMomentum(); |
---|
153 | |
---|
154 | void setMomentum( G4double x, G4double y, G4double z); |
---|
155 | |
---|
156 | void setMomentumAndUpdate( G4double x, G4double y, G4double z ); |
---|
157 | |
---|
158 | void setMomentum( G4double x, G4double y ); |
---|
159 | |
---|
160 | void setMomentumAndUpdate( G4double x, G4double y ); |
---|
161 | |
---|
162 | void setMomentum( G4double z ); |
---|
163 | |
---|
164 | void setMomentumAndUpdate( G4double z ); |
---|
165 | |
---|
166 | void setEnergy( G4double e ); |
---|
167 | |
---|
168 | void setEnergyAndUpdate( G4double e ); |
---|
169 | |
---|
170 | void setKineticEnergy( G4double ekin ); |
---|
171 | |
---|
172 | void setKineticEnergyAndUpdate(G4double ekin); |
---|
173 | |
---|
174 | G4double getEnergy(); |
---|
175 | |
---|
176 | G4double getKineticEnergy(); |
---|
177 | |
---|
178 | void setMass( G4double m ); |
---|
179 | |
---|
180 | void setMassAndUpdate( G4double m ); |
---|
181 | |
---|
182 | G4double getMass(); |
---|
183 | |
---|
184 | void setCharge( G4double c ); |
---|
185 | |
---|
186 | G4double getCharge(); |
---|
187 | |
---|
188 | void setTOF( G4double t ); |
---|
189 | |
---|
190 | G4double getTOF(); |
---|
191 | |
---|
192 | void setSide( G4int s ); |
---|
193 | |
---|
194 | G4int getSide(); |
---|
195 | |
---|
196 | void setFlag( G4bool f ); |
---|
197 | |
---|
198 | G4bool getFlag(); |
---|
199 | |
---|
200 | void setCode( G4int c ); |
---|
201 | |
---|
202 | G4int getCode(); |
---|
203 | |
---|
204 | G4String getName(); |
---|
205 | |
---|
206 | G4int getBaryonNumber(); |
---|
207 | |
---|
208 | G4int getStrangenessNumber(); |
---|
209 | |
---|
210 | G4int getQuarkContent(G4int flavor); |
---|
211 | |
---|
212 | G4int getAntiQuarkContent(G4int flavor); |
---|
213 | |
---|
214 | void setZero(); |
---|
215 | |
---|
216 | G4String getType(); |
---|
217 | |
---|
218 | void Add( const G4HEVector & p1, const G4HEVector & p2 ); |
---|
219 | |
---|
220 | void Sub( const G4HEVector & p1, const G4HEVector & p2 ); |
---|
221 | |
---|
222 | void Lor( const G4HEVector & p1, const G4HEVector & p2 ); |
---|
223 | |
---|
224 | G4double CosAng( const G4HEVector & p ); |
---|
225 | |
---|
226 | G4double Ang(const G4HEVector & p ); |
---|
227 | |
---|
228 | G4double Dot4( const G4HEVector & p1, const G4HEVector & p2); |
---|
229 | |
---|
230 | G4double Impu( const G4HEVector & p1, const G4HEVector & p2); |
---|
231 | |
---|
232 | void Add3( const G4HEVector & p1, const G4HEVector & p2); |
---|
233 | |
---|
234 | void Sub3( const G4HEVector & p1, const G4HEVector & p2); |
---|
235 | |
---|
236 | void Cross( const G4HEVector & p1, const G4HEVector & p2); |
---|
237 | |
---|
238 | G4double Dot( const G4HEVector & p1, const G4HEVector & p2); |
---|
239 | |
---|
240 | void Smul( const G4HEVector & p, G4double h); |
---|
241 | |
---|
242 | void SmulAndUpdate( const G4HEVector & p, G4double h); |
---|
243 | |
---|
244 | void Norz( const G4HEVector & p ); |
---|
245 | |
---|
246 | G4double Length(); |
---|
247 | |
---|
248 | void Exch( G4HEVector & p1); |
---|
249 | |
---|
250 | void Defs1( const G4HEVector & p1, const G4HEVector & p2); |
---|
251 | |
---|
252 | void Defs( const G4HEVector & p1, const G4HEVector & p2, |
---|
253 | G4HEVector & my, G4HEVector & mz ); |
---|
254 | |
---|
255 | void Trac( const G4HEVector & p1, const G4HEVector & mx, |
---|
256 | const G4HEVector & my, const G4HEVector & mz); |
---|
257 | |
---|
258 | void setDefinition(G4String name); |
---|
259 | |
---|
260 | G4int FillQuarkContent(); |
---|
261 | |
---|
262 | void Print( G4int L); |
---|
263 | }; |
---|
264 | |
---|
265 | #endif |
---|
266 | |
---|
267 | |
---|