Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
G4HEVector.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//
30// G4 Gheisha friend class G4KinematicParticle -- header file
31// J.L. Chuma, TRIUMF, 22-Feb-1996
32// last modified: H. Fesefeldt 18-November-1996
33
34#ifndef G4HEVector_hh
35#define G4HEVector_hh 1
36
37// Class description:
38// Instances of this class are used by the high energy parameterized models
39// to store particle type, charge, mass, energy and momentum, among other
40// things. Many operations are available with G4HEVectors, including
41// addition, subtraction, and Lorentz boosting.
42
43// Class Description - End
44
45#include "G4ParticleMomentum.hh"
46#include "Randomize.hh"
47#include "G4HadProjectile.hh"
48
50 {
51 protected:
70
71 public:
72
73 G4HEVector(const G4HadProjectile * aParticle);
74
76 {
77 px = 0.0;
78 py = 0.0;
79 pz = 0.0;
80 energy = 0.0;
81 kineticEnergy = 0.0;
82 mass = 0.0;
83 charge = 0.0;
84 timeOfFlight = 0.0;
85 side = 0;
86 flag = false;
87 code = 0;
88 particleName = "";
89 particleType = "";
90 baryon = 0;
91 strangeness = 0;
92 for (G4int i = 0; i < NumberOfQuarkFlavor; i++) {
93 theQuarkContent[i] = 0;
95 }
96 }
97
98
100 {
101 px = p.px;
102 py = p.py;
103 pz = p.pz;
104 energy = p.energy;
106 mass = p.mass;
107 charge = p.charge;
109 side = p.side;
110 flag = p.flag;
111 code = p.code;
114 baryon = p.baryon;
116 }
117
118
120 {
121 px = p.px;
122 py = p.py;
123 pz = p.pz;
124 energy = p.energy;
126 mass = p.mass;
127 charge = p.charge;
129 side = p.side;
130 flag = p.flag;
131 code = p.code;
134 baryon = p.baryon;
136 return *this;
137 }
138
140
142
144
145 void setMomentum( const G4ParticleMomentum mom );
146
147 void setMomentum( const G4ParticleMomentum * mom );
148
150
151 void setMomentumAndUpdate( const G4ParticleMomentum * mom );
152
153 const G4ParticleMomentum getMomentum() const ;
154
156
157 void setMomentum( G4double x, G4double y, G4double z);
158
160
161 void setMomentum( G4double x, G4double y );
162
164
165 void setMomentum( G4double z );
166
168
169 void setEnergy( G4double e );
170
172
173 void setKineticEnergy( G4double ekin );
174
176
177 G4double getEnergy() const;
178
179 G4double getKineticEnergy() const;
180
181 void setMass( G4double m );
182
183 void setMassAndUpdate( G4double m );
184
185 G4double getMass() const;
186
187 void setCharge( G4double c );
188
189 G4double getCharge() const;
190
191 void setTOF( G4double t );
192
193 G4double getTOF();
194
195 void setSide( G4int s );
196
197 G4int getSide();
198
199 void setFlag( G4bool f );
200
201 G4bool getFlag();
202
203 void setCode( G4int c );
204
205 G4int getCode() const;
206
207 G4String getName() const;
208
209 G4int getBaryonNumber() const;
210
212
214
216
217 void setZero();
218
219 G4String getType() const;
220
221 void Add( const G4HEVector & p1, const G4HEVector & p2 );
222
223 void Sub( const G4HEVector & p1, const G4HEVector & p2 );
224
225 void Lor( const G4HEVector & p1, const G4HEVector & p2 );
226
227 G4double CosAng(const G4HEVector& p) const;
228
229 G4double Ang(const G4HEVector & p );
230
231 G4double Dot4( const G4HEVector & p1, const G4HEVector & p2);
232
233 G4double Impu( const G4HEVector & p1, const G4HEVector & p2);
234
235 void Add3( const G4HEVector & p1, const G4HEVector & p2);
236
237 void Sub3( const G4HEVector & p1, const G4HEVector & p2);
238
239 void Cross( const G4HEVector & p1, const G4HEVector & p2);
240
241 G4double Dot( const G4HEVector & p1, const G4HEVector & p2);
242
243 void Smul( const G4HEVector & p, G4double h);
244
245 void SmulAndUpdate( const G4HEVector & p, G4double h);
246
247 void Norz( const G4HEVector & p );
248
249 G4double Length() const;
250
251 void Exch( G4HEVector & p1);
252
253 void Defs1( const G4HEVector & p1, const G4HEVector & p2);
254
255 void Defs( const G4HEVector & p1, const G4HEVector & p2,
256 G4HEVector & my, G4HEVector & mz );
257
258 void Trac( const G4HEVector & p1, const G4HEVector & mx,
259 const G4HEVector & my, const G4HEVector & mz);
260
261 void setDefinition(G4String name);
262
264
265 void Print(G4int L) const;
266};
267
268#endif
269
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
void Smul(const G4HEVector &p, G4double h)
Definition: G4HEVector.cc:659
G4double Impu(const G4HEVector &p1, const G4HEVector &p2)
Definition: G4HEVector.cc:614
void setMomentumAndUpdate(const G4ParticleMomentum mom)
Definition: G4HEVector.cc:135
G4double charge
Definition: G4HEVector.hh:58
void Lor(const G4HEVector &p1, const G4HEVector &p2)
Definition: G4HEVector.cc:558
G4int side
Definition: G4HEVector.hh:60
G4double getCharge() const
Definition: G4HEVector.cc:373
const G4ParticleMomentum getMomentum() const
Definition: G4HEVector.cc:157
void Sub(const G4HEVector &p1, const G4HEVector &p2)
Definition: G4HEVector.cc:537
G4double pz
Definition: G4HEVector.hh:54
G4HEVector & operator=(const G4HEVector &p)
Definition: G4HEVector.hh:119
void setZero()
Definition: G4HEVector.cc:496
G4int getQuarkContent(G4int flavor)
Definition: G4HEVector.cc:452
G4int getSide()
Definition: G4HEVector.cc:400
void Defs(const G4HEVector &p1, const G4HEVector &p2, G4HEVector &my, G4HEVector &mz)
Definition: G4HEVector.cc:758
void Norz(const G4HEVector &p)
Definition: G4HEVector.cc:689
G4String getType() const
Definition: G4HEVector.cc:436
void setEnergy(G4double e)
Definition: G4HEVector.cc:226
void setSide(G4int s)
Definition: G4HEVector.cc:392
void setEnergyAndUpdate(G4double e)
Definition: G4HEVector.cc:233
G4double py
Definition: G4HEVector.hh:53
void Add(const G4HEVector &p1, const G4HEVector &p2)
Definition: G4HEVector.cc:516
void Add3(const G4HEVector &p1, const G4HEVector &p2)
Definition: G4HEVector.cc:623
G4double CosAng(const G4HEVector &p) const
Definition: G4HEVector.cc:578
void setTOF(G4double t)
Definition: G4HEVector.cc:379
G4int theAntiQuarkContent[NumberOfQuarkFlavor]
Definition: G4HEVector.hh:69
G4double mass
Definition: G4HEVector.hh:57
G4String particleName
Definition: G4HEVector.hh:63
G4HEVector(const G4HEVector &p)
Definition: G4HEVector.hh:99
void setKineticEnergyAndUpdate(G4double ekin)
Definition: G4HEVector.cc:277
G4int baryon
Definition: G4HEVector.hh:65
void Cross(const G4HEVector &p1, const G4HEVector &p2)
Definition: G4HEVector.cc:641
G4int strangeness
Definition: G4HEVector.hh:66
G4double getTOF()
Definition: G4HEVector.cc:386
void Exch(G4HEVector &p1)
Definition: G4HEVector.cc:717
G4int theQuarkContent[NumberOfQuarkFlavor]
Definition: G4HEVector.hh:68
G4double Amax(G4double a, G4double b)
Definition: G4HEVector.cc:64
void Defs1(const G4HEVector &p1, const G4HEVector &p2)
Definition: G4HEVector.cc:726
G4String getParticleName(G4int code, G4int baryon)
Definition: G4HEVector.cc:71
void setCode(G4int c)
Definition: G4HEVector.cc:420
@ NumberOfQuarkFlavor
Definition: G4HEVector.hh:67
G4double getEnergy() const
Definition: G4HEVector.cc:313
G4double kineticEnergy
Definition: G4HEVector.hh:56
G4double Ang(const G4HEVector &p)
Definition: G4HEVector.cc:592
G4double px
Definition: G4HEVector.hh:52
G4bool getFlag()
Definition: G4HEVector.cc:414
G4int code
Definition: G4HEVector.hh:62
void Trac(const G4HEVector &p1, const G4HEVector &mx, const G4HEVector &my, const G4HEVector &mz)
Definition: G4HEVector.cc:798
void setCharge(G4double c)
Definition: G4HEVector.cc:367
G4double getMass() const
Definition: G4HEVector.cc:361
G4double Length() const
Definition: G4HEVector.cc:711
void SmulAndUpdate(const G4HEVector &p, G4double h)
Definition: G4HEVector.cc:668
G4double Dot4(const G4HEVector &p1, const G4HEVector &p2)
Definition: G4HEVector.cc:608
G4bool flag
Definition: G4HEVector.hh:61
G4String particleType
Definition: G4HEVector.hh:64
G4int FillQuarkContent()
Definition: G4HEVector.cc:1140
void setFlag(G4bool f)
Definition: G4HEVector.cc:407
G4double Dot(const G4HEVector &p1, const G4HEVector &p2)
Definition: G4HEVector.cc:653
G4int getCode() const
Definition: G4HEVector.cc:426
void setMassAndUpdate(G4double m)
Definition: G4HEVector.cc:331
void setKineticEnergy(G4double ekin)
Definition: G4HEVector.cc:270
void Print(G4int L) const
Definition: G4HEVector.cc:1289
G4double getTotalMomentum() const
Definition: G4HEVector.cc:166
G4double energy
Definition: G4HEVector.hh:55
G4double getKineticEnergy() const
Definition: G4HEVector.cc:318
G4int getBaryonNumber() const
Definition: G4HEVector.cc:441
G4String getName() const
Definition: G4HEVector.cc:431
void setMomentum(const G4ParticleMomentum mom)
Definition: G4HEVector.cc:117
void setMass(G4double m)
Definition: G4HEVector.cc:324
void setDefinition(G4String name)
Definition: G4HEVector.cc:812
G4int getStrangenessNumber() const
Definition: G4HEVector.cc:446
G4double timeOfFlight
Definition: G4HEVector.hh:59
void Sub3(const G4HEVector &p1, const G4HEVector &p2)
Definition: G4HEVector.cc:632
G4int getAntiQuarkContent(G4int flavor)
Definition: G4HEVector.cc:474