Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ErrorTrajState.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//
28//
29// Class Description:
30//
31// Base class for the trajectory state
32
33// History:
34// - Created: P. Arce
35// --------------------------------------------------------------------
36
37#ifndef G4ErrorTrajState_hh
38#define G4ErrorTrajState_hh
39
40#include "globals.hh"
41#include "G4Track.hh"
42#include "G4Point3D.hh"
43#include "G4Vector3D.hh"
44#include "G4ErrorTrajErr.hh"
45
47
49{
50 public: // with description
51
53
54 G4ErrorTrajState( const G4String& partType, const G4Point3D& pos,
55 const G4Vector3D& mom,
56 const G4ErrorTrajErr& errmat = G4ErrorTrajErr(5,0) );
57 // Constructor by providing particle, position and momentum
58
61 // The copy and move constructors
62
64
67 // The copy and move assignment operators
68
69 void SetData( const G4String& partType, const G4Point3D& pos,
70 const G4Vector3D& mom );
71 // Set particle, position and momentum
72
73 void BuildCharge();
74 // Build charge based on particle type
75
76 friend
77 std::ostream& operator<<(std::ostream&, const G4ErrorTrajState& ts);
78
79 virtual G4int PropagateError( const G4Track* );
80 // Propagate the error along the step
81
82 virtual G4int Update( const G4Track* ){ return -1; }
83 // Update parameters from G4Track
84
85 void UpdatePosMom( const G4Point3D& pos, const G4Vector3D& mom );
86 // Update position and momentum
87
88 void DumpPosMomError( std::ostream& out = G4cout ) const;
89 // Dump position, momentum and error
90
91 virtual void Dump( std::ostream& out = G4cout ) const = 0;
92 // Abstract method to dump all TrajState parameters
93
94 // Set and Get methods
95
97 { return fParticleType;}
98 void SetParticleType( const G4String& partType )
99 { fParticleType = partType;}
100
102 { return fPosition; }
103 virtual void SetPosition( const G4Point3D pos )
104 { fPosition = pos; }
105
107 { return fMomentum; }
108 virtual void SetMomentum( const G4Vector3D& mom )
109 { fMomentum = mom; }
110
112 { return fError; }
113 virtual void SetError( G4ErrorTrajErr em )
114 { fError = em; }
115
117 { return theG4Track; }
118 void SetG4Track( G4Track* trk )
119 { theG4Track = trk; }
120
122 { return fCharge; }
124 { fCharge = ch; }
125
126 virtual G4eTSType GetTSType() const
127 { return theTSType; }
128
129 protected:
130
136
138
139 G4Track* theG4Track = nullptr;
140
142};
143
144#endif
G4ErrorSymMatrix G4ErrorTrajErr
G4eTSType
@ G4eTS_FREE
@ G4eTS_OS
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
G4GLOB_DLL std::ostream G4cout
virtual void SetError(G4ErrorTrajErr em)
void DumpPosMomError(std::ostream &out=G4cout) const
void SetG4Track(G4Track *trk)
G4ErrorTrajErr fError
virtual ~G4ErrorTrajState()
G4Track * GetG4Track() const
virtual G4int PropagateError(const G4Track *)
void UpdatePosMom(const G4Point3D &pos, const G4Vector3D &mom)
G4ErrorTrajErr GetError() const
void SetCharge(G4double ch)
virtual void SetMomentum(const G4Vector3D &mom)
void SetData(const G4String &partType, const G4Point3D &pos, const G4Vector3D &mom)
virtual void SetPosition(const G4Point3D pos)
G4ErrorTrajState & operator=(const G4ErrorTrajState &)
G4Vector3D GetMomentum() const
G4double GetCharge() const
virtual G4int Update(const G4Track *)
const G4String & GetParticleType() const
void SetParticleType(const G4String &partType)
friend std::ostream & operator<<(std::ostream &, const G4ErrorTrajState &ts)
virtual G4eTSType GetTSType() const
virtual void Dump(std::ostream &out=G4cout) const =0
G4Point3D GetPosition() const