source: trunk/source/processes/hadronic/models/high_energy/include/G4HEVector.hh

Last change on this file was 1347, checked in by garnier, 14 years ago

geant4 tag 9.4

File size: 7.4 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: G4HEVector.hh,v 1.15 2010/11/29 05:45:06 dennis Exp $
28// GEANT4 tag $Name: geant4-09-04-ref-00 $
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
50class 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     for (G4int i = 0; i < NumberOfQuarkFlavor; i++) {
94       theQuarkContent[i] = 0;
95       theAntiQuarkContent[i] = 0;
96     }
97   }
98
99
100  G4HEVector( const G4HEVector & p )
101   {
102     px            = p.px;
103     py            = p.py;
104     pz            = p.pz;
105     energy        = p.energy;
106     kineticEnergy = p.kineticEnergy;
107     mass          = p.mass;
108     charge        = p.charge;
109     timeOfFlight  = p.timeOfFlight;
110     side          = p.side;
111     flag          = p.flag;
112     code          = p.code;
113     particleName  = p.particleName;
114     particleType  = p.particleType;
115     baryon        = p.baryon;
116     strangeness   = p.strangeness;
117   }
118
119
120  G4HEVector & operator = ( const G4HEVector & p )
121   {
122     px            = p.px;
123     py            = p.py;
124     pz            = p.pz;
125     energy        = p.energy;
126     kineticEnergy = p.kineticEnergy;
127     mass          = p.mass;
128     charge        = p.charge;
129     timeOfFlight  = p.timeOfFlight;
130     side          = p.side;
131     flag          = p.flag;
132     code          = p.code;
133     particleName  = p.particleName;
134     particleType  = p.particleType;
135     baryon        = p.baryon;
136     strangeness   = p.strangeness;
137     return *this;
138   }
139
140   ~G4HEVector(){ };
141
142   G4double Amax(G4double a, G4double b);
143
144   G4String getParticleName(G4int code, G4int baryon);
145 
146   void setMomentum( const G4ParticleMomentum mom ); 
147
148   void setMomentum( const G4ParticleMomentum * mom ); 
149
150   void setMomentumAndUpdate( const G4ParticleMomentum mom );
151
152   void setMomentumAndUpdate( const G4ParticleMomentum * mom );
153
154   const G4ParticleMomentum getMomentum() const ;
155
156   G4double getTotalMomentum() const;
157
158   void setMomentum( G4double x, G4double y, G4double z);
159
160   void setMomentumAndUpdate( G4double x, G4double y, G4double z );
161
162   void setMomentum( G4double x, G4double y );
163
164   void setMomentumAndUpdate( G4double x, G4double y );
165
166   void setMomentum( G4double z );
167
168   void setMomentumAndUpdate( G4double z );
169
170   void setEnergy( G4double e ); 
171
172   void setEnergyAndUpdate( G4double e );
173
174   void setKineticEnergy( G4double ekin ); 
175
176   void setKineticEnergyAndUpdate(G4double ekin); 
177
178   G4double getEnergy() const; 
179
180   G4double getKineticEnergy() const; 
181
182   void setMass( G4double m ); 
183
184   void setMassAndUpdate( G4double m );
185
186   G4double getMass() const; 
187
188   void setCharge( G4double c ); 
189
190   G4double getCharge() const; 
191
192   void setTOF( G4double t ); 
193
194   G4double getTOF(); 
195
196   void setSide( G4int s ); 
197
198   G4int getSide(); 
199
200   void setFlag( G4bool f ); 
201
202   G4bool getFlag(); 
203
204   void setCode( G4int c ); 
205
206   G4int getCode() const; 
207
208   G4String getName() const;
209
210   G4int getBaryonNumber() const;
211
212   G4int getStrangenessNumber() const;
213
214   G4int getQuarkContent(G4int flavor);
215
216   G4int getAntiQuarkContent(G4int flavor);
217
218   void setZero();
219
220   G4String getType() const;
221
222   void Add( const G4HEVector & p1, const G4HEVector & p2 );
223
224   void Sub( const G4HEVector & p1, const G4HEVector & p2 );
225
226   void Lor( const G4HEVector & p1, const G4HEVector & p2 );
227
228   G4double CosAng(const G4HEVector& p) const;
229
230   G4double Ang(const G4HEVector & p );
231
232   G4double Dot4( const G4HEVector & p1, const G4HEVector & p2);
233
234   G4double Impu( const G4HEVector & p1, const G4HEVector & p2);
235
236   void Add3( const G4HEVector & p1, const G4HEVector & p2);
237
238   void Sub3( const G4HEVector & p1, const G4HEVector & p2);
239
240   void Cross( const G4HEVector & p1, const G4HEVector & p2);
241
242   G4double Dot( const G4HEVector & p1, const G4HEVector & p2);
243
244   void Smul( const G4HEVector & p, G4double h);
245
246   void SmulAndUpdate( const G4HEVector & p, G4double h);
247
248   void Norz( const G4HEVector & p );
249
250   G4double Length() const;
251
252   void Exch( G4HEVector & p1);
253
254   void Defs1( const G4HEVector & p1, const G4HEVector & p2);
255
256   void Defs( const G4HEVector & p1, const G4HEVector & p2,
257                    G4HEVector & my,       G4HEVector & mz );
258
259   void Trac( const G4HEVector & p1, const G4HEVector & mx,
260              const G4HEVector & my, const G4HEVector & mz);
261
262   void setDefinition(G4String name);
263
264   G4int FillQuarkContent();
265
266   void Print(G4int L) const;
267};
268
269#endif
270
Note: See TracBrowser for help on using the repository browser.