File indexing completed on 2025-01-18 09:59:03
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 #ifndef G4RKPropagation_h
0028 #define G4RKPropagation_h 1
0029
0030 #include "G4VFieldPropagation.hh"
0031 #include "G4VNuclearField.hh"
0032 #include "G4V3DNucleus.hh"
0033 #include "G4KM_DummyField.hh"
0034 #include "G4Mag_EqRhs.hh"
0035 #include <map>
0036
0037
0038 class G4RKPropagation: public G4VFieldPropagation
0039 {
0040
0041 public:
0042 G4RKPropagation();
0043 virtual ~G4RKPropagation();
0044
0045 private:
0046 G4RKPropagation(const G4RKPropagation &right);
0047 const G4RKPropagation & operator=(const G4RKPropagation & right);
0048 G4bool operator==(const G4RKPropagation & right) const;
0049 G4bool operator!=(const G4RKPropagation & right) const;
0050
0051 public:
0052
0053 virtual void Init(G4V3DNucleus * nucleus);
0054 virtual void Transport(G4KineticTrackVector &theActive,
0055 const G4KineticTrackVector &theSpectators,
0056 G4double theTimeStep);
0057 G4bool GetSphereIntersectionTimes(const G4KineticTrack * track,
0058 G4double & t1, G4double & t2);
0059 G4ThreeVector GetMomentumTransfer() const;
0060 private:
0061 G4double theOuterRadius;
0062 G4V3DNucleus * theNucleus;
0063 std::map <G4int, G4VNuclearField *, std::less<G4int> > * theFieldMap;
0064 std::map <G4int, G4Mag_EqRhs *, std::less<G4int> > * theEquationMap;
0065 G4KM_DummyField * theField;
0066
0067 G4ThreeVector theMomentumTranfer;
0068
0069 G4bool GetSphereIntersectionTimes(const G4double radius,
0070 const G4ThreeVector & currentPos,
0071 const G4LorentzVector & momentum,
0072 G4double & t1, G4double & t2);
0073
0074
0075 G4bool FieldTransport(G4KineticTrack * track, const G4double timestep);
0076 G4bool FreeTransport(G4KineticTrack * track, const G4double timestep);
0077
0078 void delete_FieldsAndMap(
0079 std::map <G4int, G4VNuclearField *, std::less<G4int> > * aMap);
0080 void delete_EquationsAndMap(
0081 std::map <G4int, G4Mag_EqRhs *, std::less<G4int> > * aMap);
0082
0083 public:
0084 inline G4double GetBarrier(G4int encoding)
0085 {
0086 std::map <G4int, G4VNuclearField *, std::less<G4int> >::iterator iter;
0087 iter = theFieldMap->find(encoding);
0088 if(iter == theFieldMap->end()) return 0;
0089 return (*theFieldMap)[encoding]->GetBarrier();
0090 }
0091
0092 inline G4double GetField(G4int encoding,G4ThreeVector pos)
0093 {
0094 std::map <G4int, G4VNuclearField *, std::less<G4int> >::iterator iter;
0095 iter = theFieldMap->find(encoding);
0096 if(iter == theFieldMap->end()) return 0;
0097 return (*theFieldMap)[encoding]->GetField(pos);
0098 }
0099
0100 };
0101
0102 #endif
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117