Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4TrajectoryPoint.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// G4TrajectoryPoint
27//
28// Class description:
29//
30// This class represents the trajectory point of a particle being tracked.
31
32// Contact:
33// Questions and comments to this code should be sent to
34// Katsuya Amako (e-mail: [email protected])
35// Takashi Sasaki (e-mail: [email protected])
36// --------------------------------------------------------------------
37#ifndef G4TrajectoryPoint_hh
38#define G4TrajectoryPoint_hh 1
39
40#include "G4Allocator.hh" // Include from 'particle+matter'
41#include "G4ThreeVector.hh" // Include from 'geometry'
42#include "G4VTrajectoryPoint.hh"
43#include "globals.hh" // Include from 'global'
44
45#include "trkgdefs.hh"
46
48{
49 public:
50 // Constructors/Destructor
51
52 G4TrajectoryPoint() = default;
56
57 // Operators
58
59 inline void* operator new(size_t);
60 inline void operator delete(void* aTrajectoryPoint);
61 inline G4bool operator==(const G4TrajectoryPoint& right) const;
62
63 // Get/Set functions
64
65 inline const G4ThreeVector GetPosition() const override { return fPosition; }
66
67 // Get method for HEPRep style attributes
68 const std::map<G4String, G4AttDef>* GetAttDefs() const override;
69 std::vector<G4AttValue>* CreateAttValues() const override;
70
71 private:
72 G4ThreeVector fPosition{0., 0., 0.};
73};
74
76
77inline void* G4TrajectoryPoint::operator new(size_t)
78{
79 if (aTrajectoryPointAllocator() == nullptr) {
81 }
82 return (void*)aTrajectoryPointAllocator()->MallocSingle();
83}
84
85inline void G4TrajectoryPoint::operator delete(void* aTrajectoryPoint)
86{
87 aTrajectoryPointAllocator()->FreeSingle((G4TrajectoryPoint*)aTrajectoryPoint);
88}
89
91{
92 return (this == &right);
93}
94
95#endif
G4TRACKING_DLL G4Allocator< G4TrajectoryPoint > *& aTrajectoryPointAllocator()
bool G4bool
Definition G4Types.hh:86
const std::map< G4String, G4AttDef > * GetAttDefs() const override
std::vector< G4AttValue > * CreateAttValues() const override
~G4TrajectoryPoint() override
G4bool operator==(const G4TrajectoryPoint &right) const
G4TrajectoryPoint()=default
const G4ThreeVector GetPosition() const override
#define G4TRACKING_DLL
Definition trkgdefs.hh:45