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: G4SmoothTrajectory.hh 67009 2013-01-29 16:00:21Z gcosmo $ 00028 // 00029 //--------------------------------------------------------------- 00030 // 00031 // G4SmoothTrajectory.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 // 4) Auxiliary points will be associated to G4SmoothTrajectoryPoint 00041 // to assist drawing smoothly curved trajectory. 00042 // 00043 // --------------------------------------------------------------- 00044 00045 class G4SmoothTrajectory; 00046 00047 #ifndef G4SmoothTrajectory_h 00048 #define G4SmoothTrajectory_h 1 00049 00050 #include "G4VTrajectory.hh" 00051 #include "G4Allocator.hh" 00052 #include <stdlib.h> // Include from 'system' 00053 #include "G4ios.hh" // Include from 'system' 00054 #include <vector> // G4RWTValOrderedVector 00055 #include "globals.hh" // Include from 'global' 00056 #include "G4ParticleDefinition.hh" // Include from 'particle+matter' 00057 #include "G4SmoothTrajectoryPoint.hh" // Include from 'tracking' 00058 #include "G4Track.hh" 00059 #include "G4Step.hh" 00060 00061 class G4Polyline; // Forward declaration. 00062 00063 typedef std::vector<G4VTrajectoryPoint*> TrajectoryPointContainer; 00064 class G4SmoothTrajectory : public G4VTrajectory 00065 { 00066 00067 //-------- 00068 public: // with description 00069 //-------- 00070 00071 // Constructor/Destrcutor 00072 00073 G4SmoothTrajectory(); 00074 00075 G4SmoothTrajectory(const G4Track* aTrack); 00076 G4SmoothTrajectory(G4SmoothTrajectory &); 00077 virtual ~G4SmoothTrajectory(); 00078 00079 private: 00080 G4SmoothTrajectory& operator= (const G4SmoothTrajectory&); 00081 00082 // Operators 00083 public: 00084 inline void* operator new(size_t); 00085 inline void operator delete(void*); 00086 inline int operator == (const G4SmoothTrajectory& right) const 00087 {return (this==&right);} 00088 00089 // Get/Set functions 00090 inline G4int GetTrackID() const 00091 { return fTrackID; } 00092 inline G4int GetParentID() const 00093 { return fParentID; } 00094 inline G4String GetParticleName() const 00095 { return ParticleName; } 00096 inline G4double GetCharge() const 00097 { return PDGCharge; } 00098 inline G4int GetPDGEncoding() const 00099 { return PDGEncoding; } 00100 inline G4double GetInitialKineticEnergy() const 00101 { return initialKineticEnergy; } 00102 inline G4ThreeVector GetInitialMomentum() const 00103 { return initialMomentum; } 00104 00105 // Other member functions 00106 virtual void ShowTrajectory(std::ostream& os=G4cout) const; 00107 //virtual void DrawTrajectory() const; 00108 virtual void DrawTrajectory(G4int i_mode = 0) const; 00109 virtual void AppendStep(const G4Step* aStep); 00110 virtual int GetPointEntries() const { return positionRecord->size(); } 00111 virtual G4VTrajectoryPoint* GetPoint(G4int i) const 00112 { return (*positionRecord)[i]; } 00113 virtual void MergeTrajectory(G4VTrajectory* secondTrajectory); 00114 00115 G4ParticleDefinition* GetParticleDefinition(); 00116 00117 // Get method for HEPRep style attributes 00118 virtual const std::map<G4String,G4AttDef>* GetAttDefs() const; 00119 virtual std::vector<G4AttValue>* CreateAttValues() const; 00120 00121 //--------- 00122 private: 00123 //--------- 00124 00125 TrajectoryPointContainer* positionRecord; 00126 G4int fTrackID; 00127 G4int fParentID; 00128 G4int PDGEncoding; 00129 G4double PDGCharge; 00130 G4String ParticleName; 00131 G4double initialKineticEnergy; 00132 G4ThreeVector initialMomentum; 00133 00134 }; 00135 00136 #if defined G4TRACKING_ALLOC_EXPORT 00137 extern G4DLLEXPORT G4Allocator<G4SmoothTrajectory> aSmoothTrajectoryAllocator; 00138 #else 00139 extern G4DLLIMPORT G4Allocator<G4SmoothTrajectory> aSmoothTrajectoryAllocator; 00140 #endif 00141 00142 inline void* G4SmoothTrajectory::operator new(size_t) 00143 { 00144 void* aTrajectory; 00145 aTrajectory = (void*)aSmoothTrajectoryAllocator.MallocSingle(); 00146 return aTrajectory; 00147 } 00148 00149 inline void G4SmoothTrajectory::operator delete(void* aTrajectory) 00150 { 00151 aSmoothTrajectoryAllocator.FreeSingle((G4SmoothTrajectory*)aTrajectory); 00152 } 00153 00154 #endif