Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ErrorFreeTrajState.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// Class Description:
30//
31// Represents a free G4ErrorTrajState
32// It can be represented by the 5 variables
33// 1/p, lambda, phi, y_perp, z_perp
34// where lambda and phi are the dip and azimuthal angles related
35// to the momentum components in the following way:
36// p_x = p cos(lambda) cos(phi) ! lambda = 90 - theta
37// p_y = p cos(lambda) sin(phi)
38// p_z = p sin(lambda)
39// y_perp and z_perp are the coordinates of the trajectory in a
40// local orthonormal reference frame with the x_perp axis along the
41// particle direction, the y_perp being parallel to the x-y plane.
42//
43// This class also takes care of propagating the error associated to
44// the trajectory
45
46// History:
47// - Created: P. Arce
48// --------------------------------------------------------------------
49
50#ifndef G4ErrorFreeTrajState_hh
51#define G4ErrorFreeTrajState_hh
52
53#include "globals.hh"
54
55#include "G4ErrorMatrix.hh"
56
57#include "G4ErrorTrajState.hh"
59
60#include "G4Point3D.hh"
61#include "G4Vector3D.hh"
62
64
66{
67 public: // with description
68
69 G4ErrorFreeTrajState() : theFirstStep(true) {}
70 G4ErrorFreeTrajState( const G4String& partName,
71 const G4Point3D& pos,
72 const G4Vector3D& mom,
73 const G4ErrorTrajErr& errmat = G4ErrorTrajErr(5,0) );
74 // Constructor by providing particle, position and momentum
75
77 // Constructor by providing G4ErrorSurfaceTrajState
78
80
81 virtual G4int Update( const G4Track* aTrack );
82 // update parameters from G4Track
83
84 virtual G4int PropagateError( const G4Track* aTrack );
85 // propagate the error along the step
86
87 virtual void Dump( std::ostream& out = G4cout ) const;
88 // dump TrajState parameters
89
90 friend
91 std::ostream& operator<<(std::ostream&, const G4ErrorFreeTrajState& ts);
92
93 // Set and Get methods
94
95 virtual void SetPosition( const G4Point3D pos )
96 { SetParameters( pos, fMomentum ); }
97
98 virtual void SetMomentum( const G4Vector3D& mom )
99 { SetParameters( fPosition, mom ); }
100
101 void SetParameters( const G4Point3D& pos, const G4Vector3D& mom )
102 {
103 fPosition = pos;
104 fMomentum = mom;
105 fTrajParam.SetParameters( pos, mom );
106 }
107
109 { return fTrajParam; }
110
112 { return theTransfMat; }
113
114 private:
115
116 void Init();
117 // define TrajState type and build charge
118
119 G4int PropagateErrorMSC( const G4Track* aTrack );
120 // add the error associated to multiple scattering
121
122 void CalculateEffectiveZandA( const G4Material* mate, double& effZ, double& effA );
123 // calculate effective Z and A (needed by PropagateErrorMSC)
124
125 G4int PropagateErrorIoni( const G4Track* aTrack );
126 // add the error associated to ionization energy loss
127
128
129 private:
130
131 G4ErrorFreeTrajParam fTrajParam;
132
133 G4ErrorMatrix theTransfMat;
134
135 G4bool theFirstStep; // to count if transf mat is updated or initialized
136};
137
138#endif
G4ErrorSymMatrix G4ErrorTrajErr
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
G4DLLIMPORT std::ostream G4cout
void SetParameters(const G4Point3D &pos, const G4Vector3D &mom)
virtual G4int Update(const G4Track *aTrack)
void SetParameters(const G4Point3D &pos, const G4Vector3D &mom)
G4ErrorMatrix GetTransfMat() const
virtual void SetMomentum(const G4Vector3D &mom)
virtual G4int PropagateError(const G4Track *aTrack)
G4ErrorFreeTrajParam GetParameters() const
virtual void SetPosition(const G4Point3D pos)
virtual void Dump(std::ostream &out=G4cout) const
friend std::ostream & operator<<(std::ostream &, const G4ErrorFreeTrajState &ts)