Geant4 11.1.1
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 "trkgdefs.hh"
41#include "G4VTrajectoryPoint.hh"
42#include "globals.hh" // Include from 'global'
43#include "G4ThreeVector.hh" // Include from 'geometry'
44#include "G4Allocator.hh" // Include from 'particle+matter'
45
47{
48 public:
49
50 // Constructors/Destructor
51
55 virtual ~G4TrajectoryPoint();
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
66 { return fPosition; }
67
68 // Get method for HEPRep style attributes
69
70 virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
71 virtual std::vector<G4AttValue>* CreateAttValues() const;
72
73
74 private:
75
76 G4ThreeVector fPosition;
77};
78
79extern G4TRACKING_DLL
81
82inline void* G4TrajectoryPoint::operator new(size_t)
83{
84 if (aTrajectoryPointAllocator() == nullptr)
85 {
87 }
88 return (void *) aTrajectoryPointAllocator()->MallocSingle();
89}
90
91inline void G4TrajectoryPoint::operator delete(void *aTrajectoryPoint)
92{
94 ->FreeSingle((G4TrajectoryPoint *) aTrajectoryPoint);
95}
96
97inline G4bool
99{
100 return (this==&right);
101}
102
103#endif
G4TRACKING_DLL G4Allocator< G4TrajectoryPoint > *& aTrajectoryPointAllocator()
bool G4bool
Definition: G4Types.hh:86
G4bool operator==(const G4TrajectoryPoint &right) const
virtual ~G4TrajectoryPoint()
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
const G4ThreeVector GetPosition() const
virtual std::vector< G4AttValue > * CreateAttValues() const
#define G4TRACKING_DLL
Definition: trkgdefs.hh:45