Geant4-11
G4FieldTrack.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// G4FieldTrack
27//
28// Class description:
29//
30// Data structure bringing together a magnetic track's state.
31// (position, momentum direction & modulus, energy, spin, ... )
32// Uses/abilities:
33// - does not maintain any relationship between its data (eg energy/momentum).
34// - for use in Runge-Kutta solver (in passing it the values right now).
35
36// Author: John Apostolakis, CERN - First version, 14.10.1996
37// -------------------------------------------------------------------
38#ifndef G4FIELDTRACK_HH
39#define G4FIELDTRACK_HH
40
41#include "G4ThreeVector.hh"
42#include "G4ChargeState.hh"
43
45{
46 public: // with description
47
48 G4FieldTrack( const G4ThreeVector& pPosition,
49 G4double LaboratoryTimeOfFlight,
50 const G4ThreeVector& pMomentumDirection,
51 G4double kineticEnergy,
52 G4double restMass_c2,
53 G4double charge,
54 const G4ThreeVector& polarization,
55 G4double magnetic_dipole_moment = 0.0,
56 G4double curve_length = 0.0,
57 G4double PDGspin = -1.0 );
58
59 G4FieldTrack( char );
60 // Almost default constructor
61
62 G4FieldTrack( const G4ThreeVector& pPosition,
63 const G4ThreeVector& pMomentumDirection,
64 G4double curve_length,
65 G4double kineticEnergy,
66 const G4double restMass_c2,
67 G4double velocity,
68 G4double LaboratoryTimeOfFlight = 0.0,
69 G4double ProperTimeOfFlight = 0.0,
70 const G4ThreeVector* pPolarization = nullptr,
71 G4double PDGspin = -1.0 );
72 // Older constructor
73 // ---> Misses charge !!!
74
76 // Destructor
77
78 inline G4FieldTrack( const G4FieldTrack& pFieldTrack );
79 inline G4FieldTrack& operator= ( const G4FieldTrack& rStVec );
80 // Copy constructor & Assignment operator
81
82 inline G4FieldTrack(G4FieldTrack&& from);
84 // Move constructor & operator
85
86 inline void UpdateState( const G4ThreeVector& pPosition,
87 G4double LaboratoryTimeOfFlight,
88 const G4ThreeVector& pMomentumDirection,
89 G4double kineticEnergy);
90 // Update four-vectors for space/time and momentum/energy
91 // Also resets curve length.
92
93 inline void UpdateFourMomentum( G4double kineticEnergy,
94 const G4ThreeVector& momentumDirection );
95 // Update momentum (and direction), and kinetic energy
96
97 void SetChargeAndMoments(G4double charge,
98 G4double magnetic_dipole_moment = DBL_MAX,
99 G4double electric_dipole_moment = DBL_MAX,
100 G4double magnetic_charge = DBL_MAX );
101 // Set the charges and moments that are not given as DBL_MAX
102
103 inline void SetPDGSpin(G4double pdgSpin);
105
106 inline G4ThreeVector GetMomentum() const;
107 inline G4ThreeVector GetPosition() const;
108 inline const G4ThreeVector& GetMomentumDir() const;
110 inline G4double GetCurveLength() const;
111 // Distance along curve of point.
112
114 inline void SetPolarization( const G4ThreeVector& vecPol );
115
116 inline const G4ChargeState* GetChargeState() const;
120 inline G4double GetCharge() const;
121 inline G4double GetRestMass() const;
122 // Accessors.
123
124 inline void SetPosition(G4ThreeVector nPos);
125 inline void SetMomentum(G4ThreeVector nMomDir);
126 // Does change mom-dir too.
127
128 inline void SetMomentumDir(G4ThreeVector nMomDir);
129 // Does NOT change Momentum or Velocity Vector.
130
131 inline void SetRestMass(G4double Mass_c2);
132
133 inline void SetCurveLength(G4double nCurve_s);
134 // Distance along curve.
135 inline void SetKineticEnergy(G4double nEnergy);
136 // Does not modify momentum.
137
138 inline void SetLabTimeOfFlight(G4double tofLab);
139 inline void SetProperTimeOfFlight(G4double tofProper);
140 // Modifiers
141
142 public: // without description
143
144 enum { ncompSVEC = 12 };
145 // Needed and should be used only for RK integration driver
146
147 inline void DumpToArray(G4double valArr[ncompSVEC]) const;
148 void LoadFromArray(const G4double valArr[ncompSVEC],
149 G4int noVarsIntegrated);
150 friend std::ostream&
151 operator<<( std::ostream& os, const G4FieldTrack& SixVec);
152
153 public: // Obsolete methods -- due to potential confusion with PDG spin
154
155 inline void InitialiseSpin( const G4ThreeVector& vecPolarization );
156 inline G4ThreeVector GetSpin() const;
157 inline void SetSpin(G4ThreeVector vSpin);
158
159 private: // Implementation method -- Obsolete
160
161 inline G4FieldTrack& SetCurvePnt(const G4ThreeVector& pPosition,
162 const G4ThreeVector& pMomentum,
163 G4double s_curve );
164 private:
165
167 G4double fDistanceAlongCurve; // distance along curve of point
174 // G4double fInitialMomentumMag; // At 'track' creation.
175 // G4double fLastMomentumMag; // From last Update (for checking.)
176
178};
179
180#include "G4FieldTrack.icc"
181
182#endif
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
G4ChargeState fChargeState
const G4ThreeVector & GetMomentumDir() const
G4FieldTrack(const G4ThreeVector &pPosition, G4double LaboratoryTimeOfFlight, const G4ThreeVector &pMomentumDirection, G4double kineticEnergy, G4double restMass_c2, G4double charge, const G4ThreeVector &polarization, G4double magnetic_dipole_moment=0.0, G4double curve_length=0.0, G4double PDGspin=-1.0)
Definition: G4FieldTrack.cc:81
G4double SixVector[6]
G4FieldTrack & operator=(G4FieldTrack &&from)
G4double GetPDGSpin()
G4double fDistanceAlongCurve
G4double fLabTimeOfFlight
void SetMomentum(G4ThreeVector nMomDir)
G4ThreeVector fPolarization
G4FieldTrack(const G4FieldTrack &pFieldTrack)
G4double fKineticEnergy
void SetProperTimeOfFlight(G4double tofProper)
void UpdateFourMomentum(G4double kineticEnergy, const G4ThreeVector &momentumDirection)
G4FieldTrack & SetCurvePnt(const G4ThreeVector &pPosition, const G4ThreeVector &pMomentum, G4double s_curve)
G4FieldTrack & operator=(const G4FieldTrack &rStVec)
void SetMomentumDir(G4ThreeVector nMomDir)
G4ThreeVector fMomentumDir
const G4ChargeState * GetChargeState() const
G4double GetCurveLength() const
G4ThreeVector GetPolarization() const
G4ThreeVector GetMomentumDirection() const
void SetPolarization(const G4ThreeVector &vecPol)
G4double GetProperTimeOfFlight() const
void SetLabTimeOfFlight(G4double tofLab)
void SetPDGSpin(G4double pdgSpin)
G4double GetCharge() const
void SetCurveLength(G4double nCurve_s)
void SetChargeAndMoments(G4double charge, G4double magnetic_dipole_moment=DBL_MAX, G4double electric_dipole_moment=DBL_MAX, G4double magnetic_charge=DBL_MAX)
G4double GetKineticEnergy() const
G4ThreeVector GetPosition() const
void SetPosition(G4ThreeVector nPos)
G4double fRestMass_c2
G4double GetRestMass() const
G4ThreeVector GetSpin() const
void UpdateState(const G4ThreeVector &pPosition, G4double LaboratoryTimeOfFlight, const G4ThreeVector &pMomentumDirection, G4double kineticEnergy)
void DumpToArray(G4double valArr[ncompSVEC]) const
void SetRestMass(G4double Mass_c2)
G4double GetLabTimeOfFlight() const
void LoadFromArray(const G4double valArr[ncompSVEC], G4int noVarsIntegrated)
void SetSpin(G4ThreeVector vSpin)
void InitialiseSpin(const G4ThreeVector &vecPolarization)
void SetKineticEnergy(G4double nEnergy)
G4FieldTrack(G4FieldTrack &&from)
friend std::ostream & operator<<(std::ostream &os, const G4FieldTrack &SixVec)
Definition: G4FieldTrack.cc:33
G4double fProperTimeOfFlight
G4ThreeVector GetMomentum() const
#define DBL_MAX
Definition: templates.hh:62