00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id: G4Trajectory.hh 67009 2013-01-29 16:00:21Z gcosmo $ 00028 // 00029 //--------------------------------------------------------------- 00030 // 00031 // G4Trajectory.hh 00032 // 00033 // class description: 00034 // This class represents the trajectory of a particle tracked. 00035 // It includes information of 00036 // 1) List of trajectory points which compose the trajectory, 00037 // 2) static information of particle which generated the 00038 // trajectory, 00039 // 3) trackID and parent particle ID of the trajectory, 00040 // 00041 // Contact: 00042 // Questions and comments to this code should be sent to 00043 // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp) 00044 // Makoto Asai (e-mail: asai@kekvax.kek.jp) 00045 // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp) 00046 // 00047 // --------------------------------------------------------------- 00048 00049 class G4Trajectory; 00050 00051 #ifndef G4Trajectory_h 00052 #define G4Trajectory_h 1 00053 00054 #include "G4VTrajectory.hh" 00055 #include "G4Allocator.hh" 00056 #include <stdlib.h> // Include from 'system' 00057 #include "G4ios.hh" // Include from 'system' 00058 #include <vector> // G4RWTValOrderedVector 00059 #include "globals.hh" // Include from 'global' 00060 #include "G4ParticleDefinition.hh" // Include from 'particle+matter' 00061 #include "G4TrajectoryPoint.hh" // Include from 'tracking' 00062 #include "G4Track.hh" 00063 #include "G4Step.hh" 00064 00065 class G4Polyline; // Forward declaration. 00066 00067 typedef std::vector<G4VTrajectoryPoint*> TrajectoryPointContainer; 00069 class G4Trajectory : public G4VTrajectory 00071 { 00072 00073 //-------- 00074 public: // with description 00075 //-------- 00076 00077 // Constructor/Destrcutor 00078 00079 G4Trajectory(); 00080 00081 G4Trajectory(const G4Track* aTrack); 00082 G4Trajectory(G4Trajectory &); 00083 virtual ~G4Trajectory(); 00084 00085 // Operators 00086 inline void* operator new(size_t); 00087 inline void operator delete(void*); 00088 inline int operator == (const G4Trajectory& right) const 00089 {return (this==&right);} 00090 00091 // Get/Set functions 00092 inline G4int GetTrackID() const 00093 { return fTrackID; } 00094 inline G4int GetParentID() const 00095 { return fParentID; } 00096 inline G4String GetParticleName() const 00097 { return ParticleName; } 00098 inline G4double GetCharge() const 00099 { return PDGCharge; } 00100 inline G4int GetPDGEncoding() const 00101 { return PDGEncoding; } 00102 inline G4double GetInitialKineticEnergy() const 00103 { return initialKineticEnergy; } 00104 inline G4ThreeVector GetInitialMomentum() const 00105 { return initialMomentum; } 00106 00107 // Other member functions 00108 virtual void ShowTrajectory(std::ostream& os=G4cout) const; 00109 //virtual void DrawTrajectory() const; 00110 virtual void DrawTrajectory(G4int i_mode = 0) const; 00111 virtual void AppendStep(const G4Step* aStep); 00112 virtual int GetPointEntries() const { return positionRecord->size(); } 00113 virtual G4VTrajectoryPoint* GetPoint(G4int i) const 00114 { return (*positionRecord)[i]; } 00115 virtual void MergeTrajectory(G4VTrajectory* secondTrajectory); 00116 00117 G4ParticleDefinition* GetParticleDefinition(); 00118 00119 virtual const std::map<G4String,G4AttDef>* GetAttDefs() const; 00120 virtual std::vector<G4AttValue>* CreateAttValues() const; 00121 00122 //--------- 00123 private: 00124 //--------- 00125 00126 TrajectoryPointContainer* positionRecord; 00127 G4int fTrackID; 00128 G4int fParentID; 00129 G4int PDGEncoding; 00130 G4double PDGCharge; 00131 G4String ParticleName; 00132 G4double initialKineticEnergy; 00133 G4ThreeVector initialMomentum; 00134 00135 }; 00136 00137 #if defined G4TRACKING_ALLOC_EXPORT 00138 extern G4DLLEXPORT G4Allocator<G4Trajectory> aTrajectoryAllocator; 00139 #else 00140 extern G4DLLIMPORT G4Allocator<G4Trajectory> aTrajectoryAllocator; 00141 #endif 00142 00143 inline void* G4Trajectory::operator new(size_t) 00144 { 00145 void* aTrajectory; 00146 aTrajectory = (void*)aTrajectoryAllocator.MallocSingle(); 00147 return aTrajectory; 00148 } 00149 00150 inline void G4Trajectory::operator delete(void* aTrajectory) 00151 { 00152 aTrajectoryAllocator.FreeSingle((G4Trajectory*)aTrajectory); 00153 } 00154 00155 #endif 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165