Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE04Trajectory.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 //
28 //
29 // $Id: $
30 //
31 #ifndef RE04Trajectory_h
32 #define RE04Trajectory_h 1
33 
34 #include "G4VTrajectory.hh"
35 #include "G4Allocator.hh"
36 #include <stdlib.h> // Include from 'system'
37 #include "G4ios.hh" // Include from 'system'
38 #include <vector> // G4RWTValOrderedVector
39 #include "globals.hh" // Include from 'global'
40 #include "G4ParticleDefinition.hh" // Include from 'particle+matter'
41 #include "RE04TrajectoryPoint.hh" // Include from 'tracking'
42 #include "G4Track.hh"
43 #include "G4Step.hh"
44 
45 class G4Polyline; // Forward declaration.
46 
47 typedef std::vector<G4VTrajectoryPoint*> TrajectoryPointContainer;
48 
49 //
88 //
92 {
93 
94 //--------
95 public:
96 //--------
97 
98 // Constructor/Destrcutor
99 
100  RE04Trajectory();
101 
102  RE04Trajectory(const G4Track* aTrack);
104  virtual ~RE04Trajectory();
105 
106 // Operators
107  inline void* operator new(size_t);
108  inline void operator delete(void*);
109  inline int operator == (const RE04Trajectory& right) const
110  {return (this==&right);}
111 
112 // Get/Set functions
113  inline virtual G4int GetTrackID() const
114  { return fTrackID; }
115  inline virtual G4int GetParentID() const
116  { return fParentID; }
117  inline virtual G4String GetParticleName() const
118  { return fParticleName; }
119  inline virtual G4double GetCharge() const
120  { return fPDGCharge; }
121  inline virtual G4int GetPDGEncoding() const
122  { return fPDGEncoding; }
123  inline virtual G4double GetInitialKineticEnergy() const
124  { return fInitialKineticEnergy; }
125  inline virtual G4ThreeVector GetInitialMomentum() const
126  { return fInitialMomentum; }
127 
128 // Other member functions
129  virtual void ShowTrajectory(std::ostream& os=G4cout) const;
130  //virtual void DrawTrajectory() const;
131  virtual void DrawTrajectory(G4int i_mode = 0) const;
132  virtual void AppendStep(const G4Step* aStep);
133  virtual int GetPointEntries() const { return fPositionRecord->size(); }
134  virtual G4VTrajectoryPoint* GetPoint(G4int i) const
135  { return (*fPositionRecord)[i]; }
136  virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
137 
139 
140  virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
141  virtual std::vector<G4AttValue>* CreateAttValues() const;
142 
143 //---------
144  private:
145 //---------
146 
147  TrajectoryPointContainer* fPositionRecord;
148  G4int fTrackID;
149  G4int fParentID;
150  G4int fPDGEncoding;
151  G4double fPDGCharge;
152  G4String fParticleName;
153  G4double fInitialKineticEnergy;
154  G4ThreeVector fInitialMomentum;
155 
156 };
157 
159 
160 inline void* RE04Trajectory::operator new(size_t)
161 {
162  void* aTrajectory;
163  aTrajectory = (void*)faTrajAllocator.MallocSingle();
164  return aTrajectory;
165 }
166 
167 inline void RE04Trajectory::operator delete(void* aTrajectory)
168 {
169  faTrajAllocator.FreeSingle((RE04Trajectory*)aTrajectory);
170 }
171 
172 #endif
173