File indexing completed on 2025-08-02 08:28:24
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 #ifndef G4ClonedTrajectoryPoint_hh
0039 #define G4ClonedTrajectoryPoint_hh 1
0040
0041 #include "G4Allocator.hh" // Include from 'particle+matter'
0042 #include "G4ThreeVector.hh" // Include from 'geometry'
0043 #include "G4VTrajectoryPoint.hh"
0044 #include "G4Threading.hh"
0045 #include "globals.hh" // Include from 'global'
0046
0047 #include "trkgdefs.hh"
0048
0049 class G4TrajectoryPoint;
0050
0051 class G4ClonedTrajectoryPoint : public G4VTrajectoryPoint
0052 {
0053 public:
0054
0055
0056 G4ClonedTrajectoryPoint() = default;
0057 G4ClonedTrajectoryPoint(const G4TrajectoryPoint& right);
0058 ~G4ClonedTrajectoryPoint() override;
0059
0060
0061
0062 inline void* operator new(size_t);
0063 inline void operator delete(void* aTrajectoryPoint);
0064 inline G4bool operator==(const G4ClonedTrajectoryPoint& right) const;
0065
0066
0067
0068 inline const G4ThreeVector GetPosition() const override { return fPosition; }
0069
0070
0071 const std::map<G4String, G4AttDef>* GetAttDefs() const override;
0072 std::vector<G4AttValue>* CreateAttValues() const override;
0073
0074 private:
0075 G4ThreeVector fPosition{0., 0., 0.};
0076 };
0077
0078 extern G4TRACKING_DLL G4Allocator<G4ClonedTrajectoryPoint>*& aClonedTrajectoryPointAllocator();
0079
0080 inline void* G4ClonedTrajectoryPoint::operator new(size_t)
0081 {
0082 if (aClonedTrajectoryPointAllocator() == nullptr) {
0083 aClonedTrajectoryPointAllocator() = new G4Allocator<G4ClonedTrajectoryPoint>;
0084 }
0085 return (void*)aClonedTrajectoryPointAllocator()->MallocSingle();
0086 }
0087
0088 inline void G4ClonedTrajectoryPoint::operator delete(void* aTrajectoryPoint)
0089 {
0090 aClonedTrajectoryPointAllocator()->FreeSingle((G4ClonedTrajectoryPoint*)aTrajectoryPoint);
0091 }
0092
0093 inline G4bool G4ClonedTrajectoryPoint::operator==(const G4ClonedTrajectoryPoint& right) const
0094 {
0095 return (this == &right);
0096 }
0097
0098 #endif