File indexing completed on 2025-01-18 09:59:02
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
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 #ifndef G4RICHTRAJECTORY_HH
0051 #define G4RICHTRAJECTORY_HH
0052
0053 #include "G4TouchableHandle.hh"
0054 #include "G4Trajectory.hh"
0055
0056 #include "trkgdefs.hh"
0057
0058 class G4RichTrajectory : public G4Trajectory
0059 {
0060 using RichTrajectoryPointsContainer = std::vector<G4VTrajectoryPoint*>;
0061
0062 public:
0063
0064
0065 G4RichTrajectory() = default;
0066 G4RichTrajectory(const G4Track* aTrack);
0067 ~G4RichTrajectory() override;
0068 G4RichTrajectory(G4RichTrajectory&);
0069 G4RichTrajectory& operator=(const G4RichTrajectory&) = delete;
0070
0071
0072
0073 G4bool operator==(const G4RichTrajectory& r) const { return (this == &r); }
0074
0075 inline void* operator new(size_t);
0076 inline void operator delete(void*);
0077
0078
0079
0080 void ShowTrajectory(std::ostream& os = G4cout) const override;
0081 void DrawTrajectory() const override;
0082 void AppendStep(const G4Step* aStep) override;
0083 void MergeTrajectory(G4VTrajectory* secondTrajectory) override;
0084 inline G4int GetPointEntries() const override;
0085 inline G4VTrajectoryPoint* GetPoint(G4int i) const override;
0086
0087
0088
0089 const std::map<G4String, G4AttDef>* GetAttDefs() const override;
0090 std::vector<G4AttValue>* CreateAttValues() const override;
0091
0092 private:
0093
0094
0095 RichTrajectoryPointsContainer* fpRichPointsContainer = nullptr;
0096 G4TouchableHandle fpInitialVolume;
0097 G4TouchableHandle fpInitialNextVolume;
0098 const G4VProcess* fpCreatorProcess = nullptr;
0099 G4int fCreatorModelID = 0;
0100 G4TouchableHandle fpFinalVolume;
0101 G4TouchableHandle fpFinalNextVolume;
0102 const G4VProcess* fpEndingProcess = nullptr;
0103 G4double fFinalKineticEnergy = 0.0;
0104 };
0105
0106 extern G4TRACKING_DLL G4Allocator<G4RichTrajectory>*& aRichTrajectoryAllocator();
0107
0108 inline void* G4RichTrajectory::operator new(size_t)
0109 {
0110 if (aRichTrajectoryAllocator() == nullptr) {
0111 aRichTrajectoryAllocator() = new G4Allocator<G4RichTrajectory>;
0112 }
0113 return (void*)aRichTrajectoryAllocator()->MallocSingle();
0114 }
0115
0116 inline void G4RichTrajectory::operator delete(void* aRichTrajectory)
0117 {
0118 aRichTrajectoryAllocator()->FreeSingle((G4RichTrajectory*)aRichTrajectory);
0119 }
0120
0121 inline G4int G4RichTrajectory::GetPointEntries() const
0122 {
0123 return G4int(fpRichPointsContainer->size());
0124 }
0125
0126 inline G4VTrajectoryPoint* G4RichTrajectory::GetPoint(G4int i) const
0127 {
0128 return (*fpRichPointsContainer)[i];
0129 }
0130
0131 #endif