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 | // |
---|
27 | // |
---|
28 | // |
---|
29 | |
---|
30 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
31 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
32 | |
---|
33 | #ifndef F04Trajectory_h |
---|
34 | #define F04Trajectory_h 1 |
---|
35 | |
---|
36 | #include <vector> |
---|
37 | #include <stdlib.h> |
---|
38 | |
---|
39 | #include "globals.hh" |
---|
40 | |
---|
41 | #include "G4ios.hh" |
---|
42 | #include "G4Step.hh" |
---|
43 | #include "G4Track.hh" |
---|
44 | #include "G4Allocator.hh" |
---|
45 | #include "G4VTrajectory.hh" |
---|
46 | #include "G4ParticleDefinition.hh" |
---|
47 | #include "G4TrajectoryPoint.hh" |
---|
48 | |
---|
49 | typedef std::vector<G4VTrajectoryPoint*> TrajectoryPointContainer; |
---|
50 | |
---|
51 | class F04Trajectory : public G4VTrajectory |
---|
52 | { |
---|
53 | |
---|
54 | //-------- |
---|
55 | public: // without description |
---|
56 | //-------- |
---|
57 | |
---|
58 | // Constructor/Destructor |
---|
59 | |
---|
60 | F04Trajectory(); |
---|
61 | F04Trajectory(const G4Track* aTrack); |
---|
62 | F04Trajectory(F04Trajectory &); |
---|
63 | virtual ~F04Trajectory(); |
---|
64 | |
---|
65 | // Operators |
---|
66 | |
---|
67 | inline void* operator new(size_t); |
---|
68 | inline void operator delete(void*); |
---|
69 | inline int operator == (const F04Trajectory& right) const |
---|
70 | { return (this==&right); } |
---|
71 | |
---|
72 | // Get/Set functions |
---|
73 | |
---|
74 | inline G4int GetTrackID() const { return fTrackID; } |
---|
75 | inline G4int GetParentID() const { return fParentID; } |
---|
76 | inline G4String GetParticleName() const { return ParticleName; } |
---|
77 | inline G4double GetCharge() const { return PDGCharge; } |
---|
78 | inline G4int GetPDGEncoding() const { return PDGEncoding; } |
---|
79 | inline G4ThreeVector GetInitialMomentum() const { return initialMomentum; } |
---|
80 | |
---|
81 | // Other member functions |
---|
82 | |
---|
83 | virtual void ShowTrajectory(std::ostream& os=G4cout) const; |
---|
84 | virtual void DrawTrajectory() const; |
---|
85 | virtual void DrawTrajectory(G4int i_mode=0) const; |
---|
86 | virtual void AppendStep(const G4Step* aStep); |
---|
87 | virtual void MergeTrajectory(G4VTrajectory* secondTrajectory); |
---|
88 | |
---|
89 | G4ParticleDefinition* GetParticleDefinition(); |
---|
90 | |
---|
91 | virtual int GetPointEntries() const |
---|
92 | { return fpPointsContainer->size(); } |
---|
93 | virtual G4VTrajectoryPoint* GetPoint(G4int i) const |
---|
94 | { return (*fpPointsContainer)[i]; } |
---|
95 | |
---|
96 | virtual const std::map<G4String,G4AttDef>* GetAttDefs() const; |
---|
97 | virtual std::vector<G4AttValue>* CreateAttValues() const; |
---|
98 | |
---|
99 | //--------- |
---|
100 | private: |
---|
101 | //--------- |
---|
102 | |
---|
103 | // Member data |
---|
104 | |
---|
105 | TrajectoryPointContainer* fpPointsContainer; |
---|
106 | |
---|
107 | G4int fTrackID; |
---|
108 | G4int fParentID; |
---|
109 | G4double PDGCharge; |
---|
110 | G4int PDGEncoding; |
---|
111 | G4String ParticleName; |
---|
112 | G4ThreeVector initialMomentum; |
---|
113 | |
---|
114 | }; |
---|
115 | |
---|
116 | #if defined G4TRACKING_ALLOC_EXPORT |
---|
117 | extern G4DLLEXPORT G4Allocator<F04Trajectory> aTrajectoryAllocator; |
---|
118 | #else |
---|
119 | extern G4DLLIMPORT G4Allocator<F04Trajectory> aTrajectoryAllocator; |
---|
120 | #endif |
---|
121 | |
---|
122 | inline void* F04Trajectory::operator new(size_t) { |
---|
123 | void* aTrajectory = (void*) aTrajectoryAllocator.MallocSingle(); |
---|
124 | return aTrajectory; |
---|
125 | } |
---|
126 | |
---|
127 | inline void F04Trajectory::operator delete(void* aTrajectory) { |
---|
128 | aTrajectoryAllocator.FreeSingle((F04Trajectory*)aTrajectory); |
---|
129 | } |
---|
130 | |
---|
131 | #endif |
---|