source: trunk/examples/extended/field/field04/include/F04Trajectory.hh@ 1036

Last change on this file since 1036 was 807, checked in by garnier, 17 years ago

update

File size: 4.3 KB
Line 
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
49typedef std::vector<G4VTrajectoryPoint*> TrajectoryPointContainer;
50
51class 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(G4int i_mode=0) const;
85 virtual void AppendStep(const G4Step* aStep);
86 virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
87
88 G4ParticleDefinition* GetParticleDefinition();
89
90 virtual int GetPointEntries() const
91 { return fpPointsContainer->size(); }
92 virtual G4VTrajectoryPoint* GetPoint(G4int i) const
93 { return (*fpPointsContainer)[i]; }
94
95 virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
96 virtual std::vector<G4AttValue>* CreateAttValues() const;
97
98//---------
99 private:
100//---------
101
102// Member data
103
104 TrajectoryPointContainer* fpPointsContainer;
105
106 G4int fTrackID;
107 G4int fParentID;
108 G4double PDGCharge;
109 G4int PDGEncoding;
110 G4String ParticleName;
111 G4ThreeVector initialMomentum;
112
113};
114
115#if defined G4TRACKING_ALLOC_EXPORT
116 extern G4DLLEXPORT G4Allocator<F04Trajectory> aTrajectoryAllocator;
117#else
118 extern G4DLLIMPORT G4Allocator<F04Trajectory> aTrajectoryAllocator;
119#endif
120
121inline void* F04Trajectory::operator new(size_t) {
122 void* aTrajectory = (void*) aTrajectoryAllocator.MallocSingle();
123 return aTrajectory;
124}
125
126inline void F04Trajectory::operator delete(void* aTrajectory) {
127 aTrajectoryAllocator.FreeSingle((F04Trajectory*)aTrajectory);
128}
129
130#endif
Note: See TracBrowser for help on using the repository browser.