Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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:
67  enum {NumberOfQuarkFlavor = 8};
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;
94  theAntiQuarkContent[i] = 0;
95  }
96  }
97 
98 
99  G4HEVector( const G4HEVector & p )
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 
149  void setMomentumAndUpdate( const G4ParticleMomentum mom );
150 
151  void setMomentumAndUpdate( const G4ParticleMomentum * mom );
152 
153  const G4ParticleMomentum getMomentum() const ;
154 
155  G4double getTotalMomentum() const;
156 
158 
160 
161  void setMomentum( G4double x, G4double y );
162 
164 
165  void setMomentum( G4double z );
166 
168 
169  void setEnergy( G4double e );
170 
171  void setEnergyAndUpdate( G4double e );
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 
211  G4int getStrangenessNumber() const;
212 
213  G4int getQuarkContent(G4int flavor);
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 
262 
264 
265  void Print(G4int L) const;
266 };
267 
268 #endif
269