File indexing completed on 2025-01-18 09:58:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #ifndef G4ErrorTrajState_hh
0038 #define G4ErrorTrajState_hh
0039
0040 #include "globals.hh"
0041 #include "G4Track.hh"
0042 #include "G4Point3D.hh"
0043 #include "G4Vector3D.hh"
0044 #include "G4ErrorTrajErr.hh"
0045
0046 enum G4eTSType
0047 {
0048 G4eTS_FREE,
0049 G4eTS_OS
0050 };
0051
0052 class G4ErrorTrajState
0053 {
0054 public:
0055 G4ErrorTrajState()
0056 : fCharge(0.)
0057 , theG4Track(0)
0058 , iverbose(0)
0059 {}
0060
0061 G4ErrorTrajState(const G4String& partType, const G4Point3D& pos,
0062 const G4Vector3D& mom,
0063 const G4ErrorTrajErr& errmat = G4ErrorTrajErr(5, 0));
0064
0065
0066 G4ErrorTrajState(const G4ErrorTrajState&);
0067 G4ErrorTrajState(G4ErrorTrajState&&);
0068
0069
0070 virtual ~G4ErrorTrajState() {}
0071
0072 G4ErrorTrajState& operator=(const G4ErrorTrajState&);
0073 G4ErrorTrajState& operator=(G4ErrorTrajState&&);
0074
0075
0076 void SetData(const G4String& partType, const G4Point3D& pos,
0077 const G4Vector3D& mom);
0078
0079
0080 void BuildCharge();
0081
0082
0083 friend std::ostream& operator<<(std::ostream&, const G4ErrorTrajState& ts);
0084
0085 virtual G4int PropagateError(const G4Track*);
0086
0087
0088 virtual G4int Update(const G4Track*) { return -1; }
0089
0090
0091 void UpdatePosMom(const G4Point3D& pos, const G4Vector3D& mom);
0092
0093
0094 void DumpPosMomError(std::ostream& out = G4cout) const;
0095
0096
0097 virtual void Dump(std::ostream& out = G4cout) const = 0;
0098
0099
0100
0101
0102 const G4String& GetParticleType() const { return fParticleType; }
0103 void SetParticleType(const G4String& partType) { fParticleType = partType; }
0104
0105 G4Point3D GetPosition() const { return fPosition; }
0106 virtual void SetPosition(const G4Point3D pos) { fPosition = pos; }
0107
0108 G4Vector3D GetMomentum() const { return fMomentum; }
0109 virtual void SetMomentum(const G4Vector3D& mom) { fMomentum = mom; }
0110
0111 G4ErrorTrajErr GetError() const { return fError; }
0112 virtual void SetError(G4ErrorTrajErr em) { fError = em; }
0113
0114 G4Track* GetG4Track() const { return theG4Track; }
0115 void SetG4Track(G4Track* trk) { theG4Track = trk; }
0116
0117 G4double GetCharge() const { return fCharge; }
0118 void SetCharge(G4double ch) { fCharge = ch; }
0119
0120 virtual G4eTSType GetTSType() const { return theTSType; }
0121
0122 protected:
0123 G4String fParticleType;
0124 G4Point3D fPosition;
0125 G4Vector3D fMomentum;
0126 G4double fCharge = 0.;
0127 G4ErrorTrajErr fError;
0128
0129 G4eTSType theTSType;
0130
0131 G4Track* theG4Track = nullptr;
0132
0133 G4int iverbose = 0;
0134 };
0135
0136 #endif