Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4RichTrajectory.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// G4RichTrajectory
27//
28// Class description:
29//
30// This class extends G4Trajectory, which includes the following:
31// 1) List of trajectory points which compose the trajectory,
32// 2) static information of particle which generated the
33// trajectory,
34// 3) trackID and parent particle ID of the trajectory.
35// The extended information, only publicly accessible through AttValues,
36// includes:
37// 4) physical volume and next physical volume;
38// 5) creator process;
39// ...and much more.
40
41// Contact:
42// Questions and comments on G4Trajectory should be sent to
43// Katsuya Amako (e-mail: [email protected])
44// Makoto Asai (e-mail: [email protected])
45// Takashi Sasaki (e-mail: [email protected])
46// and on the extended code to:
47// John Allison (e-mail: [email protected])
48// Joseph Perl (e-mail: [email protected])
49// --------------------------------------------------------------------
50#ifndef G4RICHTRAJECTORY_HH
51#define G4RICHTRAJECTORY_HH
52
53#include "G4TouchableHandle.hh"
54#include "G4Trajectory.hh"
55
56#include "trkgdefs.hh"
57
59{
60 using RichTrajectoryPointsContainer = std::vector<G4VTrajectoryPoint*>;
61
62 public:
63 // Constructors/destructor
64 //
65 G4RichTrajectory() = default;
66 G4RichTrajectory(const G4Track* aTrack);
67 ~G4RichTrajectory() override;
70
71 // Operators
72 //
73 G4bool operator==(const G4RichTrajectory& r) const { return (this == &r); }
74
75 inline void* operator new(size_t);
76 inline void operator delete(void*);
77
78 // Other (virtual) member functions
79 //
80 void ShowTrajectory(std::ostream& os = G4cout) const override;
81 void DrawTrajectory() const override;
82 void AppendStep(const G4Step* aStep) override;
83 void MergeTrajectory(G4VTrajectory* secondTrajectory) override;
84 inline G4int GetPointEntries() const override;
85 inline G4VTrajectoryPoint* GetPoint(G4int i) const override;
86
87 // Get methods for HepRep style attributes
88 //
89 const std::map<G4String, G4AttDef>* GetAttDefs() const override;
90 std::vector<G4AttValue>* CreateAttValues() const override;
91
92 private:
93 // Extended information (only publicly accessible through AttValues)...
94 //
95 RichTrajectoryPointsContainer* fpRichPointsContainer = nullptr;
96 G4TouchableHandle fpInitialVolume;
97 G4TouchableHandle fpInitialNextVolume;
98 const G4VProcess* fpCreatorProcess = nullptr;
99 G4int fCreatorModelID = 0;
100 G4TouchableHandle fpFinalVolume;
101 G4TouchableHandle fpFinalNextVolume;
102 const G4VProcess* fpEndingProcess = nullptr;
103 G4double fFinalKineticEnergy = 0.0;
104};
105
107
108inline void* G4RichTrajectory::operator new(size_t)
109{
110 if (aRichTrajectoryAllocator() == nullptr) {
112 }
113 return (void*)aRichTrajectoryAllocator()->MallocSingle();
114}
115
116inline void G4RichTrajectory::operator delete(void* aRichTrajectory)
117{
118 aRichTrajectoryAllocator()->FreeSingle((G4RichTrajectory*)aRichTrajectory);
119}
120
122{
123 return G4int(fpRichPointsContainer->size());
124}
125
127{
128 return (*fpRichPointsContainer)[i];
129}
130
131#endif
G4TRACKING_DLL G4Allocator< G4RichTrajectory > *& aRichTrajectoryAllocator()
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4GLOB_DLL std::ostream G4cout
void AppendStep(const G4Step *aStep) override
G4bool operator==(const G4RichTrajectory &r) const
const std::map< G4String, G4AttDef > * GetAttDefs() const override
G4int GetPointEntries() const override
void DrawTrajectory() const override
G4VTrajectoryPoint * GetPoint(G4int i) const override
void MergeTrajectory(G4VTrajectory *secondTrajectory) override
~G4RichTrajectory() override
G4RichTrajectory()=default
G4RichTrajectory & operator=(const G4RichTrajectory &)=delete
void ShowTrajectory(std::ostream &os=G4cout) const override
std::vector< G4AttValue > * CreateAttValues() const override
#define G4TRACKING_DLL
Definition trkgdefs.hh:45