Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
F04Trajectory.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 // $Id: F04Trajectory.hh 90239 2015-05-21 09:07:05Z gcosmo $
27 //
30 //
31 
32 #ifndef F04Trajectory_h
33 #define F04Trajectory_h 1
34 
35 #include <vector>
36 #include <stdlib.h>
37 
38 #include "globals.hh"
39 
40 #include "G4ios.hh"
41 #include "G4Step.hh"
42 #include "G4Track.hh"
43 #include "G4Allocator.hh"
44 #include "G4VTrajectory.hh"
45 #include "G4ParticleDefinition.hh"
46 #include "G4TrajectoryPoint.hh"
47 
48 typedef std::vector<G4VTrajectoryPoint*> TrajectoryPointContainer;
49 
51 {
52 
53 //--------
54  public: // without description
55 //--------
56 
57 // Constructor/Destructor
58 
59  F04Trajectory();
60  F04Trajectory(const G4Track* aTrack);
62  virtual ~F04Trajectory();
63 
64 // Operators
65 
66  inline void* operator new(size_t);
67  inline void operator delete(void*);
68  inline int operator == (const F04Trajectory& right) const
69  { return (this==&right); }
70 
71 // Get/Set functions
72 
73  inline G4int GetTrackID() const { return fTrackID; }
74  inline G4int GetParentID() const { return fParentID; }
75  inline G4String GetParticleName() const { return fParticleName; }
76  inline G4double GetCharge() const { return fPDGCharge; }
77  inline G4int GetPDGEncoding() const { return fPDGEncoding; }
78  inline G4ThreeVector GetInitialMomentum() const {return fInitialMomentum;}
79 
80 // Other member functions
81 
82  virtual void ShowTrajectory(std::ostream& os=G4cout) const;
83  virtual void AppendStep(const G4Step* aStep);
84  virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
85 
87 
88  virtual int GetPointEntries() const
89  { return fpPointsContainer->size(); }
90  virtual G4VTrajectoryPoint* GetPoint(G4int i) const
91  { return (*fpPointsContainer)[i]; }
92 
93  virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
94  virtual std::vector<G4AttValue>* CreateAttValues() const;
95 
96 //---------
97  private:
98 //---------
99 
100 // Member data
101 
102  TrajectoryPointContainer* fpPointsContainer;
103 
104  G4int fTrackID;
105  G4int fParentID;
106  G4double fPDGCharge;
107  G4int fPDGEncoding;
108  G4String fParticleName;
109  G4ThreeVector fInitialMomentum;
110 
111 };
112 
114 
115 inline void* F04Trajectory::operator new(size_t) {
118  return (void*) F04TrajectoryAllocator->MallocSingle();
119 }
120 
121 inline void F04Trajectory::operator delete(void* aTrajectory) {
122  F04TrajectoryAllocator->FreeSingle((F04Trajectory*)aTrajectory);
123 }
124 
125 #endif
virtual G4VTrajectoryPoint * GetPoint(G4int i) const
G4String GetParticleName() const
virtual ~F04Trajectory()
std::vector< G4VTrajectoryPoint * > TrajectoryPointContainer
virtual int GetPointEntries() const
#define G4ThreadLocal
Definition: tls.hh:89
int G4int
Definition: G4Types.hh:78
G4int GetPDGEncoding() const
virtual std::vector< G4AttValue > * CreateAttValues() const
G4GLOB_DLL std::ostream G4cout
virtual void ShowTrajectory(std::ostream &os=G4cout) const
G4int GetParentID() const
Definition: G4Step.hh:76
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
G4ThreeVector GetInitialMomentum() const
G4int GetTrackID() const
G4ParticleDefinition * GetParticleDefinition()
virtual void MergeTrajectory(G4VTrajectory *secondTrajectory)
double G4double
Definition: G4Types.hh:76
G4double GetCharge() const
virtual void AppendStep(const G4Step *aStep)
int operator==(const F04Trajectory &right) const
G4ThreadLocal G4Allocator< F04Trajectory > * F04TrajectoryAllocator